docstr: Load a pretrained word embedding only once
  
  Uses a lock for thread safety
docstr_tok: ["Load","a","pretrained","word","embedding","only","once","Uses","a","lock","for","thread","safety"]
code: def load_pretrain(self, filename):
      """
      Load a pretrained word embedding only once
  
      Uses a lock for thread safety
      """
      if filename is None:
          return None
      with self.lock:
          if filename not in self.pretrains:
              logger.debug("Loading pretrain %s", filename)
              self.pretrains[filename] = Pretrain(filename)
          else:
              logger.debug("Reusing pretrain %s", filename)
  
          return self.pretrains[filename]
  
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 4 for calling the FoundationCache obj's underlying member method code with example usage: obj.load_pretrain(filename) and returns: None, self