List<PyCallableParameter> (@NotNull List<PyCallableParameter> parameters, @Nullable PyCallable callable, @NotNull PyCallSiteExpression callSite, @NotNull PyResolveContext resolveContext) { final int implicitOffset; if (callSite instanceof PyCallExpression callExpr) { final PyExpression callee = callExpr.getCallee(); if (callee instanceof PyReferenceExpression && callable instanceof PyFunction) { implicitOffset = getImplicitArgumentCount((PyReferenceExpression)callee, (PyFunction)callable, resolveContext); } else { implicitOffset = 0; } } else { implicitOffset = 1; } return parameters.subList(Math.min(implicitOffset, parameters.size()), parameters.size()); }