Given a dot-notation-style method name, e.g. 'Object.object.method', find the object to call the method on from the list of registered targets
355985
function findTarget (method) {
    var chain = [];
    if (typeof method === 'string') {
        chain = method.split('.');
        method = chain.pop();
    }

    var target = WorkerBroker.targets;

    for (let m=0; m < chain.length; m++) {
        if (target[chain[m]]) {
            target = target[chain[m]];
        }
        else {
            return [];
        }
    }

    return [method, target];
}
516714
def handle_method(signature_node, module, object_name, cache):
    
    *class_names, attr_name = object_name.split(".")  # Handle nested classes
    class_ = module
    for class_name in class_names:
        class_ = getattr(class_, class_name, None)
        if class_ is None:
            return
    attr = getattr(class_, attr_name)
    try:
        inspected_attr = cache[class_][attr_name]
        defining_class = inspected_attr.defining_class
    except KeyError:
        # TODO: This is a hack to handle bad interaction between enum and inspect
        defining_class = class_
    if defining_class is not class_:
        reftarget = "{}.{}".format(defining_class.__module__, defining_class.__name__)
        xref_node = addnodes.pending_xref(
            "", refdomain="py", refexplicit=True, reftype="class", reftarget=reftarget
        )
        name_node = nodes.literal(
            "", "{}".format(defining_class.__name__), classes=["descclassname"]
        )
        xref_node.append(name_node)
        desc_annotation = list(signature_node.traverse(addnodes.desc_annotation))
        index = len(desc_annotation)
        class_annotation = addnodes.desc_addname()
        class_annotation.extend([nodes.Text("("), xref_node, nodes.Text(").")])
        class_annotation["xml:space"] = "preserve"
        signature_node.insert(index, class_annotation)
    else:
        is_overridden = False
        for class_ in defining_class.__mro__[1:]:
            if hasattr(class_, attr_name):
                is_overridden = True
        if is_overridden:
            emphasis = nodes.emphasis(
                "overridden ", "overridden ", classes=["property"]
            )
            signature_node.insert(0, emphasis)
    if getattr(attr, "__isabstractmethod__", False):
        emphasis = nodes.emphasis("abstract", "abstract", classes=["property"])
        signature_node.insert(0, emphasis)
1369282
def find_method(method_name)
      reg = Regexp.new(method_name.to_s, true)
      methods.sort.select { |meth| reg.match(meth) }
    end
804118
def _get_a_code_object_from( thing ) :
    '''
    
    '''
    # If we were passed a Method wrapper, get its function
    if isinstance( thing, types.MethodType ) :
        thing = thing.__func__
    # If we were passed a property object, get its getter function
    # (no direct support for the fdel or fset functions)
    if hasattr( thing, 'fget' ) :
        thing = thing.fget
    # If we were passed, or now have, a function, get its code object.
    if isinstance( thing, types.FunctionType ) :
        thing = thing.__code__
    # We should now have a code object, or will never have it.
    return thing
1267850
function buildMethodMap(methods) {
  // Makes a fake set of initial methods
  var methodMap = {};
  methods.forEach(function(method) {
    methodMap[method.name] = getMethod(method.name);
  });
  return methodMap;
}
181466
function callnTimes (object, methodName, count) {
    let returnValue
    while (count--) returnValue = object[methodName]()
    return returnValue
  }
178751
private EJBMethodInfoImpl findMethodInEJBMethodInfoArray(EJBMethodInfoImpl[] methodInfos, final Method targetMethod) {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();

        if (isTraceOn && tc.isEntryEnabled()) {
            Tr.entry(tc, "findMethodInEJBMethodInfoArray for method \"" + targetMethod.toString() + "\"");
        }

        for (EJBMethodInfoImpl info : methodInfos) {
            if (targetMethod.equals(info.getMethod())) {
                if (isTraceOn && tc.isEntryEnabled()) {
                    Tr.exit(tc, "findMethodInEJBMethodInfoArray found EJBMethodInfoImpl for method \"" + targetMethod.toString() + "\"");
                }
                return info;
            }
        }

        if (isTraceOn && tc.isEntryEnabled()) {
            Tr.exit(tc, "findMethodInEJBMethodInfoArray did not find EJBMethodInfoImpl for method \"" + targetMethod.toString() + "\"");
        }
        return null;
    }
