code: def _add_logging_opts(parser, is_train=True):
      group = parser.add_argument_group("Logging")
      group.add(
          "--log_file",
          "-log_file",
          type=str,
          default="",
          help="Output logs to a file under this path.",
      )
      group.add(
          "--log_file_level",
          "-log_file_level",
          type=str,
          action=StoreLoggingLevelAction,
          choices=StoreLoggingLevelAction.CHOICES,
          default="0",
      )
      group.add(
          "--verbose",
          "-verbose",
          action="store_true",
          help="Print data loading and statistics for all process"
          "(default only log the first process shard)"
          if is_train
          else "Print scores and predictions for each sentence",
      )
  
      if is_train:
          group.add(
              "--valid_metrics",
              "-valid_metrics",
              default=[],
              nargs="+",
              help="List of names of additional validation metrics",
          )
          group.add(
              "--scoring_debug",
              "-scoring_debug",
              action="store_true",
              help="Dump the src/ref/pred of the current batch",
          )
          group.add(
              "--dump_preds",
              "-dump_preds",
              type=str,
              default=None,
              help="Folder to dump predictions to.",
          )
          group.add(
              "--report_every",
              "-report_every",
              type=int,
              default=50,
              help="Print stats at this interval.",
          )
          group.add(
              "--exp_host",
              "-exp_host",
              type=str,
              default="",
              help="Send logs to this crayon server.",
          )
          group.add(
              "--exp",
              "-exp",
              type=str,
              default="",
              help="Name of the experiment for logging.",
          )
          # Use Tensorboard for visualization during training
          group.add(
              "--tensorboard",
              "-tensorboard",
              action="store_true",
              help="Use tensorboard for visualization during training. "
              "Must have the library tensorboard >= 1.14.",
          )
          group.add(
              "--tensorboard_log_dir",
              "-tensorboard_log_dir",
              type=str,
              default="runs/onmt",
              help="Log directory for Tensorboard. "
              "This is also the name of the run.",
          )
          group.add(
              "--override_opts",
              "-override-opts",
              action="store_true",
              help="Allow to override some checkpoint opts",
          )
      else:
          # Options only during inference
          group.add(
              "--attn_debug",
              "-attn_debug",
              action="store_true",
              help="Print best attn for each word",
          )
          group.add(
              "--align_debug",
              "-align_debug",
              action="store_true",
              help="Print best align for each word",
          )
          group.add(
              "--dump_beam",
              "-dump_beam",
              type=str,
              default="",
              help="File to dump beam information to.",
          )
          group.add(
              "--n_best",
              "-n_best",
              type=int,
              default=1,
              help="If verbose is set, will output the n_best "
              "decoded sentences",
          )
          group.add(
              "--with_score",
              "-with_score",
              action="store_true",
              help="add a tab separated score to the translation",
          )
  
imports: import configargparse
  from onmt.modules.sru import CheckSRU
  from onmt.transforms import AVAILABLE_TRANSFORMS
  from onmt.constants import ModelTask
  from onmt.modules.position_ffn import ACTIVATION_FUNCTIONS
  from onmt.modules.position_ffn import ActivationFunction
  from onmt.constants import DefaultTokens
label_desc: Use image node_id 2 for calling a global function with example usage: _add_logging_opts(parser, is_train) without return types