PyStatement () { final PyImportElementStub stub = getStub(); PsiElement parent; if (stub != null) { parent = stub.getParentStub().getPsi(); } else { parent = getParent(); } return parent instanceof PyStatement ? (PyStatement)parent : null; }