1229803
def _getMethodNamePrefix(self, node):
        
        targetName = node.name
        for sibling in node.parent.nodes_of_class(type(node)):
            if sibling is node:
                # We are on the same node in parent so we skip it.
                continue
            prefix = self._getCommonStart(targetName, sibling.name)
            if not prefix.rstrip('_'):
                # We ignore prefixes which are just underscores.
                continue
            return prefix

        return ''
527406
@Nullable
  public static MethodTree findMethod(MethodSymbol symbol, VisitorState state) {
    return JavacTrees.instance(state.context).getTree(symbol);
  }
341567
public static Set<Method> getMethods(Class<?> target, MethodFilter methodFilter) {
        Class<?> clazz = target;
        Set<Method> matches = getDeclaredMethods(clazz, methodFilter);      
        while((clazz = clazz.getSuperclass()) != null) {     
            matches.addAll(getDeclaredMethods(clazz, methodFilter));
        }
        return matches;
    }
1330654
def get_method_name(method):
    

    name = get_object_name(method)
    if name.startswith("__") and not name.endswith("__"):
        name = "_{0}{1}".format(get_object_name(method.im_class), name)
    return name
607504
def get_methodnames(self, node):
        '''
        '''
        nodekey = self.get_nodekey(node)
        prefix = self._method_prefix
        if isinstance(nodekey, self.GeneratorType):
            for nodekey in nodekey:
                yield self._method_prefix + nodekey
        else:
            yield self._method_prefix + nodekey
420680
def methodcaller(name, *args):
    
    func = operator.methodcaller(name, *args)
    return lambda obj, **kwargs: func(obj)
1315669
def get_class_method(cls_or_inst, method_name):
    
    cls = cls_or_inst if isinstance(cls_or_inst, type) else cls_or_inst.__class__
    meth = getattr(cls, method_name, None)
    if isinstance(meth, property):
        meth = meth.fget
    elif isinstance(meth, cached_property):
        meth = meth.func
    return meth
1361484
private Class getTargetClass(Method setMethod) {
        Class[] params = setMethod.getParameterTypes();
        if (params == null || params.length != 1) {
            throw new BeanMappingException("illegal set method[" + setMethod.getName() + "] for ParameterType");
        }
        return params[0];
    }
854342
def get_method_info(self, obj):
        
        info = self.get_base_info(obj)
        info.update({})
        return info
494969
def visit_Method(self, method):
        
        resolved_method = method.resolved.type

        def get_params(method, extra_bindings):
            # The Method should already be the resolved version.
            result = []
            for param in method.params:
                resolved_param = texpr(param.resolved.type, param.resolved.bindings, extra_bindings)
                result.append(resolved_param.id)
            return result

        def get_return_type(method, extra_bindings):
            # The Method should already be the resolved version.
            return texpr(method.type.resolved.type, method.type.resolved.bindings,
                         extra_bindings).id

        def signature(method, return_type, params):
            return "%s %s(%s)" % (return_type, method.name.text, ", ".join(params))

        # Ensure the method has the same signature as matching methods on parent
        # interfaces:
        interfaces = list(t for t in method.clazz.bases if isinstance(t.resolved.type, Interface))
        for interface in interfaces:
            interfaceTypeExpr = interface.resolved
            for definition in interfaceTypeExpr.type.definitions:
                if definition.name.text == method.name.text:
                    resolved_definition = definition.resolved.type
                    method_params = get_params(resolved_method, method.clazz.resolved.bindings)
                    definition_params = get_params(resolved_definition, interfaceTypeExpr.bindings)
                    method_return = get_return_type(resolved_method, method.clazz.resolved.bindings)
                    definition_return = get_return_type(resolved_definition, interfaceTypeExpr.bindings)

                    if method_params != definition_params or method_return != definition_return:
                        self.errors.append(
                            "%s: method signature '%s' on %s does not match method '%s' on interface %s" % (
                                lineinfo(method), signature(resolved_method, method_return, method_params),
                                method.clazz.resolved.type.id,
                                signature(resolved_definition, definition_return, definition_params),
                                interface.resolved.type.id))