code: def build_preprocess_fn(
      cls, args: argparse.Namespace, train: bool
  ) -> Optional[
      Callable[[str, Dict[str, np.array]], Dict[str, np.ndarray]]
  ]:
      assert check_argument_types()
      if args.use_preprocessor:
          retval = CommonPreprocessor(
              train=train,
              token_type=args.token_type,
              token_list=args.token_list,
              bpemodel=args.bpemodel,
              non_linguistic_symbols=args.non_linguistic_symbols,
              text_cleaner=args.cleaner,
              g2p_type=args.g2p,
          )
      else:
          retval = None
      assert check_return_type(retval)
      return retval
  
imports: import argparse
  import logging
  from pathlib import Path
  from typing import Callable, Collection, Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  import yaml
  from typeguard import check_argument_types, check_return_type
  from espnet2.gan_tts.jets import JETS
  from espnet2.gan_tts.joint import JointText2Wav
  from espnet2.gan_tts.vits import VITS
  from espnet2.layers.abs_normalize import AbsNormalize
  from espnet2.layers.global_mvn import GlobalMVN
  from espnet2.tasks.abs_task import AbsTask
  from espnet2.text.phoneme_tokenizer import g2p_choices
  from espnet2.train.class_choices import ClassChoices
  from espnet2.train.collate_fn import CommonCollateFn
  from espnet2.train.preprocessor import CommonPreprocessor
  from espnet2.train.trainer import Trainer
  from espnet2.tts.abs_tts import AbsTTS
  from espnet2.tts.espnet_model import ESPnetTTSModel
  from espnet2.tts.fastspeech import FastSpeech
  from espnet2.tts.fastspeech2 import FastSpeech2
  from espnet2.tts.feats_extract.abs_feats_extract import AbsFeatsExtract
  from espnet2.tts.feats_extract.dio import Dio
  from espnet2.tts.feats_extract.energy import Energy
  from espnet2.tts.feats_extract.linear_spectrogram import LinearSpectrogram
  from espnet2.tts.feats_extract.log_mel_fbank import LogMelFbank
  from espnet2.tts.feats_extract.log_spectrogram import LogSpectrogram
  from espnet2.tts.prodiff import ProDiff
  from espnet2.tts.tacotron2 import Tacotron2
  from espnet2.tts.transformer import Transformer
  from espnet2.tts.utils import ParallelWaveGANPretrainedVocoder
  from espnet2.utils.get_default_kwargs import get_default_kwargs
  from espnet2.utils.griffin_lim import Spectrogram2Waveform
  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 3 for calling the TTSTask obj's underlying member method code with example usage: obj.build_preprocess_fn(cls, args, train) and returns: retval