code: def test_ordered_closest():
      keys = [
          "alfa",
          "bravo",
          "charlie",
          "delta",
          "echo",
          "foxtrot",
          "golf",
          "hotel",
          "india",
          "juliet",
          "kilo",
          "lima",
          "mike",
          "november",
      ]
      # Make into bytes for Python 3
      keys = [b(k) for k in keys]
      values = [str(len(k)).encode("ascii") for k in keys]
  
      with TempStorage("orderedclosest") as st:
          hw = OrderedHashWriter(st.create_file("test.hsh"))
          hw.add_all(zip(keys, values))
          hw.close()
  
          hr = OrderedHashReader.open(st, "test.hsh")
          ck = hr.closest_key
          assert ck(b("")) == b("alfa")
          assert ck(b(" ")) == b("alfa")
          assert ck(b("alfa")) == b("alfa")
          assert ck(b("bravot")) == b("charlie")
          assert ck(b("charlie")) == b("charlie")
          assert ck(b("kiloton")) == b("lima")
          assert ck(b("oskar")) is None
          assert list(hr.keys()) == keys
          assert list(hr.values()) == values
          assert list(hr.keys_from(b("f"))) == keys[5:]
          hr.close()
  
file_path: whoosh/tests/test_tables.py
imports: from __future__ import with_statement
  import random
  from whoosh.compat import b, xrange, iteritems
  from whoosh.filedb.filestore import RamStorage
  from whoosh.filedb.filetables import HashReader, HashWriter
  from whoosh.filedb.filetables import OrderedHashWriter, OrderedHashReader
  from whoosh.util.testing import TempStorage
label_desc: Use image node_id 7 for calling a global function with example usage: test_ordered_closest() without return types