HF RL Explorer

Write a Python 3 script at /app/decode tlv.py that reads a binary file from a path given as the first…

Write a Python 3 script at /app/decode tlv.py that reads a binary file from a path given as the first…: a task in TermGrade Environments: 1,004 executable Linux tasks (Harbor dataset). The binary format consists of a sequence of records. Each record has: - 1 byte: type tag (unsigned integer 0-255)…

The task

The binary format consists of a sequence of records. Each record has: - 1 byte: type tag (unsigned integer 0-255) - 1 byte: length L (0-255). If L == 255, the length is a varint that follows. If L < 255, L is the exact payload length. - payload: exactly L bytes.

Part of ai-and/termgrade-environments.