Returns True if `node` is a method call for `method_name`. `method_name`
    can be either a string or an iterable of strings.
975409
def is_method_call(node, method_name):
    

    if not isinstance(node, nodes.Call):
        return False

    if isinstance(node.node, nodes.Getattr):
        # e.g. foo.bar()
        method = node.node.attr

    elif isinstance(node.node, nodes.Name):
        # e.g. bar()
        method = node.node.name

    elif isinstance(node.node, nodes.Getitem):
        # e.g. foo["bar"]()
        method = node.node.arg.value

    else:
        return False

    if isinstance(method_name, (list, tuple)):
        return method in method_name

    return method == method_name
344982
function enrichMethodNode(methodNode, method) {
  method.description && (methodNode.description = method.description)

  if (method.tags.route) {
    let httpPath = method.tags.route
    let httpMethod = 'GET'
    const sepPos = httpPath.indexOf(' ')

    if (sepPos !== -1) {
      httpMethod = httpPath.substr(0, sepPos).toUpperCase()
      httpPath = httpPath.substr(sepPos + 1)

      if (!isValidHttpMethod(httpMethod)) {
        throw new Error(`Unsupported HTTP method [${httpMethod}] for ${method.name} method`)
      }
    }

    methodNode.method = httpMethod
    methodNode.path = httpPath
  }

  return methodNode
}
1087189
def function_is_noop(function_node: ast.FunctionDef) -> bool:
    
    return all(node_is_noop(n) for n in function_node.body)
1275093
def as_method(value)
      case true
      when value.tag?
        @methods_from_names[element(value).name]
      when value.dicom_name?
        @methods_from_names[value]
      when value.dicom_method?
        @names_from_methods.has_key?(value.to_sym) ? value.to_sym : nil
      else
        nil
      end
    end
1104087
def is_classmethod(meth):
    
    if inspect.ismethoddescriptor(meth):
        return isinstance(meth, classmethod)
    if not inspect.ismethod(meth):
        return False
    if not inspect.isclass(meth.__self__):
        return False
    if not hasattr(meth.__self__, meth.__name__):
        return False
    return meth == getattr(meth.__self__, meth.__name__)
1296569
private boolean isSupportedCallType(Node callNode) {
    if (!callNode.getFirstChild().isName()) {
      if (NodeUtil.isFunctionObjectCall(callNode)) {
        if (!assumeStrictThis) {
          Node thisValue = callNode.getSecondChild();
          if (thisValue == null || !thisValue.isThis()) {
            return false;
          }
        }
      } else if (NodeUtil.isFunctionObjectApply(callNode)) {
        return false;
      }
    }

    return true;
  }
738587
def is_docstring(node):
    
    return (node.type == syms.simple_stmt and
            len(node.children) > 0 and node.children[0].type == token.STRING)
1126408
def canonicalization(self, method, node):
        
        if method not in constants.TransformUsageC14NMethod:
            raise Exception('Method not allowed: ' + method)
        c14n_method = constants.TransformUsageC14NMethod[method]
        return etree.tostring(
            node,
            method=c14n_method['method'],
            with_comments=c14n_method['comments'],
            exclusive=c14n_method['exclusive']
        )
720393
public static function isFunctionCall($function_name) {
    $function_names = func_get_args();

    return function ($node) use ($function_names) {
      if ($node instanceof FunctionCallNode) {
        return in_array($node->getName()->getText(), $function_names, TRUE);
      }
      return FALSE;
    };
  }
371326
def is_classmethod(fn):
    """"""
    # This is True for bound methods
    if not inspect.ismethod(fn):
        return False
    if not hasattr(fn, "__self__"):
        return False
    im_self = fn.__self__
    # This is None for instance methods on classes, but True
    # for instance methods on instances.
    if im_self is None:
        return False
    # This is True for class methods of new- and old-style classes, respectively
    return isinstance(im_self, six.class_types)
105096
def method_or_name(namespace, x):
    '''
    
    '''
    if not isinstance(x, str):
        return x

    if hasattr(namespace, x):
        return getattr(namespace, x)

    attrs = [y for y in dir(namespace) if not y.startswith('_')]
    msg = '''"%s" is not available in %s.
These attributes are available: %s.''' % (x, namespace.__name__, attrs)
    raise AttributeError(msg)
1285476
public static boolean isCglibRenamedMethod(Method renamedMethod) {
		String name = renamedMethod.getName();
		return (name.startsWith(CGLIB_RENAMED_METHOD_PREFIX) && CGLIB_RENAMED_METHOD_PATTERN
				.matcher(name.substring(CGLIB_RENAMED_METHOD_PREFIX.length())).matches());
	}
1277885
def call_method(self, name, args=None, kwargs=None, dyn_args=None,
                    dyn_kwargs=None, lineno=None):
        
        if args is None:
            args = []
        if kwargs is None:
            kwargs = []
        return nodes.Call(self.attr(name, lineno=lineno), args, kwargs,
                          dyn_args, dyn_kwargs, lineno=lineno)
460194
def fn_name(fn):
    '''
        
    '''
    expression = '(\S+) (?:of|at)'
    #Checks if the function is a mehtod and should have the self argument passed
    is_method   = inspect.ismethod(fn)

    #Builds the name of the method,module.class.method or module.method
    name        = '{}.{}'.format(fn.__module__, re.compile(expression).findall(str(fn))[0])

    return name,is_method
41978
private static boolean isCallTo(Node n, Node targetMethod) {
    if (!n.isCall()) {
      return false;
    }
    Node method = n.getFirstChild();
    return method.isGetProp() && method.matchesQualifiedName(targetMethod);
  }
427696
private boolean isFeatureMethod(MethodNode method) {
    for (Statement stat : AstUtil.getStatements(method)) {
      String label = stat.getStatementLabel();
      if (label == null) continue;

      // assertion: is (meant to be) a feature method, so we'll return true in the end
      if (method.isStatic())
        errorReporter.error(method, "Feature methods must not be static");

      return true;
    }

    return false;
  }
677085
private function isSimpleMethod(MethodNode $node)
    {
        $countScope = count($node->findChildrenOfType('ScopeStatement'));

        if (0 !== $countScope) {
            return false;
        }

        $countReturn = count($node->findChildrenOfType('ReturnStatement'));
        $countThis = $this->countThis($node);
        $countSetter = $this->countSetter($node);

        if (1 < $countReturn) {
            return false;
        }

        if (($countReturn + 1) < $countThis - $countSetter) {
            return false;
        }

        return true;
    }