PyFunction (@NotNull Editor editor, @NotNull PsiFile file, Predicate<PyFunction> condition) { final PsiElement elementAt = getElementUnderCaret(editor, file); return elementAt != null ? ContainerUtil.getOnlyItem(findSuitableFunctions(elementAt, condition)) : null; }