code: def add(self, value):
          
          path = value if isinstance(value, Path) else Path(str(value))
          if path and path != path.parent:
              destination = self
              for part in path.parts:
                  destination = destination.setdefault(part, DirectoryTree())
docs: Create a safe directory from a value.