code: def _generate_data():
      """Generate images archive."""
  
      # Generate images
      images_dir = os.path.join(_output_dir(), "images")
      if not tf.io.gfile.exists(images_dir):
          tf.io.gfile.makedirs(images_dir)
      for i in range(_TRAIN_IMAGES_NUMBER + _TEST_IMAGES_NUMBER):
          image_name = "image{:03d}.jpg".format(i)
          tf.io.gfile.copy(
              fake_data_utils.get_random_jpeg(),
              os.path.join(images_dir, image_name),
              overwrite=True,
          )
  
      # Generate annotations
      annotations_dir = os.path.join(_output_dir(), "annotations")
  
      if not tf.io.gfile.exists(annotations_dir):
          tf.io.gfile.makedirs(annotations_dir)
  
      # Generate trimaps
      trimaps_dir = os.path.join(annotations_dir, "trimaps")
  
      if not tf.io.gfile.exists(trimaps_dir):
          tf.io.gfile.makedirs(trimaps_dir)
  
      global_count = 0
      for filename, num_examples in [
          ("trainval.txt", _TRAIN_IMAGES_NUMBER),
          ("test.txt", _TEST_IMAGES_NUMBER),
      ]:
          fobj = tempfile.NamedTemporaryFile(delete=False, mode="w")
          with fobj:
              for i in range(num_examples):
                  fobj.write(
                      "image{:03d} {} 0 0\n".format(
                          global_count, i % 37
                      )
                  )
                  global_count += 1
          tf.io.gfile.copy(
              fobj.name,
              os.path.join(annotations_dir, filename),
              overwrite=True,
          )
  
      # Create trimaps
      for i in range(_TRAIN_IMAGES_NUMBER + _TEST_IMAGES_NUMBER):
          trimap_name = "image{:03d}.png".format(i)
          tf.io.gfile.copy(
              fake_data_utils.get_random_png(channels=1),
              os.path.join(trimaps_dir, trimap_name),
              overwrite=True,
          )
  
file_path: datasets/tensorflow_datasets/testing/fake_data_generation/oxford_iiit_pet.py
imports: import os
  import tempfile
  from absl import app
  from absl import flags
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  from tensorflow_datasets.testing import fake_data_utils
label_desc: Use image node_id 2 for calling a global function with example usage: _generate_data() without return types