String (PsiElement element) { if (element instanceof PyImportElement) { return ((PyImportElement) element).getVisibleName(); } if (element instanceof PyReferenceExpression || element instanceof PyTargetExpression) { final QualifiedName qname = ((PyQualifiedExpression)element).asQualifiedName(); if (qname != null) { return qname.toString(); } } return element instanceof PyElement ? ((PyElement)element).getName() : null; }