code: def _generate_train_archive():
      """Generate train archive."""
      output_path = os.path.join(
          _ilsvrc2012_output_dir(), "ILSVRC2012_img_train.tar"
      )
      tar = tarfile.open(output_path, mode="w")
      names_file = imagenet_common.label_names_file()
      label_names = tfds.features.ClassLabel(
          names_file=names_file
      ).names
      for i in range(TRAIN_SYNSET_NUMBER):
          synset_name = label_names[i]
          synset = _get_synset(synset_name)
          tar.add(synset, arcname="%s.tar" % synset_name)
      tar.close()
  
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 3 for calling a global function with example usage: _generate_train_archive() without return types