code: def parse_args() -> argparse.Namespace:
      parser = argparse.ArgumentParser("backend-test-tools")
      subparsers = parser.add_subparsers()
  
      subparser = subparsers.add_parser(
          "generate-data", help="convert testcases to test data."
      )
      subparser.add_argument(
          "-c",
          "--clean",
          default=False,
          action="store_true",
          help="Clean the output directory before generating data for node testcases.",
      )
      subparser.add_argument(
          "-o",
          "--output",
          default=DATA_DIR,
          help="output directory (default: %(default)s)",
      )
      subparser.add_argument(
          "-t",
          "--op_type",
          default=None,
          help="op_type for test case generation. (generates test data for the specified op_type only.)",
      )
      subparser.add_argument(
          "-d",
          "--diff",
          default=False,
          action="store_true",
          help="only generates test data for those changed files (compared to the main branch).",
      )
      subparser.set_defaults(func=generate_data)
  
      return parser.parse_args()
  
file_path: onnx/onnx/backend/test/cmd_tools.py
imports: import argparse
  import json
  import os
  import shutil
  import warnings
  import onnx.backend.test.case.model
  import onnx.backend.test.case.node
  from onnx import ONNX_ML, TensorProto, numpy_helper
label_desc: Use image node_id 2 for calling a global function with example usage: parse_args() and returns: parser