<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def is_valid(identifier):
 """ If the identifier is valid for Python, return True, otherwise False. """


    return (
        isinstance(identifier, six.string_types)
        and bool(NAME_RE.search(identifier))
        and not keyword.iskeyword(identifier)
    )