id
stringlengths
32
32
text
stringlengths
421
9.88k
family
stringclasses
1 value
kind
stringclasses
4 values
label
stringclasses
15 values
source
stringclasses
3 values
stratum
stringclasses
350 values
gold
stringlengths
92
1.29k
presentation
stringclasses
3 values
group_id
stringlengths
20
99
n_tokens
int64
138
3.07k
code_comprehend-000264523de977fc
Question: The module below currently passes all of its tests. ``` 1: import math 2: from collections.abc import Sequence 3: 4: Sample = int | float 5: MAX_FRAMES = 1 << 20 6: MAX_SAMPLES = 8 * MAX_FRAMES 7: 8: 9: class PcmError(ValueError): 10: """A code with only the coordinates present for this particul...
code_comprehend
failing_test
1
synth
synth:05-processing.audio.sample-frame-layout
{"failing": ["check_2"], "shown": ["check_1", "check_2", "check_3", "check_4"], "edit": {"line": 68, "before": " return [plane[frame] for frame in range(count) for plane in planes]", "after": " return [plane[count] for frame in range(count) for plane in planes]", "fn": "interleave", "op": "var", "unique": true}, ...
qa
synth:05-processing.audio.sample-frame-layout/focused-sample:interleave
1,031
code_comprehend-000357037f7b5cf7
### Task Code review: the tests define the expected behavior. ``` 1: from collections.abc import Iterator 2: from contextlib import contextmanager 3: from dataclasses import dataclass, field 4: from enum import Enum 5: 6: 7: class Tilt(Enum): 8: """The direction a drainboard leans toward the sink.""" 9: 1...
code_comprehend
spot_bug
no_bug
ol5
ol5:contextlib
{"bug_line": null, "fix": null, "buggy": null, "tests_orig": ["test_cleared_on_exception", "test_dispatch_right", "test_drainboard_defaults", "test_draining_loads_then_clears_and_tilts"]}
qa
ol5:f80b18ce8bf89f86
729
code_comprehend-00069fb67fd3237e
Review this code. The tests below describe the intended behavior; at most one line is wrong. ``` 1: import calendar 2: 3: from datetime import date 4: 5: 6: def calculate_claim_age(claim_date: date, as_of: date | None = None) -> tuple[int, int, int]: 7: """Calculate a claim's age in whole years, months, and...
code_comprehend
spot_bug
bug
r3vc
r3vc:legal_dates
{"bug_line": 15, "fix": " anniversary = date(claim_date.year + years, month, day)", "buggy": " anniversary = date(claim_date.year + years, month, as_of)", "tests_orig": ["test_1", "test_4", "test_5", "test_6"]}
plain
r3vc:vcode4-cba0283e31f7c044
875
code_comprehend-0009b31045cb6059
### Task You are reviewing a one-line change to this Python code. ```python def format_lab_sample_durations(durations: list[int | None]) -> list[str]: """Format each available lab sample duration as hours and minutes.""" formatted = [] for seconds in durations: if seconds is None: conti...
code_comprehend
failing_test
3+
r3vc
r3vc:dates
{"failing": ["test_b", "test_c", "test_e", "test_g"], "shown": ["test_a", "test_b", "test_c", "test_d", "test_e", "test_f", "test_g"], "edit": {"line": 13, "before": " if minutes == 60:", "after": " if minutes != 60:", "fn": "format_lab_sample_durations", "op": "cmp", "unique": true}, "tests_orig": ["test...
qa
r3vc:vcode4-0bcdbe13851d4c88
891
code_comprehend-000ed5cddb798690
<|start|><|user|> The following code is unchanged so far. ``` 1: from __future__ import annotations 2: import math 3: 4: 5: class ADError(ValueError): 6: """Invalid shape, domain, graph, arithmetic, or resource request.""" 7: 8: 9: def finite(value: float) -> float: 10: if isinstance(value, bool) or n...
code_comprehend
edit_output
unchanged
synth
synth:03-algorithms.autodiff.hessian-vector-products
{"expr": "finite(1.0)", "orig": "1.0", "new": "1.0", "edit": {"line": 16, "before": " if not math.isfinite(result):", "after": " if not math.isfinite(value):", "fn": "finite", "op": "var", "unique": true}}
chat
synth:03-algorithms.autodiff.hessian-vector-products/focused-sample:finite
290
code_comprehend-001619c074512de8
Instruction: What happens to a call's result when one line changes? The code: ```python def newsletter_adjacent_subscriber_products(counts: list[str]) -> int: """Sum the products of adjacent subscriber counts after trimming whitespace. Args: counts: Numeric subscriber counts represented as strings. ...
code_comprehend
edit_output
changed
r3vc
r3vc:lists
{"expr": "newsletter_adjacent_subscriber_products(['-2', '3', '-4'])", "orig": "-18", "new": "0", "edit": {"line": 11, "before": " return sum(left * right for left, right in zip(numbers, numbers[1:]))", "after": " return sum(left + right for left, right in zip(numbers, numbers[1:]))", "fn": "newsletter_adjacent_s...
qa
r3vc:vcode4-8182d9e2a88ec511
288
code_comprehend-001621413fbb21d9
Question: Your job: decide which tests would fail after a one-line edit. Code first. ``` 1: import re 2: 3: 4: def split_tax_worksheet_clauses(sentence: str, keep_empty: bool = False) -> list[str]: 5: """Split a tax worksheet sentence at commas and semicolons. 6: Raises TypeError if sentence is not a str...
code_comprehend
failing_test
1
r3vc
r3vc:strings
{"failing": ["test_4"], "shown": ["test_1", "test_2", "test_3", "test_4", "test_5"], "edit": {"line": 11, "before": " return clauses if keep_empty else [part for part in clauses if part]", "after": " return sentence if keep_empty else [part for part in clauses if part]", "fn": "split_tax_worksheet_clauses", "op":...
qa
r3vc:vcode4-1885c502a65e9b93
424
code_comprehend-001ad3a722dc423f
### Task Example: Your job: decide which tests would fail after a one-line edit. Code first. ```python def chess_club_budget_remaining(category_budgets: dict[str, float], expenses: dict[str, float], reverse: bool = False) -> list[tuple[str, float]]: """Return the chess club's remaining budget per category in sort...
code_comprehend
failing_test
2
synth
synth:02-data-structures.maps.counting-bloom-filter
{"failing": ["test_a", "test_d"], "shown": ["test_a", "test_b", "test_c", "test_d"], "edit": {"line": 5, "before": " if ledger[middle][0] < key:", "after": " if ledger[middle][0] > key:", "fn": "lower_bound", "op": "cmp", "unique": true}, "tests_orig": ["test_6", "test_1", "test_2", "test_5"]}
qa
synth:02-data-structures.maps.counting-bloom-filter/focused-sample:lower_bound
1,149
code_comprehend-001af1ae926c446f
<|start|><|user|> Read the specification, then the code. Task description: Please build a small payment queue for covered services under a care plan. Define a protocol `CoveredPaymentQueue` with methods `add(self, claim_id: str, amount_cents: int) -> None` and `take(self) -> tuple[str, int] | None`. Provide two class...
code_comprehend
spot_bug
no_bug
ol5
ol5:heap
{"bug_line": null, "fix": null, "buggy": null, "tests_orig": ["test_equal_amounts_use_smaller_claim_id", "test_smallest_take_empty", "test_smallest_order", "test_largest_order", "test_settle_empties_queue"]}
chat
ol5:60cbdf614ac332e9
1,260
code_comprehend-00256804094a8f71
<|start|><|user|> This code ships with a few unit tests, shown after it. ```python from collections.abc import Generator from contextlib import ExitStack, contextmanager from dataclasses import dataclass from typing import TypeAlias, cast ByteInput: TypeAlias = bytes | bytearray | memoryview class Error(ValueError)...
code_comprehend
failing_test
3+
synth
synth:04-formats.network-wire.ipv4-header
{"failing": ["test_case_2", "test_case_3", "test_case_4"], "shown": ["test_case_1", "test_case_2", "test_case_3", "test_case_4"], "edit": {"line": 34, "before": " if issubclass(type(value), bytes):", "after": " if not issubclass(type(value), bytes):", "fn": "_view", "op": "add_not", "unique": true}, "tests_orig":...
chat
synth:04-formats.network-wire.ipv4-header/focused-sample:format_ipv4
1,063
code_comprehend-002912bf4cf21d21
Query: The code below may have a one-line bug. The tests show the intended behavior. ``` 1 def format_moving_item_ranges(item_numbers: list[int]) -> str: 2 """Compress moving item numbers into comma-separated consecutive ranges. 3 4 Args: 5 item_numbers: Integer item numbers to sort, deduplica...
code_comprehend
spot_bug
bug
r3vc
r3vc:lists
{"bug_line": 20, "fix": " start = number", "buggy": " start = numbers", "tests_orig": ["test_3", "test_4", "test_6", "test_7", "test_8"]}
qa
r3vc:vcode4-4bc3fe9dc55f6f86
559
code_comprehend-002ee26a5fecbf51
This code ships with a few unit tests, shown after it. ``` 1 | """An aligned report of abrasive sheets in stock.""" 2 | 3 | MIN_GRIT = 12 4 | MAX_GRIT = 3000 5 | 6 | 7 | class Sheet: 8 | """One abrasive sheet whose numbers are validated on assignment.""" 9 | 10 | __slots__ = ("_grit", "_length_mm", "_...
code_comprehend
failing_test
3+
ol5
ol5:properties
{"failing": ["test_bad_length_on_assignment", "test_report_layout", "test_sheet_accepts_grit_edges"], "shown": ["test_bad_length_on_assignment", "test_report_layout", "test_sheet_rejects_grit_out_of_range", "test_sheet_accepts_grit_edges"], "edit": {"line": 38, "before": " if value <= 0:", "after": " if v...
plain
ol5:66e929d8b56089bf
1,183
code_comprehend-00319b5d18d7cf7b
Here is a function and the tests it is supposed to pass. Is there a bug? ``` 1: from datetime import date 2: 3: import calendar 4: 5: 6: def calculate_claim_age(claim_date: date, as_of: date = date(2024, 1, 1)) -> tuple[int, int, int]: 7: """Return a claim's elapsed age as full years, months, and days.""" ...
code_comprehend
spot_bug
no_bug
r3vc
r3vc:legal_dates
{"bug_line": null, "fix": null, "buggy": null, "tests_orig": ["test_1", "test_3", "test_5", "test_6"]}
plain
r3vc:vcode4-adbb23519380c92d
652
code_comprehend-00379b1cda0ce314
Task: Check the code against its tests; there may be one wrong line. ``` 1: def add_minutes_to_billing_time(time_text, minutes): 2: """Add minutes to a billing record time in HH:MM format. Raises ValueError when the time is malformed or outside the 24-hour clock.""" 3: if len(time_text) != 5 or time_text[2] !=...
code_comprehend
spot_bug
bug
r3vc
r3vc:dates
{"bug_line": 8, "fix": " total = (hour * 60 + minute + minutes) % (24 * 60)", "buggy": " total = (hour * 59 + minute + minutes) % (24 * 60)", "tests_orig": ["test_4", "test_5", "test_6"]}
qa
r3vc:vcode4-f3c56a7704e845f2
434
code_comprehend-003a0ebed73305bb
Instruction: Check this implementation against its specification. Spec: The risk desk keeps quarterly snapshots of counterparty financial standing, each snapshot mapping a company name to its letter grade. Build a class `StandingDiff` with `__init__(self, before: dict[str, str], after: dict[str, str]) -> None` and th...
code_comprehend
spot_bug
bug
ol5
ol5:diff_lists
{"bug_line": 25, "fix": " return sorted(self._after.keys() - self._before.keys())", "buggy": " return sorted(self._after.keys() + self._before.keys())", "tests_orig": ["test_changed_lists_both_grades", "test_unchanged_excluded", "test_changed_sorted_by_company"]}
qa
ol5:eb776b9d69ac5f8a
1,008
code_comprehend-003bb8ad336e2f3b
<|start|><|user|> Find the bug, if there is one. What the code should do: We measure scratch hardness with a sclerometer, and each reading is a float. Please write a module `sclero.py` with two public functions. First, `kth_smallest(readings: list[float], k: int, *, copy: bool = True) -> float` returns the k-th small...
code_comprehend
spot_bug
bug
ol5
ol5:kth_smallest
{"bug_line": 34, "fix": " hi = p - 1", "buggy": " hi = p + 1", "tests_orig": ["test_copy_flag_preserves_input", "test_median_odd", "test_kth_smallest_basic", "test_kth_smallest_copy_true_leaves_input_unchanged", "test_median_hardness_even_count"]}
chat
ol5:7dc8d1c09176ffdb
1,262
code_comprehend-0044f09d592568b5
Your job: decide which tests would fail after a one-line edit. Code first. ```python """Overpayment offset arithmetic with exact decimal rounding.""" from decimal import ROUND_FLOOR, ROUND_HALF_UP, Decimal, InvalidOperation _CENT = Decimal("0.01") _MODES = {"half_up": ROUND_HALF_UP, "floor": ROUND_FLOOR} def month...
code_comprehend
failing_test
1
ol5
ol5:decimal
{"failing": ["test_3"], "shown": ["test_1", "test_2", "test_3", "test_4", "test_5", "test_6"], "edit": {"line": 25, "before": " raise ValueError(msg) from exc", "after": " raise ValueError(owed) from exc", "fn": "monthly_offset", "op": "var", "unique": true}, "tests_orig": ["test_invalid_mode_raises", "te...
plain
ol5:cf2d860a604f0903
669
code_comprehend-004bcdf08ce1ef43
<|start|><|user|> Which line belongs in the gap? First, the code: ```python def box_office_overlap_minutes(first: tuple[int, int], second: tuple[int, int]) -> int: """Return the shared duration of two theatre box-office time ranges in minutes. Raises ValueError if either range is not a pair of nonnegative integer ...
code_comprehend
fill_line
B
r3vc
r3vc:dates
{"letter": "B", "line": 6, "options": ["if interval[0] < 0 or interval[1] <= interval[0]:", "if interval[0] < 0 or interval[1] < interval[0]:", "if interval[0] < 0 or interval[1] > interval[0]:"], "checks": [["box_office_overlap_minutes((60, 120), (90, 150))", "30"], ["box_office_overlap_minutes((0, 10), (10, 20))", "0...
chat
r3vc:vcode4-962d75955c1b6371
461
code_comprehend-0055500ba8567a2c
Instruction: Below is some Python code. ``` 1 | import re 2 | 3 | 4 | def find_docket_parenthetical_year(docket_text: str) -> int: 5 | """Find the first four-digit year inside a parenthetical in a court docket. Raises ValueError if no such year is present.""" 6 | match = re.search(r"\([^()]*?\b(\d{4})\b[^()]*\...
code_comprehend
edit_output
raises
r3vc
r3vc:legal_citations
{"expr": "find_docket_parenthetical_year('(2020)')", "orig": "2020", "new": "raises ValueError", "edit": {"line": 7, "before": " if match is None:", "after": " if match is not None:", "fn": "find_docket_parenthetical_year", "op": "cmp", "unique": true}}
qa
r3vc:vcode4-c5ef9fa241fbe0da
248
code_comprehend-005819e33f8d2f2d
### Task Check the code against its tests; there may be one wrong line. ``` 1 def bucket_print_quantities(quantities, limits, labels): 2 """Group print quantities into labelled ranges defined by exclusive upper limits.""" 3 if len(labels) == len(limits) + 1: 4 raise ValueError("labels must have...
code_comprehend
spot_bug
bug
r3vc
r3vc:lists
{"bug_line": 3, "fix": " if len(labels) != len(limits) + 1:", "buggy": " if len(labels) == len(limits) + 1:", "tests_orig": ["test_1", "test_2", "test_3", "test_5", "test_8"]}
qa
r3vc:vcode4-da41fa2cfc1895bf
576
code_comprehend-005d4a4f37d6470d
Request: Someone deleted one line from this module. ```python import graphlib from collections.abc import Iterator def iter_trait_order(prerequisites: dict[str, list[str]]) -> Iterator[tuple[str, int]]: """Yield each duckbill trait with the layer it can be checked in.""" known = set(prerequisites) for tr...
code_comprehend
fill_line
B
ol5
ol5:graphlib
{"letter": "B", "line": 19, "options": ["for trait in known:", "for trait in ready:", "for trait in layer:"], "checks": [["summarize_order({})", "[]"], ["summarize_order({'bill width': [], 'lamellae count': [], 'filter rate': ['bill width']})", "['0: bill width', '0: lamellae count', '1: filter rate']"], ["summarize_or...
qa
ol5:1087ca91349a43f9
477
code_comprehend-005ee1216f1c2ec5
Query: Here is a solved example first. Below is a Python module, its tests, and a one-line edit. Work out which tests fail once the edit is applied. ``` 1 | def gradebook_pascal_row(row_index): 2 | """Return a row of Pascal's triangle for a classroom gradebook. 3 | A negative row index raises ValueError. ...
code_comprehend
failing_test
none
synth
synth:03-algorithms.numeric.prime-enumeration
{"failing": [], "shown": ["test_1", "test_2", "test_3", "test_4", "test_5"], "edit": {"line": 17, "before": " if value > MAX_BOUND:", "after": " if value >= MAX_BOUND:", "fn": "_bound", "op": "cmp", "unique": true}, "tests_orig": ["test_3", "test_2", "test_5", "test_4", "test_1"]}
qa
synth:03-algorithms.numeric.prime-enumeration/focused-sample:is_prime_trial
1,006
code_comprehend-0061a82294d3e2fa
<|start|><|system|> You are a helpful assistant.<|eot|> <|user|> Example: Take a look at this function. ```python from enum import Enum, auto from itertools import permutations class Room(Enum): """Timetable rooms, each charging its own penalty per lesson.""" HALL = auto() LAB = auto() GYM = auto()...
code_comprehend
edit_output
unchanged
ol5
ol5:generator_pipeline
{"expr": "validate_ledger(['bolt,4.50', 'nut,0.20'])", "orig": "[]", "new": "[]", "edit": {"line": 6, "before": " for number, line in enumerate(lines, start=1):", "after": " for number, line in enumerate(lines, start=2):", "fn": "_numbered", "op": "const", "unique": true}}
chat
ol5:dc67c2e5b794d7fc
1,592
code_comprehend-006404689acbc37e
Which tests break after a small change? Here is the code. ```python def dedupe_food_bank_records(records: list[dict], field: str, default: object = None) -> list[dict]: """Keep the first food-bank record for each field value, using a default when the field is missing.""" seen = set() unique = [] for re...
code_comprehend
failing_test
pass
r3vc
r3vc:lists
{"failing": [], "shown": ["test_a", "test_b", "test_c", "test_d"], "edit": {"line": 6, "before": " value = record.get(field, default)", "after": " value = record.get(field, field)", "fn": "dedupe_food_bank_records", "op": "var", "unique": true}, "tests_orig": ["test_6", "test_4", "test_2", "test_5"], "ask...
plain
r3vc:vcode4-d36434cee99dde82
388
code_comprehend-00677410489bbfb8
<|start|><|user|> A teammate wrote this function. The tests after it state what it must do. ``` 1 from dataclasses import dataclass 2 3 type Matrix = list[list[float]] 4 5 6 @dataclass(slots=True) 7 class PmpuVent: 8 """Quarterly nonepoxide organic HAP emissions of one process vent, one row per quarte...
code_comprehend
spot_bug
bug
ol5
ol5:matrix_ops
{"bug_line": 33, "fix": " return sum(sum(e * w for e, w in zip(row, weights, strict=True)) for row in vent.emissions)", "buggy": " return sum(sum(e + w for e, w in zip(row, weights, strict=True)) for row in vent.emissions)", "tests_orig": ["test_add_elementwise", "test_group_load_scalar", "test_group_load_wrong_w...
chat
ol5:f83db3d67e07f4e5
993
code_comprehend-006de9bcacf2d9d5
This code ships with a few unit tests, shown after it. ```python def changed_contract_clause_keys(original_clauses: dict[str, str], revised_clauses: dict[str, str]) -> list[str]: """Return clause keys added, removed, or changed between two contract versions.""" changed = [] for key, original_value in origi...
code_comprehend
failing_test
2
r3vc
r3vc:dicts
{"failing": ["test_case_1", "test_case_2"], "shown": ["test_case_1", "test_case_2", "test_case_3", "test_case_4"], "edit": {"line": 8, "before": " if key not in original_clauses:", "after": " if key not in original_value:", "fn": "changed_contract_clause_keys", "op": "var", "unique": true}, "tests_orig": ...
plain
r3vc:vcode4-d911fa7b043e8e41
392
code_comprehend-006f2e63bb392be5
Check the code against its tests; there may be one wrong line. ``` 1: from datetime import date 2: 3: 4: def bus_schedule_iso_week_number(service_date: date) -> int: 5: """Return the ISO week number for a bus service date.""" 6: iso_parts = service_date.isocalendar() 7: week_lookup = dict(zip(("year", "wee...
code_comprehend
spot_bug
no_bug
r3vc
r3vc:dates
{"bug_line": null, "fix": null, "buggy": null, "tests_orig": ["test_1", "test_4", "test_5"]}
plain
r3vc:vcode4-a1b3c5990506c6df
302
code_comprehend-007004b597325600
### Task Which tests break after a small change? Here is the code. ```python def summarize_missing_permit_values(rows): """Count missing values in each permit-record column.""" counts = {} for row in rows: for column, value in row.items(): if column not in counts: counts...
code_comprehend
failing_test
fail
r3vc
r3vc:cleaning
{"failing": ["test_2", "test_3", "test_4"], "shown": ["test_1", "test_2", "test_3", "test_4", "test_5"], "edit": {"line": 6, "before": " if column not in counts:", "after": " if rows not in counts:", "fn": "summarize_missing_permit_values", "op": "var", "unique": true}, "tests_orig": ["test_2", "t...
qa
r3vc:vcode4-8af32f6aea81da19
316
code_comprehend-007668b192d97581
<|start|><|user|> The following implementation is missing a single line. ```python _RATES: dict[str, float] = {"wash": 1.0, "rinse": 0.6, "dry": 1.4} type BatchRecord = dict[str, str | float] def litres_of(record: BatchRecord) -> float: """Validate one solvent batch record and return its volume in litres.""" ...
code_comprehend
fill_line
C
ol5
ol5:match_mapping
{"letter": "C", "line": 32, "options": ["return litres_of(record) * rate_of(record)", "return litres_of(record) + rate_of(record)", "return litres_of(record) // rate_of(record)"], "checks": [["cost_of({'kind': 'rinse', 'litres': 10.0})", "16.0"], ["cost_of({'kind': 'dry', 'litres': 10.0})", "7.0"], ["batch_cost([])", "...
chat
ol5:f3976ed65bb7bbc2
803
code_comprehend-00790466df9192cc
A colleague wants to change one line of the following module. ```python MAX_N = 10_000 def index(value: int, name: str) -> None: if type(value) is not int: raise TypeError(f"{name} must be an integer, excluding bool") def domain(n: int) -> None: index(n, "n") if n < 0: raise ValueError(...
code_comprehend
failing_test
1
synth
synth:03-algorithms.combinatorics.factorials-binomial
{"failing": ["test_2"], "shown": ["test_1", "test_2", "test_3", "test_4"], "edit": {"line": 19, "before": " row = [1]", "after": " row = [0]", "fn": "pascal_row", "op": "const", "unique": true}, "tests_orig": ["test_2", "test_1", "test_8", "test_4"]}
plain
synth:03-algorithms.combinatorics.factorials-binomial/focused-sample:pascal_row
382
code_comprehend-007a9ea905b9249e
Query: Below is some Python code. ```python """A prefix trie over fire-safety lodging rate codes.""" from dataclasses import dataclass, field @dataclass(slots=True) class Node: """One trie node: an optional rate for a code ending here, plus children.""" rate: int | None = None children: dict[str, Node]...
code_comprehend
edit_output
raises
ol5
ol5:trie
{"expr": "build_schedule([('lodging', 120)])", "orig": "Node(rate=None, children={'lodging': Node(rate=120, children={})})", "new": "raises AttributeError", "edit": {"line": 28, "before": " add_code(root, code, nightly)", "after": " add_code(code, code, nightly)", "fn": "build_schedule", "op": "var", "uni...
qa
ol5:1e0b70c7da7a585f
648
code_comprehend-007b8a0963888e1a
Below is a Python module, its tests, and a one-line edit. Work out which tests fail once the edit is applied. ```python import re def mask_gate_board_numbers(board_text: str, token: str) -> tuple[str, int]: """Replace digit sequences on an airport gate board with a placeholder token. Raises TypeError if either a...
code_comprehend
failing_test
3+
r3vc
r3vc:strings
{"failing": ["test_1", "test_3", "test_4"], "shown": ["test_1", "test_2", "test_3", "test_4"], "edit": {"line": 8, "before": " masked, count = re.subn(r\"\\d+\", lambda match: token, board_text)", "after": " masked, count = re.subn(r\"\\d+\", lambda match: board_text, board_text)", "fn": "mask_gate_board_numbers"...
plain
r3vc:vcode4-0fa31ae21096bea7
447
code_comprehend-007cbfda5e68664d
### Task Fill in the missing line. The code: ```python from dataclasses import dataclass class ArithmeticLimit(ArithmeticError): """A stored or intermediate integer exceeds the selected magnitude width.""" class ResourceLimit(RuntimeError): """The computation needs more terms than the selected budget.""" ...
code_comprehend
fill_line
A
synth
synth:03-algorithms.numeric.continued-fractions
{"letter": "A", "line": 45, "options": ["ap, aq = a * p1, a + q1", "ap, aq = a * p1, a // q1", "ap, aq = a * p1, a * q1"], "checks": [["convergents((5,))", "((5, 6),)"], ["convergents((8,))", "((8, 9),)"], ["convergents((10,))", "((10, 11),)"], ["convergents((40,))", "((40, 41),)"], ["convergents((-8,))", "((-8, -7),)"...
qa
synth:03-algorithms.numeric.continued-fractions/focused-sample:convergents
792
code_comprehend-007d68ba23baea6c
Fill in the missing line. The code: ```python PRIMES = (5, 17, 257, 65537) KINDS = ("permutation", "all-affine") def integer(value: int, low: int, high: int, name: str) -> None: if type(value) is not int or not low <= value <= high: raise ValueError(f"{name} must be an integer in [{low},{high}]") def d...
code_comprehend
fill_line
B
synth
synth:02-data-structures.maps.universal-hashing
{"letter": "B", "line": 27, "options": ["return (a // key + b) % p", "return (a + key + b) % p", "return (a * key + b) % p"], "checks": [["field('permutation', 5, 1, 0, 1)", "2"], ["field('permutation', 17, 7, 3, 16)", "9"], ["field('permutation', 5, 1, 1, 1)", "3"], ["field('permutation', 5, 1, 1, 2)", "4"]], "target_...
plain
synth:02-data-structures.maps.universal-hashing/focused-sample:field
531
code_comprehend-0088439a8d17fc14
<|start|><|user|> The code below may have a one-line bug. The tests show the intended behavior. ``` 1 | from collections.abc import Sequence 2 | from math import isfinite 3 | 4 | 5 | def checked( 6 | a: Sequence[Sequence[float]], b: Sequence[float], x: Sequence[float] 7 | ) -> tuple[tuple[tuple[float, ...],...
code_comprehend
spot_bug
bug
synth
synth:03-algorithms.numeric.jacobi-iteration
{"bug_line": 38, "fix": " if not all(map(isfinite, new)):", "buggy": " if not all(map(isfinite, a)):", "tests_orig": ["test_1", "test_2", "test_4"]}
chat
synth:03-algorithms.numeric.jacobi-iteration/focused-sample:sweep
930
code_comprehend-00891a932f5e9d2e
<|start|><|user|> Your job: decide which tests would fail after a one-line edit. Code first. ```python MAX_N = 1_000_000 class ResourceLimitError(ValueError): """The requested exact calculation exceeds this educational workload.""" def integer(value: int, name: str, minimum: int, maximum: int) -> None: """...
code_comprehend
failing_test
none
synth
synth:03-algorithms.numeric.divisor-power-sums
{"failing": [], "shown": ["test_a", "test_b", "test_c", "test_d"], "edit": {"line": 26, "before": " factors[candidate] = factors.get(candidate, 0) + 1", "after": " factors[candidate] = factors.get(remaining, 0) + 1", "fn": "factor", "op": "var", "unique": true}, "tests_orig": ["test_2", "test_6", ...
chat
synth:03-algorithms.numeric.divisor-power-sums/focused-sample:factor
494
code_comprehend-008ae7a777013b80
Given the module that follows, reason about how one edit changes a result. ```python from __future__ import annotations from fractions import Fraction from math import factorial, isfinite from typing import Literal Number = Fraction | float Mode = Literal["exact", "float"] MAX_BITS = 4096 class SplineError(ValueErr...
code_comprehend
edit_output
unchanged
synth
synth:03-algorithms.approximation.cubic-splines
{"expr": "convert(7, 'exact')", "orig": "Fraction(7, 1)", "new": "Fraction(7, 1)", "edit": {"line": 33, "before": " if type(value) not in (int, float) and not isinstance(value, Fraction):", "after": " if type(value) not in (int, float) and not isinstance(mode, Fraction):", "fn": "convert", "op": "var", "unique": ...
plain
synth:03-algorithms.approximation.cubic-splines/focused-sample:convert
482
code_comprehend-008beea8fdf70084
<|start|><|user|> Example: Here is a function and the tests it is supposed to pass. Is there a bug? ``` 1 | def truncate_hardware_text_at_word(text: str, max_length: int, ellipsis: str = "…") -> str: 2 | """Truncate text at a word boundary and append an ellipsis.""" 3 | if max_length < 0: 4 | rais...
code_comprehend
spot_bug
bug
ol5
ol5:sparse_vector
{"bug_line": 21, "fix": " return {i: value * factor for i, value in vec.items() if value * factor != 0.0}", "buggy": " return {i: value + factor for i, value in vec.items() if value * factor != 0.0}", "tests_orig": ["test_scale_drops_zeros", "test_add_sums_shared_indices_and_keeps_union", "test_scale_multiplies_a...
chat
ol5:f075e32d181495ed
1,383
code_comprehend-008fede49369c75f
The module below currently passes all of its tests. ``` 1 | def classify_era(year: int) -> str: 2 | """Return the era label used by the archive for a work's year.""" 3 | if year < 1500: 4 | return "ancient" 5 | if year < 1800: 6 | return "classical" 7 | if year < 1900: 8 | ...
code_comprehend
failing_test
3+
ol5
ol5:parametrized_cases
{"failing": ["test_a", "test_b", "test_c", "test_d"], "shown": ["test_a", "test_b", "test_c", "test_d"], "edit": {"line": 23, "before": " if title in self._years:", "after": " if title not in self._years:", "fn": "WorksLedger.add_work", "op": "cmp", "unique": true}, "tests_orig": ["test_duplicate_add_rais...
plain
ol5:35f1085e3755532d
1,042
code_comprehend-00932d6460e11fb3
Is this implementation correct? Task description: We keep steel poles on site and need a tiny calibration module named `poles.py`. Write a dataclass `Pole` with slots and two float fields `length_m` and `diameter_cm`, a function `capacity(pole: Pole) -> float`, and a function `calibration_failures(cases: list[tuple[P...
code_comprehend
spot_bug
no_bug
ol5
ol5:parametrized_cases
{"bug_line": null, "fix": null, "buggy": null, "tests_orig": ["test_default_table_has_no_failures", "test_capacity_is_rounded_to_two_decimals"]}
plain
ol5:0725c7b9999101b0
913
code_comprehend-0096a47ec70c8a0c
Instruction: You are reviewing a one-line change to this Python code. ``` 1: def split_dental_patient_name(full_name: str, suffixes: tuple[str, ...] = ('Jr.', 'Sr.', 'II', 'III', 'IV')) -> tuple[str, str, str, str]: 2: """Split a patient's full name into given, middle, family, and suffix parts. 3: 4: Args:...
code_comprehend
failing_test
1
r3vc
r3vc:cleaning
{"failing": ["test_3"], "shown": ["test_1", "test_2", "test_3", "test_4", "test_5", "test_6"], "edit": {"line": 18, "before": " if tokens and any(tokens[-1].rstrip('.').casefold() == item.rstrip('.').casefold() for item in suffixes):", "after": " if tokens and any(tokens[-1].lstrip('.').casefold() == item.rstrip(...
qa
r3vc:vcode4-d0afb02698787a59
976
code_comprehend-00983ef1cc3a10e3
Read the code and its tests, then predict the effect of an edit on the test results. ```python class Lightship: """A moored vessel that marks a channel with a fixed light.""" def __init__( self, name: str, *, lamps: int = 2, candela: float = 5000.0, fog_signal: ...
code_comprehend
failing_test
1
ol5
ol5:keyword_only
{"failing": ["test_toggle_light_flips_and_returns_state"], "shown": ["test_fog_signal_tail", "test_toggle_light_flips_and_returns_state", "test_lamp_floor", "test_fog_signal_appends_suffix", "test_candela_floor_in_constructor"], "edit": {"line": 22, "before": " self._fog_signal = fog_signal", "after": " s...
plain
ol5:5834d58f89660ffc
850
code_comprehend-009a4c8581417d75
[Task] Below is some Python code. ``` 1: """Trait masks for cynara plants, stored as plain ints.""" 2: 3: _TRAITS: tuple[str, ...] = ("spiny", "purple", "round", "tall", "wide") 4: _BIT: dict[str, int] = {name: 1 << index for index, name in enumerate(_TRAITS)} 5: 6: 7: def trait_mask(names: list[str]) -> int: ...
code_comprehend
edit_output
unchanged
ol5
ol5:bitset
{"expr": "trait_names(22)", "orig": "['purple', 'round', 'wide']", "new": "['purple', 'round', 'wide']", "edit": {"line": 10, "before": " for name in names:", "after": " for name in mask:", "fn": "trait_mask", "op": "var", "unique": true}}
qa
ol5:5a7266dff2458fc6
406
code_comprehend-009b6538ce4f7822
<|start|><|user|> Here is a Python function and a call with its current result. Predict the result after a one-line change. ```python import math def food_bank_supply_cycle_lcm(limit: int) -> int: """Return the least common multiple of the positive integers from 1 through limit.""" if limit < 1: rais...
code_comprehend
edit_output
changed
r3vc
r3vc:math
{"expr": "food_bank_supply_cycle_lcm(1)", "orig": "1", "new": "0", "edit": {"line": 8, "before": " result = 1", "after": " result = 0", "fn": "food_bank_supply_cycle_lcm", "op": "const", "unique": true}}
chat
r3vc:vcode4-834b7922c85ac829
216
code_comprehend-009d83457aa4ee6c
Look at this implementation and the tests that cover it. ``` 1: from fractions import Fraction 2: 3: MAX_BITS = 256 4: 5: 6: class ResourceLimitError(ValueError): 7: """The requested exact computation exceeds the educational budget.""" 8: 9: 10: def canonical(values: tuple[Fraction, ...]) -> tuple[Fractio...
code_comprehend
failing_test
2
synth
synth:03-algorithms.approximation.chebyshev-polynomials
{"failing": ["test_3", "test_4"], "shown": ["test_1", "test_2", "test_3", "test_4"], "edit": {"line": 18, "before": " while end > 1 and values[end - 1] == 0:", "after": " while end <= 1 and values[end - 1] == 0:", "fn": "canonical", "op": "cmp", "unique": true}, "tests_orig": ["test_3", "test_4", "test_2", "test_...
plain
synth:03-algorithms.approximation.chebyshev-polynomials/focused-sample:canonical
578
code_comprehend-00a2f761fefa522a
Task: A colleague wants to change one line of the following module. ``` 1 | from dataclasses import dataclass 2 | from typing import Literal 3 | 4 | type PassageMode = Literal["air", "light"] 5 | 6 | 7 | @dataclass(slots=True) 8 | class Aperture: 9 | """A gap in a solid boundary, measured in metres.""" 10...
code_comprehend
failing_test
3+
ol5
ol5:overload_literal
{"failing": ["test_total_passage_sums", "test_light_passage_uses_low_factor", "test_passage_light_factor"], "shown": ["test_negative_height_rejected", "test_aperture_rejects_negative_height", "test_total_passage_empty", "test_total_passage_sums", "test_light_passage_uses_low_factor", "test_air_passage_uses_high_factor"...
qa
ol5:9d0836e298375efb
836
code_comprehend-00aa2291fe508af3
<|start|><|user|> This code ships with a few unit tests, shown after it. ```python def museum_ticket_interest_schedule(principal: float, annual_rate: float, periods: int, periods_per_year: int = 1) -> list[float]: """Return the balance after each period of simple interest. The annual rate is a decimal, and ea...
code_comprehend
failing_test
pass
r3vc
r3vc:money_units
{"failing": [], "shown": ["check_1", "check_2", "check_3", "check_4", "check_5", "check_6"], "edit": {"line": 10, "before": " period_interest = principal * annual_rate / periods_per_year", "after": " period_interest = principal * annual_rate // periods_per_year", "fn": "museum_ticket_interest_schedule", "op": "ar...
chat
r3vc:vcode4-fd4f7dad107c7428
602
code_comprehend-00ad625f39ea2a27
Query: Complete the code: exactly one line is missing. ```python def lowest_lab_sample_unit_price(samples: list[tuple[str, float, float]]) -> tuple[str, float]: """Find the lab sample with the lowest price per unit. Args: samples: Records of sample name, quantity, and total price. Returns: ...
code_comprehend
fill_line
B
r3vc
r3vc:money_units
{"letter": "B", "line": 20, "options": ["return quantity, best_unit_price", "return best_name, best_unit_price", "return best_unit_price, best_unit_price"], "checks": [["lowest_lab_sample_unit_price([('water', 2, 6), ('soil', 3, 6)])", "('soil', 2.0)"], ["lowest_lab_sample_unit_price([('single', 1, 5)])", "('single', 5...
qa
r3vc:vcode4-6137ca0b8faa5b11
502
code_comprehend-00b0bb93f7d17050
Question: This code is incomplete by one line. ```python from collections.abc import Iterable from enum import Enum from itertools import accumulate class Speed(Enum): """Beater speed settings and their crank turns per minute.""" SLOW = 20 MEDIUM = 45 FAST = 80 def _rate(speed: Speed) -> int: ...
code_comprehend
fill_line
A
ol5
ol5:prefix_sums
{"letter": "A", "line": 42, "options": ["before = prefix[start - 1] if start >= 0 else 0", "before = prefix[start - 1] if start > 0 else 0", "before = prefix[start - 1] if start < 0 else 0", "before = prefix[start - 1] if start <= 0 else 0"], "checks": [["turns_between([160, 240, 480], 2, 2)", "0"], ["turns_between([20...
qa
ol5:77e4577794914e91
592
code_comprehend-00b4e4e545fd2a56
Which line belongs in the gap? First, the code: ```python def build_gradebook(students, grades, default_grade="N/A"): """Pair student names with grades, using a default when a grade is missing.""" gradebook = {} ... # <- fill in this line if index < len(grades): gradebook[student] = gr...
code_comprehend
fill_line
A
r3vc
r3vc:lists
{"letter": "A", "line": 4, "options": ["for index, student in enumerate(students):", "for index, student in enumerate(gradebook):", "for index, student in enumerate(grades):"], "checks": [["build_gradebook([], [])", "{}"], ["build_gradebook(['Alice'], [100])", "{'Alice': 100}"], ["build_gradebook(['Alice', 'Bob'], [90]...
plain
r3vc:vcode4-ddd514101e8a4d1c
294
code_comprehend-00b5438094c3d4c9
[Task] You are reviewing a one-line change to this Python code. ``` 1 """One-pass statistics over a lather bubble log.""" 2 3 from collections.abc import Iterable, Iterator 4 from pathlib import Path 5 6 7 def bubble_sizes(log: Path) -> Iterator[int]: 8 """Yield each lather bubble width in micrometres...
code_comprehend
failing_test
3+
ol5
ol5:reservoir_free_stats
{"failing": ["test_bubble_sizes_preserves_order", "test_non_positive_line_raises", "test_bubble_sizes_bad_line"], "shown": ["test_empty_stream_raises", "test_bubble_sizes_preserves_order", "test_non_positive_line_raises", "test_lather_stats_empty", "test_bubble_sizes_bad_line", "test_lather_stats_single_value"], "edit"...
qa
ol5:9734503a796b3eac
1,176
code_comprehend-00b705d12c6d25c7
Example: This code should pass the tests shown after it. It may contain a one-line bug. ``` 1: def duplicate_manifest_tracking_keys(manifest: dict[str, str], min_keys: int = 2) -> dict[str, list[str]]: 2: """Find tracking values associated with at least the requested number of manifest keys. 3: 4: Args: ...
code_comprehend
spot_bug
no_bug
r3vc
r3vc:dates
{"bug_line": null, "fix": null, "buggy": null, "tests_orig": ["test_3", "test_4", "test_5", "test_6", "test_7"]}
plain
r3vc:vcode4-db3dca97046347a4
1,125
code_comprehend-00bf4db8b2d20823
Take a look at this function. ```python def newsletter_adjacent_subscriber_products(counts: list[str]) -> int: """Sum the products of adjacent subscriber counts after trimming whitespace. Args: counts: Numeric subscriber counts represented as strings. Returns: The sum of products for all ...
code_comprehend
edit_output
raises
r3vc
r3vc:lists
{"expr": "newsletter_adjacent_subscriber_products(['7'])", "orig": "0", "new": "raises NameError", "edit": {"line": 11, "before": " return sum(left * right for left, right in zip(numbers, numbers[1:]))", "after": " return sum(left * right for left, right in zip(count, numbers[1:]))", "fn": "newsletter_adjacent_su...
plain
r3vc:vcode4-8182d9e2a88ec511
271
code_comprehend-00c9449d6dc64299
A line is missing from the function below. ```python """Walk a tree of martensite laths.""" from dataclasses import dataclass, field @dataclass(slots=True) class Lath: """A martensite subunit and the subunits nested inside it.""" name: str children: list[Lath] = field(default_factory=list) def depth_...
code_comprehend
fill_line
A
ol5
ol5:tree_recursive
{"letter": "A", "line": 18, "options": ["return 1 + max(depth_of(child) for child in node.children)", "return 0 + max(depth_of(child) for child in node.children)", "return 2 + max(depth_of(child) for child in node.children)"], "checks": [["depth_of(Lath(name='plate', children=[]))", "1"], ["depth_of(Lath(name='leaf', c...
plain
ol5:f417f9e1dbb000ce
448
code_comprehend-00d46a18de014c6c
Check this implementation against its specification. Specification: For a records-office audit we must decide which record series to keep when the archive shelf space is tight. Define a dataclass `Record` (fields `code: str`, `volume: int`, `score: int`, slots) and a function `select(records: list[Record], capacity: ...
code_comprehend
spot_bug
bug
ol5
ol5:dp_knapsack
{"bug_line": 25, "fix": " table[i][space] = best", "buggy": " table[i][space] = count", "tests_orig": ["test_best_combination_is_selected", "test_everything_fits_when_capacity_is_large", "test_select_rejects_negative_volume"]}
plain
ol5:00560eb641fadf48
837
code_comprehend-00d78fc8e8444051
<|start|><|user|> Given the module that follows, reason about how one edit changes a result. ```python def diff_tax_price_lists(old_prices: list[float], new_prices: list[float]) -> list[float]: """Calculate item-by-item price changes for a tax worksheet. Raises ValueError if the lists have different lengths or con...
code_comprehend
edit_output
raises
r3vc
r3vc:dicts
{"expr": "diff_tax_price_lists([0], [0])", "orig": "[0]", "new": "raises ValueError", "edit": {"line": 9, "before": " if isinstance(new, bool) or not isinstance(new, (int, float)):", "after": " if isinstance(new, bool) or isinstance(new, (int, float)):", "fn": "diff_tax_price_lists", "op": "drop_not", "un...
chat
r3vc:vcode4-f866b1dce12515aa
393
code_comprehend-00d8fcff3dd9ee37
Request: Your job: decide which tests would fail after a one-line edit. Code first. ```python """Validated chair records for a small furniture workshop.""" from dataclasses import dataclass @dataclass class Chair: """A seat described by material, leg count and weight in kilograms.""" material: str legs...
code_comprehend
failing_test
none
ol5
ol5:input_validation
{"failing": [], "shown": ["test_bad_weight_raises_value_error", "test_load_rating", "test_low_legs_raises_value_error", "test_bool_legs_raises_type_error"], "edit": {"line": 21, "before": " if self.weight_kg <= 0:", "after": " if self.weight_kg <= 1:", "fn": "Chair.__post_init__", "op": "const", "unique":...
qa
ol5:c0c78a8ead213654
648
code_comprehend-00dc1d81423e98ae
Check the code against its tests; there may be one wrong line. ``` 1 | from bisect import bisect_left, bisect_right 2 | from enum import IntEnum 3 | 4 | 5 | class Level(IntEnum): 6 | """Approval tiers, ordered from least to most senior.""" 7 | 8 | CLERK = 1 9 | SUPERVISOR = 2 10 | DIRECTOR = 3...
code_comprehend
spot_bug
bug
ol5
ol5:binary_search
{"bug_line": 35, "fix": " return self._levels[i - 1]", "buggy": " return self._levels[i + 1]", "tests_orig": ["test_exact_match_routes_to_threshold", "test_floor_for_unknown_tier_rejected", "test_floor_for_returns_least_amount_for_level", "test_add_rejects_less_senior_tier_after_existing_threshold"]}
plain
ol5:f2976bb9f4f55384
1,022
code_comprehend-00e0705b1946002b
### Task Here is a Python function and a call with its current result. Predict the result after a one-line change. ```python def calculate_hardware_cart_tax(items: list[tuple[str, float]], tax_rate: float = 0.08) -> dict[str, float]: """Calculate the subtotal, sales tax, and total for a hardware cart. Args: ...
code_comprehend
edit_output
unchanged
r3vc
r3vc:money_units
{"expr": "calculate_hardware_cart_tax([('bolt', 1.0)])", "orig": "{'subtotal': 1.0, 'tax': 0.08, 'total': 1.08}", "new": "{'subtotal': 1.0, 'tax': 0.08, 'total': 1.08}", "edit": {"line": 15, "before": " if price < 0:", "after": " if price <= 0:", "fn": "calculate_hardware_cart_tax", "op": "cmp", "unique":...
qa
r3vc:vcode4-1a6e19291bc812c2
497
code_comprehend-00e1c2990b59da1d
<|start|><|user|> Look at this implementation and the tests that cover it. ``` 1 | from dataclasses import dataclass, replace 2 | from typing import Protocol, Self 3 | 4 | 5 | class Directive(Protocol): 6 | """A leadership item that can produce a revised copy.""" 7 | 8 | label: str 9 | priority: i...
code_comprehend
failing_test
3+
ol5
ol5:dataclass_replace
{"failing": ["test_note_is_added", "test_none_note_keeps_notes", "test_both_satisfy_protocol"], "shown": ["test_note_is_added", "test_note_appended", "test_original_unchanged", "test_none_note_keeps_notes", "test_both_satisfy_protocol", "test_priority_out_of_range_raises"], "edit": {"line": 45, "before": " notes...
chat
ol5:0ce5958745a1ca74
1,164
code_comprehend-00e76f191ec4aef1
This code should pass the tests shown after it. It may contain a one-line bug. ``` 1: from __future__ import annotations 2: from dataclasses import dataclass 3: 4: 5: class Malformed(ValueError): 6: """The input has no interpretation under this contract.""" 7: 8: 9: class ResourceLimit(RuntimeError): 10: ...
code_comprehend
spot_bug
no_bug
synth
synth:03-algorithms.finite-fields.binary-tensor-decompositions
{"bug_line": null, "fix": null, "buggy": null, "tests_orig": ["test_3", "test_4", "test_5"]}
plain
synth:03-algorithms.finite-fields.binary-tensor-decompositions/focused-sample:convolution
1,093
code_comprehend-00ebb6a5f05df2cb
### Task Your job: decide which tests would fail after a one-line edit. Code first. ```python def gate_board_convert_distance(value: float, from_unit: str, to_unit: str) -> float: """Convert a gate-board distance between supported units. Raises ValueError if either unit is unsupported.""" meters_per_unit = {"m...
code_comprehend
failing_test
1
r3vc
r3vc:money_units
{"failing": ["check_2"], "shown": ["check_1", "check_2", "check_3", "check_4"], "edit": {"line": 8, "before": " if converted == int(converted):", "after": " if converted != int(converted):", "fn": "gate_board_convert_distance", "op": "cmp", "unique": true}, "tests_orig": ["test_2", "test_1", "test_6", "test_5"]}
qa
r3vc:vcode4-86f29d8f837d2a6a
568
code_comprehend-00ed488fc419e494
<|start|><|user|> The code below may have a one-line bug. The tests show the intended behavior. ``` 1 | import re 2 | 3 | 4 | def parse_federal_rule_citation(citation: str, citation_prefix: str = 'Fed. R. Civ. P.') -> tuple[str, tuple[str, ...]]: 5 | """Parse a rule citation into its rule number and subdivisi...
code_comprehend
spot_bug
bug
r3vc
r3vc:legal_citations
{"bug_line": 7, "fix": " if not match or match.group(1) != citation_prefix:", "buggy": " if not match or match.group(0) != citation_prefix:", "tests_orig": ["test_1", "test_4", "test_6"]}
chat
r3vc:vcode4-c75263b9d449c980
411
code_comprehend-00f772f471de086a
A colleague wants to change one line of the following module. ``` 1: from datetime import datetime 2: 3: 4: def effective_date_to_iso(date_text): 5: """Convert a recognized Effective Date string to ISO date format.""" 6: formats = ("%Y-%m-%d", "%m/%d/%Y", "%B %d, %Y", "%b %d, %Y") 7: for date_format...
code_comprehend
failing_test
pass
r3vc
r3vc:legal_dates
{"failing": ["test_1", "test_3", "test_4"], "shown": ["test_1", "test_2", "test_3", "test_4"], "edit": {"line": 7, "before": " for date_format in formats:", "after": " for date_format in date_text:", "fn": "effective_date_to_iso", "op": "var", "unique": true}, "tests_orig": ["test_2", "test_5", "test_4", "test_3"...
plain
r3vc:vcode4-717d3ff2fc5b3893
420
code_comprehend-00fabd18de3a2368
Request: A colleague wants to change one line of the following module. ```python class HandleAssembly: """Tracks which parts of a tool handle are fastened together.""" def __init__(self) -> None: """Start with no parts and no links.""" self._links: dict[str, set[str]] = {} def add_part(se...
code_comprehend
failing_test
3+
ol5
ol5:connected_components
{"failing": ["test_links_join_transitively", "test_single_part_component", "test_summary_ordering_and_undirection"], "shown": ["test_empty_summary", "test_links_join_transitively", "test_single_part_component", "test_summary_ordering_and_undirection", "test_empty_assembly_summary", "test_link_with_missing_part_raises_k...
qa
ol5:eda4318db27fc028
962
code_comprehend-00feff846e09118e
<|start|><|user|> Check this implementation against its specification. The request: I'm cataloguing a tray of tomatoes and want to track which rows hold ripe fruit without gaps or overlaps. Write an immutable dataclass `Interval` with integer fields `start` and `end` (end-exclusive), plus two functions: `add_interval...
code_comprehend
spot_bug
bug
ol5
ol5:interval_list
{"bug_line": 14, "fix": " if window.start < 0 or window.end < window.start:", "buggy": " if window.start < 0 and window.end < window.start:", "tests_orig": ["test_invalid_bounds", "test_total_covered", "test_add_merges_overlapping_chain"]}
chat
ol5:2fae839717e26657
899
code_comprehend-010290b3fc3aa574
Request: The module below currently passes all of its tests. ```python from collections import Counter def most_common_garden_value_by_group(entries: list[tuple[str, str]]) -> dict[str, str]: """Return the most frequent recorded value for each garden group.""" counts_by_group = {} for group, value in ent...
code_comprehend
failing_test
fail
r3vc
r3vc:dicts
{"failing": ["test_1", "test_2", "test_3", "test_4", "test_5"], "shown": ["test_1", "test_2", "test_3", "test_4", "test_5", "test_6"], "edit": {"line": 7, "before": " for group, value in entries:", "after": " for group, value in counts_by_group:", "fn": "most_common_garden_value_by_group", "op": "var", "unique": ...
qa
r3vc:vcode4-64a2dbb5127f6228
523
code_comprehend-0104427c3b66b9e0
### Task Code review: the tests define the expected behavior. ``` 1 import re 2 3 4 def school_timetable_duration_minutes(duration): 5 """Parse a duration written as hour and minute units into total minutes. 6 7 Args: 8 duration: A string such as '2h 15m', containing nonnegative hour and m...
code_comprehend
spot_bug
no_bug
r3vc
r3vc:dates
{"bug_line": null, "fix": null, "buggy": null, "tests_orig": ["test_1", "test_3", "test_5"]}
qa
r3vc:vcode4-ca70b2bb0439364e
517
code_comprehend-01059adc80a86d73
Question: An implementation was written for the following request. The request: Write a small module for paisley-inspired sparse vectors. Define an enum named `PaisleyOp` with members `DOT` and `SUM`, and a public function `apply_paisley(op: PaisleyOp, left: dict[int, float], right: dict[int, float]) -> float | dict[...
code_comprehend
spot_bug
no_bug
ol5
ol5:sparse_vector
{"bug_line": null, "fix": null, "buggy": null, "tests_orig": ["test_inputs_unchanged", "test_dot_no_shared_nonzero", "test_sum_merge_and_zero_omission", "test_inputs_not_mutated"]}
qa
ol5:4920470aee1552f4
1,166
code_comprehend-01060930881a95f7
[Task] Which line belongs in the gap? First, the code: ```python def normalize_bakery_phone(phone: str, strip_country_code: bool = False) -> str: """Return a bakery order phone number as digits only, optionally removing a leading U.S. country code.""" digits = "".join(char for char in phone if char.isdigit()) ...
code_comprehend
fill_line
B
r3vc
r3vc:cleaning
{"letter": "B", "line": 4, "options": ["if char and len(digits) == 11 and digits.startswith(\"1\"):", "if strip_country_code and len(digits) == 11 and digits.startswith(\"1\"):", "if digits and len(digits) == 11 and digits.startswith(\"1\"):"], "checks": [["normalize_bakery_phone('(212) 555-0198')", "'2125550198'"], ["...
qa
r3vc:vcode4-0b17b5f5b152f2c9
420
code_comprehend-010a5200c46bf8d9
Request: Code review: compare the implementation to the spec. Spec: For our classical-architecture catalogue I need a small module about the triangular gable above a temple colonnade and the relief figures placed along its base. Define a dataclass `Relief` with fields `name: str` and `base: float`, where `base` is th...
code_comprehend
spot_bug
no_bug
ol5
ol5:bucket_sort
{"bug_line": null, "fix": null, "buggy": null, "tests_orig": ["test_empty_input", "test_out_of_range_raises", "test_negative_raises", "test_equal_bases_keep_input_order", "test_sorts_left_to_right_by_base"]}
qa
ol5:7d0879145731e248
817
code_comprehend-010d8cbfd5240bba
[Task] Code review: the tests define the expected behavior. ``` 1: from datetime import date 2: 3: 4: def invoice_age_in_years(birth_date: date, on_date: date, days_per_year: float = 365.2425) -> float: 5: """Calculate age in years on the specified invoice date, rounded to two decimal places. Raises ValueErro...
code_comprehend
spot_bug
no_bug
r3vc
r3vc:dates
{"bug_line": null, "fix": null, "buggy": null, "tests_orig": ["test_1", "test_2", "test_3", "test_5", "test_6"]}
qa
r3vc:vcode4-8effbcec2a7d95ef
607
code_comprehend-01104118d630eb7c
Question: A colleague wants to change one line of the following module. ```python from functools import reduce from operator import xor class CodecError(ValueError): """Atomic failure with a shared-contract kind and byte offset.""" def __init__(self, kind: str, offset: int = 0): self.kind = kind ...
code_comprehend
failing_test
1
synth
synth:04-formats.compression-integrity.error-correcting-codes
{"failing": ["check_3"], "shown": ["check_1", "check_2", "check_3", "check_4", "check_5"], "edit": {"line": 32, "before": " word ^= 1 << (7 - syndrome) if syndrome else 128", "after": " word ^= 0 << (7 - syndrome) if syndrome else 128", "fn": "decode_hamming", "op": "const", "unique": true}, "test...
qa
synth:04-formats.compression-integrity.error-correcting-codes/focused-sample:decode_hamming
708
code_comprehend-01105cf8108238db
Request: Review this code. The tests below describe the intended behavior; at most one line is wrong. ``` 1: LIMIT = (1 << 63) - 1 2: 3: 4: def integer(value: int, minimum: int = 0) -> None: 5: if type(value) is not int and value < minimum: 6: raise ValueError("invalid integer") 7: if value > LI...
code_comprehend
spot_bug
bug
synth
synth:02-data-structures.graphs-heaps.block-compressed-sparse-row
{"bug_line": 5, "fix": " if type(value) is not int or value < minimum:", "buggy": " if type(value) is not int and value < minimum:", "tests_orig": ["test_2", "test_3", "test_4", "test_7"]}
qa
synth:02-data-structures.graphs-heaps.block-compressed-sparse-row/focused-sample:product
351
code_comprehend-0112529a15db7699
Task: Read the code and its tests, then predict the effect of an edit on the test results. ```python class UnresolvedError(RuntimeError): """No residue was obtained within the available resources.""" def _integer(value: int, name: str) -> None: if type(value) is not int: raise TypeError(f"{name} must...
code_comprehend
failing_test
fail
synth
synth:03-algorithms.numeric.modular-exponentiation
{"failing": ["test_case_1", "test_case_2", "test_case_3", "test_case_4", "test_case_6"], "shown": ["test_case_1", "test_case_2", "test_case_3", "test_case_4", "test_case_5", "test_case_6"], "edit": {"line": 13, "before": " if modulus <= 0:", "after": " if modulus >= 0:", "fn": "_domain", "op": "cmp", "unique": tr...
qa
synth:03-algorithms.numeric.modular-exponentiation/focused-sample:multiply_mod
535
code_comprehend-01226966d0fb645f
Instruction: Here is some Python code together with a short test suite. ```python def sort_contract_clauses(clauses, max_length): """Sort contract clauses by title and numeric section, then return at most the requested number.""" if max_length < 0: raise ValueError("maximum length must be nonnegative")...
code_comprehend
failing_test
none
r3vc
r3vc:legal_citations
{"failing": [], "shown": ["test_1", "test_2", "test_3", "test_4", "test_5", "test_6"], "edit": {"line": 3, "before": " if max_length < 0:", "after": " if max_length < 1:", "fn": "sort_contract_clauses", "op": "const", "unique": true}, "tests_orig": ["test_3", "test_5", "test_6", "test_7", "test_1", "test_4"]}
qa
r3vc:vcode4-1523ae5f49eff18d
553
code_comprehend-0123d2ee07e7e083
[Task] Trace the effect of an edit on a function call. Start with the code: ```python """Order the steps of a dowel-joint assembly.""" from graphlib import CycleError, TopologicalSorter def _check_unknown(steps: dict[str, set[str]]) -> None: """Raise ValueError if a dependency names a step that does not exist."...
code_comprehend
edit_output
raises
ol5
ol5:graphlib
{"expr": "assembly_order({'cut dowel': set(), 'drill holes': {'cut dowel'}, 'glue': {'drill holes'}})", "orig": "['cut dowel', 'drill holes', 'glue']", "new": "raises ValueError", "edit": {"line": 11, "before": " if unknown:", "after": " if not unknown:", "fn": "_check_unknown", "op": "add_not", "unique":...
qa
ol5:6ff98ae287fe2fb9
441
code_comprehend-01243232ae29036f
Query: Below is a Python module, its tests, and a one-line edit. Work out which tests fail once the edit is applied. ``` 1 | from collections.abc import Sequence 2 | 3 | MIN64 = -(1 << 63) 4 | MAX64 = (1 << 63) - 1 5 | 6 | 7 | def integer(value: int, low: int, high: int) -> int: 8 | """Reject bool as well ...
code_comprehend
failing_test
none
synth
synth:01-foundations.mathematics.recurrences
{"failing": [], "shown": ["test_1", "test_2", "test_3", "test_4", "test_5", "test_6", "test_7"], "edit": {"line": 26, "before": " for value in c + a:", "after": " for value in coefficients + a:", "fn": "arrays", "op": "var", "unique": true}, "tests_orig": ["test_3", "test_8", "test_4", "test_5", "test_1", "test_7...
qa
synth:01-foundations.mathematics.recurrences/focused-sample:prefix
1,087
code_comprehend-01278b3765bc0c2a
<|start|><|user|> Study the code below; a single line will be edited. ```python def playlist_time_to_24_hour(time_text: str, period: str = "AM") -> str: """Convert a playlist time in 12-hour notation to 24-hour notation.""" parts = time_text.split(":") if len(parts) != 2 or period.upper() not in {"AM", "PM...
code_comprehend
edit_output
changed
r3vc
r3vc:dates
{"expr": "playlist_time_to_24_hour('1:01', 'am')", "orig": "'01:01'", "new": "'02:01'", "edit": {"line": 9, "before": " hour = hour % 12 + (12 if period.upper() == \"PM\" else 0)", "after": " hour = hour % 12 + (12 if period.upper() == \"PM\" else 1)", "fn": "playlist_time_to_24_hour", "op": "const", "unique": tr...
chat
r3vc:vcode4-3435ca90503ba4d3
361
code_comprehend-012e70eded5edb7b
### Task Given the module that follows, reason about how one edit changes a result. ``` 1: def make_recipe_pascal_row(row_index: int) -> list[int]: 2: """Build a row of Pascal's triangle for a recipe app. 3: 4: The first row has index zero. Negative indices raise ValueError. 5: """ 6: if row_inde...
code_comprehend
edit_output
changed
r3vc
r3vc:math
{"expr": "make_recipe_pascal_row(2)", "orig": "[1, 2, 1]", "new": "[0, 1, 1]", "edit": {"line": 10, "before": " next_row = [1]", "after": " next_row = [0]", "fn": "make_recipe_pascal_row", "op": "const", "unique": true}}
qa
r3vc:vcode4-a85e7deec39f9ade
319
code_comprehend-01354e7b32ddc469
<|start|><|user|> Example: A colleague wants to change one line of the following module. ```python def apply_garage_percent_discounts(base_fee: float, discounts: list[float], minimum_charge: float = 0.0) -> float: """Apply parking garage discounts one after another, subject to a minimum charge. Args: ...
code_comprehend
failing_test
3+
r3vc
r3vc:dicts
{"failing": ["test_2", "test_3", "test_5"], "shown": ["test_1", "test_2", "test_3", "test_4", "test_5"], "edit": {"line": 12, "before": " if previous[key] != current[key]:", "after": " if previous[key] != current[changed]:", "fn": "changed_bank_statement_keys", "op": "var", "unique": true}, "tests...
chat
r3vc:vcode4-aad018852d1a81e6
1,633
code_comprehend-013af4a83c842fcd
This code is incomplete by one line. ```python """Validator pipeline for zoning applications.""" from collections.abc import Iterable, Iterator from dataclasses import dataclass from itertools import chain @dataclass(slots=True) class Application: """One zoning application as filed.""" parcel_id: str z...
code_comprehend
fill_line
B
ol5
ol5:generator_pipeline
{"letter": "B", "line": 42, "options": ["limit, min_parking = app", "limit, min_parking = limits", "limit, min_parking = tagged"], "checks": [["validate([Application(parcel_id='P-1', zone='RES', height_m=15.0, area_m2=500.0, parking=3)])", "['P-1: height 15.0 exceeds 12.0 m in zone RES']"], ["validate([Application(parc...
plain
ol5:97de43b273e90c7b
854
code_comprehend-013dc62c8919162c
<|start|><|user|> You are reviewing a one-line change to this Python code. ``` 1 """Parse placental-mammal survey rows, skipping damaged records.""" 2 3 from collections.abc import Iterable 4 from dataclasses import dataclass 5 6 7 @dataclass(slots=True) 8 class Mammal: 9 """One surveyed eutherian s...
code_comprehend
failing_test
3+
ol5
ol5:error_recovery
{"failing": ["test_empty_name_is_skipped", "test_skips_wrong_field_count", "test_skips_empty_name", "test_non_integer_numbers_are_skipped", "test_keeps_good_rows_and_counts_skips", "test_blank_and_malformed_rows_are_skipped", "test_good_rows_survive_bad_neighbours", "test_skips_blank_rows"], "shown": ["test_empty_name_...
chat
ol5:cb389c5401a16ebb
1,041
code_comprehend-013dddde35fa232e
Q: Consider this implementation. ```python """Longest stretch of river gauge readings allowed by a flow rule.""" from dataclasses import dataclass from typing import Protocol class StageRule(Protocol): """A rule that accepts or rejects a running total.""" def accepts(self, total: float) -> bool: ""...
code_comprehend
edit_output
unchanged
ol5
ol5:sliding_window
{"expr": "longest_stretch([2.0, 3.0, 1.0, 9.0, 2.0], Ceiling(limit=6.0))", "orig": "3", "new": "3", "edit": {"line": 49, "before": " left += 1", "after": " left += 2", "fn": "longest_stretch", "op": "const", "unique": true}}
qa
ol5:5b93eaee01c4fc5a
480
code_comprehend-013f3e244b32f2cb
This code should pass the tests shown after it. It may contain a one-line bug. ``` 1 | from __future__ import annotations 2 | from dataclasses import dataclass 3 | from math import factorial, gcd, isqrt, lcm 4 | 5 | 6 | class CoefficientError(ValueError): 7 | """A caller coefficient is not canonical.""" 8 ...
code_comprehend
spot_bug
no_bug
synth
synth:03-algorithms.exact-linear-algebra.determinants-adjugates
{"bug_line": null, "fix": null, "buggy": null, "tests_orig": ["test_1", "test_2", "test_3", "test_5", "test_6"]}
plain
synth:03-algorithms.exact-linear-algebra.determinants-adjugates/focused-sample:rational
782
code_comprehend-0141906e2caa6d85
Look at this implementation and the tests that cover it. ```python class PageError(ValueError): """One atomic failure with a contract kind and absolute byte offset.""" def __init__(self, kind: str, offset: int = 0): self.kind = kind self.offset = offset super().__init__(f"{kind} @{offs...
code_comprehend
failing_test
3+
synth
synth:04-formats.database-pages.sqlite-btree-pages
{"failing": ["test_1", "test_3", "test_5"], "shown": ["test_1", "test_2", "test_3", "test_4", "test_5"], "edit": {"line": 21, "before": " return value, at", "after": " return value, data", "fn": "varint", "op": "var", "unique": true}, "tests_orig": ["test_2", "test_7", "test_3", "test_8", "test_6"...
plain
synth:04-formats.database-pages.sqlite-btree-pages/focused-sample:varint
496
code_comprehend-014247b45f33c93b
<|start|><|user|> For instance: Does this code behave as the tests require? It might contain a single faulty line. ``` 1 """State agency selection for the State grant program.""" 2 3 from enum import Enum 4 5 6 class AgencyKind(Enum): 7 """Kinds of State agency that may apply for and run a grant.""" 8...
code_comprehend
spot_bug
no_bug
synth
synth:02-data-structures.trees.y-fast-trie
{"bug_line": null, "fix": null, "buggy": null, "tests_orig": ["test_1", "test_2", "test_3", "test_4"]}
chat
synth:02-data-structures.trees.y-fast-trie/focused-sample:local_bound
1,319
code_comprehend-0142c7c32a170c97
Here is a snippet and the result of one call to it. ```python from dataclasses import dataclass MAX = (1 << 64) - 1 HALF = (1 << 32) - 1 def integer(value: object, low: int, high: int, name: str) -> int: if type(value) is not int: raise TypeError(f"{name} must be an exact built-in int") if not low <...
code_comprehend
edit_output
unchanged
synth
synth:01-foundations.representation.overflow-and-modular-arithmetic
{"expr": "word(1, 1, 1, 'wrapping', 'add')", "orig": "WordResult(value=0, overflow=True)", "new": "WordResult(value=0, overflow=True)", "edit": {"line": 61, "before": " low = (p00 & HALF) | ((middle & HALF) << 32)", "after": " low = (p10 & HALF) | ((middle & HALF) << 32)", "fn": "wide_product", "op": "var", "uniq...
plain
synth:01-foundations.representation.overflow-and-modular-arithmetic/focused-sample:word
889
code_comprehend-014399524620dd1d
Look at this implementation and the tests that cover it. ``` 1 """Monotonic-stack lookups over a toboggan run profile.""" 2 3 4 class TobogganRun: 5 """Slope profile of a toboggan run with next-drop and next-rise lookups.""" 6 7 def __init__(self, heights: list[int]) -> None: 8 """Store a ...
code_comprehend
failing_test
pass
ol5
ol5:monotonic_stack
{"failing": ["test_a", "test_b", "test_c", "test_d", "test_e", "test_f", "test_g"], "shown": ["test_a", "test_b", "test_c", "test_d", "test_e", "test_f", "test_g", "test_h"], "edit": {"line": 20, "before": " while stack:", "after": " while not stack:", "fn": "TobogganRun._next_extreme", "op": "add...
plain
ol5:9aa99addf3005441
992
code_comprehend-0145334a6bbe4b83
Does the code below meet the specification? It may contain a one-line bug. What the code should do: Our herbarium labels cladophylls (flattened leaf-like stems) as ordered lists of segment lengths along the shoot. Write a Protocol `Shoot` with one method `lengths(self) -> list[int]`, two implementing classes, and the...
code_comprehend
spot_bug
no_bug
ol5
ol5:dp_lis
{"bug_line": null, "fix": null, "buggy": null, "tests_orig": ["test_empty_shoot_yields_zero", "test_tapered_matches_recorded_for_same_data", "test_equal_neighbours_do_not_extend_run", "test_both_classes_agree_for_identical_sequences"]}
plain
ol5:da2f498e8ed9ffac
1,136
code_comprehend-0147ca677aaa68c8
Instruction: Fill in the missing line. The code: ```python """Report the positions an overtime expression cannot be read from.""" import re _NUMBER = r"[0-9]+(?:\.[0-9]+)?" _NAME = r"[a-z_][a-z_0-9]*" _OPERATOR = r"[+\-*/()]" _SPACE = r"\s+" _TOKEN = re.compile(f"{_NUMBER}|{_NAME}|{_OPERATOR}|{_SPACE}") def find_p...
code_comprehend
fill_line
B
ol5
ol5:tokenizer
{"letter": "B", "line": 16, "options": ["while at < len(problems):", "while at < len(text):", "while at < len(at):"], "checks": [["find_problems('a$b@')", "[\"unexpected character '$' at offset 1\", \"unexpected character '@' at offset 3\"]"], ["find_problems(' hours\\n')", "[]"], ["find_problems('hours + 3.5 * overti...
qa
ol5:ca4217a1d7b11f89
454
code_comprehend-014be304214d1812
Instruction: The following code is unchanged so far. ```python from __future__ import annotations import math from collections.abc import Sequence from dataclasses import dataclass Pair = tuple[float, float] MAX_LENGTH = 4096 class ResourceLimit(ValueError): """The requested work exceeds the educational impleme...
code_comprehend
edit_output
unchanged
synth
synth:03-algorithms.numeric.fft
{"expr": "energy([])", "orig": "Energy(mantissa=0.0, exponent=0)", "new": "Energy(mantissa=0.0, exponent=0)", "edit": {"line": 46, "before": " _, exponent = math.frexp(largest)", "after": " _, exponent = math.frexp(pair)", "fn": "energy", "op": "var", "unique": true}}
qa
synth:03-algorithms.numeric.fft/focused-sample:energy
582
code_comprehend-014fd94d13adb423
Task: Given the module that follows, reason about how one edit changes a result. ```python from datetime import date def count_notice_period_days(start, end, inclusive=True): """Count calendar days in a notice period, including both endpoints when inclusive is true.""" first = date.fromisoformat(start) if is...
code_comprehend
edit_output
unchanged
r3vc
r3vc:legal_dates
{"expr": "count_notice_period_days('2024-01-01', '2024-01-01')", "orig": "1", "new": "1", "edit": {"line": 8, "before": " days = (last - first).days", "after": " days = (first - first).days", "fn": "count_notice_period_days", "op": "var", "unique": true}}
qa
r3vc:vcode4-d3bd7c5ea3812193
269
code_comprehend-014fffc9cba7937d
Q: Trace the effect of an edit on a function call. Start with the code: ```python import re def detect_regulatory_short_cites(text: str) -> list[str]: """Find Id. and supra short-cite markers in filing text. Args: text: The regulatory filing text to inspect. Returns: The matched markers...
code_comprehend
edit_output
changed
r3vc
r3vc:legal_citations
{"expr": "detect_regulatory_short_cites(\"supra, supra; Id., Id.\")", "orig": "['supra', 'supra', 'Id.', 'Id.']", "new": "['supra, supra; Id., Id.']", "edit": {"line": 14, "before": " return re.findall(pattern, text, flags=re.IGNORECASE)", "after": " return re.findall(text, text, flags=re.IGNORECASE)", "fn": "det...
qa
r3vc:vcode4-d7cea302b59f7b95
277
code_comprehend-01551e3c6af5a570
Instruction: Which tests break after a small change? Here is the code. ```python def apply_playlist_percent_discounts(price: float, discounts: list[float], round_digits: int | None = 2) -> float: """Apply percentage discounts to a playlist item's price in sequence. Args: price: The starting nonnegativ...
code_comprehend
failing_test
none
r3vc
r3vc:money_units
{"failing": [], "shown": ["test_case_1", "test_case_2", "test_case_3", "test_case_4", "test_case_5"], "edit": {"line": 22, "before": " return amount", "after": " return price", "fn": "apply_playlist_percent_discounts", "op": "var", "unique": true}, "tests_orig": ["test_4", "test_2", "test_3", "test_1", "t...
qa
r3vc:vcode4-09a7d16851cf4f4b
513
code_comprehend-01596d420c4b24f3
Code review: the tests define the expected behavior. ``` 1 | def playlist_digit_sum_and_root(track_number: int) -> tuple[int, int]: 2 | """Return the digit sum and digital root of a playlist track number.""" 3 | digits = str(abs(track_number)) 4 | digit_sum = sum(int(digit) for digit in digits) 5 | dig...
code_comprehend
spot_bug
no_bug
r3vc
r3vc:math
{"bug_line": null, "fix": null, "buggy": null, "tests_orig": ["test_1", "test_3", "test_4", "test_6"]}
plain
r3vc:vcode4-2bd9f43485b9bffb
311
code_comprehend-015baa0a3b434023
Trace the effect of an edit on a function call. Start with the code: ``` 1 | def add_minutes_to_trail_log_time(clock, minutes): 2 | """Add minutes to a hiking log time in HH:MM format.""" 3 | if len(clock) != 5 or clock[2] != ":": 4 | raise ValueError("time must use HH:MM format") 5 | hour = i...
code_comprehend
edit_output
changed
r3vc
r3vc:dates
{"expr": "add_minutes_to_trail_log_time('00:01', -2)", "orig": "'23:59'", "new": "'23:57'", "edit": {"line": 9, "before": " total = (hour * 60 + minute + minutes) % (24 * 60)", "after": " total = (hour * 60 - minute + minutes) % (24 * 60)", "fn": "add_minutes_to_trail_log_time", "op": "arith", "unique": true}}
plain
r3vc:vcode4-48c1161799904063
370
code_comprehend-01659d1486ec9b19
[Task] One line has been removed from this Python code. ```python """Emission audit of mobile earth stations protecting aeronautical radionavigation.""" from dataclasses import dataclass PFD_LIMIT_DBW = -154.0 ANGLE_LOW_DEG = 25.0 ANGLE_HIGH_DEG = 90.0 @dataclass(slots=True, frozen=True) class EarthStation: ""...
code_comprehend
fill_line
B
ol5
ol5:validation_report
{"letter": "B", "line": 33, "options": ["if station.pfd_dbw_per_m2 < PFD_LIMIT_DBW:", "if station.pfd_dbw_per_m2 > PFD_LIMIT_DBW:", "if station.pfd_dbw_per_m2 <= PFD_LIMIT_DBW:", "if station.pfd_dbw_per_m2 >= PFD_LIMIT_DBW:"], "checks": [["audit([EarthStation(call_sign='KAA', pfd_dbw_per_m2=-150.0, off_axis_angle_deg=1...
qa
ol5:cb4159c976bf523b
1,036
code_comprehend-016e1e905166a32d
Check the code against its tests; there may be one wrong line. ``` 1 | from collections import Counter 2 | 3 | 4 | def playlist_modes(tracks: list[str]) -> list[str]: 5 | """Return the track names occurring most often in a playlist. 6 | 7 | An empty playlist returns an empty list. Tied modes are returne...
code_comprehend
spot_bug
no_bug
r3vc
r3vc:math
{"bug_line": null, "fix": null, "buggy": null, "tests_orig": ["test_2", "test_3", "test_4", "test_5", "test_6"]}
plain
r3vc:vcode4-18e7d1ab61e45324
442
code_comprehend-01741b28e49bf2ad
Predict the test results after an edit. The code: ``` 1 def group_billing_keys_by_value(records): 2 """Group billing-record keys by their associated value. Raises TypeError if records is not a dictionary or a value cannot be used as a dictionary key.""" 3 if not isinstance(records, dict): 4 raise T...
code_comprehend
failing_test
3+
r3vc
r3vc:dicts
{"failing": ["test_1", "test_2", "test_4", "test_5", "test_6"], "shown": ["test_1", "test_2", "test_3", "test_4", "test_5", "test_6"], "edit": {"line": 3, "before": " if not isinstance(records, dict):", "after": " if isinstance(records, dict):", "fn": "group_billing_keys_by_value", "op": "drop_not", "unique": tru...
plain
r3vc:vcode4-e009c512fbac1a24
841