code: def parse_args(args=None):
      from calamari_ocr.ocr.scenario import CalamariScenario
  
      parser = PAIArgumentParser()
      parser.add_argument(
          "--version",
          action="version",
          version="%(prog)s v" + __version__,
      )
  
      default_trainer_params = CalamariScenario.default_trainer_params()
      parser.add_root_argument(
          "trainer",
          default_trainer_params.__class__,
          default=default_trainer_params,
      )
      params = parser.parse_args(args).trainer
      return params
  
file_path: calamari/calamari_ocr/scripts/train.py
imports: from contextlib import ExitStack
  from typing import TYPE_CHECKING, Dict
  from paiargparse import PAIArgumentParser
  from tfaip.util.logging import logger, WriteToLogFile
  from tfaip.util.typing import AnyNumpy
  from calamari_ocr import __version__
label_desc: Use image node_id 3 for calling a global function with example usage: parse_args(args) and returns: params