docstr: Directory manager for managing the configuration,
     dashboard data and generators need to recompose the state
     in the various managers.
  
  :param parent_directory_path: Directory path of where the state data
                                directory will be stored.
  :type parent_directory_path: Path
  :param sub_directory_name: The name where the state needs to be stored
                             or the directory where the state can be
                             found.
  :type sub_directory_name: str
docstr_tok: ["Directory","manager","for","managing","the","configuration",",","dashboard","data","and","generators","need","to","recompose","the","state","in","the","various","managers",".",":","param","parent_directory_path",":","Directory","path","of","where","the","state","data","directory","will","be","stored",".",":","type","parent_directory_path",":","Path",":","param","sub_directory_name",":","The","name","where","the","state","needs","to","be","stored","or","the","directory","where","the","state","can","be","found",".",":","type","sub_directory_name",":","str"]
code: def __init__(self, parent_directory_path, sub_directory_name=None):
      """Directory manager for managing the configuration,
         dashboard data and generators need to recompose the state
         in the various managers.
  
      :param parent_directory_path: Directory path of where the state data
                                    directory will be stored.
      :type parent_directory_path: Path
      :param sub_directory_name: The name where the state needs to be stored
                                 or the directory where the state can be
                                 found.
      :type sub_directory_name: str
      """
      self.parent_directory_path = parent_directory_path
  
      if sub_directory_name is None:
          self.sub_directory_name = str(uuid.uuid4())
      else:
          self.sub_directory_name = sub_directory_name
  
      parent_directory = Path(self.parent_directory_path)
      if not parent_directory.exists():
          parent_directory.mkdir(parents=True, exist_ok=True)
  
      sub_directory = (
          Path(self.parent_directory_path) / self.sub_directory_name
      )
      if not sub_directory.exists():
          sub_directory.mkdir(parents=True, exist_ok=True)
  
file_path: responsible-ai-toolbox/responsibleai/responsibleai/_tools/shared/state_directory_management.py
imports: import os
  import uuid
  from pathlib import Path
  from typing import List
label_desc: Use image node_id 1 to create a new DirectoryManager object  with example: obj = DirectoryManager(parent_directory_path, sub_directory_name)