Dataset Viewer
Auto-converted to Parquet Duplicate
id
stringlengths
22
22
text
stringlengths
134
7.81k
sub
stringclasses
12 values
fmt
stringclasses
2 values
variant
stringclasses
2 values
n_steps
int64
1
10
teacher
stringclasses
4 values
skill
stringclasses
232 values
n_tokens
int64
36
2.64k
item_uid
stringlengths
16
16
ol5-0020b41f2d9a0b5a-0
Review: Build the behaviour specified below in Python. Show each step. In our ensilage trials, moisture readings are stored as small integer matrices, and feed mixes are computed as matrix products. Write `add_layers(base: list[list[int]], topping: list[list[int]]) -> Iterator[list[int]]`, a generator that yields the ...
code_impl
plain
worked
1
glm-5.3-flash
matrix_ops
805
0020b41f2d9a0b5a
ol5-0020b41f2d9a0b5a-1
Update the module below to current Python idioms. ```python """Layer arithmetic for silage moisture and feed-mix tables.""" from typing import Iterator, List def add_layers(base, topping): # type: (List[List[int]], List[List[int]]) -> Iterator[List[int]] """Yield the element-wise sum of two equal-shaped mat...
code_refactor
plain
worked
1
glm-5.3-flash
matrix_ops
1,067
0020b41f2d9a0b5a
ol5-007ff4b3dfc72050-0
Exercise: What exactly does this program output? ```python from datetime import date, timedelta def match_days(start: date, count: int) -> list[str]: """Return short labels for rochambeau match days, skipping Sundays.""" return [ (start + timedelta(days=offset)).strftime("%a %d") for offset i...
code_trace
plain
worked
1
glm-5.3-flash
zoneinfo_free_dates
300
007ff4b3dfc72050
ol5-008db79727150f6a-1
Code up a Python solution to the task that follows. Exact answers only. The depreciation studies desk receives ledger dumps where each line reads `"class name|life_years|placed_year"`, and staff type the same asset class in shuffled word order, so names that are anagrams of each other must be treated as one class. Wri...
code_impl
plain
answer_only
1
glm-5.3-flash
anagram_groups
673
008db79727150f6a
ol5-008db79727150f6a-2
Short task: Debug the following module and give the corrected code. Failing assertion: `test_anagram_names_share_a_bundle()` ```python """Bundling of asset ledger lines for depreciation study requests.""" from dataclasses import dataclass, field @dataclass class AssetEntry: """One ledger line of plant asset dat...
code_bugfix
plain
worked
1
glm-5.3-flash
anagram_groups
961
008db79727150f6a
ol5-008db79727150f6a-3
Work it out: Modernise the code below to current Python idioms. ```python """Bundling of asset ledger lines for depreciation study requests.""" class AssetEntry(object): """One ledger line of plant asset data.""" def __init__(self, name, life_years, placed_year): # type: (str, int, int) -> None ...
code_refactor
plain
worked
1
glm-5.3-flash
anagram_groups
1,166
008db79727150f6a
ol5-008db79727150f6a-4
Annotate every function below. ```python """Bundling of asset ledger lines for depreciation study requests.""" from dataclasses import dataclass, field @dataclass class AssetEntry: """One ledger line of plant asset data.""" name: str life_years: int placed_year: int @dataclass class AssetBundle: ...
code_types
plain
worked
1
glm-5.3-flash
anagram_groups
856
008db79727150f6a
ol5-008db79727150f6a-5
Drill: Put together typed test functions for the code below. ```python """Bundling of asset ledger lines for depreciation study requests.""" from dataclasses import dataclass, field @dataclass class AssetEntry: """One ledger line of plant asset data.""" name: str life_years: int placed_year: int ...
code_tests
plain
answer_only
1
glm-5.3-flash
anagram_groups
1,172
008db79727150f6a
ol5-00d5e5a10b834507-0
<|start|><|system|> Show working only when it helps.<|eot|> <|user|> Solve the following problem with a short Python program. At a statistics fair, a prize of $450 is split among three display teams in the ratio 2:3:4, which is 9 equal parts in all. The team with the most visitors earns the largest share. How much mon...
math_prog
chat
worked
1
glm-5.3-flash
ratio_share
160
00d5e5a10b834507
ol5-01230b4de1f227f4-0
Work out this problem with code, then state the answer. A birdbath basin holds at most 14 liters of water, and there are already 5 liters in it. A gardener adds x more liters, and the water must not overflow. What is the largest whole number of liters she can add? <|think|> 1. Largest value of x: 14 − 5 = 9 <|/think|...
math_prog
plain
worked
1
glm-5.3-flash
inequality
126
01230b4de1f227f4
ol5-01230b4de1f227f4-1
A birdbath basin holds at most 14 liters of water, and there are already 5 liters in it. A gardener adds x more liters, and the water must not overflow. What is the largest whole number of liters she can add? Answer: 9 liters
math_wp
plain
answer_only
1
glm-5.3-flash
inequality
59
01230b4de1f227f4
ol5-012f3e0273a12d3e-0
Create the Python that the specification below describes. Every year our department receives progress reports that must be reviewed in priority order, and among equally urgent ones the earlier submission should come first. Write a class `ReportQueue` with `submit(self, priority: int, title: str) -> None`, `take_next(s...
code_impl
plain
worked
1
glm-5.3-flash
heap
722
012f3e0273a12d3e
ol5-012f3e0273a12d3e-1
Produce typed test functions for the code below. ```python """A priority queue for reviewing annual reports in order.""" import heapq from itertools import count class ReportQueue: """A queue that always releases the oldest report of the smallest priority.""" def __init__(self) -> None: """Start wi...
code_tests
plain
answer_only
1
glm-5.3-flash
heap
1,165
012f3e0273a12d3e
ol5-01609652162119f9-0
<|start|><|user|> Challenge: Put together clean, typed Python for the request below. Our training studio logs when athletes train, and we cap how often each one can book. Write `window_report(records: list[tuple[int, str]], window: int, limit: int) -> str`: each record is a `(day, athlete)` pair, `window` is the width...
code_impl
chat
worked
1
glm-5.3-flash
rate_limit_window
829
01609652162119f9
ol5-01609652162119f9-1
Debug the Python below and give the corrected code. The check that fails = `assert lines[3] == "12 Ana BLOCKED"` ```python """A fixed-window training limit rendered as an aligned report.""" def window_report(records: list[tuple[int, str]], window: int, limit: int) -> str: """Render training sessions under a pe...
code_bugfix
plain
worked
1
glm-5.3-flash
rate_limit_window
1,087
01609652162119f9
ol5-0167acd29dd29f21-0
Figure out this problem. Show the working. At a stall by the seawall, dried kelp sells in two pouches: 200 g for $3.00 and 600 g for $7.50. The 200 g pouch works out to 1.5 cents per gram. What is the price of the 600 g pouch, in cents per gram? <|think|> 1. Price of the 600 g pouch: 750 ÷ 600 = 1.25 <|/think|> Answe...
math_wp
plain
worked
1
glm-5.3-flash
best_buy
118
0167acd29dd29f21
ol5-017234540369a950-0
Program the module that the specification below describes. An apothecary records batches of nard in a ledger and sometimes regrets an entry, so the ledger needs undo and redo. Write a slots dataclass `NardLedger` with a method `note(self, text: str) -> None` that records a batch note, `undo(self) -> str | None`, and `...
code_impl
plain
worked
1
glm-5.3-flash
undo_stack
826
017234540369a950
ol5-017234540369a950-1
Code up the specification below in Python 3.14. An apothecary records batches of nard in a ledger and sometimes regrets an entry, so the ledger needs undo and redo. Write a slots dataclass `NardLedger` with a method `note(self, text: str) -> None` that records a batch note, `undo(self) -> str | None`, and `redo(self) ...
code_impl
plain
answer_only
1
glm-5.3-flash
undo_stack
683
017234540369a950
ol5-017234540369a950-2
Drill: Add parameter and return types to the code below using modern typing syntax. ```python from dataclasses import dataclass, field @dataclass(slots=True) class NardLedger: """A log of nard batches with separate undo and redo stacks.""" entries: list[str] = field(default_factory=list) _undo: list[str...
code_types
plain
worked
1
glm-5.3-flash
undo_stack
998
017234540369a950
ol5-017234540369a950-3
Write a test suite for this code. ```python from dataclasses import dataclass, field @dataclass(slots=True) class NardLedger: """A log of nard batches with separate undo and redo stacks.""" entries: list[str] = field(default_factory=list) _undo: list[str] = field(default_factory=list, init=False, repr=F...
code_tests
plain
answer_only
1
glm-5.3-flash
undo_stack
1,184
017234540369a950
ol5-017acb0af852b1ac-0
Settle the short problem below. Under the rules for mineral resources reports, a State office receives production reports and royalty reports from companies on federal leases. Each quarter the office handles 240 such reports, and 45% of them are reviewed with a field check. How many reports are reviewed with a field c...
math_wp
plain
worked
1
glm-5.3-flash
percent_composition
95
017acb0af852b1ac
ol5-01ec3edab605ae33-1
<|start|><|user|> Drill: Find and fix the bug in the module below and give the corrected code. Failing check = `test_disjoint_periods_stay_apart()` ```python from dataclasses import dataclass @dataclass(slots=True) class SongPeriod: """A stretch of minutes, counted from dawn, during which a songbird sings.""" ...
code_bugfix
chat
worked
1
glm-5.3-flash
merge_intervals
726
01ec3edab605ae33
ol5-01ec3edab605ae33-2
Try this: Convert the module below without changing what it does. ```python from typing import List class SongPeriod(object): """A stretch of minutes, counted from dawn, during which a songbird sings.""" def __init__(self, start, end): self.start = start self.end = end def __eq__(self, ...
code_refactor
plain
worked
1
glm-5.3-flash
merge_intervals
763
01ec3edab605ae33
ol5-01ec3edab605ae33-3
Produce tests that check the behaviour of the module below. ```python from dataclasses import dataclass @dataclass(slots=True) class SongPeriod: """A stretch of minutes, counted from dawn, during which a songbird sings.""" start: int end: int def merge_periods(periods: list[SongPeriod]) -> list[SongPe...
code_tests
plain
answer_only
1
glm-5.3-flash
merge_intervals
773
01ec3edab605ae33
ol5-023a7be4df294242-0
Practice: State the printed output of this program after tracing it. ```python from itertools import groupby type Segment = tuple[str, int] def encode(states: str) -> list[Segment]: """Compress a sewer pipe survey into runs of lining states.""" return [(state, sum(1 for _ in group)) for state, group in grou...
code_trace
plain
worked
1
glm-5.3-flash
run_length
333
023a7be4df294242
ol5-024695eb4a999eee-0
<|start|><|user|> What does the program below write to the screen? ```python from dataclasses import dataclass @dataclass(slots=True) class Jackdaw: """A ringed jackdaw with a wing length in millimetres.""" name: str wing_mm: int def __post_init__(self) -> None: if self.wing_mm < 200 or sel...
code_trace
chat
worked
1
glm-5.3-flash
dataclass_post_init
333
024695eb4a999eee
ol5-026a385a17a6d704-0
<|start|><|user|> Build what the task below asks for. A beauty counter limits how many lipstick samples a clerk may hand out. Write one function `allow_events(stamps: list[int], limit: int, window: int) -> list[bool]`. Each stamp is a strictly increasing event time; the answer tells whether that event is admitted unde...
code_impl
chat
worked
1
glm-5.3-flash
rate_limit_window
521
026a385a17a6d704
ol5-026a385a17a6d704-1
Develop a typed Python module for the task below. A beauty counter limits how many lipstick samples a clerk may hand out. Write one function `allow_events(stamps: list[int], limit: int, window: int) -> list[bool]`. Each stamp is a strictly increasing event time; the answer tells whether that event is admitted under a ...
code_impl
plain
answer_only
1
glm-5.3-flash
rate_limit_window
445
026a385a17a6d704
ol5-026a385a17a6d704-2
Fix the code below and give the corrected code. Failing assertion - `assert allow_events([0, 1, 1, 2], 1, 100) == [True, False, False, False]` ```python """Fixed-window admission for lipstick sample handouts.""" def allow_events(stamps: list[int], limit: int, window: int) -> list[bool]: """Decide admission per s...
code_bugfix
plain
worked
1
glm-5.3-flash
rate_limit_window
614
026a385a17a6d704
ol5-026a385a17a6d704-3
Example: Clean up the following module to current Python idioms. ```python """Fixed-window admission for lipstick sample handouts.""" def allow_events(stamps, limit, window): # type: (List[int], int, int) -> List[bool] """Decide admission per stamp: at most limit events per window.""" if limit < 1: ...
code_refactor
plain
worked
1
glm-5.3-flash
rate_limit_window
524
026a385a17a6d704
ol5-02923b74ab7a0183-0
What does the program below output? ```python def longest_span(masses: list[int], limit: int) -> int: """Longest run of reindeer whose combined load stays within the limit.""" best = start = total = 0 for stop, mass in enumerate(masses): total += mass while total > limit: total ...
code_trace
plain
worked
1
glm-5.3-flash
sliding_window
222
02923b74ab7a0183
ol5-029d4689ae3f904b-0
<|start|><|user|> Answer this problem with a short Python program. A library stacks its new novels in cases, with 5 shelves in each case and 6 novels on each shelf. If 4 cases are filled this way, how many novels does that make?<|eot|> <|assistant|> <|think|> 1. Total novels: 4 × 5 × 6 = 120 <|/think|> Program: <|form...
math_prog
chat
worked
1
glm-5.3-flash
counting_principle
118
029d4689ae3f904b
ol5-02bf0d160496d74a-0
Program idiomatic Python for the following request. The drainage crew walks a street in one direction and records each gutter segment as a pair of a drain number and a segment label. They want the labels regrouped by drain so the report reads drain 0 first, then drain 1, and so on, with the crew's own order kept insid...
code_impl
plain
worked
1
ds-v4.1-flash
bucket_sort
468
02bf0d160496d74a
ol5-02bf0d160496d74a-1
Develop the Python that the specification below describes. The drainage crew walks a street in one direction and records each gutter segment as a pair of a drain number and a segment label. They want the labels regrouped by drain so the report reads drain 0 first, then drain 1, and so on, with the crew's own order kep...
code_impl
plain
answer_only
1
ds-v4.1-flash
bucket_sort
392
02bf0d160496d74a
ol5-02bf0d160496d74a-2
Add type hints to this code for a strict type checker. ```python def bucket_by_drain(segments): """Return the labels ordered by ascending drain number, keeping each drain's order.""" for drain, _ in segments: if drain < 0: raise ValueError(f"drain number must not be negative, {drain} was gi...
code_types
plain
worked
1
ds-v4.1-flash
bucket_sort
444
02bf0d160496d74a
ol5-02e30aff6f7c7ea9-0
Give the exact output of the program below after tracing it. ```python """Rank the three longest ribbon loops in a bowknot kit.""" import heapq spans: dict[str, int] = {"sash": 14, "wreath": 9, "gift": 17, "chair": 5, "rail": 11} top3 = heapq.nlargest(3, spans.items(), key=lambda kv: kv[1]) print([name for name, _ i...
code_trace
plain
worked
1
glm-5.3-flash
heap_topk
243
02e30aff6f7c7ea9
ol5-02e30aff6f7c7ea9-1
Work out what the following code prints. ```python """Rank the three longest ribbon loops in a bowknot kit.""" import heapq spans: dict[str, int] = {"sash": 14, "wreath": 9, "gift": 17, "chair": 5, "rail": 11} top3 = heapq.nlargest(3, spans.items(), key=lambda kv: kv[1]) print([name for name, _ in top3]) print(sum(l...
code_trace
plain
answer_only
1
glm-5.3-flash
heap_topk
190
02e30aff6f7c7ea9
ol5-0335a74e17b9eaf3-0
Produce idiomatic Python for the following request. The juice bar downstairs finally put pumps on the counter, and now everyone squeezes all day. Write an enum `Condiment` with members `KETCHUP`, `MUSTARD`, and `CHUTNEY`, and a single function `allow(condiment: Condiment, tick: int, tally: dict[Condiment, tuple[int, i...
code_impl
plain
worked
1
glm-5.3-flash
rate_limit_window
674
0335a74e17b9eaf3
ol5-0335a74e17b9eaf3-1
Skill check: Program the behaviour specified below in Python. The juice bar downstairs finally put pumps on the counter, and now everyone squeezes all day. Write an enum `Condiment` with members `KETCHUP`, `MUSTARD`, and `CHUTNEY`, and a single function `allow(condiment: Condiment, tick: int, tally: dict[Condiment, tu...
code_impl
plain
answer_only
1
glm-5.3-flash
rate_limit_window
590
0335a74e17b9eaf3
ol5-0335a74e17b9eaf3-2
Type-annotate the module below using modern typing syntax. ```python """Fixed-window serving meter for a condiment counter.""" from enum import Enum, auto class Condiment(Enum): """Pumps available at the counter.""" KETCHUP = auto() MUSTARD = auto() CHUTNEY = auto() type Tally = dict[Condiment, t...
code_types
plain
worked
1
glm-5.3-flash
rate_limit_window
742
0335a74e17b9eaf3
ol5-0335a74e17b9eaf3-3
Put together a plain-assert test module for the code below. ```python """Fixed-window serving meter for a condiment counter.""" from enum import Enum, auto class Condiment(Enum): """Pumps available at the counter.""" KETCHUP = auto() MUSTARD = auto() CHUTNEY = auto() type Tally = dict[Condiment, ...
code_tests
plain
answer_only
1
glm-5.3-flash
rate_limit_window
1,009
0335a74e17b9eaf3
ol5-035775f7171a80cf-0
Develop the module described below together with its tests. Show your steps. In a mathematics worksheet on correlated series we need per-window association values for two paired measurement series. Write an `Enum` called `Stat` with members `PEARSON` and `COVARIANCE`, and a function `rolling(xs: list[float], ys: list[...
code_impl_tests
plain
worked
1
glm-5.3-flash
deque_window
1,333
035775f7171a80cf
ol5-035775f7171a80cf-1
<|start|><|user|> Write the following task in modern Python. Keep it short. In a mathematics worksheet on correlated series we need per-window association values for two paired measurement series. Write an `Enum` called `Stat` with members `PEARSON` and `COVARIANCE`, and a function `rolling(xs: list[float], ys: list[f...
code_impl
chat
answer_only
1
glm-5.3-flash
deque_window
853
035775f7171a80cf
ol5-035775f7171a80cf-2
Fix the following module, which fails one of its tests. The check that does not hold - `assert rolling([1.0, 2.0], [2.0, 1.0], 2) == [-1.0]` ```python """Sliding-window association measures for paired numeric series.""" from collections import deque from enum import Enum, auto class Stat(Enum): """The window st...
code_bugfix
plain
worked
1
glm-5.3-flash
deque_window
1,374
035775f7171a80cf
ol5-035775f7171a80cf-3
Bring up to date the legacy code below into modern, typed Python. ```python # -*- coding: utf-8 -*- from collections import deque class Stat(object): """The window statistic to compute.""" PEARSON = "pearson" COVARIANCE = "covariance" def _moments(xs, ys): """Return the population covariance and t...
code_refactor
plain
worked
1
glm-5.3-flash
deque_window
1,192
035775f7171a80cf
ol5-035775f7171a80cf-4
Add tests that check the behaviour of the module below. One line is enough. ```python """Sliding-window association measures for paired numeric series.""" from collections import deque from enum import Enum, auto class Stat(Enum): """The window statistic to compute.""" PEARSON = auto() COVARIANCE = aut...
code_tests
plain
answer_only
1
glm-5.3-flash
deque_window
1,349
035775f7171a80cf
ol5-039b242c4e62b495-0
<|start|><|user|> Answer this problem. An account under the full cost appropriations structure of 51 U.S.C. 20143 holds $50,000 and earns simple interest at 4% per year for 3 years. How much interest does the account earn?<|eot|> <|assistant|> <|think|> 1. Interest: 50000 × 4/100 × 3 = 6000 <|/think|> Answer: $6,000<|...
math_wp
chat
worked
1
glm-5.3-flash
simple_interest
89
039b242c4e62b495
ol5-03bb773f7ad1f3f9-0
Program a typed Python module for the task below. Our clinic's billing desk keeps a short list of charge lines, one per primary payer, and under a full-charge billing authority the desk may only bill a set whose amounts add up exactly to the allowed target. Write a module with an enum `PayerAuthority` (members `FULL_C...
code_impl
plain
worked
1
glm-5.3-flash
combinations_search
822
03bb773f7ad1f3f9
ol5-03bb773f7ad1f3f9-1
Exercise: Implement a typed Python module for the task below. Our clinic's billing desk keeps a short list of charge lines, one per primary payer, and under a full-charge billing authority the desk may only bill a set whose amounts add up exactly to the allowed target. Write a module with an enum `PayerAuthority` (mem...
code_impl
plain
answer_only
1
glm-5.3-flash
combinations_search
682
03bb773f7ad1f3f9
ol5-03bb773f7ad1f3f9-2
Example: Find and fix the bug in this code and give the corrected code. The test that breaks - `test_full_charge_single_claim_counts_as_subset()` ```python """Pick payer claims billable in full under a provider's billing authority.""" from enum import Enum from itertools import combinations from typing import NamedTu...
code_bugfix
plain
worked
1
glm-5.3-flash
combinations_search
944
03bb773f7ad1f3f9
ol5-03bb773f7ad1f3f9-3
Example: Modernise the following module into modern, typed Python. ```python """Pick payer claims billable in full under a provider's billing authority.""" from collections import namedtuple from itertools import combinations FULL_CHARGE = "full_charge" OFFSET = "offset" class PayerAuthority(object): """Billin...
code_refactor
plain
worked
1
glm-5.3-flash
combinations_search
840
03bb773f7ad1f3f9
ol5-03f735692eb1a722-0
<|start|><|user|> An application under the marketing order lists a shipment of 30 crates of fruit, with each crate weighing 18 kg. The order requires weights in pounds, and 1 kg equals 2.2 lb. How many pounds does the shipment weigh?<|eot|> <|assistant|> <|think|> 1. Weight of the shipment: 30 × 18 × 2.2 = 1188 <|/thin...
math_wp
chat
worked
1
glm-5.3-flash
unit_conversion
100
03f735692eb1a722
ol5-040a4d61c9edb33f-0
Exercise: Implement what the task below asks for. Our smeltery records recipes as compact strings. An ingot mark is a single character, a letter; a group like `3[A]` means the ingots inside the brackets are smelted three times, and groups nest, as in `2[2[B]A]`. Write one top-level function `smelt(recipe: str) -> list...
code_impl
plain
worked
1
glm-5.3-flash
stack
610
040a4d61c9edb33f
ol5-040a4d61c9edb33f-1
Debug this code and give the corrected code. The check that does not hold = `test_multi_digit_count()` ```python """Expand a smelting recipe with nested crucible groups into ingot marks.""" def smelt(recipe: str) -> list[str]: """Expand recipes like "2[C]D" or "2[2[B]A]" into a flat ingot list.""" ingots: li...
code_bugfix
plain
worked
1
glm-5.3-flash
stack
768
040a4d61c9edb33f
ol5-040a4d61c9edb33f-2
Add parameter and return types to the code below for a strict type checker. ```python """Expand a smelting recipe with nested crucible groups into ingot marks.""" def smelt(recipe): """Expand recipes like "2[C]D" or "2[2[B]A]" into a flat ingot list.""" ingots = [] stack = [] digits = "" for ch i...
code_types
plain
worked
1
glm-5.3-flash
stack
683
040a4d61c9edb33f
ol5-0453adb38e7870c9-1
Write what the task below asks for. Exact answers only. On our pig farm we mix slop in a single vat, and requests arrive one at a time, so the first request recorded should be the first one mixed. Write a function `serve_slop(mixes: list[tuple[str, float]], vat_size: float) -> list[str]` that treats the incoming mixin...
code_impl
plain
answer_only
1
glm-5.3-flash
queue_fifo
402
0453adb38e7870c9
ol5-0453adb38e7870c9-2
Repair the following module and give the corrected code. Failing check - `raise AssertionError("expected ValueError")` ```python from collections import deque def serve_slop(mixes: list[tuple[str, float]], vat_size: float) -> list[str]: """Serve mixing requests first in, first out, skipping any request larger th...
code_bugfix
plain
worked
1
glm-5.3-flash
queue_fifo
527
0453adb38e7870c9
ol5-0453adb38e7870c9-3
Annotate the code below. ```python from collections import deque def serve_slop(mixes, vat_size): """Serve mixing requests first in, first out, skipping any request larger than the remaining supply.""" if vat_size <= 0: raise ValueError("vat_size must be positive") queue = deque(mixes) served...
code_types
plain
worked
1
glm-5.3-flash
queue_fifo
435
0453adb38e7870c9
ol5-049ffc7098b9f164-0
Write down what the following code prints. ```python import heapq type Tuber = tuple[str, int] def best_crops(weights: list[Tuber], k: int) -> list[Tuber]: """Return the k heaviest tubers, heaviest first.""" return heapq.nlargest(k, weights, key=lambda entry: entry[1]) harvest: list[Tuber] = [ ("russe...
code_trace
plain
worked
1
glm-5.3-flash
heap_topk
303
049ffc7098b9f164
ol5-04af3ab62b74bcfe-0
<|start|><|user|> Build the behaviour specified below in Python. Please write a small module that measures return on equity capital for proprietary providers, the way 42 CFR 413.157 describes it. Provide a frozen dataclass `CapitalRecord` with fields `facility: str`, `equity_cents: int` and `capital_cents: int`, and a...
code_impl
chat
worked
1
ds-v4.1-flash
async_basics
722
04af3ab62b74bcfe
ol5-04af3ab62b74bcfe-1
Put together typed test functions for the code below. ```python """Return on equity capital for proprietary providers.""" import asyncio from dataclasses import dataclass @dataclass(slots=True, frozen=True) class CapitalRecord: """Allowable equity and total capital of one proprietary provider.""" facility:...
code_tests
plain
answer_only
1
ds-v4.1-flash
async_basics
871
04af3ab62b74bcfe
ol5-04c0f298306340dd-0
Self-test: Draft the Python that the specification below describes. We ship treacle in two grades and every sample is checked before it leaves the plant. Write a module with two dataclasses, `LightSyrup(grade: str, viscosity: int)` and `DarkSyrup(grade: str, viscosity: int)`, and one function `validate_batch(batch: li...
code_impl
plain
worked
1
glm-5.3-flash
match_statement
623
04c0f298306340dd
ol5-04c0f298306340dd-1
Code up what the task below asks for. We ship treacle in two grades and every sample is checked before it leaves the plant. Write a module with two dataclasses, `LightSyrup(grade: str, viscosity: int)` and `DarkSyrup(grade: str, viscosity: int)`, and one function `validate_batch(batch: list[LightSyrup | DarkSyrup]) ->...
code_impl
plain
answer_only
1
glm-5.3-flash
match_statement
548
04c0f298306340dd
ol5-04c0f298306340dd-2
<|start|><|user|> Task: Clean up the module below. ```python class LightSyrup(object): """A pale treacle sample from the refining line.""" def __init__(self, grade, viscosity): self.grade = grade self.viscosity = viscosity class DarkSyrup(object): """A black treacle sample from the refin...
code_refactor
chat
worked
1
glm-5.3-flash
match_statement
720
04c0f298306340dd
ol5-04c0f298306340dd-3
Problem: Add parameter and return types to the code below. ```python from dataclasses import dataclass @dataclass(slots=True) class LightSyrup: """A pale treacle sample from the refining line.""" grade: str viscosity: int @dataclass(slots=True) class DarkSyrup: """A black treacle sample from the r...
code_types
plain
worked
1
glm-5.3-flash
match_statement
660
04c0f298306340dd
ol5-04c0f298306340dd-4
Draft unit tests for the following Python module. ```python from dataclasses import dataclass @dataclass(slots=True) class LightSyrup: """A pale treacle sample from the refining line.""" grade: str viscosity: int @dataclass(slots=True) class DarkSyrup: """A black treacle sample from the refining l...
code_tests
plain
answer_only
1
glm-5.3-flash
match_statement
655
04c0f298306340dd
ol5-04e5d4fe4f9f16c5-0
Determine the output of the code below after tracing it. ```python from typing import TypedDict class Caracal(TypedDict): """One caracal sighting record.""" site: str tassel_cm: float leap_m: float sightings: list[Caracal] = [ {"site": "gravel plain", "tassel_cm": 4.8, "leap_m": 3.1}, {"si...
code_trace
plain
worked
1
glm-5.3-flash
typed_dict
297
04e5d4fe4f9f16c5
ol5-04e5d4fe4f9f16c5-1
Practice: Give what the script below prints after tracing it. ```python from typing import TypedDict class Caracal(TypedDict): """One caracal sighting record.""" site: str tassel_cm: float leap_m: float sightings: list[Caracal] = [ {"site": "gravel plain", "tassel_cm": 4.8, "leap_m": 3.1}, ...
code_trace
plain
answer_only
1
glm-5.3-flash
typed_dict
244
04e5d4fe4f9f16c5
ol5-05110546728c87e2-0
Try this: Produce the specification below in Python 3.14. I need a small helper for the royalty value of oil that the reporter or an affiliate does not sell under an arm's-length contract. Write a validator `collect_problems(volume: float, price: float, adjustment: float) -> list[str]` that returns one problem message...
code_impl
plain
worked
1
glm-5.3-flash
properties
1,138
05110546728c87e2
ol5-05110546728c87e2-1
Problem: Correct the function below. This assertion fails = `assert collect_problems(1.0, 0.0, 0.0) == []` ```python """Validate and store a royalty value for oil not sold under an arm's-length contract.""" def collect_problems(volume: float, price: float, adjustment: float) -> list[str]: """Return one message p...
code_bugfix
plain
worked
1
glm-5.3-flash
properties
1,666
05110546728c87e2
ol5-05110546728c87e2-2
Clean up the following module into modern, typed Python. ```python from typing import List def collect_problems(volume, price, adjustment): # type: (float, float, float) -> List[str] """Return one message per invalid royalty input, in field order.""" messages = [] # type: List[str] if volume <= 0.0:...
code_refactor
plain
worked
1
glm-5.3-flash
properties
1,657
05110546728c87e2
ol5-0615db17d4b05544-0
<|start|><|system|> Avoid unnecessary detail.<|eot|> <|user|> Build the code and the tests for the following task. Here is a question our desk team keeps asking: when must I submit reports? We staff a shared submission desk for the periodic reports described by 40 CFR 62.14464, and I need a helper that tells me when a...
code_impl_tests
chat
worked
1
ds-v4.1-flash
interval_scheduling_rooms
1,264
0615db17d4b05544
ol5-0615db17d4b05544-1
Annotate this code using modern typing syntax. ```python """Desk planning for the periodic report windows of 40 CFR 62.14464.""" import heapq from dataclasses import dataclass @dataclass(frozen=True, slots=True) class ReportWindow: """One report window with its first and last submission day.""" label: str ...
code_types
plain
worked
1
ds-v4.1-flash
interval_scheduling_rooms
800
0615db17d4b05544
ol5-063d4ebe03a28dfb-0
Create a Python solution to the task that follows. Show your steps. We track assessed values for land parcels in a survey area. Most parcels carry no entry, so we store assessments in a dict mapping parcel index to value, treating absent indices as 0.0. Write a module with a type alias `Assessment = dict[int, float]`,...
code_impl
plain
worked
1
glm-5.3-flash
sparse_vector
560
063d4ebe03a28dfb
ol5-063d4ebe03a28dfb-1
Develop a typed Python module for the task below. Take care with the details. We track assessed values for land parcels in a survey area. Most parcels carry no entry, so we store assessments in a dict mapping parcel index to value, treating absent indices as 0.0. Write a module with a type alias `Assessment = dict[int...
code_impl
plain
answer_only
1
glm-5.3-flash
sparse_vector
451
063d4ebe03a28dfb
ol5-063d4ebe03a28dfb-2
<|start|><|user|> Repair the function below and give the corrected code. This assertion fails: `assert dot(left, right) == 2.0 * 5.0 + 4.0 * -1.0` ```python """Sparse assessment vectors over parcel indices.""" from collections.abc import Iterator type Assessment = dict[int, float] def nonzero_entries(values: Asses...
code_bugfix
chat
worked
1
glm-5.3-flash
sparse_vector
608
063d4ebe03a28dfb
ol5-06680a24dcd7332c-0
Problem: Write the Python that the specification below describes. For our fossil club catalogue I need a small ordering pipeline for brachiopod specimens. Write `Specimen`, a slots dataclass with `genus: str`, `width_mm: float`, `zone: int`; `parse_specimens(rows: list[tuple[str, float, int]]) -> list[Specimen]`; the ...
code_impl
plain
worked
1
glm-5.3-flash
stable_sort
704
06680a24dcd7332c
ol5-06680a24dcd7332c-1
Add type hints to the code below using modern typing syntax. ```python """Order brachiopod specimen records by genus and shell width.""" from dataclasses import dataclass @dataclass(slots=True) class Specimen: """One collected brachiopod specimen.""" genus: str width_mm: float zone: int def parse...
code_types
plain
worked
1
glm-5.3-flash
stable_sort
861
06680a24dcd7332c
ol5-06680a24dcd7332c-2
<|start|><|system|> Answer in plain English.<|eot|> <|user|> Produce tests for the module that follows. ```python """Order brachiopod specimen records by genus and shell width.""" from dataclasses import dataclass @dataclass(slots=True) class Specimen: """One collected brachiopod specimen.""" genus: str ...
code_tests
chat
answer_only
1
glm-5.3-flash
stable_sort
814
06680a24dcd7332c
ol5-06889579e91a0345-0
A curio collector bends a 20 cm wire into a rectangular display frame. The area is a quadratic function of the width, and the greatest area occurs when the frame is a square. What is the maximum area in square centimeters? <|think|> 1. Maximum area: 20 × 20 ÷ 16 = 25 <|/think|> Answer: 25 cm²
math_wp
plain
worked
1
ds-v4.1-flash
optimization_poly
78
06889579e91a0345
ol5-06dd2975ccffba60-0
<|start|><|user|> Predict the output of the code below. ```python from dataclasses import dataclass @dataclass(frozen=True, slots=True) class Window: """A warranty tier and its coverage length in months.""" months: int tier: str paid: dict[Window, str] = { Window(12, "basic"): "repair", Window...
code_trace
chat
worked
1
glm-5.3-flash
hashable_value
264
06dd2975ccffba60
ol5-072553eb3e46e16c-0
<|start|><|user|> Work out the question below. On a leased ranch, 3 of the 8 current leases are up for renewal this season. An auditor picks 2 of the 8 leases at random without looking. What is the probability, as an exact fraction, that both leases picked are renewals?<|eot|> <|assistant|> <|think|> 1. Probability bo...
math_wp
chat
worked
1
glm-5.3-flash
probability_two_step
108
072553eb3e46e16c
ol5-07432eb88d96ad87-0
Answer the question below. An application was abandoned because of Office error, and the agency reinstated it. The applicant must pay a reinstatement fee of $730 for the year, prorated by days. Only 60 of the 365 days in the year remain. How much is the prorated fee? <|think|> 1. Prorated fee: 730 × 60 ÷ 365 = 120 <|...
math_wp
plain
worked
1
glm-5.3-flash
proration
94
07432eb88d96ad87
ol5-075d6c71f3832fe9-0
Work it out: Implement the following task in modern Python. Our agency needs a tiny review engine for administrative record cases. Write a module with a module-level table `TRANSITIONS` mapping `(status, ruling)` pairs to the next status, with statuses `intake`, `review`, `closed` and rulings `accept`, `return`, `upho...
code_impl
plain
worked
1
glm-5.3-flash
state_machine
662
075d6c71f3832fe9
ol5-075d6c71f3832fe9-1
Exercise: Develop clean, typed Python for the request below. Our agency needs a tiny review engine for administrative record cases. Write a module with a module-level table `TRANSITIONS` mapping `(status, ruling)` pairs to the next status, with statuses `intake`, `review`, `closed` and rulings `accept`, `return`, `uph...
code_impl
plain
answer_only
1
glm-5.3-flash
state_machine
566
075d6c71f3832fe9
ol5-075d6c71f3832fe9-2
Practice item: Add parameter and return types to the module below so that ty accepts it. ```python """A state machine for an agency review of an administrative record.""" from collections.abc import Mapping TRANSITIONS: Mapping[tuple[str, str], str] = { ("intake", "accept"): "review", ("intake", "return"): "...
code_types
plain
worked
1
glm-5.3-flash
state_machine
675
075d6c71f3832fe9
ol5-075d6c71f3832fe9-3
Put together tests for the module that follows. ```python """A state machine for an agency review of an administrative record.""" from collections.abc import Mapping TRANSITIONS: Mapping[tuple[str, str], str] = { ("intake", "accept"): "review", ("intake", "return"): "closed", ("review", "uphold"): "close...
code_tests
plain
answer_only
1
glm-5.3-flash
state_machine
875
075d6c71f3832fe9
End of preview. Expand in Data Studio

OpenLemma v0.5: rendered training text

Training documents rendered from mjbommar/openlemma-v0.5-items. Each document puts the instruction first, then the problem (specification, code or puzzle), then a short numbered reasoning trace and the answer:

<|think|>
1. ...
2. ...
<|/think|>
Answer: ...

<|think|> / <|/think|> and <|formal|> / <|/formal|> (around solution-side code, SMT and CAS blocks) are single reserved tokens of the ALEA tokenizer; strip or replace them for other tokenizers. About 30% of items also appear as an answer-only document (no trace). The chat config renders every item as a chat transcript.

part documents tokens (ALEA tokenizer)
default (plain + 20% chat) 34,110 22,780,245
chat (every item as chat) 34,605 23,568,634

How the data was made

Every item combines a skill from our own taxonomy (157 code skills, 66 math skills, 10 logic puzzle kinds), a topical seed and a step count (1 to 6). Seeds are concrete nouns and topics from OpenGloss, headings of U.S. Code and eCFR sections about computations and procedures (fees, deadlines, filings, interest, payroll, records), and a list of everyday and public-record domains. The combination is deduplicated, so every task is specific to its seed and written with its own names; tasks are not taken from existing datasets, textbooks or code repositories, and every document also passes the copyright n-gram filter below.

The text was written by language models (teachers) through OpenRouter, pinned to third-party hosts that serve the open weights with zero data retention:

teacher OpenRouter id weight license verified items (before deduplication and the held-out split)
GLM-5.3-Flash z-ai/glm-5.3-flash MIT 16,607
DeepSeek-V4.1-Flash deepseek/deepseek-v4.1-flash MIT 2,345
Qwen3.8-2.4T-A95B qwen/qwen3.8-2.4t-a95b Qwen3.8-Max License 131
DeepSeek-V4-Pro deepseek/deepseek-v4-pro-0813 MIT 2

Logic puzzles (entities, clues, gold answers) are generated by our own code; the teacher writes only the numbered solution steps. Bug-fix, type-annotation and refactoring tasks are derived from verified solutions by deterministic program transformations.

Verification

Nothing is included unless every check passes.

family checks pass rate
code (spec → implementation) ruff format, ruff check --fix with a strict rule set (pyupgrade, bugbear, simplify, isort, naming, annotations, pathlib and more; target Python 3.14) with zero remaining violations; ty check with zero errors; the teacher's tests and an independent test suite written by a second teacher from the specification alone both pass in a sandbox (no network, resource limits, temporary directory) 38.7%
code tracing ruff and ty clean; the program is executed twice with different hash seeds; both outputs are identical and equal the stated output 71.4%
math the solution program prints exactly the answer; every arithmetic step is recomputed exactly; algebra and calculus items carry an Axeyum CAS statement whose result equals the answer 78.9%
logic the answer equals the generator's gold; the Axeyum SMT solver confirms satisfiability, the model and uniqueness (or the entailment status); positional claims in the steps hold in the unique solution 87.0%

Pass rate = verified items / items requested from the teachers.

Decontamination and non-infringement

  • Fail-closed decontamination of every rendered document against ALEA's held-out evaluation sets (in-context-learning, correction, step-scaling, broad spot-check and arithmetic-notation probes, including their templates and name lists) by word 8-grams, nonce words and held-out pairs; 10.1% of documents were dropped.
  • A copyright filter (hashed word 13-grams of a reference set of copyrighted texts): 1 document(s) matched and were dropped.
  • Code longer than 110 lines, and any code with licence, copyright, author or version tags or URLs, is dropped.
  • A toxicity classifier (s-nlp/roberta_toxicity_classifier) over every 64-word chunk: documents scoring 0.8 or above were dropped (7 in the default config, 3 in the chat config).
  • No private contact details were found; the e-mail addresses in code and tests are invented placeholders.
  • The held-out evaluation split of this release is kept private (unreleased) so it stays usable for evaluation.

License

CC-BY-4.0. The generation, verification and rendering code will be released with the ALEA model.

Downloads last month
58