class_docstr: Reads/writes `RecordIO` data format, supporting sequential read and write.
  
  Examples
  ---------
  >>> record = mx.recordio.MXRecordIO('tmp.rec', 'w')
  <mxnet.recordio.MXRecordIO object at 0x10ef40ed0>
  >>> for i in range(5):
  ...    record.write('record_%d'%i)
  >>> record.close()
  >>> record = mx.recordio.MXRecordIO('tmp.rec', 'r')
  >>> for i in range(5):
  ...    item = record.read()
  ...    print(item)
  record_0
  record_1
  record_2
  record_3
  record_4
  >>> record.close()
  
  Parameters
  ----------
  uri : string
      Path to the record file.
  flag : string
      'w' for write or 'r' for read.
docstr: Restore from pickled.
docstr_tok: ["Restore","from","pickled","."]
code: def __setstate__(self, d):
      """Restore from pickled."""
      self.__dict__ = d
      is_open = d["is_open"]
      self.is_open = False
      self.handle = RecordIOHandle()
      self.uri = c_str(self.uri)
      if is_open:
          self.open()
  
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 5 for calling the MXRecordIO obj's underlying member method code with example usage: obj.__setstate__(d) without return types