code: def _get_synset(synset_name):
      """Returns path to synset archive."""
      fobj = tempfile.NamedTemporaryFile(
          delete=False, mode="wb", suffix=".tar"
      )
      tar = tarfile.open(mode="w", fileobj=fobj)
      for i in range(1, TRAIN_IMAGES_PER_SYNSET + 1):
          fname = "%s_%s.JPEG" % (synset_name, i)
          # There are a few PNG and CMYK images:
          if synset_name == "n01440764" and i == 1:
              path = fake_data_utils.get_random_png()
          elif synset_name == "n01440764" and i in [2, 3]:
              path = os.path.join(
                  FLAGS.tfds_dir,
                  "testing",
                  "test_data",
                  "6pixels_cmyk.jpeg",
              )
          else:
              path = fake_data_utils.get_random_jpeg()
          tar.add(path, arcname=fname)
      fobj.close()
      return fobj.name
  
file_path: datasets/tensorflow_datasets/testing/fake_data_generation/imagenet.py
imports: import json
  import os
  import tarfile
  import tempfile
  from absl import app
  from absl import flags
  import tensorflow.compat.v1
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.datasets.imagenet2012 import imagenet_common
  import tensorflow_datasets.public_api
  from tensorflow_datasets.testing import fake_data_utils
label_desc: Use image node_id 1 for calling a global function with example usage: _get_synset(synset_name) and returns: fobj