@Override
      protected void createDirectories(String subDirName) {
        super.createDirectories(subDirName);

        final PsiDirectory restoredDirectory = directoryPointer.getElement();
        if (restoredDirectory == null) return;
        PsiFileSystemItem element = getCreatedElement();
        PsiFileSystemItem lastElement = element;
        while (element != null && !element.equals(restoredDirectory)) {
          lastElement = element;
          element = element.getParent();
        }
        if (element == null) return;

        VirtualFile topmostCreatedDirectory = lastElement.getVirtualFile();
        if (topmostCreatedDirectory == null) return;
        PyNamespacePackagesService.getInstance(module).toggleMarkingAsNamespacePackage(topmostCreatedDirectory);
      }
@Override
      protected void createDirectories(String subDirName)