Optimize a Python-based data pipeline to handle massive streaming inputs for model fine-tuning.
Implement pack_stream(records, block_size, eos_token). Process records in order, keep only the first record for each id, append eos_token after every non-empty accepted record, and return complete fixed-size token blocks. Discard any incomplete final block. The function must return a list of lists, not a generator.
records is a list of dictionaries with integer id and integer-list tokens; block_size is a positive integer. Preserve token order and do not add an EOS token for empty or duplicate records.
def pack_stream(records, block_size, eos_token):