code: def build_model(cls, args: argparse.Namespace) -> ESPnetEnhS2TModel:
      assert check_argument_types()
  
      # Build submodels in the order of subtask_series
      model_conf = args.model_conf.copy()
      for _, subtask in enumerate(args.subtask_series):
          subtask_conf = dict(
              init=None, model_conf=eval(f"args.{subtask}_model_conf")
          )
  
          for attr in eval(f"{subtask}_attributes"):
              subtask_conf[attr] = (
                  getattr(args, subtask + "_" + attr, None)
                  if getattr(args, subtask + "_" + attr, None)
                  is not None
                  else getattr(args, attr, None)
              )
  
          if subtask in ["asr", "st", "diar"]:
              m_subtask = "s2t"
          elif subtask in ["enh"]:
              m_subtask = subtask
          else:
              raise ValueError(f"{subtask} not supported.")
  
          logging.info(
              f"Building {subtask} task model, using config: {subtask_conf}"
          )
  
          model_conf[f"{m_subtask}_model"] = name2task[
              subtask
          ].build_model(argparse.Namespace(**subtask_conf))
  
      # 8. Build model
      model = ESPnetEnhS2TModel(**model_conf)
  
      # FIXME(kamo): Should be done in model?
      # 9. Initialize
      if args.init is not None:
          initialize(model, args.init)
  
      assert check_return_type(model)
      return model
  
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 6 for calling the EnhS2TTask obj's underlying member method code with example usage: obj.build_model(cls, args) and returns: model