def _called_in_methods(func, klass, methods):
 if (not isinstance(func, astroid.Function)):
  return False
 for method in methods:
  try:
   infered = klass.getattr(method)
  except astroid.NotFoundError:
   continue
  for infer_method in infered:
   for callfunc in infer_method.nodes_of_class(astroid.CallFunc):
    try:
     bound = next(callfunc.func.infer())
    except (astroid.InferenceError, StopIteration):
     continue
    if (not isinstance(bound, astroid.BoundMethod)):
     continue
    func_obj = bound._proxied
    if isinstance(func_obj, astroid.UnboundMethod):
     func_obj = func_obj._proxied
    if (func_obj.name == func.name):
     return True
 return False

def _called_in_methods ( func , klass , methods ) : if ( not isinstance ( func , astroid . Function ) ) : return False for method in methods : try : infered = klass . getattr ( method ) except astroid . NotFoundError : continue for infer_method in infered : for callfunc in infer_method . nodes_of_class ( astroid . CallFunc ) : try : bound = next ( callfunc . func . infer ( ) ) except ( astroid . InferenceError , StopIteration ) : continue if ( not isinstance ( bound , astroid . BoundMethod ) ) : continue func_obj = bound . _proxied if isinstance ( func_obj , astroid . UnboundMethod ) : func_obj = func_obj . _proxied if ( func_obj . name == func . name ) : return True return False
check if the func was called in any of the given methods .