code: def _save_word2vec_format(fname, vocab, vectors, fvocab):
      """Store the input-hidden weight matrix in the same format used by the original
      C word2vec-tool, for compatibility.
  
      Code taken and adjusted from gensim: https://github.com/RaRe-Technologies/gensim/blob/ec222e8e3e72608a59805040eadcf5c734a2b96c/gensim/models/utils_any2vec.py#L105
  
      Parameters
      ----------
      fname : str
          The file path used to save the vectors in.
      vocab : list
          The vocabulary of words.
      vectors : numpy.array
          The vectors to be stored.
      fvocab : str
          File path used to save the vocabulary.
      """
      if not (vocab or vectors):
          raise RuntimeError("no input")
      vector_size = vectors.shape[1]
      if fvocab is not None:
          logger.info(f"storing vocabulary in {fvocab}")
          with io.open(fvocab, "w") as vout:
              for word in vocab:
                  vout.write(word + "\n")
      logger.info(
          f"storing {len(vocab)} projection weights with dimension {vector_size} into {fname}"
      )
      assert (len(vocab), vector_size) == vectors.shape
      with io.open(fname, "w") as fout:
          # store in sorted order: most frequent words at the top
          for i, word in enumerate(vocab):
              row = vectors[i, :]
              fout.write(
                  f"{word} {' '.join(repr(val) for val in row)}\n"
              )
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import io
  import json
  import logging
  import os
  import unicodedata
  from pathlib import Path
  import numpy
  import pandas
  from tqdm import tqdm
  from transformers import BertTokenizer
  from sklearn.decomposition import TruncatedSVD
  from sklearn.cluster import KMeans
  from collections import Counter
  from farm.file_utils import load_from_cache
label_desc: Use image node_id 6 for calling a global function with example usage: _save_word2vec_format(fname, vocab, vectors, fvocab) without return types