import _ast


def simpleAssignToName(node):
    """If a simple assignment to a name, return name, otherwise None."""
    if isinstance(node, _ast.Assign) and len(node.targets) == 1:
        targetNode = node.targets[0]
        if isinstance(targetNode, _ast.Name):
            return targetNode.id
        else:
            return None
    else:
        return None