code: def create_encoder_config(
      args: argparse.Namespace,
      max_seq_len_source: int,
      max_seq_len_target: int,
      num_embed_source: int,
  ) -> Tuple[transformer.TransformerConfig, int]:
      """
      Create the encoder config.
  
      :param args: Arguments as returned by argparse.
      :param max_seq_len_source: Maximum source sequence length.
      :param max_seq_len_target: Maximum target sequence length.
      :param num_embed_source: The size of the source embedding.
      :return: The encoder config and the number of hidden units of the encoder.
      """
      encoder_num_layers, _ = args.num_layers
  
      encoder_transformer_preprocess, _ = args.transformer_preprocess
      encoder_transformer_postprocess, _ = args.transformer_postprocess
      encoder_transformer_model_size, _ = args.transformer_model_size
  
      total_source_factor_size = 0
      for factor_combine, factor_size in zip(
          args.source_factors_combine, args.source_factors_num_embed
      ):
          if factor_combine == C.FACTORS_COMBINE_CONCAT:
              total_source_factor_size += factor_size
      if total_source_factor_size > 0:
          logger.info(
              "Encoder transformer-model-size adjusted to account for source factor embeddings: %d -> %d"
              % (
                  encoder_transformer_model_size,
                  num_embed_source + total_source_factor_size,
              )
          )
          encoder_transformer_model_size = (
              num_embed_source + total_source_factor_size
          )
  
      config_encoder = transformer.TransformerConfig(
          model_size=encoder_transformer_model_size,
          attention_heads=args.transformer_attention_heads[0],
          feed_forward_num_hidden=args.transformer_feed_forward_num_hidden[
              0
          ],
          act_type=args.transformer_activation_type[0],
          num_layers=encoder_num_layers,
          dropout_attention=args.transformer_dropout_attention[0],
          dropout_act=args.transformer_dropout_act[0],
          dropout_prepost=args.transformer_dropout_prepost[0],
          positional_embedding_type=args.transformer_positional_embedding_type,
          preprocess_sequence=encoder_transformer_preprocess,
          postprocess_sequence=encoder_transformer_postprocess,
          max_seq_len_source=max_seq_len_source,
          max_seq_len_target=max_seq_len_target,
          depth_key_value=encoder_transformer_model_size,
          use_lhuc=args.lhuc is not None
          and (C.LHUC_ENCODER in args.lhuc or C.LHUC_ALL in args.lhuc),
          decoder_type=args.decoder,
          use_glu=args.transformer_feed_forward_use_glu,
      )
      encoder_num_hidden = encoder_transformer_model_size
  
      return config_encoder, encoder_num_hidden
  
imports: from .None import initial_setup
  import argparse
  import gc
  import logging
  import os
  import shutil
  import sys
  import tempfile
  from typing import Any, cast, Callable, Optional, Dict, List, Tuple, Type
  import torch
  import torch.distributed
  import torch.distributed.elastic.multiprocessing.errors
  from .None import arguments
  from .None import checkpoint_decoder
  from .None import constants
  from .None import convert_deepspeed
  from .None import data_io
  from .None import encoder
  from .None import layers
  from .None import loss
  from .None import lr_scheduler
  from .None import model
  from .None import optimizers
  from .None import training
  from .None import transformer
  from .None import utils
  from .None import vocab
  from .config import Config
  from .log import setup_main_logger
  from .utils import check_condition
label_desc: Use image node_id 9 for calling a global function with example usage: create_encoder_config(args, max_seq_len_source, max_seq_len_target, num_embed_source) and returns: config_encoder,  encoder_num_hidden