docstr: Load a transformer only once
  
  Uses a lock for thread safety
docstr_tok: ["Load","a","transformer","only","once","Uses","a","lock","for","thread","safety"]
code: def load_bert(self, transformer_name):
      """
      Load a transformer only once
  
      Uses a lock for thread safety
      """
      if transformer_name is None:
          return None, None
      with self.lock:
          if transformer_name not in self.bert:
              model, tokenizer = bert_embedding.load_bert(
                  transformer_name
              )
              self.bert[transformer_name] = (model, tokenizer)
          else:
              logger.debug("Reusing bert %s", transformer_name)
  
          return self.bert[transformer_name]
  
file_path: stanza/stanza/models/common/foundation_cache.py
imports: import logging
  import threading
  from stanza.models.common import bert_embedding
  from stanza.models.common.char_model import CharacterLanguageModel
  from stanza.models.common.pretrain import Pretrain
label_desc: Use image node_id 2 for calling the FoundationCache obj's underlying member method code with example usage: obj.load_bert(transformer_name) and returns: None,  None, self