code: def add_brevity_penalty_args(params):
      params.add_argument(
          "--brevity-penalty-type",
          default="none",
          type=str,
          choices=[
              C.BREVITY_PENALTY_NONE,
              C.BREVITY_PENALTY_LEARNED,
              C.BREVITY_PENALTY_CONSTANT,
          ],
          help="If specified, adds brevity penalty to the hypotheses' scores, calculated with learned "
          "or constant length ratios. The latter, by default, uses the length ratio (|ref|/|hyp|) "
          "estimated from the training data and averaged over models. Default: %(default)s.",
      )
      params.add_argument(
          "--brevity-penalty-weight",
          default=1.0,
          type=float_greater_or_equal(0.0),
          help="Scaler for the brevity penalty in beam search: weight * log(BP) + score. "
          "Default: %(default)s",
      )
      params.add_argument(
          "--brevity-penalty-constant-length-ratio",
          default=0.0,
          type=float_greater_or_equal(0.0),
          help="Has effect if --brevity-penalty-type is set to 'constant'. If positive, overrides the "
          "length ratio, used for brevity penalty calculation, for all inputs. If zero, uses the "
          "average of length ratios from the training data over all models. 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 38 for calling a global function with example usage: add_brevity_penalty_args(params) without return types