parameters: (s)
return_statement: return header, s
docstring: Unpack a MXImageRecord to string.
  
      Parameters
      ----------
      s : str
          String buffer from ``MXRecordIO.read``.
  
      Returns
      -------
      header : IRHeader
          Header of the image record.
      s : str
          Unpacked string.
  
      Examples
      --------
      >>> record = mx.recordio.MXRecordIO('test.rec', 'r')
      >>> item = record.read()
      >>> header, s = mx.recordio.unpack(item)
      >>> header
      HEADER(flag=0, label=14.0, id=20129312, id2=0)
docstring_summary: Unpack a MXImageRecord to string.
docstring_tokens: Unpack a MXImageRecord to string .
function: def unpack(s):
      """Unpack a MXImageRecord to string.
  
      Parameters
      ----------
      s : str
          String buffer from ``MXRecordIO.read``.
  
      Returns
      -------
      header : IRHeader
          Header of the image record.
      s : str
          Unpacked string.
  
      Examples
      --------
      >>> record = mx.recordio.MXRecordIO('test.rec', 'r')
      >>> item = record.read()
      >>> header, s = mx.recordio.unpack(item)
      >>> header
      HEADER(flag=0, label=14.0, id=20129312, id2=0)
      """
      header = IRHeader(*struct.unpack(_IR_FORMAT, s[:_IR_SIZE]))
      s = s[_IR_SIZE:]
      if header.flag > 0:
          header = header._replace(label=np.fromstring(s, np.float32, header.flag))
          s = s[header.flag*4:]
      return header, s
function_tokens: def unpack ( s ) : header = IRHeader ( * struct . unpack ( _IR_FORMAT , s [ : _IR_SIZE ] ) ) s = s [ _IR_SIZE : ] if header . flag > 0 : header = header . _replace ( label = np . fromstring ( s , np . float32 , header . flag ) ) s = s [ header . flag * 4 : ] return header , s