def being_declared(string):
    """
    Helper method used to see if the function or subroutine is being defined
    :param string: the string being checked against the forbidden words
    :return: a boolean indicating if it is being declared or called
    """

    if 'write' in string or 'function' in string or 'subroutine' in string \
            or 'character' in string or 'if' in string or 'result' in string:
        being_declared = True
    else:
        being_declared = False
    return being_declared