HF RL Explorer

Create a script /app/decode records.py that reads a binary file and outputs valid JSON to stdout.

Create a script /app/decode records.py that reads a binary file and outputs valid JSON to stdout.: a task in TermGrade Environments: 1,004 executable Linux tasks (Harbor dataset). Binary format specification: The file consists of a sequence of records. Each record has: 1. A tag (1 byte): an…

The task

**Binary format specification:** The file consists of a sequence of records. Each record has: 1. A **tag** (1 byte): an unsigned 8-bit integer indicating the record type. 2. A **length** (variable-length unsigned integer using the varint encoding described below). 3. A **value** of exactly `length` bytes.

Part of ai-and/termgrade-environments.