code: def main():
      args = parse_args()
  
      target_dir = os.path.expanduser(args.target_dir)
      if os.path.exists(target_dir):
          raise ValueError(
              "Target dir [" + target_dir + "] exists. Remove it first"
          )
  
      download_dir = os.path.expanduser(args.download_dir)
      train_tar_fname = os.path.join(download_dir, _TRAIN_TAR)
      check_file(train_tar_fname, args.checksum, _TRAIN_TAR_SHA1)
      val_tar_fname = os.path.join(download_dir, _VAL_TAR)
      check_file(val_tar_fname, args.checksum, _VAL_TAR_SHA1)
  
      build_rec = args.with_rec
      if build_rec:
          os.makedirs(os.path.join(target_dir, "rec"))
      extract_train(
          train_tar_fname,
          os.path.join(target_dir, "train"),
          build_rec,
          args.num_thread,
      )
      extract_val(
          val_tar_fname,
          os.path.join(target_dir, "val"),
          build_rec,
          args.num_thread,
      )
  
file_path: gluon-cv/scripts/datasets/imagenet.py
imports: import os
  import argparse
  import tarfile
  import pickle
  import gzip
  import subprocess
  from tqdm import tqdm
  from mxnet.gluon.utils import check_sha1
  from gluoncv.utils import download, makedirs
label_desc: Use image node_id 6 for calling a global function with example usage: main() without return types