code: def parse_args():
      parser = argparse.ArgumentParser(
          formatter_class=argparse.ArgumentDefaultsHelpFormatter,
          description="Creates a webdataset index file for the use with the `fn.readers.webdataset`.",
      )
      parser.add_argument("archive", help="path to .tar file.")
      parser.add_argument(
          "index",
          help="path to index file",
          nargs="?",
      )
      args = parser.parse_args()
      if args.index is None:
          args.index = (
              args.archive[
                  : args.archive.find(".", args.archive.rfind("/") + 2)
              ]
              + ".idx"
          )
      args.archive = os.path.abspath(args.archive)
      args.index = os.path.abspath(args.index)
      return args
  
file_path: DALI/tools/wds2idx.py
imports: import argparse
  import os
  import subprocess
  import sys
  import tarfile
  import time
  from shutil import which
label_desc: Use image node_id 1 for calling a global function with example usage: parse_args() and returns: args