code: def test_indexed_recordio(tmpdir):
      fidx = tmpdir.join("idx")
      frec = tmpdir.join("rec")
      N = 255
  
      writer = mx.recordio.MXIndexedRecordIO(str(fidx), str(frec), "w")
      for i in range(N):
          writer.write_idx(i, bytes(str(chr(i)), "utf-8"))
      del writer
  
      reader = mx.recordio.MXIndexedRecordIO(str(fidx), str(frec), "r")
      keys = reader.keys
      assert sorted(keys) == [i for i in range(N)]
      random.shuffle(keys)
      for i in keys:
          res = reader.read_idx(i)
          assert res == bytes(str(chr(i)), "utf-8")
  
imports: import sys
  import mxnet
  import numpy
  import random
  import string
label_desc: Use image node_id 2 for calling a global function with example usage: test_indexed_recordio(tmpdir) without return types