code: def _write_tar(path, split_name, image_ids, prefix=None):
      """Writes tar file with images to given path.
  
      Args:
        path: sting, path to tar to be written.
        split_name: string. eg: 'train', 'validation', 'test'.
        image_ids: list of str, ids of the images to add to tar file.
        prefix: one of [0-9a-f], or None.
      """
      if prefix is not None:
          split_name = "%s_%s" % (split_name, prefix)
      with tarfile.open(path, mode="w") as tar:
          for i, image_id in enumerate(image_ids):
              fname = "%s/%s.jpg" % (split_name, image_id)
              # Note: Generate two large images with more than 300k pixels.
              kwargs = dict(height=600, width=600) if i < 2 else dict()
              tar.add(
                  fake_data_utils.get_random_jpeg(**kwargs),
                  arcname=fname,
              )
  
file_path: datasets/tensorflow_datasets/testing/fake_data_generation/open_images.py
imports: import os
  import random
  import tarfile
  from absl import app
  from absl import flags
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.features import ClassLabel
  from tensorflow_datasets.object_detection import open_images
  from tensorflow_datasets.testing import fake_data_utils
label_desc: Use image node_id 3 for calling a global function with example usage: _write_tar(path, split_name, image_ids, prefix) without return types