PsiElement (@NotNull PsiElement context, @NotNull PyResolveContext resolveContext) { final PsiElement parent = myParent.resolve(context, resolveContext); if (parent == null || !resolveContext.getTypeEvalContext().maySwitchToAST(parent)) { return null; } final FunctionFinder finder = new FunctionFinder(myFunctionName); parent.acceptChildren(finder); return finder.myResult != null ? finder.myResult : parent; }