class_docstr: DummyAgent operates in an offline mode.
  Waits until all source is read to run inference.
class_docstr_tok: ["DummyAgent","operates","in","an","offline","mode",".","Waits","until","all","source","is","read","to","run","inference","."]
code: def add_args(parser):
      # Note(kamo): Use '_' instead of '-' as separator.
      # '-' is confusing if written in yaml.
      parser.add_argument(
          "--log_level",
          type=lambda x: x.upper(),
          default="INFO",
          choices=(
              "CRITICAL",
              "ERROR",
              "WARNING",
              "INFO",
              "DEBUG",
              "NOTSET",
          ),
          help="The verbose level of logging",
      )
  
      parser.add_argument(
          "--ngpu",
          type=int,
          default=0,
          help="The number of gpus. 0 indicates CPU mode",
      )
      parser.add_argument(
          "--seed", type=int, default=0, help="Random seed"
      )
      parser.add_argument(
          "--dtype",
          default="float32",
          choices=["float16", "float32", "float64"],
          help="Data type",
      )
      parser.add_argument(
          "--num_workers",
          type=int,
          default=1,
          help="The number of workers used for DataLoader",
      )
  
      group = parser.add_argument_group(
          "The model configuration related"
      )
      group.add_argument(
          "--st_train_config",
          type=str,
          help="ST training configuration",
      )
      group.add_argument(
          "--st_model_file",
          type=str,
          help="ST model parameter file",
      )
      group.add_argument(
          "--lm_train_config",
          type=str,
          help="LM training configuration",
      )
      group.add_argument(
          "--src_lm_train_config",
          type=str,
          help="LM training configuration",
      )
      group.add_argument(
          "--lm_file",
          type=str,
          help="LM parameter file",
      )
      group.add_argument(
          "--src_lm_file",
          type=str,
          help="LM parameter file",
      )
      group.add_argument(
          "--word_lm_train_config",
          type=str,
          help="Word LM training configuration",
      )
      group.add_argument(
          "--src_word_lm_train_config",
          type=str,
          help="Word LM training configuration",
      )
      group.add_argument(
          "--word_lm_file",
          type=str,
          help="Word LM parameter file",
      )
      group.add_argument(
          "--src_word_lm_file",
          type=str,
          help="Word LM parameter file",
      )
      group.add_argument(
          "--ngram_file",
          type=str,
          help="N-gram parameter file",
      )
      group.add_argument(
          "--src_ngram_file",
          type=str,
          help="N-gram parameter file",
      )
      group.add_argument(
          "--model_tag",
          type=str,
          help="Pretrained model tag. If specify this option, *_train_config and "
          "*_file will be overwritten",
      )
      group.add_argument(
          "--enh_s2t_task",
          type=str2bool,
          default=False,
          help="enhancement and asr joint model",
      )
  
      group = parser.add_argument_group("Beam-search related")
      group.add_argument(
          "--batch_size",
          type=int,
          default=1,
          help="The batch size for inference",
      )
      group.add_argument(
          "--nbest",
          type=int,
          default=1,
          help="Output N-best hypotheses",
      )
      group.add_argument(
          "--asr_nbest",
          type=int,
          default=1,
          help="Output N-best hypotheses",
      )
      group.add_argument(
          "--beam_size", type=int, default=20, help="Beam size"
      )
      group.add_argument(
          "--asr_beam_size", type=int, default=20, help="Beam size"
      )
      group.add_argument(
          "--penalty", type=float, default=0.0, help="Insertion penalty"
      )
      group.add_argument(
          "--asr_penalty",
          type=float,
          default=0.0,
          help="Insertion penalty",
      )
      group.add_argument(
          "--maxlenratio",
          type=float,
          default=0.0,
          help="Input length ratio to obtain max output length. "
          "If maxlenratio=0.0 (default), it uses a end-detect "
          "function "
          "to automatically find maximum hypothesis lengths."
          "If maxlenratio<0.0, its absolute value is interpreted"
          "as a constant max output length",
      )
      group.add_argument(
          "--asr_maxlenratio",
          type=float,
          default=0.0,
          help="Input length ratio to obtain max output length. "
          "If maxlenratio=0.0 (default), it uses a end-detect "
          "function "
          "to automatically find maximum hypothesis lengths."
          "If maxlenratio<0.0, its absolute value is interpreted"
          "as a constant max output length",
      )
      group.add_argument(
          "--minlenratio",
          type=float,
          default=0.0,
          help="Input length ratio to obtain min output length",
      )
      group.add_argument(
          "--asr_minlenratio",
          type=float,
          default=0.0,
          help="Input length ratio to obtain min output length",
      )
      group.add_argument(
          "--lm_weight", type=float, default=1.0, help="RNNLM weight"
      )
      group.add_argument(
          "--asr_lm_weight",
          type=float,
          default=1.0,
          help="RNNLM weight",
      )
      group.add_argument(
          "--ngram_weight", type=float, default=0.9, help="ngram weight"
      )
      group.add_argument(
          "--asr_ngram_weight",
          type=float,
          default=0.9,
          help="ngram weight",
      )
      group.add_argument(
          "--ctc_weight", type=float, default=0.0, help="ST CTC weight"
      )
      group.add_argument(
          "--asr_ctc_weight",
          type=float,
          default=0.3,
          help="ASR CTC weight",
      )
  
      group.add_argument(
          "--transducer_conf",
          default=None,
          help="The keyword arguments for transducer beam search.",
      )
  
      group = parser.add_argument_group("Text converter related")
      group.add_argument(
          "--token_type",
          type=str_or_none,
          default=None,
          choices=["char", "bpe", None],
          help="The token type for ST model. "
          "If not given, refers from the training args",
      )
      group.add_argument(
          "--src_token_type",
          type=str_or_none,
          default=None,
          choices=["char", "bpe", None],
          help="The token type for ST model. "
          "If not given, refers from the training args",
      )
      group.add_argument(
          "--bpemodel",
          type=str_or_none,
          default=None,
          help="The model path of sentencepiece. "
          "If not given, refers from the training args",
      )
      group.add_argument(
          "--src_bpemodel",
          type=str_or_none,
          default=None,
          help="The model path of sentencepiece. "
          "If not given, refers from the training args",
      )
      group.add_argument(
          "--ctc_greedy",
          type=str2bool,
          default=False,
      )
  
      group.add_argument(
          "--sim_chunk_length",
          type=int,
          default=0,
          help="The length of one chunk, to which speech will be "
          "divided for evalution of streaming processing.",
      )
      group.add_argument(
          "--disable_repetition_detection", type=str2bool, default=False
      )
      group.add_argument(
          "--encoded_feat_length_limit",
          type=int,
          default=0,
          help="Limit the lengths of the encoded feature"
          "to input to the decoder.",
      )
      group.add_argument(
          "--decoder_text_length_limit",
          type=int,
          default=0,
          help="Limit the lengths of the text"
          "to input to the decoder.",
      )
  
      group.add_argument(
          "--backend",
          type=str,
          default="offline",
          help="Limit the lengths of the text"
          "to input to the decoder.",
      )
      group.add_argument(
          "--time_sync",
          type=str2bool,
          default=False,
      )
      group.add_argument(
          "--incremental_decode",
          type=str2bool,
          default=False,
      )
      group.add_argument(
          "--blank_penalty",
          type=float,
          default=1.0,
      )
      group.add_argument(
          "--hold_n",
          type=int,
          default=0,
      )
      group.add_argument(
          "--token_delay",
          type=str2bool,
          default=True,
      )
      group.add_argument(
          "--rnnt",
          type=str2bool,
          default=False,
      )
      group.add_argument(
          "--lang",
          type=str,
          default="de",
      )
      group.add_argument(
          "--hugging_face_decoder", type=str2bool, default=False
      )
      group.add_argument(
          "--recompute",
          type=str2bool,
          default=False,
      )
      group.add_argument(
          "--chunk_decay",
          type=float,
          default=1.0,
      )
      group.add_argument(
          "--use_word_list",
          type=str2bool,
          default=False,
      )
  
      return parser
  
file_path: espnet/egs2/voices/asr1/pyscripts/utils/simuleval_agent.py
imports: import logging
  import random
  from typing import Any, List, Optional, Sequence, Tuple, Union
  import torch
  from mosestokenizer import MosesDetokenizer
  from simuleval.agents import SpeechToTextAgent
  from simuleval.agents.actions import ReadAction, WriteAction
  from simuleval.utils import entrypoint
  from espnet2.bin.st_inference import Speech2Text
  from espnet2.bin.st_inference_streaming import Speech2TextStreaming
  from espnet2.torch_utils.set_all_random_seed import set_all_random_seed
  from espnet2.utils.types import str2bool, str2triple_str, str_or_none
label_desc: Use image node_id 2 for calling the DummyAgent obj's underlying member method code with example usage: obj.add_args(parser) and returns: parser