def is_valid_identifier(name):
    """Returns True if `name` a valid Python identifier.

    If `name` is not a string, return False.  This is roughly::

        isinstance(name, str) and name.isidentifier()

    """
    return isinstance(name, str) and name.isidentifier()
