code: def test_random_access():
      times = 1000
      with TempStorage("orderedhash") as st:
          hw = HashWriter(st.create_file("test.hsh"))
          hw.add_all((b("%08x" % x), b(str(x))) for x in xrange(times))
          hw.close()
  
          keys = list(range(times))
          random.shuffle(keys)
          hr = HashReader.open(st, "test.hsh")
          for x in keys:
              assert hr[b("%08x" % x)] == b(str(x))
          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 6 for calling a global function with example usage: test_random_access() without return types