def __init__(self, fields, aggregationPeriod=None):
if not fields:<EOL><INDENT>raise ValueError('<STR_LIT>' % (fields,))<EOL><DEDENT>self._fields = fields<EOL>self._aggregationPeriod = aggregationPeriod<EOL>self._sequenceId = -<NUM_LIT:1><EOL>self._fieldNames = tuple(f.name for f in fields)<EOL>self._categoryFieldIndex = _getFieldIndexBySpecial(<EOL>fields,<EOL>FieldMetaSpecial.category)<EOL>self._resetFieldIndex = _getFieldIndexBySpecial(<EOL>fields,<EOL>FieldMetaSpecial.reset)<EOL>self._sequenceFieldIndex = _getFieldIndexBySpecial(<EOL>fields,<EOL>FieldMetaSpecial.sequence)<EOL>self._timestampFieldIndex = _getFieldIndexBySpecial(<EOL>fields,<EOL>FieldMetaSpecial.timestamp)<EOL>self._learningFieldIndex = _getFieldIndexBySpecial(<EOL>fields,<EOL>FieldMetaSpecial.learning)<EOL>
:param fields: non-empty sequence of nupic.data.fieldmeta.FieldMetaInfo
  objects corresponding to fields in input rows.
:param aggregationPeriod: (dict) aggregation period of the record stream 
  containing 'months' and 'seconds'. The months is always an integer
  and seconds is a floating point. Only one is allowed to be non-zero at a
  time. If there is no aggregation associated with the stream, pass None.
  Typically, a raw file or hbase stream will NOT have any aggregation info,
  but subclasses of RecordStreamIface, like StreamReader, will and will
  provide the aggregation period. This is used by the encode method to
  assign a record number to a record given its timestamp and the aggregation
  interval.