code: def build_encoder(cls, args):
      encoder = S2STransformerEncoder(args)
      pretraining_path = getattr(
          args, "load_pretrained_encoder_from", None
      )
      if pretraining_path is not None:
          if not Path(pretraining_path).exists():
              logger.warning(
                  f"skipped pretraining because {pretraining_path} does not exist"
              )
          else:
              encoder = (
                  checkpoint_utils.load_pretrained_component_from_model(
                      component=encoder, checkpoint=pretraining_path
                  )
              )
              logger.info(
                  f"loaded pretrained encoder from: {pretraining_path}"
              )
      return encoder
  
imports: import logging
  from pathlib import Path
  from typing import Any, Dict, List, Optional
  import torch
  from torch import Tensor
  from fairseq import checkpoint_utils, utils
  from fairseq.models import FairseqEncoderDecoderModel, FairseqEncoderModel, FairseqLanguageModel, register_model, register_model_architecture
  from fairseq.models.speech_to_speech.modules.ctc_decoder import CTCDecoder
  from fairseq.models.speech_to_speech.modules.stacked_embedding import StackedEmbedding
  from fairseq.models.speech_to_text import S2TTransformerEncoder
  from fairseq.models.text_to_speech import TTSTransformerDecoder
  from fairseq.models.transformer import Linear, TransformerDecoder, TransformerModelBase
label_desc: Use image node_id 1 for calling the S2STransformerMultitaskModelBase obj's underlying member method code with example usage: obj.build_encoder(cls, args) and returns: encoder