code: def _generate_val_archive():
      """Generate val archive."""
      output_path = os.path.join(
          _ilsvrc2012_output_dir(), "ILSVRC2012_img_val.tar"
      )
      tar = tarfile.open(output_path, mode="w")
      for i in range(1, VAL_IMAGES_NUMBER + 1):
          fname = "ILSVRC2012_val_{:08}.JPEG".format(i)
          jpeg = fake_data_utils.get_random_jpeg()
          tar.add(jpeg, arcname=fname)
      tar.close()
  
      if FLAGS.real:
          real_labels_path = os.path.join(
              _ilsvrc2012_output_dir(), "real.json"
          )
          with open(real_labels_path, "w") as f:
              json.dump(
                  [[i, i + 1] for i in range(VAL_IMAGES_NUMBER)], f
              )
  
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 4 for calling a global function with example usage: _generate_val_archive() without return types