code: def read(self):
          
          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
docs: 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.