code: def _mock_imagenet_dir(temp_dir):
      """Creates a mock directory with 5 noun-id directores and 3 variants of the noun images. Random images are used."""
      noun_id_to_text = dict()
      for i in range(MOCK_NOUNS_COUNT):
          # Make noun-id directory (e.g. n00000001 format)
          noun_id = "n0000000{}".format(i)
          noun_id_to_text[noun_id] = "text for {}".format(noun_id)
          noun_dir = os.path.join(temp_dir, noun_id)
          os.mkdir(noun_dir)
  
          # Create 3 noun image variants (e.g n00000001_0001.JPEG)
          for variant_id in range(MOCK_VARIANTS_COUNT):
              jpeg_path = os.path.join(
                  noun_dir, "{}_000{}.JPEG".format(noun_id, variant_id)
              )
              dummy_image = np.random.randint(
                  0, 255, size=MOCK_IMAGE_SIZE, dtype=np.uint8
              )
              cv2.imwrite(jpeg_path, dummy_image)
      return noun_id_to_text
  
file_path: petastorm/examples/imagenet/tests/test_generate_imagenet_dataset.py
imports: import os
  import shutil
  import tempfile
  import unittest
  import cv2
  import numpy
  from examples.imagenet.generate_petastorm_imagenet import download_nouns_mapping, imagenet_directory_to_petastorm_dataset
label_desc: Use image node_id 1 for calling a global function with example usage: _mock_imagenet_dir(temp_dir) and returns: noun_id_to_text