boolean (@NotNull VirtualFile virtualFile) { if (myModule == null) return false; Project project = myModule.getProject(); if (PythonLanguageLevelPusher.getLanguageLevelForVirtualFile(project, virtualFile).isOlderThan(LanguageLevel.PYTHON34)) return false; if (PyUtil.isRoot(virtualFile, project)) return false; if (!isInProject(virtualFile, project)) return false; PsiDirectory psiDirectory = PsiManager.getInstance(project).findDirectory(virtualFile); if (psiDirectory != null && PyUtil.isOrdinaryPackage(psiDirectory)) return false; VirtualFile curDir = virtualFile; while (curDir != null) { if (!curDir.isDirectory()) return false; if (myNamespacePackageFolders.contains(curDir)) return false; if (PyUtil.isRoot(curDir, project)) break; psiDirectory = PsiManager.getInstance(myModule.getProject()).findDirectory(curDir); if (psiDirectory != null && PyUtil.isOrdinaryPackage(psiDirectory)) break; curDir = curDir.getParent(); } return true; }