code: def test_keyterms():
      ana = analysis.StandardAnalyzer()
      vectorformat = formats.Frequency()
      schema = fields.Schema(
          path=fields.ID,
          content=fields.TEXT(analyzer=ana, vector=vectorformat),
      )
      st = RamStorage()
      ix = st.create_index(schema)
      w = ix.writer()
      w.add_document(
          path=u("a"), content=u("This is some generic content")
      )
      w.add_document(
          path=u("b"), content=u("This is some distinctive content")
      )
      w.commit()
  
      with ix.searcher() as s:
          docnum = s.document_number(path=u("b"))
          keyterms = list(s.key_terms([docnum], "content"))
          assert len(keyterms) > 0
          assert keyterms[0][0] == "distinctive"
  
          r = s.search(query.Term("path", u("b")))
          keyterms2 = list(r.key_terms("content"))
          assert len(keyterms2) > 0
          assert keyterms2[0][0] == "distinctive"
  
imports: from __future__ import with_statement
  import pytest
  from whoosh import analysis, fields, formats, highlight, qparser, query
  from whoosh.codec.whoosh3 import W3Codec
  from whoosh.compat import u, xrange, text_type, permutations
  from whoosh.filedb.filestore import RamStorage
  from whoosh.util.testing import TempStorage, TempIndex
label_desc: Use image node_id 16 for calling a global function with example usage: test_keyterms() without return types