boolean (@NotNull InsertionContext context, @NotNull PyFunction function) { final PsiElement element = context.getFile().findElementAt(context.getStartOffset()); PyReferenceExpression refExpr = PsiTreeUtil.getParentOfType(element, PyReferenceExpression.class); final int implicitArgsCount; if (refExpr != null) { final var typeEvalContext = TypeEvalContext.codeInsightFallback(refExpr.getProject()); final var resolveContext = PyResolveContext.defaultContext(typeEvalContext); implicitArgsCount = PyCallExpressionHelper.getImplicitArgumentCount(refExpr, function, resolveContext); } else { implicitArgsCount = 0; } return function.getParameterList().getParameters().length > implicitArgsCount; }