class_docstr: Wraps Gensim's `models.keyedvectors` module
  (https://radimrehurek.com/gensim/models/keyedvectors.html)
class_docstr_tok: ["Wraps","Gensim","'s","`","models.keyedvectors","`","module","(","https",":","\/\/radimrehurek.com\/gensim\/models\/keyedvectors.html",")"]
code: def __init__(self, keyed_vectors):
      gensim = utils.LazyLoader("gensim", globals(), "gensim")
  
      if isinstance(keyed_vectors, gensim.models.KeyedVectors):
          self.keyed_vectors = keyed_vectors
      else:
          raise ValueError(
              "`keyed_vectors` argument must be a "
              "`gensim.models.keyedvectors.WordEmbeddingsKeyedVectors` object"
          )
  
      self.keyed_vectors.init_sims()
      self._mse_dist_mat = defaultdict(dict)
      self._cos_sim_mat = defaultdict(dict)
  
imports: from abc import ABC, abstractmethod
  from collections import defaultdict
  import os
  import pickle
  import numpy
  import torch
  from textattack.shared import utils
label_desc: Use image node_id 1 to create a new GensimWordEmbedding object from inherited base classes: AbstractWordEmbedding with example: obj = GensimWordEmbedding(keyed_vectors)