PyFunction (@NotNull PyFunction function, @NotNull TypeEvalContext context) { final PsiFile file = function.getContainingFile(); if (file instanceof PyiFile) return null; return ContainerUtil.getLastItem(collectImplementationsOrOverloads(function, true, context)); }