class_docstr: Reads/writes `RecordIO` data format, supporting random access.
  
  Examples
  ---------
  >>> for i in range(5):
  ...     record.write_idx(i, 'record_%d'%i)
  >>> record.close()
  >>> record = mx.recordio.MXIndexedRecordIO('tmp.idx', 'tmp.rec', 'r')
  >>> record.read_idx(3)
  record_3
  
  Parameters
  ----------
  idx_path : str
      Path to the index file.
  uri : str
      Path to the record file. Only supports seekable file types.
  flag : str
      'w' for write or 'r' for read.
  key_type : type
      Data type for keys.
code: def __init__(self, idx_path, uri, flag, key_type=int):
      self.idx_path = idx_path
      self.idx = {}
      self.keys = []
      self.key_type = key_type
      self.fidx = None
      super(MXIndexedRecordIO, self).__init__(uri, flag)
  
imports: from collections import namedtuple
  from multiprocessing import current_process
  import ctypes
  import struct
  import numbers
  import numpy
  from .base import _LIB
  from .base import RecordIOHandle
  from .base import check_call
  from .base import c_str
label_desc: Use image node_id 1 to create a new MXIndexedRecordIO object from inherited base classes: MXRecordIO with example: obj = MXIndexedRecordIO(idx_path, uri, flag, key_type)