code: def add_average_args(params):
      average_params = params.add_argument_group("Averaging")
      average_params.add_argument(
          "inputs",
          metavar="INPUT",
          type=str,
          nargs="+",
          help="either a single model directory (automatic checkpoint selection) "
          "or multiple .params files (manual checkpoint selection)",
      )
      average_params.add_argument(
          "--metric",
          help="Name of the metric to choose n-best checkpoints from. Default: %(default)s.",
          default=C.PERPLEXITY,
          choices=C.METRICS,
      )
      average_params.add_argument(
          "-n",
          type=int,
          default=4,
          help="number of checkpoints to find. Default: %(default)s.",
      )
      average_params.add_argument(
          "--output",
          "-o",
          required=True,
          type=str,
          help="File to write averaged parameters to.",
      )
      average_params.add_argument(
          "--strategy",
          choices=C.AVERAGE_CHOICES,
          default=C.AVERAGE_BEST,
          help="selection method. Default: %(default)s.",
      )
  
imports: import argparse
  import os
  import sys
  import types
  from typing import Any, Callable, Dict, List, Tuple, Optional
  import yaml
  from sockeye.utils import smart_open
  from .None import constants
label_desc: Use image node_id 11 for calling a global function with example usage: add_average_args(params) without return types