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: Returns record as a string.
  
  Examples
  ---------
  >>> 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()
  
  Returns
  ----------
  buf : string
      Buffer read.
docstr_tok: ["Returns","record","as","a","string",".","Examples","--","--","--","--","-",">",">",">","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","(",")","Returns","--","--","--","--","--","buf",":","string","Buffer","read","."]
code: def read(self):
      """Returns record as a string.
  
      Examples
      ---------
      >>> 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()
  
      Returns
      ----------
      buf : string
          Buffer read.
      """
      assert not self.writable
      # trying to implicitly read from multiple processes is forbidden,
      # there's no elegant way to handle unless lock is introduced
      self._check_pid(allow_reset=False)
      buf = ctypes.c_char_p()
      size = ctypes.c_size_t()
      check_call(
          _LIB.MXRecordIOReaderReadRecord(
              self.handle, ctypes.byref(buf), ctypes.byref(size)
          )
      )
      if buf:
          buf = ctypes.cast(
              buf, ctypes.POINTER(ctypes.c_char * size.value)
          )
          return buf.contents.raw
      else:
          return None
  
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 10 for calling the MXRecordIO obj's underlying member method code with example usage: obj.read() and returns: buf, None