File size: 738 Bytes
7943e63
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""Read the release with Python's standard library."""
import argparse
import json
from pathlib import Path

root = Path(__file__).resolve().parents[1]
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--record-id")
args = parser.parse_args()
with (root / "data/records.jsonl").open() as stream:
    for line in stream:
        record = json.loads(line)
        if args.record_id is None or record["record_id"] == args.record_id:
            print(record["record_id"])
            print(record["beginner_question"])
            print(record["answer"])
            print("Limitations:", record["limitations"])
            break
    else:
        raise SystemExit("Record not found in the complete-record subset.")