def _formatSequence(tokens, categories, seqID, uniqueID):
    """Write the sequence of data records for this sample."""
    record = {"_category":categories,
              "_sequenceId":seqID}
    data = []
    reset = 1
    for t in tokens:
      tokenRecord = record.copy()
      tokenRecord["_token"] = t
      tokenRecord["_reset"] = reset
      tokenRecord["ID"] = uniqueID
      reset = 0
      data.append(tokenRecord)

    return data
Write the sequence of data records for this sample.