code: def test_directory_manager(self, tmpdir, create_parent_directory):
      if create_parent_directory:
          parent_directory = tmpdir.mkdir("parent_directory")
      else:
          parent_directory = tmpdir / "parent_directory"
      dm_one = DirectoryManager(
          parent_directory_path=parent_directory,
          sub_directory_name="known",
      )
  
      assert dm_one.parent_directory_path.exists()
      assert dm_one.sub_directory_name == "known"
      assert (
          dm_one.parent_directory_path / dm_one.sub_directory_name
      ).exists()
  
      self._verify_directory_manager_operations(dm_one)
  
      assert isinstance(
          DirectoryManager.list_sub_directories(parent_directory), list
      )
      assert (
          len(DirectoryManager.list_sub_directories(parent_directory))
          == 1
      )
      assert "known" in DirectoryManager.list_sub_directories(
          parent_directory
      )
  
      dm_two = DirectoryManager(parent_directory_path=parent_directory)
  
      assert dm_two.parent_directory_path.exists()
      assert dm_two.sub_directory_name is not None
      assert (
          dm_two.parent_directory_path / dm_two.sub_directory_name
      ).exists()
  
      self._verify_directory_manager_operations(dm_two)
  
      assert isinstance(
          DirectoryManager.list_sub_directories(parent_directory), list
      )
      assert (
          len(DirectoryManager.list_sub_directories(parent_directory))
          == 2
      )
      assert (
          dm_two.sub_directory_name
          in DirectoryManager.list_sub_directories(parent_directory)
      )
  
imports: from pathlib import Path
  import pytest
  from responsibleai._tools.shared.state_directory_management import DirectoryManager
label_desc: Use image node_id 2 for calling the TestStateDirectoryManagement obj's underlying member method code with example usage: obj.test_directory_manager(tmpdir, create_parent_directory) without return types