def _aggregate(input, options, output, timeFieldName):
aggregator = Aggregator(aggregationInfo=options, <EOL>inputFields=input.getFields(),<EOL>timeFieldName=timeFieldName)<EOL>while True:<EOL><INDENT>inRecord = input.getNextRecord()<EOL>print("<STR_LIT>", inRecord)<EOL>(outRecord, aggBookmark) = aggregator.next(record = inRecord, <EOL>curInputBookmark = None)<EOL>print("<STR_LIT>", outRecord)<EOL>if outRecord is not None:<EOL><INDENT>output.appendRecord(outRecord, None)<EOL><DEDENT>if inRecord is None and outRecord is None:<EOL><INDENT>break<EOL><DEDENT><DEDENT>
Aggregate the input stream and write aggregated records to the output
    stream