Recursive helper function to find subsequent method calls of the given method. Uses "dict" as storage for method call during recursion, storing all
called {@link CtMethod} objects in it.
975045
private Map<CtClass, Set<CtMethod>> find(final CtMethod declaredMethod, final int level, final Map<CtClass, Set<CtMethod>> dict) {
		if (level < 0) {
			throw new IllegalArgumentException("level < 0");
		}
		addToMap(declaredMethod.getDeclaringClass(), declaredMethod, dict);
		if (level > 0) {
			try {
				declaredMethod.instrument(new ExprEditor() {
					@Override
					public void edit(final MethodCall m) throws CannotCompileException {
						try {
							CtMethod method = m.getMethod();
							LOG.info(method.getLongName() + " / " + level);
							find(method, level - 1, dict);
						} catch (NotFoundException e) {
							e.printStackTrace(); // should not happen
						}
						super.edit(m);
					}

				});
			} catch (CannotCompileException e) {
				// cannot possibly be thrown due to the fact that we don't change anything here
				e.printStackTrace();
			}
		}
		return dict;
	}
254881
def GetMethodConfig(self, method):
        """"""
        method_config = self._method_configs.get(method)
        if method_config:
            return method_config
        func = getattr(self, method, None)
        if func is None:
            raise KeyError(method)
        method_config = getattr(func, 'method_config', None)
        if method_config is None:
            raise KeyError(method)
        self._method_configs[method] = config = method_config()
        return config
53660
def get_method(self, method_name, default=None):
        
        for method in self.methods:
            if method.name == method_name:
                return method
        return default
1259850
public static Method findMethod(Class<?> c, String methodName) {
        for (Method m : c.getMethods()) {
            if (!m.getName().equalsIgnoreCase(methodName)) {
                continue;
            }
            if (m.getParameterCount() != 1) {
                continue;
            }
            return m;
        }

        return null;
    }
1368610
def _get_method_doc(self):
        
        ret = {}
        for method_name in self.methods:
            method = getattr(self, method_name, None)
            if method:
                ret[method_name] = method.__doc__
        return ret
1102204
List<Method> getSortedCandidateMethods(String methodName, Method[] methods) {
		List<Method> candidates = new ArrayList<>();
		for (Method method : methods) {
			if (method.getName().equals(methodName)) {
				candidates.add(method);
			}
		}
		Collections.sort(candidates, comparator);
		return candidates;
	}
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
929656
def method_calls(self, tab=''):
        
        ret = ''
        for method in self.methods:
            func = getattr(self, method)
            args, _, _, default = inspect.getargspec(func)
            default = default or []
            index = len(args) - len(default)
            args_defaults = [a for a in args[1:index]]
            for i in range(len(default)):
                args_defaults.append(args[i + index] + '=' + repr(default[i]))

            ret += '%s%s(%s)\n' % (tab, method, ', '.join(args_defaults),)
        return ret
408352
private static Set<Method> findLockedMethods(ClassContext classContext, SelfCalls selfCalls, Set<CallSite> obviouslyLockedSites)
    {

        JavaClass javaClass = classContext.getJavaClass();
        Method[] methodList = javaClass.getMethods();

        CallGraph callGraph = selfCalls.getCallGraph();

        // Initially, assume all methods are locked
        Set<Method> lockedMethodSet = new HashSet<>();

        // Assume all public methods are unlocked
        for (Method method : methodList) {
            if (method.isSynchronized()) {
                lockedMethodSet.add(method);
            }
        }

        // Explore the self-call graph to find nonpublic methods
        // that can be called from an unlocked context.
        boolean change;
        do {
            change = false;

            for (Iterator<CallGraphEdge> i = callGraph.edgeIterator(); i.hasNext();) {
                CallGraphEdge edge = i.next();
                CallSite callSite = edge.getCallSite();

                if (obviouslyLockedSites.contains(callSite) || lockedMethodSet.contains(callSite.getMethod())) {
                    // Calling method is locked, so the called method
                    // is also locked.
                    CallGraphNode target = edge.getTarget();
                    if (lockedMethodSet.add(target.getMethod())) {
                        change = true;
                    }
                }
            }
        } while (change);

        if (DEBUG) {
            System.out.println("Apparently locked methods:");
            for (Method method : lockedMethodSet) {
                System.out.println("\t" + method.getName());
            }
        }

        // We assume that any methods left in the locked set
        // are called only from a locked context.
        return lockedMethodSet;
    }
1263190
def memoize_methodcalls(func, pickle=False, dumps=pickle.dumps):
    '''
    '''
    cache = func._memoize_cache = {}
    @functools.wraps(func)
    def memoizer(self, *args, **kwargs):
        if pickle:
            key = dumps((args, kwargs))
        else:
            key = args
        if key not in cache:
            cache[key] = func(self, *args, **kwargs)
        return cache[key]
    return memoizer
335874
def find_call(self, path, method):
        
        if not path.endswith('/'):
            path += '/'
        path = path.split('/')[1:]
        return self._recursive_route_match(self._routes, path, method, [])
535765
def get_methods(self):
        
        if self.__cache_all_methods is None:
            self.__cache_all_methods = []
            for i in self.get_classes():
                for j in i.get_methods():
                    self.__cache_all_methods.append(j)
        return self.__cache_all_methods
1253331
public Method getMethod(Method method) {
        return getMethod(method.getReturnType(), method.getName(), method.getParameterTypes());
    }
1135503
public Collection<Method> getMethods() {
        final Collection<Method> methods = new ArrayList<Method>();
        for (Map.Entry<String, Map<ParamList, Map<Class<?>, Method>>> entry : this.methods.entrySet()) {
            final Map<ParamList, Map<Class<?>, Method>> nameMap = entry.getValue();
            for (Map<Class<?>, Method> map : nameMap.values()) {
                methods.addAll(map.values());
            }
        }
        return methods;
    }
1276744
def get_method(self, name, descriptor):
        
        key = name + str(descriptor)
        if key not in self.methods:
            self.methods[key] = ExternalMethod(self.name, name, descriptor)

        return self.methods[key]
3575
def getMethods(self):
        
        callables = {}

        for name in dir(self.service):
            method = getattr(self.service, name)

            if name.startswith('_') or not python.callable(method):
                continue

            callables[name] = method

        return callables
223839
def cached_property(method):
    
    name = method.__name__

    def newmethod(self):
        try:
            val = self.__dict__[name]
        except KeyError:
            val = method(self)
            self.__dict__[name] = val
        return val
    newmethod.__name__ = method.__name__
    newmethod.__doc__ = method.__doc__
    return property(newmethod)