code: def _prepare_directory(
      self, num_classes=2, nested_dirs=False, count=16, length=20
  ):
      # Get a unique temp directory
      temp_dir = self.get_temp_dir()
  
      # Generate paths to class subdirectories
      paths = []
      for class_index in range(num_classes):
          class_directory = f"class_{class_index}"
          if nested_dirs:
              class_paths = [
                  class_directory,
                  os.path.join(class_directory, "subfolder_1"),
                  os.path.join(class_directory, "subfolder_2"),
                  os.path.join(
                      class_directory, "subfolder_1", "sub-subfolder"
                  ),
              ]
          else:
              class_paths = [class_directory]
          for path in class_paths:
              os.mkdir(os.path.join(temp_dir, path))
          paths += class_paths
  
      for i in range(count):
          path = paths[i % len(paths)]
          filename = os.path.join(path, f"text_{i}.txt")
          with open(os.path.join(temp_dir, filename), "w") as f:
              text = "".join(
                  [
                      random.choice(string.printable)
                      for _ in range(length)
                  ]
              )
              f.write(text)
      return temp_dir
  
file_path: keras/keras/utils/text_dataset_utils_test.py
imports: import os
  import random
  import string
  from keras import testing
  from keras.utils import text_dataset_utils
label_desc: Use image node_id 1 for calling the TextDatasetFromDirectoryTest obj's underlying member method code with example usage: obj._prepare_directory(num_classes, nested_dirs, count, length) and returns: temp_dir