PyFunction (@NotNull PyType type, @NotNull String name, @NotNull TypeEvalContext context) { final PyResolveContext resolveContext = PyResolveContext.defaultContext(context); final List<? extends RatedResolveResult> results = type.resolveMember(name, null, AccessDirection.READ, resolveContext); if (results != null && !results.isEmpty()) { final RatedResolveResult result = results.get(0); final PsiElement element = result.getElement(); if (element instanceof PyFunction) { return (PyFunction)element; } } return null; }