boolean (VirtualFile directory) { if (myModule != null) { PsiDirectory psiDirectory = PsiManager.getInstance(myModule.getProject()).findDirectory(directory); if (psiDirectory != null && PyUtil.isOrdinaryPackage(psiDirectory)) return false; } VirtualFile curDir = directory; while (curDir != null) { if (isMarked(curDir)) return true; if (myModule != null) { if (PyUtil.isRoot(directory, myModule.getProject())) break; PsiDirectory psiDirectory = PsiManager.getInstance(myModule.getProject()).findDirectory(curDir); if (psiDirectory != null && PyUtil.isOrdinaryPackage(psiDirectory)) break; } curDir = curDir.getParent(); } return false; }