code: def process_index_path(tar_paths, index_dir):
      """
      Appends the folder `{index_dir}` to the filepath of all tarfiles.
      Example:
           /X/Y/Z/audio_0.tar -> /X/Y/Z/{index_dir}/audio_0.index
      """
      index_paths = []
      for path in tar_paths:
          basepath, filename = os.path.split(path)
          path = filename.replace(".tar", ".index")
          path = os.path.join(basepath, path)
          base, name = os.path.split(path)
          index_path = os.path.join(index_dir, name)
          index_paths.append(index_path)
  
      return index_paths
  
file_path: NeMo/scripts/speech_recognition/create_dali_tarred_dataset_index.py
imports: import glob
  import logging
  import os
  from dataclasses import dataclass
  import hydra
  from hydra.core.config_store import ConfigStore
  from joblib import Parallel, delayed
  from omegaconf import MISSING
label_desc: Use image node_id 1 for calling a global function with example usage: process_index_path(tar_paths, index_dir) and returns: index_paths