boolean (@NotNull PsiDirectory directory) { for (PyCustomPackageIdentifier customPackageIdentifier : PyCustomPackageIdentifier.EP_NAME.getExtensions()) { if (customPackageIdentifier.isPackage(directory)) { return true; } } return false; }