code: def make_index(storage, indexname, word2nums, num2words):
      """Creates a Whoosh index in the given storage object containing
      synonyms taken from word2nums and num2words. Returns the Index
      object.
      """
  
      schema = Schema(word=ID, syns=STORED)
      ix = storage.create_index(schema, indexname=indexname)
      w = ix.writer()
      for word in iterkeys(word2nums):
          syns = synonyms(word2nums, num2words, word)
          w.add_document(word=text_type(word), syns=syns)
      w.commit()
      return ix
  
file_path: whoosh/src/whoosh/lang/wordnet.py
imports: from collections import defaultdict
  from whoosh.compat import iterkeys, text_type
  from whoosh.fields import Schema, ID, STORED
label_desc: Use image node_id 2 for calling a global function with example usage: make_index(storage, indexname, word2nums, num2words) and returns: ix