code: def tar_processing(tar_path, output_dir, logger):
      filepath = untar(tar_path, logger)
      json_files = [
          f for f in os.listdir(filepath) if f.endswith(".json")
      ]
      all_data = []
      cnt = 0
  
      for file in json_files:
          with open(os.path.join(filepath, file), "r") as f:
              df = json.load(f)
          cnt = cnt + 1
          all_data.extend([df])
      dir_name = os.path.basename(filepath)
      # write all data to a json file
      logger.info(f"{dir_name} has {cnt} jsons")
      json_name = os.path.basename(filepath) + ".json"
      if not os.path.exists(os.path.join(output_dir, "annotations")):
          os.mkdir(os.path.join(output_dir, "annotations"))
      with open(
          os.path.join(output_dir, "annotations", json_name), "w"
      ) as f:
          json.dump(all_data, f)
      logger.info(f"{dir_name} completed")
      cp_rm(filepath, output_dir)
      return os.path.basename(filepath)
  
file_path: mmdetection/tools/dataset_converters/grit_processing.py
imports: import argparse
  import json
  import logging
  import os
  import tarfile
  from functools import partial
  from multiprocessing import Pool
label_desc: Use image node_id 3 for calling a global function with example usage: tar_processing(tar_path, output_dir, logger) and returns: os