List<PyCallableParameter> (@NotNull PsiElement element, @NotNull TypeEvalContext context) { final PyArgumentList argumentList = PsiTreeUtil.getParentOfType(element, PyArgumentList.class); if (argumentList != null) { boolean elementIsArgument = false; for (PyExpression argument : argumentList.getArgumentExpressions()) { if (PyPsiUtils.flattenParens(argument) == element) { elementIsArgument = true; break; } } final PyCallExpression callExpression = argumentList.getCallExpression(); if (elementIsArgument && callExpression != null) { final PyExpression callee = callExpression.getCallee(); if (callee instanceof PyReferenceExpression calleeReferenceExpr) { final PyExpression firstQualifier = PyPsiUtils.getFirstQualifier(calleeReferenceExpr); final PsiReference ref = firstQualifier.getReference(); if (ref != null && ref.isReferenceTo(this)) { return Collections.emptyList(); } } final PyResolveContext resolveContext = PyResolveContext.defaultContext(context); return callExpression.multiMapArguments(resolveContext) .stream() .flatMap(mapping -> mapping.getMappedParameters().entrySet().stream()) .filter(entry -> entry.getKey() == element) .map(Map.Entry::getValue) .collect(Collectors.toList()); } } return Collections.emptyList(); }