String (@NotNull PsiNamedElement element) { String name = null; if (element instanceof PyQualifiedNameOwner) { // Will return null for a local function name = ((PyQualifiedNameOwner)element).getQualifiedName(); } if (StringUtil.isEmpty(name)) { name = element.getName(); } if (StringUtil.isNotEmpty(name)) { return element instanceof PyFunction ? name + "()" : name; } return ""; }