class_docstr: ImgTextTarDataset class for datasets that store Image-Text pairs as tar files, each tar file with multiple pairs.
  
  The dataset should be stored in following format where `img_text_tar_dataset` is the location of directory that
  has all tar files.
  
  img_text_tar_dataset
  |--- 00000000_0_1000.tar.gz
  |-------- 00000000_0_image
  |-------- 00000000_0_text
  |-------- 00000000_1_image
  |-------- 00000000_1_text
  |-------- ...
  
  |--- 00000000_1000_2000.tar.gz
  |-------- 00000000_1000_image
  |-------- 00000000_1000_text
  |-------- 00000000_1001_image
  |-------- 00000000_1001_text
  |-------- ...
  
  Args:
      opts: An argparse.Namespace instance.
class_docstr_tok: ["ImgTextTarDataset","class","for","datasets","that","store","Image-Text","pairs","as","tar","files",",","each","tar","file","with","multiple","pairs",".","The","dataset","should","be","stored","in","following","format","where","`","img_text_tar_dataset","`","is","the","location","of","directory","that","has","all","tar","files",".","img_text_tar_dataset","|","--","-","00000000_0_1000.tar.gz","|","--","--","--","--","00000000_0_image","|","--","--","--","--","00000000_0_text","|","--","--","--","--","00000000_1_image","|","--","--","--","--","00000000_1_text","|","--","--","--","--","...","|","--","-","00000000_1000_2000.tar.gz","|","--","--","--","--","00000000_1000_image","|","--","--","--","--","00000000_1000_text","|","--","--","--","--","00000000_1001_image","|","--","--","--","--","00000000_1001_text","|","--","--","--","--","...","Args",":","opts",":","An","argparse.Namespace","instance","."]
docstr: Reads the metadata file and returns a mapping of indices of files stored in a tar file and its name
docstr_tok: ["Reads","the","metadata","file","and","returns","a","mapping","of","indices","of","files","stored","in","a","tar","file","and","its","name"]
code: def get_dataset(self, *args, **kwargs) -> Dict[str, str]:
      """Reads the metadata file and returns a mapping of indices of files stored in a tar file and its name"""
      if self.is_training:
          # read metadata file
          # metadata file is a dictionary storing the start image-text ids along with the tar file name.
          # Example {'0-18000': 'file_1.tar', 18000-29000', 'file_2.tar'}
          metadata_file_loc = getattr(
              self.opts,
              "dataset.multi_modal_img_text.img_text_tar.metadata_file",
          )
          if metadata_file_loc is None:
              if self.is_master_node:
                  logger.error(
                      "Please specify metadata file using "
                      "--dataset.multi-modal-img-text.img_text_tar.metadata-file for {}".format(
                          self.__class__.__name__
                      )
                  )
  
          metadata_file_local_path = get_local_path(
              self.opts, path=metadata_file_loc, force_delete=False
          )
          with open(metadata_file_local_path, "rb") as fp:
              metadata = pickle.load(fp)
              return metadata
      else:
          return {}
  
imports: import argparse
  import glob
  import io
  import os
  import pickle
  import tarfile
  from multiprocessing.pool import Pool
  from typing import AnyStr, Dict, Tuple
  import numpy
  import torch
  from PIL import Image, ImageFile
  from data.datasets import DATASET_REGISTRY
  from data.datasets.multi_modal_img_text.base_multi_modal_img_text import BaseMultiModalImgText
  from utils import logger, resources
  from utils.ddp_utils import dist_barrier
  from utils.download_utils import get_local_path
label_desc: Use image node_id 2 for calling the ImgTextTarDataset obj's underlying member method code with example usage: obj.get_dataset() and returns: dict, metadata