code: def translate_opts(parser):
      """Translation / inference options"""
      config_opts(parser)
      group = parser.add_argument_group("Model")
      group.add(
          "--model",
          "-model",
          dest="models",
          metavar="MODEL",
          nargs="+",
          type=str,
          default=[],
          required=True,
          help="Path to model .pt file(s). "
          "Multiple models can be specified, "
          "for ensemble decoding.",
      )
      group.add(
          "--precision",
          "-precision",
          default="",
          choices=["", "fp32", "fp16", "int8"],
          help="Precision to run inference."
          "default is model.dtype"
          "fp32 to force slow FP16 model on GTX1080"
          "int8 enables pytorch native 8-bit quantization"
          "(cpu only)",
      )
      group.add(
          "--fp32",
          "-fp32",
          action=DeprecateAction,
          help="Deprecated use 'precision' instead",
      )
      group.add(
          "--int8",
          "-int8",
          action=DeprecateAction,
          help="Deprecated use 'precision' instead",
      )
      group.add(
          "--avg_raw_probs",
          "-avg_raw_probs",
          action="store_true",
          help="If this is set, during ensembling scores from "
          "different models will be combined by averaging their "
          "raw probabilities and then taking the log. Otherwise, "
          "the log probabilities will be averaged directly. "
          "Necessary for models whose output layers can assign "
          "zero probability.",
      )
      group.add(
          "--self_attn_type",
          "-self_attn_type",
          type=str,
          default="scaled-dot-flash",
          help="Self attention type in Transformer decoder "
          'layer -- currently "scaled-dot", "scaled-dot-flash" or "average" ',
      )
      group = parser.add_argument_group("Data")
      group.add(
          "--data_type",
          "-data_type",
          default="text",
          help="Type of the source input. Options: [text].",
      )
      group.add(
          "--src",
          "-src",
          required=True,
          help="Source sequence to decode (one line per " "sequence)",
      )
      group.add("--tgt", "-tgt", help="True target sequence (optional)")
      group.add(
          "--tgt_file_prefix",
          "-tgt_file_prefix",
          action="store_true",
          help="Generate predictions using provided `-tgt` as prefix.",
      )
      group.add(
          "--output",
          "-output",
          default="pred.txt",
          help="Path to output the predictions (each line will "
          "be the decoded sequence",
      )
      group.add(
          "--report_align",
          "-report_align",
          action="store_true",
          help="Report alignment for each translation.",
      )
      group.add(
          "--gold_align",
          "-gold_align",
          action="store_true",
          help="Report alignment between source and gold target."
          "Useful to test the performance of learnt alignments.",
      )
      group.add(
          "--report_time",
          "-report_time",
          action="store_true",
          help="Report some translation time metrics",
      )
      group.add(
          "--profile",
          "-profile",
          action="store_true",
          help="Report pytorch profiling stats",
      )
      # Adding options related to source and target features
      _add_features_opts(parser)
  
      # Adding options relate to decoding strategy
      _add_decoding_opts(parser)
  
      # Adding option for logging
      _add_logging_opts(parser, is_train=False)
  
      distributed_opts(parser)
  
      group = parser.add_argument_group("Efficiency")
      group.add(
          "--batch_size",
          "-batch_size",
          type=int,
          default=30,
          help="Batch size",
      )
      group.add(
          "--batch_type",
          "-batch_type",
          default="sents",
          choices=["sents", "tokens"],
          help="Batch grouping for batch_size. Standard "
          "is sents. Tokens will do dynamic batching",
      )
      group.add(
          "--gpu", "-gpu", type=int, default=-1, help="Device to run on"
      )
  
      group.add(
          "-transforms",
          "--transforms",
          default=[],
          nargs="+",
          choices=AVAILABLE_TRANSFORMS.keys(),
          help="Default transform pipeline to apply to data.",
      )
  
      # Adding options related to Transforms
      _add_transform_opts(parser)
  
      _add_quant_opts(parser)
  
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 15 for calling a global function with example usage: translate_opts(parser) without return types