def assign_parent(node):
 while (node and isinstance(node, (astroid.AssName, astroid.Tuple, astroid.List))):
  node = node.parent
 return node

def assign_parent ( node ) : while ( node and isinstance ( node , ( astroid . AssName , astroid . Tuple , astroid . List ) ) ) : node = node . parent return node
return the higher parent which is not an assname .