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: Inserts a string buffer as a record.
  
  Examples
  ---------
  >>> record = mx.recordio.MXRecordIO('tmp.rec', 'w')
  >>> for i in range(5):
  ...    record.write('record_%d'%i)
  >>> record.close()
  
  Parameters
  ----------
  buf : string (python2), bytes (python3)
      Buffer to write.
docstr_tok: ["Inserts","a","string","buffer","as","a","record",".","Examples","--","--","--","--","-",">",">",">","record","=","mx.recordio.MXRecordIO","(","'tmp.rec","'",",","'","w","'",")",">",">",">","for","i","in","range","(","5",")",":","...","record.write","(","'record_","%","d","'","%","i",")",">",">",">","record.close","(",")","Parameters","--","--","--","--","--","buf",":","string","(","python2",")",",","bytes","(","python3",")","Buffer","to","write","."]
code: def write(self, buf):
      """Inserts a string buffer as a record.
  
      Examples
      ---------
      >>> record = mx.recordio.MXRecordIO('tmp.rec', 'w')
      >>> for i in range(5):
      ...    record.write('record_%d'%i)
      >>> record.close()
  
      Parameters
      ----------
      buf : string (python2), bytes (python3)
          Buffer to write.
      """
      assert self.writable
      self._check_pid(allow_reset=False)
      check_call(
          _LIB.MXRecordIOWriterWriteRecord(
              self.handle,
              ctypes.c_char_p(buf),
              ctypes.c_size_t(len(buf)),
          )
      )
  
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 9 for calling the MXRecordIO obj's underlying member method code with example usage: obj.write(buf) without return types