class_docstr: A loader and saver for pretrained embeddings. 
code: def load(self):
      if self.filename is not None and os.path.exists(self.filename):
          try:
              data = torch.load(
                  self.filename, lambda storage, loc: storage
              )
              logger.debug(
                  "Loaded pretrain from {}".format(self.filename)
              )
              if "emb" not in data or "vocab" not in data:
                  raise RuntimeError(
                      "File {} exists but is not a stanza pretrain file".format(
                          self.filename
                      )
                  )
              self._vocab, self._emb = (
                  PretrainedWordVocab.load_state_dict(data["vocab"]),
                  data["emb"],
              )
              return
          except (KeyboardInterrupt, SystemExit):
              raise
          except BaseException as e:
              if not self._vec_filename and not self._csv_filename:
                  raise
              logger.warning(
                  "Pretrained file exists but cannot be loaded from {}, due to the following exception:\n\t{}".format(
                      self.filename, e
                  )
              )
              vocab, emb = self.read_pretrain()
      else:
          if not self._vec_filename and not self._csv_filename:
              raise FileNotFoundError(
                  "Pretrained file {} does not exist, and no text/xz file was provided".format(
                      self.filename
                  )
              )
          if self.filename is not None:
              logger.info(
                  "Pretrained filename %s specified, but file does not exist.  Attempting to load from text file"
                  % self.filename
              )
          vocab, emb = self.read_pretrain()
  
      self._vocab = vocab
      self._emb = emb
  
      if self._save_to_file:
          # save to file
          assert (
              self.filename is not None
          ), "Filename must be provided to save pretrained vector to file."
          self.save(self.filename)
  
imports: import csv
  import os
  import re
  import lzma
  import logging
  import numpy
  import torch
  from .vocab import BaseVocab, VOCAB_PREFIX, UNK_ID
  from stanza.models.common.utils import open_read_binary, open_read_text
  from stanza.resources.common import DEFAULT_MODEL_DIR
label_desc: Use image node_id 4 for calling the Pretrain obj's underlying member method code with example usage: obj.load() without return types