code: def _prepare_directory(
      self,
      num_classes=2,
      nested_dirs=False,
      color_mode="rgb",
      count=16,
  ):
      # Generate paths to class subdirectories
      temp_dir = self.get_temp_dir()
      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
  
      # Save images to the paths
      i = 0
      for img in self._get_images(color_mode=color_mode, count=count):
          path = paths[i % len(paths)]
          if color_mode == "rgb":
              ext = "jpg"
          else:
              ext = "png"
          filename = os.path.join(path, f"image_{i}.{ext}")
          img.save(os.path.join(temp_dir, filename))
          i += 1
      return temp_dir
  
imports: import os
  import numpy
  from keras import backend
  from keras import testing
  from keras.utils import image_dataset_utils
  from keras.utils import image_utils
  from keras.utils.module_utils import tensorflow
label_desc: Use image node_id 2 for calling the ImageDatasetFromDirectoryTest obj's underlying member method code with example usage: obj._prepare_directory(num_classes, nested_dirs, color_mode, count) and returns: temp_dir