HF RL Explorer

Write a command-line tool /app/decode (Python script) that reads a binary file and outputs a JSON array of…

Write a command-line tool /app/decode (Python script) that reads a binary file and outputs a JSON array of…: a task in TermGrade Environments: 1,004 executable Linux tasks (Harbor dataset). Input format (binary): A sequence of records. Each record has: - 1 byte: record type (unsigned integer) - 4…

The task

**Input format (binary):** A sequence of records. Each record has: - 1 byte: record type (unsigned integer) - 4 bytes: payload length (unsigned 32-bit big-endian integer) - N bytes: payload (exactly `length` bytes) - 2 bytes: CRC-16 (big-endian) of the payload bytes (CCITT-FALSE: polynomial 0x1021, initial value…

Part of ai-and/termgrade-environments.