PsiElement (@NotNull PyArgumentList argumentList) { int n = 0; boolean notSureAboutStarArgs = false; PyStarArgument firstStarArg = null; for (PyExpression arg : argumentList.getArguments()) { final PyStarArgument starArg = PyUtil.as(arg, PyStarArgument.class); if (starArg != null) { if (!starArg.isKeyword()) { if (firstStarArg == null) { firstStarArg = starArg; } // TODO: Support multiple *args for Python 3.5+ final Ref<PyExpression> resolvedRef = resolvePositionalStarExpression(starArg, n); if (resolvedRef != null) { final PsiElement resolved = resolvedRef.get(); if (resolved != null) { return resolved; } } else { notSureAboutStarArgs = true; } } } else if (!(arg instanceof PyKeywordArgument)) { if (myPosition == n) { return arg; } n++; } } return notSureAboutStarArgs ? firstStarArg : null; }