PsiElement (@NotNull PsiElement element) { final PyElement parent = PsiTreeUtil.getParentOfType(element, ScopeOwner.class, PyComprehensionElement.class); if (parent instanceof PyListCompExpression && LanguageLevel.forElement(element).isPython2()) { return findContainer(parent); } return parent; }