code: def main(args):
      num_process = min(multiprocessing.cpu_count(), args.num_process)
      if not os.path.exists(args.output):
          os.makedirs(args.output, exist_ok=True)
      fnames = sorted(os.listdir(args.input))
      fnames = [os.path.join(args.input, fname) for fname in fnames]
      if args.shuffle:
          random.shuffle(fnames)
      print(
          "Start extracting {} files with {} cores".format(
              len(fnames), num_process
          )
      )
      start_time = time.time()
      with multiprocessing.Pool(num_process) as pool:
          iter = pool.imap(
              functools.partial(
                  extract_files,
                  output_dir=args.output,
                  shuffle=args.shuffle,
              ),
              fnames,
          )
          for f_index, _ in enumerate(iter):
              if f_index > 0 and f_index % 250 == 0:
                  elapsed = time.time() - start_time
                  print(
                      "Extracted {:}, Elapsed: {:}s, ETA: {:}s, ".format(
                          f_index,
                          int(elapsed),
                          int(
                              (len(fnames) - f_index)
                              / (f_index / elapsed)
                          ),
                      )
                  )
  
      print("Done!")
  
file_path: gluon-nlp/scripts/datasets/pretrain_corpus/prepare_openwebtext.py
imports: import os
  import re
  import time
  import random
  import tarfile
  import argparse
  import functools
  import multiprocessing
label_desc: Use image node_id 3 for calling a global function with example usage: main(args) without return types