code: def get_huggingface_transformer(
      model_name: Optional[str] = None,
      pretrained: bool = False,
      config_dict: Optional[Union[dict, DictConfig]] = None,
      encoder: bool = True,
  ) -> Union[HuggingFaceEncoderModule, HuggingFaceDecoderModule]:
      if encoder:
          model = HuggingFaceEncoderModule(
              model_name, pretrained, config_dict
          )
      else:
          model = HuggingFaceDecoderModule(
              model_name, pretrained, config_dict
          )
  
      return model
  
file_path: NeMo/nemo/collections/nlp/modules/common/transformer/transformer_utils.py
imports: from typing import Optional, Union
  from omegaconf.dictconfig import DictConfig
  from nemo.collections.nlp.modules.common.huggingface.huggingface_decoder import HuggingFaceDecoderModule
  from nemo.collections.nlp.modules.common.huggingface.huggingface_encoder import HuggingFaceEncoderModule
  from nemo.collections.nlp.modules.common.transformer.transformer import TransformerDecoderNM, TransformerEncoderNM
  from nemo.collections.nlp.modules.common.transformer.transformer_bottleneck import TransformerBottleneckEncoderNM
label_desc: Use image node_id 2 for calling a global function with example usage: get_huggingface_transformer(model_name, pretrained, config_dict, encoder) and returns: model