code: def pick_random_word(model, threshold=10):
      # pick a random word with a suitable number of occurences
      while True:
          word = random.choice(model.wv.index_to_key)
          if model.wv.get_vecattr(word, "count") > threshold:
              return word
  
imports: import logging
  import collections
  import io
  import re
  import tarfile
  import os.path
  import smart_open
  import gensim.utils
  import multiprocessing
  from collections import OrderedDict
  import gensim.models.doc2vec
  from gensim.models.doc2vec import Doc2Vec
  from gensim.test.test_doc2vec import ConcatenatedDoc2Vec
  import numpy
  import statsmodels.api
  from random import sample
  from collections import defaultdict
  from random import shuffle
  import random
  import random
  from gensim.test.utils import datapath
label_desc: Use image node_id 6 for calling a global function with example usage: pick_random_word(model, threshold) and returns: word