boolean () { if (myFromImportStatement != null) { PyPsiUtils.assertValid(myFromImportStatement); if (!myFromImportStatement.isValid() || myFromImportStatement.isFromFuture()) { return false; } } else { PyPsiUtils.assertValid(myImportStatement); if (myImportStatement == null || !myImportStatement.isValid()) { return false; } } final PyReferenceExpression referenceExpression = myImportElement.getImportReferenceExpression(); if (referenceExpression == null || referenceExpression.getReference().resolve() == null) { return false; } return true; }