code: def test_termkey():
      st, codec, seg = _make_codec()
      tw = codec.field_writer(st, seg)
      fieldobj = fields.TEXT()
      tw.start_field("alfa", fieldobj)
      tw.start_term(b("bravo"))
      tw.add(0, 1.0, b(""), 3)
      tw.finish_term()
      tw.start_term(b("\xc3\xa6\xc3\xaf\xc5\xc3\xba"))
      tw.add(0, 4.0, b(""), 3)
      tw.finish_term()
      tw.finish_field()
      tw.start_field("text", fieldobj)
      tw.start_term(b("\xe6\xa5\xe6\xac\xe8\xaa"))
      tw.add(0, 7.0, b(""), 9)
      tw.finish_term()
      tw.finish_field()
      tw.close()
  
      tr = codec.terms_reader(st, seg)
      assert ("alfa", b("bravo")) in tr
      assert ("alfa", b("\xc3\xa6\xc3\xaf\xc5\xc3\xba")) in tr
      assert ("text", b("\xe6\xa5\xe6\xac\xe8\xaa")) in tr
      tr.close()
  
imports: from __future__ import with_statement
  import random
  from array import array
  import pytest
  from whoosh import analysis, fields, formats, query
  from whoosh.compat import u, b, text_type
  from whoosh.compat import array_tobytes, xrange
  from whoosh.codec import default_codec
  from whoosh.filedb.filestore import RamStorage
  from whoosh.util.testing import TempStorage
label_desc: Use image node_id 2 for calling a global function with example usage: test_termkey() without return types