List<PsiNamedElement> () { final List<PyExpression> expressions = PyUtil.flattenedParensAndStars(getTargets()); List<PsiNamedElement> result = new ArrayList<>(); for (PyExpression expression : expressions) { if (expression instanceof PyQualifiedExpression && ((PyQualifiedExpression)expression).isQualified()) { continue; } if (expression instanceof PsiNamedElement) { result.add((PsiNamedElement)expression); } } return result; }