PsiPolyVariantReference (@NotNull PyResolveContext context) { if (isQualified()) { return new PyQualifiedReference(this, context); } final PsiElement importParent = PsiTreeUtil.getParentOfType(this, PyImportElement.class, PyFromImportStatement.class); if (importParent != null) { return PyImportReference.forElement(this, importParent, context); } return new PyDocReference(this, context); }