def is_ancestor_name(frame, node):
 try:
  bases = frame.bases
 except AttributeError:
  return False
 for base in bases:
  if (node in base.nodes_of_class(astroid.Name)):
   return True
 return False

def is_ancestor_name ( frame , node ) : try : bases = frame . bases except AttributeError : return False for base in bases : if ( node in base . nodes_of_class ( astroid . Name ) ) : return True return False
return true if frame is a astroid .