PyCallExpression (@NotNull final PsiElement anchor, @NotNull final FQNamesProvider functionName) { final PsiElement parent = PsiTreeUtil.findFirstParent(anchor, new MyFunctionCondition(functionName)); if (parent instanceof PyCallExpression) { return (PyCallExpression)parent; } return null; }