String (@NotNull String name, @Nullable QualifiedName importPath, @Nullable PyImportElement source) { final StringBuilder sb = new StringBuilder(); if (source != null) { final PsiElement parent = source.getParent(); if (parent instanceof PyFromImportStatement) { sb.append(name); } else { sb.append(source.getVisibleName()).append(".").append(name); } } else { if (importPath != null && importPath.getComponentCount() > 0) { sb.append(importPath).append("."); } sb.append(name); } return sb.toString(); }