def node_frame_class(node):
 klass = node.frame()
 while ((klass is not None) and (not isinstance(klass, astroid.Class))):
  if (klass.parent is None):
   klass = None
  else:
   klass = klass.parent.frame()
 return klass

def node_frame_class ( node ) : klass = node . frame ( ) while ( ( klass is not None ) and ( not isinstance ( klass , astroid . Class ) ) ) : if ( klass . parent is None ) : klass = None else : klass = klass . parent . frame ( ) return klass
return klass node for a method node .