code: def parse_args():
      parser = argparse.ArgumentParser()
      parser.add_argument(
          "in_path", help="Input json path in coco format."
      )
      parser.add_argument(
          "out_path", help="Output json path in openmmlab format."
      )
      parser.add_argument(
          "--task",
          type=str,
          default="auto",
          choices=["auto", "textdet", "textspotter"],
          help='Output annotation type, defaults to "auto", which decides the'
          'best task type based on whether "text" is annotated. Other options'
          'are "textdet" and "textspotter".',
      )
      args = parser.parse_args()
      return args
  
file_path: mmocr/tools/dataset_converters/textdet/data_migrator.py
imports: import argparse
  from collections import defaultdict
  from copy import deepcopy
  from typing import Dict, List
  import mmengine
  from mmocr.utils import dump_ocr_data
label_desc: Use image node_id 2 for calling a global function with example usage: parse_args() and returns: args