code: def add_task_arguments(cls, parser: argparse.ArgumentParser):
      group = parser.add_argument_group(description="Task related")
  
      group.add_argument(
          "--token_list",
          type=str_or_none,
          default=None,
          help="A text mapping int-id to token",
      )
      group.add_argument(
          "--src_token_list",
          type=str_or_none,
          default=None,
          help="A text mapping int-id to token (for source language)",
      )
      group.add_argument(
          "--init",
          type=lambda x: str_or_none(x.lower()),
          default=None,
          help="The initialization method",
          choices=[
              "chainer",
              "xavier_uniform",
              "xavier_normal",
              "kaiming_uniform",
              "kaiming_normal",
              None,
          ],
      )
  
      group.add_argument(
          "--input_size",
          type=int_or_none,
          default=None,
          help="The number of input dimension of the feature",
      )
  
      group.add_argument(
          "--ctc_conf",
          action=NestedDictAction,
          default=get_default_kwargs(CTC),
          help="The keyword arguments for CTC class.",
      )
  
      group.add_argument(
          "--enh_criterions",
          action=NestedDictAction,
          default=[
              {
                  "name": "si_snr",
                  "conf": {},
                  "wrapper": "fixed_order",
                  "wrapper_conf": {},
              },
          ],
          help="The criterions binded with the loss wrappers.",
      )
  
      group.add_argument(
          "--diar_num_spk",
          type=int_or_none,
          default=None,
          help="The number of speakers (for each recording) for diar submodel class",
      )
  
      group.add_argument(
          "--diar_input_size",
          type=int_or_none,
          default=None,
          help="The number of input dimension of the feature",
      )
  
      group.add_argument(
          "--enh_model_conf",
          action=NestedDictAction,
          default=get_default_kwargs(ESPnetEnhancementModel),
          help="The keyword arguments for enh submodel class.",
      )
  
      group.add_argument(
          "--asr_model_conf",
          action=NestedDictAction,
          default=get_default_kwargs(ESPnetASRModel),
          help="The keyword arguments for asr submodel class.",
      )
  
      group.add_argument(
          "--st_model_conf",
          action=NestedDictAction,
          default=get_default_kwargs(ESPnetEnhancementModel),
          help="The keyword arguments for st submodel class.",
      )
  
      group.add_argument(
          "--diar_model_conf",
          action=NestedDictAction,
          default=get_default_kwargs(ESPnetDiarizationModel),
          help="The keyword arguments for diar submodel class.",
      )
  
      group.add_argument(
          "--subtask_series",
          type=str,
          nargs="+",
          default=("enh", "asr"),
          choices=["enh", "asr", "st", "diar"],
          help="The series of subtasks in the pipeline.",
      )
  
      group.add_argument(
          "--model_conf",
          action=NestedDictAction,
          default=get_default_kwargs(ESPnetEnhS2TModel),
          help="The keyword arguments for model class.",
      )
  
      group = parser.add_argument_group(
          description="Preprocess related"
      )
      group.add_argument(
          "--use_preprocessor",
          type=str2bool,
          default=False,
          help="Apply preprocessing to data or not",
      )
      group.add_argument(
          "--token_type",
          type=str,
          default="bpe",
          choices=["bpe", "char", "word", "phn"],
          help="The text will be tokenized "
          "in the specified level token",
      )
      group.add_argument(
          "--bpemodel",
          type=str_or_none,
          default=None,
          help="The model file of sentencepiece",
      )
      group.add_argument(
          "--src_token_type",
          type=str,
          default="bpe",
          choices=["bpe", "char", "word", "phn"],
          help="The source text will be tokenized "
          "in the specified level token",
      )
      group.add_argument(
          "--src_bpemodel",
          type=str_or_none,
          default=None,
          help="The model file of sentencepiece (for source language)",
      )
      group.add_argument(
          "--non_linguistic_symbols",
          type=str_or_none,
          help="non_linguistic_symbols file path",
      )
      group.add_argument(
          "--cleaner",
          type=str_or_none,
          choices=[None, "tacotron", "jaconv", "vietnamese"],
          default=None,
          help="Apply text cleaning",
      )
      group.add_argument(
          "--g2p",
          type=str_or_none,
          choices=g2p_choices,
          default=None,
          help="Specify g2p method if --token_type=phn",
      )
      group.add_argument(
          "--text_name",
          nargs="+",
          default=["text"],
          type=str,
          help="Specify the text_name attribute used in the preprocessor",
      )
  
      for class_choices in cls.class_choices_list:
          # Append --<name> and --<name>_conf.
          # e.g. --encoder and --encoder_conf
          class_choices.add_arguments(group)
  
imports: import argparse
  import copy
  import logging
  from typing import Callable, Collection, Dict, List, Optional, Tuple
  import numpy
  import torch
  from typeguard import check_argument_types, check_return_type
  from espnet2.asr.ctc import CTC
  from espnet2.asr.espnet_model import ESPnetASRModel
  from espnet2.diar.espnet_model import ESPnetDiarizationModel
  from espnet2.enh.espnet_enh_s2t_model import ESPnetEnhS2TModel
  from espnet2.enh.espnet_model import ESPnetEnhancementModel
  from espnet2.tasks.abs_task import AbsTask
  from espnet2.tasks.asr import ASRTask
  from espnet2.tasks.asr import decoder_choices
  from espnet2.tasks.asr import encoder_choices
  from espnet2.tasks.asr import frontend_choices, normalize_choices
  from espnet2.tasks.asr import postencoder_choices
  from espnet2.tasks.asr import preencoder_choices
  from espnet2.tasks.asr import specaug_choices
  from espnet2.tasks.diar import DiarizationTask
  from espnet2.tasks.diar import attractor_choices
  from espnet2.tasks.diar import decoder_choices
  from espnet2.tasks.diar import encoder_choices
  from espnet2.tasks.diar import frontend_choices
  from espnet2.tasks.diar import label_aggregator_choices
  from espnet2.tasks.diar import normalize_choices
  from espnet2.tasks.diar import specaug_choices
  from espnet2.tasks.enh import EnhancementTask
  from espnet2.tasks.enh import decoder_choices
  from espnet2.tasks.enh import encoder_choices
  from espnet2.tasks.enh import mask_module_choices
  from espnet2.tasks.enh import separator_choices
  from espnet2.tasks.st import STTask
  from espnet2.tasks.st import decoder_choices
  from espnet2.tasks.st import encoder_choices
  from espnet2.tasks.st import extra_asr_decoder_choices
  from espnet2.tasks.st import extra_mt_decoder_choices
  from espnet2.tasks.st import postencoder_choices
  from espnet2.tasks.st import preencoder_choices
  from espnet2.text.phoneme_tokenizer import g2p_choices
  from espnet2.torch_utils.initialize import initialize
  from espnet2.train.collate_fn import CommonCollateFn
  from espnet2.train.preprocessor import CommonPreprocessor, CommonPreprocessor_multi, MutliTokenizerCommonPreprocessor
  from espnet2.train.trainer import Trainer
  from espnet2.utils.get_default_kwargs import get_default_kwargs
  from espnet2.utils.nested_dict_action import NestedDictAction
  from espnet2.utils.types import int_or_none, str2bool, str_or_none
label_desc: Use image node_id 1 for calling the EnhS2TTask obj's underlying member method code with example usage: obj.add_task_arguments(cls, parser) without return types