code: def add_rerank_args(params):
      rerank_params = params.add_argument_group("Reranking")
      rerank_params.add_argument(
          "--reference",
          "-r",
          type=str,
          required=True,
          help="File where target reference translations are stored.",
      )
      rerank_params.add_argument(
          "--hypotheses",
          "-hy",
          type=str,
          required=True,
          help="File with nbest translations, one nbest list per line,"
          "in JSON format as returned by sockeye.translate with --nbest-size x.",
      )
      rerank_params.add_argument(
          "--metric",
          "-m",
          type=str,
          required=False,
          default=C.RERANK_BLEU,
          choices=C.RERANK_METRICS,
          help="Sentence-level metric used to compare each nbest translation to the reference or "
          "the source."
          "Default: %(default)s.",
      )
      rerank_params.add_argument(
          "--isometric-alpha",
          required=False,
          type=float_greater_or_equal(0.0),
          default=0.5,
          help="Alpha factor used for reranking (--isometric-[ratio/diff]) nbest list. "
          "Requires optimization on dev set."
          "Default: %(default)s.",
      )
      rerank_params.add_argument(
          "--output",
          "-o",
          default=None,
          help="File to write output to. Default: STDOUT.",
      )
      rerank_params.add_argument(
          "--output-best",
          action="store_true",
          help="Output only the best hypothesis from each nbest list.",
      )
      rerank_params.add_argument(
          "--output-best-non-blank",
          action="store_true",
          help="When outputting only the best hypothesis (--output-best) and the best hypothesis "
          "is a blank line, output following non-blank best from the nbest list.",
      )
      rerank_params.add_argument(
          "--output-reference-instead-of-blank",
          action="store_true",
          help="When outputting only the best hypothesis (--output-best) and the best hypothesis "
          "is a blank line, output the reference instead.",
      )
      rerank_params.add_argument(
          "--return-score",
          action="store_true",
          help="Returns the reranking scores as scores in output JSON objects.",
      )
  
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 12 for calling a global function with example usage: add_rerank_args(params) without return types