code: def parse_args():
      parser = argparse.ArgumentParser(
          description="Optimize anchor parameters."
      )
      parser.add_argument("config", help="Train config file path.")
      parser.add_argument(
          "--device",
          default="cuda:0",
          help="Device used for calculating.",
      )
      parser.add_argument(
          "--input-shape",
          type=int,
          nargs="+",
          default=[608, 608],
          help="input image size",
      )
      parser.add_argument(
          "--algorithm",
          default="differential_evolution",
          help="Algorithm used for anchor optimizing."
          "Support k-means and differential_evolution for YOLO.",
      )
      parser.add_argument(
          "--iters",
          default=1000,
          type=int,
          help="Maximum iterations for optimizer.",
      )
      parser.add_argument(
          "--output-dir",
          default=None,
          type=str,
          help="Path to save anchor optimize result.",
      )
  
      args = parser.parse_args()
      return args
  
imports: import argparse
  import os.path
  import numpy
  import torch
  from mmengine.config import Config
  from mmengine.fileio import dump
  from mmengine.logging import MMLogger
  from mmengine.registry import init_default_scope
  from mmengine.utils import ProgressBar
  from scipy.optimize import differential_evolution
  from mmdet.registry import DATASETS
  from mmdet.structures.bbox import bbox_cxcywh_to_xyxy, bbox_overlaps, bbox_xyxy_to_cxcywh
  from mmdet.utils import replace_cfg_vals, update_data_root
label_desc: Use image node_id 1 for calling a global function with example usage: parse_args() and returns: args