code: def build_optimizers(
      cls,
      args: argparse.Namespace,
      model: ESPnetUASRModel,
  ) -> List[torch.optim.Optimizer]:
      # check
      assert hasattr(model, "generator")
      assert hasattr(model, "discriminator")
  
      generator_param_list = list(model.generator.parameters())
      discriminator_param_list = list(model.discriminator.parameters())
  
      # Add optional sets of model parameters
      if model.use_segmenter is not None:
          generator_param_list += list(model.segmenter.parameters())
      if (
          "pseudo_label_loss" in model.losses.keys()
          and model.losses["pseudo_label_loss"].weight > 0
      ):
          generator_param_list += list(
              model.losses["pseudo_label_loss"].decoder.parameters()
          )
  
      # define generator optimizer
      optim_generator_class = optim_classes.get(args.optim)
      if optim_generator_class is None:
          raise ValueError(
              f"must be one of {list(optim_classes)}: {args.optim_generator}"
          )
      optim_generator = optim_generator_class(
          generator_param_list,
          **args.optim_conf,
      )
      optimizers = [optim_generator]
  
      # define discriminator optimizer
      optim_discriminator_class = optim_classes.get(args.optim2)
      if optim_discriminator_class is None:
          raise ValueError(
              f"must be one of {list(optim_classes)}: {args.optim_discriminator}"
          )
      optim_discriminator = optim_discriminator_class(
          discriminator_param_list,
          **args.optim2_conf,
      )
      optimizers += [optim_discriminator]
  
      return optimizers
  
imports: import argparse
  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.frontend.abs_frontend import AbsFrontend
  from espnet2.asr.frontend.default import DefaultFrontend
  from espnet2.asr.frontend.fused import FusedFrontends
  from espnet2.asr.frontend.s3prl import S3prlFrontend
  from espnet2.asr.frontend.windowing import SlidingWindow
  from espnet2.tasks.abs_task import AbsTask, optim_classes
  from espnet2.torch_utils.initialize import initialize
  from espnet2.train.class_choices import ClassChoices
  from espnet2.train.collate_fn import CommonCollateFn
  from espnet2.train.preprocessor import CommonPreprocessor
  from espnet2.train.uasr_trainer import UASRTrainer
  from espnet2.uasr.discriminator.abs_discriminator import AbsDiscriminator
  from espnet2.uasr.discriminator.conv_discriminator import ConvDiscriminator
  from espnet2.uasr.espnet_model import ESPnetUASRModel
  from espnet2.uasr.generator.abs_generator import AbsGenerator
  from espnet2.uasr.generator.conv_generator import ConvGenerator
  from espnet2.uasr.loss.abs_loss import AbsUASRLoss
  from espnet2.uasr.loss.discriminator_loss import UASRDiscriminatorLoss
  from espnet2.uasr.loss.gradient_penalty import UASRGradientPenalty
  from espnet2.uasr.loss.phoneme_diversity_loss import UASRPhonemeDiversityLoss
  from espnet2.uasr.loss.pseudo_label_loss import UASRPseudoLabelLoss
  from espnet2.uasr.loss.smoothness_penalty import UASRSmoothnessPenalty
  from espnet2.uasr.segmenter.abs_segmenter import AbsSegmenter
  from espnet2.uasr.segmenter.join_segmenter import JoinSegmenter
  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 7 for calling the UASRTask obj's underlying member method code with example usage: obj.build_optimizers(cls, args, model) and returns: optimizers