id
stringlengths
30
95
domain
stringclasses
5 values
task_type
stringclasses
49 values
difficulty
stringclasses
5 values
prompt
stringlengths
12
3.09k
context
stringclasses
596 values
observations
stringlengths
2
170
constraints
stringclasses
242 values
assumptions
stringclasses
51 values
plan
stringclasses
240 values
strategy
stringclasses
240 values
solution
stringlengths
5
766
answer
stringlengths
1
766
verification
stringlengths
268
1.71k
provenance
stringclasses
95 values
quality
stringclasses
29 values
education_level
stringclasses
6 values
concept_id
stringclasses
54 values
evidence
stringclasses
29 values
transformation
stringclasses
8 values
temporal
stringclasses
0 values
runtime
stringclasses
0 values
natural_language
stringclasses
1 value
translation_status
stringclasses
1 value
metadata
stringlengths
220
5.58k
or-coding-py-nested-delimiter-scan-85bd9022ad05
coding
code_generation
beginner
Implement `delimiters_ok(text: str) -> bool`. Return True if every round, square, and curly bracket in `text` is correctly nested and matched. All other characters are ignored. Empty input is valid.
{"language": "python", "repository": {"files": {"solution.py": "def delimiters_ok(text):\n pairs = {\")\": \"(\", \"]\": \"[\", \"}\": \"{\"}\n stack = []\n for ch in text:\n if ch in \"([{\":\n stack.append(ch)\n elif ch in \")]}\":\n if not stack or stack[-1] != pairs[ch]:...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def delimiters_ok(text): pairs = {")": "(", "]": "[", "}": "{"} stack = [] for ch in text: if ch in "([{": stack.append(ch) elif ch in ")]}": if not stack or stack[-1] != pairs[ch]: return False stack.pop() return not stack
def delimiters_ok(text): pairs = {")": "(", "]": "[", "}": "{"} stack = [] for ch in text: if ch in "([{": stack.append(ch) elif ch in ")]}": if not stack or stack[-1] != pairs[ch]: return False stack.pop() return not stack
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 4}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:44Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.conditionals
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.625, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.375, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.75, "tests": 0.0, "total": 4.35}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "nest...
or-coding-py-window-max-sum-6217a2479b07
coding
code_generation
intermediate
Implement `max_window_sum(values, k)` returning the maximum sum of any contiguous subarray of length `k`. If `k` is larger than the list, raise ValueError.
{"language": "python", "repository": {"files": {"solution.py": "def max_window_sum(values, k):\n if k <= 0 or k > len(values):\n raise ValueError(\"invalid window\")\n current = sum(values[:k])\n best = current\n for i in range(k, len(values)):\n current += values[i] - values[i - k]\n i...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def max_window_sum(values, k): if k <= 0 or k > len(values): raise ValueError("invalid window") current = sum(values[:k]) best = current for i in range(k, len(values)): current += values[i] - values[i - k] if current > best: best = current return best
def max_window_sum(values, k): if k <= 0 or k > len(values): raise ValueError("invalid window") current = sum(values[:k]) best = current for i in range(k, len(values)): current += values[i] - values[i - k] if current > best: best = current return best
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 3}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:44Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.575, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.75, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.575, "tests": 0.0, "total": 4.5}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "windo...
or-coding-py-debug-window-max-sum-929a7ef31c21
coding
debugging
advanced
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `max_window_sum(values, k)` returning the maximum sum of any contiguous subarray of length `k`. If `k` is larger than the list, raise ValueError. --- solution.py (buggy) --- def max_window_sum...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 3, \"failures\": 2, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_bad (test_solution.Test.test_bad) ... ok\ntest_example (test_solution.Test.test_example) ... FAIL\ntest_k_one (test_solution.Test.test_k_one) ... FAIL\...
["Forgets to subtract the value leaving the window."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
def max_window_sum(values, k): if k <= 0 or k > len(values): raise ValueError("invalid window") current = sum(values[:k]) best = current for i in range(k, len(values)): current += values[i] - values[i - k] if current > best: best = current return best
def max_window_sum(values, k): if k <= 0 or k > len(values): raise ValueError("invalid window") current = sum(values[:k]) best = current for i in range(k, len(values)): current += values[i] - values[i - k] if current > best: best = current return best
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 3}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:44Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.575, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.875}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {...
or-coding-py-stable-group-by-af1de6dd3bd2
coding
code_generation
beginner
Implement `group_in_order(items, key_fn)` that groups consecutive items with the same key, preserving first-seen group order for non-consecutive keys as well (like an insertion-ordered map of lists). Return a list of (key, group_list) pairs.
{"language": "python", "repository": {"files": {"solution.py": "def group_in_order(items, key_fn):\n order = []\n buckets = {}\n for item in items:\n key = key_fn(item)\n if key not in buckets:\n buckets[key] = []\n order.append(key)\n buckets[key].append(item)\n r...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def group_in_order(items, key_fn): order = [] buckets = {} for item in items: key = key_fn(item) if key not in buckets: buckets[key] = [] order.append(key) buckets[key].append(item) return [(key, buckets[key]) for key in order]
def group_in_order(items, key_fn): order = [] buckets = {} for item in items: key = key_fn(item) if key not in buckets: buckets[key] = [] order.append(key) buckets[key].append(item) return [(key, buckets[key]) for key in order]
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.525, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.375, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.825, "tests": 0.0, "total": 4.324999999999999}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0",...
or-coding-py-lru-cache-map-5dfd0b972649
coding
code_generation
beginner
Implement class `TinyLRU(capacity)` with `get(key)` (return None if missing) and `put(key, value)`. Evict the least recently used entry when over capacity. Both get and put count as use.
{"language": "python", "repository": {"files": {"solution.py": "from collections import OrderedDict\n\nclass TinyLRU:\n def __init__(self, capacity):\n if capacity < 1:\n raise ValueError(\"capacity\")\n self.capacity = capacity\n self._data = OrderedDict()\n\n def get(self, key):\...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
from collections import OrderedDict class TinyLRU: def __init__(self, capacity): if capacity < 1: raise ValueError("capacity") self.capacity = capacity self._data = OrderedDict() def get(self, key): if key not in self._data: return None self._data.move_to_end(key) return self._data[key] def put(self, key,...
from collections import OrderedDict class TinyLRU: def __init__(self, capacity): if capacity < 1: raise ValueError("capacity") self.capacity = capacity self._data = OrderedDict() def get(self, key): if key not in self._data: return None self._data.move_to_end(key) return self._data[key] def put(self, key,...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.conditionals
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.95, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.7, "tests": 0.0, "total": 4.25}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "lru_cach...
or-coding-py-debug-lru-cache-map-d25e87700735
coding
debugging
advanced
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement class `TinyLRU(capacity)` with `get(key)` (return None if missing) and `put(key, value)`. Evict the least recently used entry when over capacity. Both get and put count as use. --- solution.py...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_evict (test_solution.Test.test_evict) ... FAIL\n\n======================================================================\nFAIL: test_evict (test_soluti...
["get() does not refresh recency."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
from collections import OrderedDict class TinyLRU: def __init__(self, capacity): if capacity < 1: raise ValueError("capacity") self.capacity = capacity self._data = OrderedDict() def get(self, key): if key not in self._data: return None self._data.move_to_end(key) return self._data[key] def put(self, key,...
from collections import OrderedDict class TinyLRU: def __init__(self, capacity): if capacity < 1: raise ValueError("capacity") self.capacity = capacity self._data = OrderedDict() def get(self, key): if key not in self._data: return None self._data.move_to_end(key) return self._data[key] def put(self, key,...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.725, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 3.925, "tests": 0.0, "total": 10.95}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": ...
or-coding-py-binary-search-first-4a8714ec195f
coding
code_generation
intermediate
Implement `first_ge(sorted_values, target)` returning the smallest index i such that sorted_values[i] >= target, or len(sorted_values) if none exists. The list is sorted non-decreasing.
{"language": "python", "repository": {"files": {"solution.py": "def first_ge(sorted_values, target):\n lo, hi = 0, len(sorted_values)\n while lo < hi:\n mid = (lo + hi) // 2\n if sorted_values[mid] < target:\n lo = mid + 1\n else:\n hi = mid\n return lo\n", "test_solu...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def first_ge(sorted_values, target): lo, hi = 0, len(sorted_values) while lo < hi: mid = (lo + hi) // 2 if sorted_values[mid] < target: lo = mid + 1 else: hi = mid return lo
def first_ge(sorted_values, target): lo, hi = 0, len(sorted_values) while lo < hi: mid = (lo + hi) // 2 if sorted_values[mid] < target: lo = mid + 1 else: hi = mid return lo
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 3}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.conditionals
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.525, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.125, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.575, "tests": 0.0, "total": 4.824999999999999}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0",...
or-coding-py-merge-intervals-cc5bc5fd01ac
coding
code_generation
intermediate
Implement `merge_ranges(ranges)` where each range is [start, end] with start <= end. Return a new list of disjoint merged ranges sorted by start.
{"language": "python", "repository": {"files": {"solution.py": "def merge_ranges(ranges):\n if not ranges:\n return []\n ordered = sorted(ranges, key=lambda r: r[0])\n out = [list(ordered[0])]\n for start, end in ordered[1:]:\n if start <= out[-1][1]:\n out[-1][1] = max(out[-1][1], ...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def merge_ranges(ranges): if not ranges: return [] ordered = sorted(ranges, key=lambda r: r[0]) out = [list(ordered[0])] for start, end in ordered[1:]: if start <= out[-1][1]: out[-1][1] = max(out[-1][1], end) else: out.append([start, end]) return out
def merge_ranges(ranges): if not ranges: return [] ordered = sorted(ranges, key=lambda r: r[0]) out = [list(ordered[0])] for start, end in ordered[1:]: if start <= out[-1][1]: out[-1][1] = max(out[-1][1], end) else: out.append([start, end]) return out
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 3}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.conditionals
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.575, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.75, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.575, "tests": 0.0, "total": 4.5}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "merge...
or-coding-py-debug-merge-intervals-6fc2cea66a6d
coding
debugging
advanced
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `merge_ranges(ranges)` where each range is [start, end] with start <= end. Return a new list of disjoint merged ranges sorted by start. --- solution.py (buggy) --- def merge_ranges(ranges): i...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 3, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_empty (test_solution.Test.test_empty) ... ok\ntest_overlap (test_solution.Test.test_overlap) ... ok\ntest_touch (test_solution.Test.test_touch) ... FAI...
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
def merge_ranges(ranges): if not ranges: return [] ordered = sorted(ranges, key=lambda r: r[0]) out = [list(ordered[0])] for start, end in ordered[1:]: if start <= out[-1][1]: out[-1][1] = max(out[-1][1], end) else: out.append([start, end]) return out
def merge_ranges(ranges): if not ranges: return [] ordered = sorted(ranges, key=lambda r: r[0]) out = [list(ordered[0])] for start, end in ordered[1:]: if start <= out[-1][1]: out[-1][1] = max(out[-1][1], end) else: out.append([start, end]) return out
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 3}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.575, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.875}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {...
or-coding-py-topo-order-50c5ec8cdc24
coding
code_generation
intermediate
Implement `topo_sort(nodes, edges)` for a directed acyclic graph. `nodes` is a list of hashable ids. `edges` is a list of (src, dst) meaning src must come before dst. Return any valid topological order. Raise ValueError if a cycle exists.
{"language": "python", "repository": {"files": {"solution.py": "from collections import defaultdict, deque\n\ndef topo_sort(nodes, edges):\n incoming = {n: 0 for n in nodes}\n graph = defaultdict(list)\n for src, dst in edges:\n graph[src].append(dst)\n incoming[dst] = incoming.get(dst, 0) + 1\n ...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
from collections import defaultdict, deque def topo_sort(nodes, edges): incoming = {n: 0 for n in nodes} graph = defaultdict(list) for src, dst in edges: graph[src].append(dst) incoming[dst] = incoming.get(dst, 0) + 1 incoming.setdefault(src, incoming.get(src, 0)) ready = deque([n for n in nodes if incoming.get...
from collections import defaultdict, deque def topo_sort(nodes, edges): incoming = {n: 0 for n in nodes} graph = defaultdict(list) for src, dst in edges: graph[src].append(dst) incoming[dst] = incoming.get(dst, 0) + 1 incoming.setdefault(src, incoming.get(src, 0)) ready = deque([n for n in nodes if incoming.get...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.collections
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.825, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.5, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.975, "tests": 0.0, "total": 4.9}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "topo_o...
or-coding-py-debug-topo-order-7b0d10953f8f
coding
debugging
expert
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `topo_sort(nodes, edges)` for a directed acyclic graph. `nodes` is a list of hashable ids. `edges` is a list of (src, dst) meaning src must come before dst. Return any valid topological order. ...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_chain (test_solution.Test.test_chain) ... FAIL\ntest_cycle (test_solution.Test.test_cycle) ... ok\n\n==================================================...
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
from collections import defaultdict, deque def topo_sort(nodes, edges): incoming = {n: 0 for n in nodes} graph = defaultdict(list) for src, dst in edges: graph[src].append(dst) incoming[dst] = incoming.get(dst, 0) + 1 incoming.setdefault(src, incoming.get(src, 0)) ready = deque([n for n in nodes if incoming.get...
from collections import defaultdict, deque def topo_sort(nodes, edges): incoming = {n: 0 for n in nodes} graph = defaultdict(list) for src, dst in edges: graph[src].append(dst) incoming[dst] = incoming.get(dst, 0) + 1 incoming.setdefault(src, incoming.get(src, 0)) ready = deque([n for n in nodes if incoming.get...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.collections
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.825, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 11.125}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {...
or-coding-py-dijkstra-hops-3cc79c98ed19
coding
code_generation
beginner
Implement `shortest_cost(graph, start, goal)` where graph maps node -> list of (neighbor, weight) with non-negative weights. Return the minimum cost or None if unreachable.
{"language": "python", "repository": {"files": {"solution.py": "import heapq\n\ndef shortest_cost(graph, start, goal):\n best = {start: 0}\n heap = [(0, start)]\n while heap:\n cost, node = heapq.heappop(heap)\n if cost != best.get(node, None):\n continue\n if node == goal:\n ...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
import heapq def shortest_cost(graph, start, goal): best = {start: 0} heap = [(0, start)] while heap: cost, node = heapq.heappop(heap) if cost != best.get(node, None): continue if node == goal: return cost for nxt, weight in graph.get(node, []): cand = cost + weight if cand < best.get(nxt, float("inf")): b...
import heapq def shortest_cost(graph, start, goal): best = {start: 0} heap = [(0, start)] while heap: cost, node = heapq.heappop(heap) if cost != best.get(node, None): continue if node == goal: return cost for nxt, weight in graph.get(node, []): cand = cost + weight if cand < best.get(nxt, float("inf")): b...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.loops
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.7, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.5, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.6, "tests": 0.0, "total": 4.4}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "dijkstra_h...
or-coding-py-debug-dijkstra-hops-6ee2d302315a
coding
debugging
expert
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `shortest_cost(graph, start, goal)` where graph maps node -> list of (neighbor, weight) with non-negative weights. Return the minimum cost or None if unreachable. --- solution.py (buggy) --- i...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 2, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_missing (test_solution.Test.test_missing) ... FAIL\ntest_path (test_solution.Test.test_path) ... FAIL\n\n==============================================...
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
import heapq def shortest_cost(graph, start, goal): best = {start: 0} heap = [(0, start)] while heap: cost, node = heapq.heappop(heap) if cost != best.get(node, None): continue if node == goal: return cost for nxt, weight in graph.get(node, []): cand = cost + weight if cand < best.get(nxt, float("inf")): b...
import heapq def shortest_cost(graph, start, goal): best = {start: 0} heap = [(0, start)] while heap: cost, node = heapq.heappop(heap) if cost != best.get(node, None): continue if node == goal: return cost for nxt, weight in graph.get(node, []): cand = cost + weight if cand < best.get(nxt, float("inf")): b...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.7, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 11.0}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"err...
or-coding-py-heap-median-ebe3df4f8fd3
coding
code_generation
intermediate
Implement class `RunningMedian` with `add(x)` and `median()` (mean of the two center values when the count is even). Values are numbers.
{"language": "python", "repository": {"files": {"solution.py": "import heapq\n\nclass RunningMedian:\n def __init__(self):\n self.low = []\n self.high = []\n\n def add(self, x):\n if not self.low or x <= -self.low[0]:\n heapq.heappush(self.low, -x)\n else:\n heapq...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
import heapq class RunningMedian: def __init__(self): self.low = [] self.high = [] def add(self, x): if not self.low or x <= -self.low[0]: heapq.heappush(self.low, -x) else: heapq.heappush(self.high, x) if len(self.low) > len(self.high) + 1: heapq.heappush(self.high, -heapq.heappop(self.low)) elif len(self...
import heapq class RunningMedian: def __init__(self): self.low = [] self.high = [] def add(self, x): if not self.low or x <= -self.low[0]: heapq.heappush(self.low, -x) else: heapq.heappush(self.high, x) if len(self.low) > len(self.high) + 1: heapq.heappush(self.high, -heapq.heappop(self.low)) elif len(self...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.conditionals
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.85, "constraints": 1.4, "keywords": 0.0, "math_ops": 2.25, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.525, "tests": 0.0, "total": 6.225}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "heap...
or-coding-py-parse-kv-config-761c659cab58
coding
code_generation
intermediate
Implement `parse_kv(text)` for a tiny config language: - ignore blank lines and lines starting with `#` - remaining lines are `key = value` (value trimmed, may contain =) - duplicate keys: last wins Return a dict. Raise ValueError on lines without `=`.
{"language": "python", "repository": {"files": {"solution.py": "def parse_kv(text):\n result = {}\n for raw in text.splitlines():\n line = raw.strip()\n if not line or line.startswith(\"#\"):\n continue\n if \"=\" not in line:\n raise ValueError(line)\n key, value...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def parse_kv(text): result = {} for raw in text.splitlines(): line = raw.strip() if not line or line.startswith("#"): continue if "=" not in line: raise ValueError(line) key, value = line.split("=", 1) result[key.strip()] = value.strip() return result
def parse_kv(text): result = {} for raw in text.splitlines(): line = raw.strip() if not line or line.startswith("#"): continue if "=" not in line: raise ValueError(line) key, value = line.split("=", 1) result[key.strip()] = value.strip() return result
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.575, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.375, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 1.05, "tests": 0.0, "total": 4.6000000000000005}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0",...
or-coding-py-semver-core-cmp-af727ae91767
coding
code_generation
beginner
Implement `cmp_semver(a, b)` comparing MAJOR.MINOR.PATCH strings (digits only, no pre-release). Return -1, 0, or 1.
{"language": "python", "repository": {"files": {"solution.py": "def cmp_semver(a, b):\n def parts(s):\n bits = s.split(\".\")\n if len(bits) != 3 or not all(p.isdigit() for p in bits):\n raise ValueError(s)\n return tuple(int(p) for p in bits)\n left, right = parts(a), parts(b)\n ...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def cmp_semver(a, b): def parts(s): bits = s.split(".") if len(bits) != 3 or not all(p.isdigit() for p in bits): raise ValueError(s) return tuple(int(p) for p in bits) left, right = parts(a), parts(b) return (left > right) - (left < right)
def cmp_semver(a, b): def parts(s): bits = s.split(".") if len(bits) != 3 or not all(p.isdigit() for p in bits): raise ValueError(s) return tuple(int(p) for p in bits) left, right = parts(a), parts(b) return (left > right) - (left < right)
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.45, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.5, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.375, "tests": 0.0, "total": 3.9250000000000003}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "...
or-coding-py-debug-semver-core-cmp-3ec077e8ae1c
coding
debugging
advanced
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `cmp_semver(a, b)` comparing MAJOR.MINOR.PATCH strings (digits only, no pre-release). Return -1, 0, or 1. --- solution.py (buggy) --- def cmp_semver(a, b): return (a > b) - (a < b) --- test_...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_cmp (test_solution.Test.test_cmp) ... FAIL\n\n======================================================================\nFAIL: test_cmp (test_solution.Tes...
["Compares as strings so 1.10.0 < 1.2.0."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
def cmp_semver(a, b): def parts(s): bits = s.split(".") if len(bits) != 3 or not all(p.isdigit() for p in bits): raise ValueError(s) return tuple(int(p) for p in bits) left, right = parts(a), parts(b) return (left > right) - (left < right)
def cmp_semver(a, b): def parts(s): bits = s.split(".") if len(bits) != 3 or not all(p.isdigit() for p in bits): raise ValueError(s) return tuple(int(p) for p in bits) left, right = parts(a), parts(b) return (left > right) - (left < right)
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.3, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 2.95, "tests": 0.0, "total": 9.55}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"er...
or-coding-py-dep-resolution-pins-c28ab4b294ab
coding
code_generation
beginner
Implement `pins_ok(declared, locked)` where declared maps package -> minimum inclusive version tuple (major, minor, patch) and locked maps package -> installed version tuple. Every declared package must be present and installed >= minimum. Extra locked packages are allowed.
{"language": "python", "repository": {"files": {"solution.py": "def pins_ok(declared, locked):\n for name, minimum in declared.items():\n if name not in locked:\n return False\n if locked[name] < minimum:\n return False\n return True\n", "test_solution.py": "import unittest\nfr...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def pins_ok(declared, locked): for name, minimum in declared.items(): if name not in locked: return False if locked[name] < minimum: return False return True
def pins_ok(declared, locked): for name, minimum in declared.items(): if name not in locked: return False if locked[name] < minimum: return False return True
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 3}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.475, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.25, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.95, "tests": 0.0, "total": 4.2749999999999995}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", ...
or-coding-py-debug-dep-resolution-pins-1435c42ac5ce
coding
debugging
advanced
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `pins_ok(declared, locked)` where declared maps package -> minimum inclusive version tuple (major, minor, patch) and locked maps package -> installed version tuple. Every declared package must ...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 3, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_missing (test_solution.Test.test_missing) ... ok\ntest_ok (test_solution.Test.test_ok) ... FAIL\ntest_old (test_solution.Test.test_old) ... ok\n\n=====...
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
def pins_ok(declared, locked): for name, minimum in declared.items(): if name not in locked: return False if locked[name] < minimum: return False return True
def pins_ok(declared, locked): for name, minimum in declared.items(): if name not in locked: return False if locked[name] < minimum: return False return True
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 3}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.modules
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.475, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.774999999999999}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {...
or-coding-py-sql-ident-quote-d0a22efbb77f
coding
code_generation
intermediate
Implement `quote_ident(name)` for a conservative SQL identifier: accept only `[A-Za-z_][A-Za-z0-9_]*` and wrap in double quotes with internal quotes doubled. Raise ValueError otherwise. This is defensive quoting, not a parser for arbitrary SQL.
{"language": "python", "repository": {"files": {"solution.py": "import re\n\ndef quote_ident(name):\n if not re.fullmatch(r\"[A-Za-z_][A-Za-z0-9_]*\", name):\n raise ValueError(\"invalid identifier\")\n return '\"' + name.replace('\"', '\"\"') + '\"'\n", "test_solution.py": "import unittest\nfrom solution ...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
import re def quote_ident(name): if not re.fullmatch(r"[A-Za-z_][A-Za-z0-9_]*", name): raise ValueError("invalid identifier") return '"' + name.replace('"', '""') + '"'
import re def quote_ident(name): if not re.fullmatch(r"[A-Za-z_][A-Za-z0-9_]*", name): raise ValueError("invalid identifier") return '"' + name.replace('"', '""') + '"'
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.475, "constraints": 1.4, "keywords": 0.0, "math_ops": 2.75, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.8, "tests": 0.0, "total": 6.625}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "sql_i...
or-coding-py-debug-sql-ident-quote-802f0517d1d2
coding
debugging
advanced
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `quote_ident(name)` for a conservative SQL identifier: accept only `[A-Za-z_][A-Za-z0-9_]*` and wrap in double quotes with internal quotes doubled. Raise ValueError otherwise. This is defensive...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 0, \"errors\": 1, \"skipped\": 0, \"passed\": false}\n\ntest_ok (test_solution.Test.test_ok) ... ERROR\ntest_reject (test_solution.Test.test_reject) ... ok\n\n=====================================================...
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
import re def quote_ident(name): if not re.fullmatch(r"[A-Za-z_][A-Za-z0-9_]*", name): raise ValueError("invalid identifier") return '"' + name.replace('"', '""') + '"'
import re def quote_ident(name): if not re.fullmatch(r"[A-Za-z_][A-Za-z0-9_]*", name): raise ValueError("invalid identifier") return '"' + name.replace('"', '""') + '"'
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.475, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.774999999999999}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {...
or-coding-py-parameterized-filter-2992f1833ac8
coding
code_generation
intermediate
Implement `safe_select_by_id(conn, table, row_id)` using sqlite3. `table` must match `[a-z_]+`. Execute a parameterized query `SELECT * FROM {table} WHERE id = ?` and return the list of rows. Never interpolate `row_id` into the SQL string.
{"language": "python", "repository": {"files": {"solution.py": "import re\n\ndef safe_select_by_id(conn, table, row_id):\n if not re.fullmatch(r\"[a-z_]+\", table):\n raise ValueError(\"table\")\n sql = f'SELECT * FROM \"{table}\" WHERE id = ?'\n return list(conn.execute(sql, (row_id,)))\n", "test_solut...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
import re def safe_select_by_id(conn, table, row_id): if not re.fullmatch(r"[a-z_]+", table): raise ValueError("table") sql = f'SELECT * FROM "{table}" WHERE id = ?' return list(conn.execute(sql, (row_id,)))
import re def safe_select_by_id(conn, table, row_id): if not re.fullmatch(r"[a-z_]+", table): raise ValueError("table") sql = f'SELECT * FROM "{table}" WHERE id = ?' return list(conn.execute(sql, (row_id,)))
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 3}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.75, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.125, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.875, "tests": 0.0, "total": 5.35}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "para...
or-coding-py-path-confine-9bfc484ac11f
coding
code_generation
beginner
Implement `resolve_under(root, relative)` that joins `relative` to `root` and returns the resolved path only if it stays inside `root`. Reject `..` escapes. Use pathlib. Raise ValueError on escape.
{"language": "python", "repository": {"files": {"solution.py": "from pathlib import Path\n\ndef resolve_under(root, relative):\n base = Path(root).resolve()\n target = (base / relative).resolve()\n try:\n target.relative_to(base)\n except ValueError as exc:\n raise ValueError(\"escape\") from ...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
from pathlib import Path def resolve_under(root, relative): base = Path(root).resolve() target = (base / relative).resolve() try: target.relative_to(base) except ValueError as exc: raise ValueError("escape") from exc return str(target)
from pathlib import Path def resolve_under(root, relative): base = Path(root).resolve() target = (base / relative).resolve() try: target.relative_to(base) except ValueError as exc: raise ValueError("escape") from exc return str(target)
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.exceptions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.65, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.25, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.7, "tests": 0.0, "total": 4.199999999999999}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "sl...
or-coding-py-cidr-contains-880e214734b6
coding
code_generation
beginner
Implement `ipv4_in_cidr(ip, cidr)` where ip is dotted IPv4 and cidr is like `10.0.0.0/8`. Return True iff the address is in the prefix. No extra libraries beyond stdlib.
{"language": "python", "repository": {"files": {"solution.py": "import ipaddress\n\ndef ipv4_in_cidr(ip, cidr):\n return ipaddress.IPv4Address(ip) in ipaddress.IPv4Network(cidr, strict=False)\n", "test_solution.py": "import unittest\nfrom solution import ipv4_in_cidr\n\nclass Test(unittest.TestCase):\n def test_i...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
import ipaddress def ipv4_in_cidr(ip, cidr): return ipaddress.IPv4Address(ip) in ipaddress.IPv4Network(cidr, strict=False)
import ipaddress def ipv4_in_cidr(ip, cidr): return ipaddress.IPv4Address(ip) in ipaddress.IPv4Network(cidr, strict=False)
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 3}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.4, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.125, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.675, "tests": 0.0, "total": 3.8000000000000003}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", ...
or-coding-py-fcfs-finish-72e6ead16506
coding
code_generation
beginner
Implement `fcfs_completion(jobs)` where each job is (arrival, burst) and jobs are already ordered by arrival time (ties keep given order). Return a list of completion times in the same order. The CPU is idle until the next arrival if needed.
{"language": "python", "repository": {"files": {"solution.py": "def fcfs_completion(jobs):\n time = 0\n done = []\n for arrival, burst in jobs:\n time = max(time, arrival) + burst\n done.append(time)\n return done\n", "test_solution.py": "import unittest\nfrom solution import fcfs_completion\n...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def fcfs_completion(jobs): time = 0 done = [] for arrival, burst in jobs: time = max(time, arrival) + burst done.append(time) return done
def fcfs_completion(jobs): time = 0 done = [] for arrival, burst in jobs: time = max(time, arrival) + burst done.append(time) return done
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.425, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.25, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 1.0, "tests": 0.0, "total": 4.275}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "fcfs_...
or-coding-py-debug-fcfs-finish-69a773b61602
coding
debugging
advanced
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `fcfs_completion(jobs)` where each job is (arrival, burst) and jobs are already ordered by arrival time (ties keep given order). Return a list of completion times in the same order. The CPU is ...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 2, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_idle (test_solution.Test.test_idle) ... FAIL\ntest_queue (test_solution.Test.test_queue) ... FAIL\n\n==================================================...
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
def fcfs_completion(jobs): time = 0 done = [] for arrival, burst in jobs: time = max(time, arrival) + burst done.append(time) return done
def fcfs_completion(jobs): time = 0 done = [] for arrival, burst in jobs: time = max(time, arrival) + burst done.append(time) return done
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.425, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.725}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {...
or-coding-py-round-robin-trace-992838c315ea
coding
code_generation
advanced
Implement `rr_finish(bursts, quantum)` for processes all arriving at 0, indexed 0..n-1, using a FIFO ready queue. Return completion times list. Ignore context-switch cost.
{"language": "python", "repository": {"files": {"solution.py": "from collections import deque\n\ndef rr_finish(bursts, quantum):\n remaining = list(bursts)\n finish = [None] * len(bursts)\n q = deque(range(len(bursts)))\n t = 0\n while q:\n i = q.popleft()\n run = min(quantum, remaining[i])...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
from collections import deque def rr_finish(bursts, quantum): remaining = list(bursts) finish = [None] * len(bursts) q = deque(range(len(bursts))) t = 0 while q: i = q.popleft() run = min(quantum, remaining[i]) remaining[i] -= run t += run if remaining[i] == 0: finish[i] = t else: q.append(i) return fini...
from collections import deque def rr_finish(bursts, quantum): remaining = list(bursts) finish = [None] * len(bursts) q = deque(range(len(bursts))) t = 0 while q: i = q.popleft() run = min(quantum, remaining[i]) remaining[i] -= run t += run if remaining[i] == 0: finish[i] = t else: q.append(i) return fini...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.conditionals
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.625, "constraints": 1.4, "keywords": 3.0, "math_ops": 1.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.575, "tests": 0.0, "total": 7.8}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "round_...
or-coding-py-debug-round-robin-trace-426b74f925fc
coding
debugging
expert
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `rr_finish(bursts, quantum)` for processes all arriving at 0, indexed 0..n-1, using a FIFO ready queue. Return completion times list. Ignore context-switch cost. --- solution.py (buggy) --- fr...
{"failure": {"command": "python harness.py", "output": "\ntest_rr (test_solution.Test.test_rr) ... "}, "language": "python", "repository": {"files": {"solution.py": "from collections import deque\n\ndef rr_finish(bursts, quantum):\n remaining = list(bursts)\n finish = [None] * len(bursts)\n q = deque(range(len...
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
from collections import deque def rr_finish(bursts, quantum): remaining = list(bursts) finish = [None] * len(bursts) q = deque(range(len(bursts))) t = 0 while q: i = q.popleft() run = min(quantum, remaining[i]) remaining[i] -= run t += run if remaining[i] == 0: finish[i] = t else: q.append(i) return fini...
from collections import deque def rr_finish(bursts, quantum): remaining = list(bursts) finish = [None] * len(bursts) q = deque(range(len(bursts))) t = 0 while q: i = q.popleft() run = min(quantum, remaining[i]) remaining[i] -= run t += run if remaining[i] == 0: finish[i] = t else: q.append(i) return fini...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.625, "constraints": 1.4, "keywords": 3.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 2.9, "tests": 0.0, "total": 12.825}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {...
or-coding-py-lru-page-faults-e1513d15e836
coding
code_generation
beginner
Implement `lru_faults(pages, frames)` counting page faults with LRU replacement among `frames` slots. Empty frames fill first.
{"language": "python", "repository": {"files": {"solution.py": "def lru_faults(pages, frames):\n slot = []\n used = []\n faults = 0\n for page in pages:\n if page in slot:\n used.remove(page)\n used.append(page)\n continue\n faults += 1\n if len(slot) < ...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def lru_faults(pages, frames): slot = [] used = [] faults = 0 for page in pages: if page in slot: used.remove(page) used.append(page) continue faults += 1 if len(slot) < frames: slot.append(page) else: victim = used.pop(0) idx = slot.index(victim) slot[idx] = page used.append(page) return faults
def lru_faults(pages, frames): slot = [] used = [] faults = 0 for page in pages: if page in slot: used.remove(page) used.append(page) continue faults += 1 if len(slot) < frames: slot.append(page) else: victim = used.pop(0) idx = slot.index(victim) slot[idx] = page used.append(page) return faults
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:58Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.conditionals
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.65, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.25, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.4, "tests": 0.0, "total": 3.9}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "lru_page...
or-coding-py-banker-safe-3b58e6d2a848
coding
code_generation
intermediate
Implement `is_safe(available, allocation, need)` for the Banker's algorithm safety check. `available` is a list of resource counts. `allocation` and `need` are lists of per-process lists. Return True iff a safe sequence exists.
{"language": "python", "repository": {"files": {"solution.py": "def is_safe(available, allocation, need):\n work = list(available)\n finish = [False] * len(allocation)\n while True:\n progressed = False\n for i, done in enumerate(finish):\n if done:\n continue\n ...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def is_safe(available, allocation, need): work = list(available) finish = [False] * len(allocation) while True: progressed = False for i, done in enumerate(finish): if done: continue if all(need[i][j] <= work[j] for j in range(len(work))): for j in range(len(work)): work[j] += allocation[i][j] finish[i] = Tr...
def is_safe(available, allocation, need): work = list(available) finish = [False] * len(allocation) while True: progressed = False for i, done in enumerate(finish): if done: continue if all(need[i][j] <= work[j] for j in range(len(work))): for j in range(len(work)): work[j] += allocation[i][j] finish[i] = Tr...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:58Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.loops
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.65, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.625, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.8, "tests": 0.0, "total": 4.675000000000001}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "s...
or-coding-py-token-bucket-f0a6eaa2b164
coding
code_generation
intermediate
Implement class `TokenBucket(rate, burst)` with `allow(time, cost=1)`. `rate` is tokens per time unit, `burst` is max tokens. Start full at t=0. `time` is non-decreasing. Return True if the request is admitted.
{"language": "python", "repository": {"files": {"solution.py": "class TokenBucket:\n def __init__(self, rate, burst):\n self.rate = rate\n self.burst = burst\n self.tokens = float(burst)\n self.t = 0.0\n\n def allow(self, time, cost=1):\n if time < self.t:\n raise Val...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
class TokenBucket: def __init__(self, rate, burst): self.rate = rate self.burst = burst self.tokens = float(burst) self.t = 0.0 def allow(self, time, cost=1): if time < self.t: raise ValueError("time") self.tokens = min(self.burst, self.tokens + (time - self.t) * self.rate) self.t = time if self.tokens >= c...
class TokenBucket: def __init__(self, rate, burst): self.rate = rate self.burst = burst self.tokens = float(burst) self.t = 0.0 def allow(self, time, cost=1): if time < self.t: raise ValueError("time") self.tokens = min(self.burst, self.tokens + (time - self.t) * self.rate) self.t = time if self.tokens >= c...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:58Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.7, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.125, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.775, "tests": 0.0, "total": 5.2}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "token_...
or-coding-py-debug-token-bucket-ba68a47d70d8
coding
debugging
expert
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement class `TokenBucket(rate, burst)` with `allow(time, cost=1)`. `rate` is tokens per time unit, `burst` is max tokens. Start full at t=0. `time` is non-decreasing. Return True if the request is ad...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_burst_then_refill (test_solution.Test.test_burst_then_refill) ... FAIL\n\n======================================================================\nFAIL:...
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
class TokenBucket: def __init__(self, rate, burst): self.rate = rate self.burst = burst self.tokens = float(burst) self.t = 0.0 def allow(self, time, cost=1): if time < self.t: raise ValueError("time") self.tokens = min(self.burst, self.tokens + (time - self.t) * self.rate) self.t = time if self.tokens >= c...
class TokenBucket: def __init__(self, rate, burst): self.rate = rate self.burst = burst self.tokens = float(burst) self.t = 0.0 def allow(self, time, cost=1): if time < self.t: raise ValueError("time") self.tokens = min(self.burst, self.tokens + (time - self.t) * self.rate) self.t = time if self.tokens >= c...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:58Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.7, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 11.0}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"err...
or-coding-py-openapi-required-d4f6731d64e0
coding
code_generation
beginner
Implement `missing_required(schema, payload)` where schema is `{"required": [...], "properties": {name: {"type": "string"|"number"|"boolean"}}}`. Return sorted names that are missing or have the wrong JSON type. Extra payload keys are ignored.
{"language": "python", "repository": {"files": {"solution.py": "def missing_required(schema, payload):\n types = {\"string\": str, \"number\": (int, float), \"boolean\": bool}\n bad = []\n for name in schema.get(\"required\", []):\n if name not in payload:\n bad.append(name)\n cont...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def missing_required(schema, payload): types = {"string": str, "number": (int, float), "boolean": bool} bad = [] for name in schema.get("required", []): if name not in payload: bad.append(name) continue declared = schema["properties"][name]["type"] if declared == "number" and isinstance(payload[name], bool): b...
def missing_required(schema, payload): types = {"string": str, "number": (int, float), "boolean": bool} bad = [] for name in schema.get("required", []): if name not in payload: bad.append(name) continue declared = schema["properties"][name]["type"] if declared == "number" and isinstance(payload[name], bool): b...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:59Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.conditionals
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.675, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.725, "tests": 0.0, "total": 4.0}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "openap...
or-coding-py-debug-openapi-required-4ba8a9abe615
coding
debugging
advanced
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `missing_required(schema, payload)` where schema is `{"required": [...], "properties": {name: {"type": "string"|"number"|"boolean"}}}`. Return sorted names that are missing or have the wrong JS...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_types (test_solution.Test.test_types) ... FAIL\n\n======================================================================\nFAIL: test_types (test_soluti...
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
def missing_required(schema, payload): types = {"string": str, "number": (int, float), "boolean": bool} bad = [] for name in schema.get("required", []): if name not in payload: bad.append(name) continue declared = schema["properties"][name]["type"] if declared == "number" and isinstance(payload[name], bool): b...
def missing_required(schema, payload): types = {"string": str, "number": (int, float), "boolean": bool} bad = [] for name in schema.get("required", []): if name not in payload: bad.append(name) continue declared = schema["properties"][name]["type"] if declared == "number" and isinstance(payload[name], bool): b...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:59Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.675, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.975}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {...
or-coding-py-layer-ports-b6582f00b6e8
coding
code_generation
beginner
Implement `allowed_import(from_layer, to_layer, rules)` where layers are strings and rules is a list of (src, dst) allowed edges. A module may always import from its own layer. Return True iff the import is permitted.
{"language": "python", "repository": {"files": {"solution.py": "def allowed_import(from_layer, to_layer, rules):\n if from_layer == to_layer:\n return True\n allowed = set(rules)\n return (from_layer, to_layer) in allowed\n", "test_solution.py": "import unittest\nfrom solution import allowed_import\n\nc...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def allowed_import(from_layer, to_layer, rules): if from_layer == to_layer: return True allowed = set(rules) return (from_layer, to_layer) in allowed
def allowed_import(from_layer, to_layer, rules): if from_layer == to_layer: return True allowed = set(rules) return (from_layer, to_layer) in allowed
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:59Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.4, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.85, "tests": 0.0, "total": 3.85}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "layer_po...
or-coding-py-debug-layer-ports-26eff8f48a77
coding
debugging
advanced
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `allowed_import(from_layer, to_layer, rules)` where layers are strings and rules is a list of (src, dst) allowed edges. A module may always import from its own layer. Return True iff the import...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_hex (test_solution.Test.test_hex) ... FAIL\n\n======================================================================\nFAIL: test_hex (test_solution.Tes...
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
def allowed_import(from_layer, to_layer, rules): if from_layer == to_layer: return True allowed = set(rules) return (from_layer, to_layer) in allowed
def allowed_import(from_layer, to_layer, rules): if from_layer == to_layer: return True allowed = set(rules) return (from_layer, to_layer) in allowed
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:59Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.4, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 3.775, "tests": 0.0, "total": 10.475}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {...
or-coding-py-infix-rpn-eval-24d19ffbb57b
coding
code_generation
intermediate
Implement `eval_rpn(tokens)` for integers and + - * / (integer division toward zero is NOT required: use Python `//` toward -inf). Tokens are strings.
{"language": "python", "repository": {"files": {"solution.py": "def eval_rpn(tokens):\n stack = []\n ops = {\n \"+\": lambda a, b: a + b,\n \"-\": lambda a, b: a - b,\n \"*\": lambda a, b: a * b,\n \"/\": lambda a, b: a // b,\n }\n for tok in tokens:\n if tok in ops:\n ...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def eval_rpn(tokens): stack = [] ops = { "+": lambda a, b: a + b, "-": lambda a, b: a - b, "*": lambda a, b: a * b, "/": lambda a, b: a // b, } for tok in tokens: if tok in ops: b = stack.pop() a = stack.pop() stack.append(ops[tok](a, b)) else: stack.append(int(tok)) if len(stack) != 1: raise ValueError...
def eval_rpn(tokens): stack = [] ops = { "+": lambda a, b: a + b, "-": lambda a, b: a - b, "*": lambda a, b: a * b, "/": lambda a, b: a // b, } for tok in tokens: if tok in ops: b = stack.pop() a = stack.pop() stack.append(ops[tok](a, b)) else: stack.append(int(tok)) if len(stack) != 1: raise ValueError...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:59Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.conditionals
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.7, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.6, "tests": 0.0, "total": 6.9}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "infix_rpn_...
or-coding-py-debug-infix-rpn-eval-cadd2bbd5165
coding
debugging
expert
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `eval_rpn(tokens)` for integers and + - * / (integer division toward zero is NOT required: use Python `//` toward -inf). Tokens are strings. --- solution.py (buggy) --- def eval_rpn(tokens): ...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_div (test_solution.Test.test_div) ... ok\ntest_expr (test_solution.Test.test_expr) ... FAIL\n\n========================================================...
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
def eval_rpn(tokens): stack = [] ops = { "+": lambda a, b: a + b, "-": lambda a, b: a - b, "*": lambda a, b: a * b, "/": lambda a, b: a // b, } for tok in tokens: if tok in ops: b = stack.pop() a = stack.pop() stack.append(ops[tok](a, b)) else: stack.append(int(tok)) if len(stack) != 1: raise ValueError...
def eval_rpn(tokens): stack = [] ops = { "+": lambda a, b: a + b, "-": lambda a, b: a - b, "*": lambda a, b: a * b, "/": lambda a, b: a // b, } for tok in tokens: if tok in ops: b = stack.pop() a = stack.pop() stack.append(ops[tok](a, b)) else: stack.append(int(tok)) if len(stack) != 1: raise ValueError...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:59Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.7, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 11.0}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"err...
or-coding-py-mini-typecheck-unify-593cc25f6fe5
coding
code_generation
intermediate
Implement `unify(a, b)` for a tiny type language: types are strings ('Int', 'Bool') or lists ['Fun', t1, t2]. Variables are strings starting with `?`. Return a dict substitution or None on failure. Do not need occurs-check beyond rejecting assigning a variable to a type that contains it as a nested list.
{"language": "python", "repository": {"files": {"solution.py": "def occurs(var, typ):\n if typ == var:\n return True\n if isinstance(typ, list):\n return any(occurs(var, part) for part in typ[1:])\n return False\n\ndef apply_sub(sub, typ):\n if isinstance(typ, str):\n return sub.get(typ...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def occurs(var, typ): if typ == var: return True if isinstance(typ, list): return any(occurs(var, part) for part in typ[1:]) return False def apply_sub(sub, typ): if isinstance(typ, str): return sub.get(typ, typ) return [typ[0], *(apply_sub(sub, p) for p in typ[1:])] def unify(a, b, sub=None): sub = dict(sub...
def occurs(var, typ): if typ == var: return True if isinstance(typ, list): return any(occurs(var, part) for part in typ[1:]) return False def apply_sub(sub, typ): if isinstance(typ, str): return sub.get(typ, typ) return [typ[0], *(apply_sub(sub, p) for p in typ[1:])] def unify(a, b, sub=None): sub = dict(sub...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:59Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 1.075, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.375, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 1.275, "tests": 0.0, "total": 5.325}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "mi...
or-coding-py-static-unused-38afb5319518
coding
code_generation
intermediate
Implement `unused_assigns(lines)` for a toy language: lines are `x = ...` or `use x`. Names are `[a-z]+`. Return sorted names assigned at least once and never used. Later use counts.
{"language": "python", "repository": {"files": {"solution.py": "import re\n\ndef unused_assigns(lines):\n assigned = set()\n used = set()\n for line in lines:\n m = re.fullmatch(r\"([a-z]+) = .*\", line.strip())\n if m:\n assigned.add(m.group(1))\n continue\n m = re.f...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
import re def unused_assigns(lines): assigned = set() used = set() for line in lines: m = re.fullmatch(r"([a-z]+) = .*", line.strip()) if m: assigned.add(m.group(1)) continue m = re.fullmatch(r"use ([a-z]+)", line.strip()) if m: used.add(m.group(1)) return sorted(assigned - used)
import re def unused_assigns(lines): assigned = set() used = set() for line in lines: m = re.fullmatch(r"([a-z]+) = .*", line.strip()) if m: assigned.add(m.group(1)) continue m = re.fullmatch(r"use ([a-z]+)", line.strip()) if m: used.add(m.group(1)) return sorted(assigned - used)
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:59Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.55, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.75, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.75, "tests": 0.0, "total": 5.65}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "static...
or-coding-py-doc-extract-params-c3a9d5470e58
coding
code_generation
beginner
Implement `google_args(docstring)` extracting Args from a Google-style docstring. Return a list of (name, description) for lines indented like ` name: desc`. Ignore other sections.
{"language": "python", "repository": {"files": {"solution.py": "def google_args(docstring):\n lines = docstring.splitlines()\n out = []\n in_args = False\n for line in lines:\n if line.strip() == \"Args:\":\n in_args = True\n continue\n if in_args and line.strip().endswit...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def google_args(docstring): lines = docstring.splitlines() out = [] in_args = False for line in lines: if line.strip() == "Args:": in_args = True continue if in_args and line.strip().endswith(":") and not line.startswith(" "): break if in_args: stripped = line.strip() if ": " in stripped: name, desc = stri...
def google_args(docstring): lines = docstring.splitlines() out = [] in_args = False for line in lines: if line.strip() == "Args:": in_args = True continue if in_args and line.strip().endswith(":") and not line.startswith(" "): break if in_args: stripped = line.strip() if ": " in stripped: name, desc = stri...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:59Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.625, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.125, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.6, "tests": 0.0, "total": 3.95}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "doc_e...
or-coding-py-debug-doc-extract-params-513944f8b950
coding
debugging
advanced
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `google_args(docstring)` extracting Args from a Google-style docstring. Return a list of (name, description) for lines indented like ` name: desc`. Ignore other sections. --- solution.py (bugg...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_args (test_solution.Test.test_args) ... FAIL\n\n======================================================================\nFAIL: test_args (test_solution....
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
def google_args(docstring): lines = docstring.splitlines() out = [] in_args = False for line in lines: if line.strip() == "Args:": in_args = True continue if in_args and line.strip().endswith(":") and not line.startswith(" "): break if in_args: stripped = line.strip() if ": " in stripped: name, desc = stri...
def google_args(docstring): lines = docstring.splitlines() out = [] in_args = False for line in lines: if line.strip() == "Args:": in_args = True continue if in_args and line.strip().endswith(":") and not line.startswith(" "): break if in_args: stripped = line.strip() if ": " in stripped: name, desc = stri...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:59Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.625, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.925}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {...
or-coding-py-migrate-rename-keys-ae57de445432
coding
code_generation
beginner
Implement `migrate_v1_to_v2(payload)` renaming keys `userName`->`username` and `emailAddress`->`email`, leaving other keys. Missing keys stay missing.
{"language": "python", "repository": {"files": {"solution.py": "def migrate_v1_to_v2(payload):\n mapping = {\"userName\": \"username\", \"emailAddress\": \"email\"}\n return {mapping.get(k, k): v for k, v in payload.items()}\n", "test_solution.py": "import unittest\nfrom solution import migrate_v1_to_v2\n\nclass ...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def migrate_v1_to_v2(payload): mapping = {"userName": "username", "emailAddress": "email"} return {mapping.get(k, k): v for k, v in payload.items()}
def migrate_v1_to_v2(payload): mapping = {"userName": "username", "emailAddress": "email"} return {mapping.get(k, k): v for k, v in payload.items()}
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:59Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.35, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.25, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.35, "tests": 0.0, "total": 3.5500000000000003}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "...
or-coding-py-compat-flag-23b7947ba53a
coding
code_generation
beginner
Implement `api_supported(client, server)` where versions are (major, minor). Compatible iff major matches and client.minor <= server.minor.
{"language": "python", "repository": {"files": {"solution.py": "def api_supported(client, server):\n return client[0] == server[0] and client[1] <= server[1]\n", "test_solution.py": "import unittest\nfrom solution import api_supported\n\nclass Test(unittest.TestCase):\n def test_ok(self):\n self.assertTrue...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def api_supported(client, server): return client[0] == server[0] and client[1] <= server[1]
def api_supported(client, server): return client[0] == server[0] and client[1] <= server[1]
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:59Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.3, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.4, "tests": 0.0, "total": 3.3}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "compat_fla...
or-coding-py-dockerfile-user-99c246d38333
coding
code_generation
beginner
Implement `dockerfile_runs_as_root(text)` returning True if the last USER instruction is missing or is `USER root` / `USER 0` (ignoring case on root). Comment lines starting with # are ignored.
{"language": "python", "repository": {"files": {"solution.py": "def dockerfile_runs_as_root(text):\n user = None\n for raw in text.splitlines():\n line = raw.strip()\n if not line or line.startswith(\"#\"):\n continue\n parts = line.split()\n if parts[0].upper() == \"USER\":...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def dockerfile_runs_as_root(text): user = None for raw in text.splitlines(): line = raw.strip() if not line or line.startswith("#"): continue parts = line.split() if parts[0].upper() == "USER": user = parts[1] if len(parts) > 1 else "" if user is None: return True return user.lower() == "root" or user == "0"
def dockerfile_runs_as_root(text): user = None for raw in text.splitlines(): line = raw.strip() if not line or line.startswith("#"): continue parts = line.split() if parts[0].upper() == "USER": user = parts[1] if len(parts) > 1 else "" if user is None: return True return user.lower() == "root" or user == "0"
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:59Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.conditionals
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.55, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.125, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.725, "tests": 0.0, "total": 4.0}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "docke...
or-coding-py-debug-dockerfile-user-4c8fafbbafc1
coding
debugging
advanced
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `dockerfile_runs_as_root(text)` returning True if the last USER instruction is missing or is `USER root` / `USER 0` (ignoring case on root). Comment lines starting with # are ignored. --- solu...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_last_user (test_solution.Test.test_last_user) ... FAIL\n\n======================================================================\nFAIL: test_last_user ...
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
def dockerfile_runs_as_root(text): user = None for raw in text.splitlines(): line = raw.strip() if not line or line.startswith("#"): continue parts = line.split() if parts[0].upper() == "USER": user = parts[1] if len(parts) > 1 else "" if user is None: return True return user.lower() == "root" or user == "0"
def dockerfile_runs_as_root(text): user = None for raw in text.splitlines(): line = raw.strip() if not line or line.startswith("#"): continue parts = line.split() if parts[0].upper() == "USER": user = parts[1] if len(parts) > 1 else "" if user is None: return True return user.lower() == "root" or user == "0"
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:59Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.55, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.85}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"e...
or-coding-py-compose-depends-cf786caf91fe
coding
code_generation
intermediate
Implement `startup_order(depends)` where depends maps service -> list of services it needs first. Return a topological order. Raise ValueError on cycles.
{"language": "python", "repository": {"files": {"solution.py": "from collections import defaultdict, deque\n\ndef startup_order(depends):\n nodes = set(depends)\n for deps in depends.values():\n nodes.update(deps)\n incoming = {n: 0 for n in nodes}\n graph = defaultdict(list)\n for svc, deps in de...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
from collections import defaultdict, deque def startup_order(depends): nodes = set(depends) for deps in depends.values(): nodes.update(deps) incoming = {n: 0 for n in nodes} graph = defaultdict(list) for svc, deps in depends.items(): for dep in deps: graph[dep].append(svc) incoming[svc] += 1 ready = deque([n...
from collections import defaultdict, deque def startup_order(depends): nodes = set(depends) for deps in depends.values(): nodes.update(deps) incoming = {n: 0 for n in nodes} graph = defaultdict(list) for svc, deps in depends.items(): for dep in deps: graph[dep].append(svc) incoming[svc] += 1 ready = deque([n...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:00Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.collections
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.85, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.625, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.525, "tests": 0.0, "total": 4.6}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "compo...
or-coding-py-debug-compose-depends-e6950cea10f0
coding
debugging
expert
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `startup_order(depends)` where depends maps service -> list of services it needs first. Return a topological order. Raise ValueError on cycles. --- solution.py (buggy) --- from collections imp...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_order (test_solution.Test.test_order) ... FAIL\n\n======================================================================\nFAIL: test_order (test_soluti...
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
from collections import defaultdict, deque def startup_order(depends): nodes = set(depends) for deps in depends.values(): nodes.update(deps) incoming = {n: 0 for n in nodes} graph = defaultdict(list) for svc, deps in depends.items(): for dep in deps: graph[dep].append(svc) incoming[svc] += 1 ready = deque([n...
from collections import defaultdict, deque def startup_order(depends): nodes = set(depends) for deps in depends.values(): nodes.update(deps) incoming = {n: 0 for n in nodes} graph = defaultdict(list) for svc, deps in depends.items(): for dep in deps: graph[dep].append(svc) incoming[svc] += 1 ready = deque([n...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:00Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.collections
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.85, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 11.15}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"e...
or-coding-py-async-gather-ok-95298ce50108
coding
code_generation
intermediate
Implement `first_true(predicates)` where predicates is a list of zero-arg callables. Return the index of the first that returns a truthy value, or -1. Later predicates must not be called after success (short-circuit).
{"language": "python", "repository": {"files": {"solution.py": "def first_true(predicates):\n for i, fn in enumerate(predicates):\n if fn():\n return i\n return -1\n", "test_solution.py": "import unittest\nfrom solution import first_true\n\nclass Test(unittest.TestCase):\n def test_short(self...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def first_true(predicates): for i, fn in enumerate(predicates): if fn(): return i return -1
def first_true(predicates): for i, fn in enumerate(predicates): if fn(): return i return -1
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:00Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.6, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.625, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.8, "tests": 0.0, "total": 4.625}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "async_...
or-coding-py-mutex-counter-52c971c4e6a9
coding
code_generation
beginner
Implement `threaded_increment(n_threads, n_each)` that starts n_threads threads each adding n_each to a shared integer behind a threading.Lock. Return the final count (must equal n_threads * n_each).
{"language": "python", "repository": {"files": {"solution.py": "import threading\n\ndef threaded_increment(n_threads, n_each):\n lock = threading.Lock()\n value = {\"n\": 0}\n\n def worker():\n for _ in range(n_each):\n with lock:\n value[\"n\"] += 1\n\n threads = [threading...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
import threading def threaded_increment(n_threads, n_each): lock = threading.Lock() value = {"n": 0} def worker(): for _ in range(n_each): with lock: value["n"] += 1 threads = [threading.Thread(target=worker) for _ in range(n_threads)] for t in threads: t.start() for t in threads: t.join() return value["...
import threading def threaded_increment(n_threads, n_each): lock = threading.Lock() value = {"n": 0} def worker(): for _ in range(n_each): with lock: value["n"] += 1 threads = [threading.Thread(target=worker) for _ in range(n_threads)] for t in threads: t.start() for t in threads: t.join() return value["...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:00Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.625, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.375, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.65, "tests": 0.0, "total": 4.25}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "mute...
or-coding-py-two-sum-index-9c2e41fc19d9
coding
code_generation
beginner
Implement `pair_indices(nums, target)` returning a pair of distinct indices i < j such that nums[i] + nums[j] == target, or None. Prefer the lexicographically smallest (i, j).
{"language": "python", "repository": {"files": {"solution.py": "def pair_indices(nums, target):\n seen = {}\n best = None\n for i, value in enumerate(nums):\n need = target - value\n if need in seen:\n cand = (seen[need], i)\n if best is None or cand < best:\n ...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def pair_indices(nums, target): seen = {} best = None for i, value in enumerate(nums): need = target - value if need in seen: cand = (seen[need], i) if best is None or cand < best: best = cand if value not in seen: seen[value] = i return best
def pair_indices(nums, target): seen = {} best = None for i, value in enumerate(nums): need = target - value if need in seen: cand = (seen[need], i) if best is None or cand < best: best = cand if value not in seen: seen[value] = i return best
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:00Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.55, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.375, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.675, "tests": 0.0, "total": 4.2}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "two_s...
or-coding-py-edit-distance-k-d9911a04d868
coding
code_generation
intermediate
Implement `within_edit(a, b, k)` True iff Levenshtein distance(a, b) <= k. You may use DP. Strings are short.
{"language": "python", "repository": {"files": {"solution.py": "def within_edit(a, b, k):\n if abs(len(a) - len(b)) > k:\n return False\n prev = list(range(len(b) + 1))\n for i, ca in enumerate(a, start=1):\n row = [i]\n for j, cb in enumerate(b, start=1):\n cost = 0 if ca == cb...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def within_edit(a, b, k): if abs(len(a) - len(b)) > k: return False prev = list(range(len(b) + 1)) for i, ca in enumerate(a, start=1): row = [i] for j, cb in enumerate(b, start=1): cost = 0 if ca == cb else 1 row.append(min(row[j - 1] + 1, prev[j] + 1, prev[j - 1] + cost)) prev = row return prev[-1] <= k
def within_edit(a, b, k): if abs(len(a) - len(b)) > k: return False prev = list(range(len(b) + 1)) for i, ca in enumerate(a, start=1): row = [i] for j, cb in enumerate(b, start=1): cost = 0 if ca == cb else 1 row.append(min(row[j - 1] + 1, prev[j] + 1, prev[j - 1] + cost)) prev = row return prev[-1] <= k
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:00Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.conditionals
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.5, "constraints": 1.4, "keywords": 0.0, "math_ops": 2.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.45, "tests": 0.0, "total": 5.550000000000001}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slu...
or-coding-py-cycle-list-4961dd97c673
coding
code_generation
beginner
Represent a singly linked list as nodes `{"v": value, "n": next_or_None}`. Implement `has_cycle(head)` using constant extra memory (Floyd).
{"language": "python", "repository": {"files": {"solution.py": "def has_cycle(head):\n slow = head\n fast = head\n while fast and fast[\"n\"]:\n slow = slow[\"n\"]\n fast = fast[\"n\"][\"n\"]\n if slow is fast:\n return True\n return False\n", "test_solution.py": "import unit...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def has_cycle(head): slow = head fast = head while fast and fast["n"]: slow = slow["n"] fast = fast["n"]["n"] if slow is fast: return True return False
def has_cycle(head): slow = head fast = head while fast and fast["n"]: slow = slow["n"] fast = fast["n"]["n"] if slow is fast: return True return False
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:00Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.575, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.45, "tests": 0.0, "total": 3.625}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "cycle...
or-coding-py-debug-cycle-list-92acf22819df
coding
debugging
advanced
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Represent a singly linked list as nodes `{"v": value, "n": next_or_None}`. Implement `has_cycle(head)` using constant extra memory (Floyd). --- solution.py (buggy) --- def has_cycle(head): slow = head ...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_cycle (test_solution.Test.test_cycle) ... FAIL\n\n======================================================================\nFAIL: test_cycle (test_soluti...
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
def has_cycle(head): slow = head fast = head while fast and fast["n"]: slow = slow["n"] fast = fast["n"]["n"] if slow is fast: return True return False
def has_cycle(head): slow = head fast = head while fast and fast["n"]: slow = slow["n"] fast = fast["n"]["n"] if slow is fast: return True return False
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:00Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.575, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.875}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {...
or-coding-py-bst-validate-4c158319df27
coding
code_generation
beginner
Nodes are `{"v": int, "l": node|None, "r": node|None}`. Implement `is_bst(root)` with strict ordering (left < v < right) for the whole tree.
{"language": "python", "repository": {"files": {"solution.py": "def is_bst(root, lo=None, hi=None):\n if root is None:\n return True\n v = root[\"v\"]\n if lo is not None and v <= lo:\n return False\n if hi is not None and v >= hi:\n return False\n return is_bst(root[\"l\"], lo, v) a...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def is_bst(root, lo=None, hi=None): if root is None: return True v = root["v"] if lo is not None and v <= lo: return False if hi is not None and v >= hi: return False return is_bst(root["l"], lo, v) and is_bst(root["r"], v, hi)
def is_bst(root, lo=None, hi=None): if root is None: return True v = root["v"] if lo is not None and v <= lo: return False if hi is not None and v >= hi: return False return is_bst(root["l"], lo, v) and is_bst(root["r"], v, hi)
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:00Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.525, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.55, "tests": 0.0, "total": 3.6750000000000003}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "...
or-coding-py-debug-bst-validate-fbc45fa163b6
coding
debugging
advanced
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Nodes are `{"v": int, "l": node|None, "r": node|None}`. Implement `is_bst(root)` with strict ordering (left < v < right) for the whole tree. --- solution.py (buggy) --- def is_bst(root, lo=None, hi=None...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_bad (test_solution.Test.test_bad) ... ok\ntest_ok (test_solution.Test.test_ok) ... FAIL\n\n============================================================...
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
def is_bst(root, lo=None, hi=None): if root is None: return True v = root["v"] if lo is not None and v <= lo: return False if hi is not None and v >= hi: return False return is_bst(root["l"], lo, v) and is_bst(root["r"], v, hi)
def is_bst(root, lo=None, hi=None): if root is None: return True v = root["v"] if lo is not None and v <= lo: return False if hi is not None and v >= hi: return False return is_bst(root["l"], lo, v) and is_bst(root["r"], v, hi)
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:00Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.525, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.825}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {...
or-coding-py-cli-argv-1cfeb4dc50c7
coding
code_generation
intermediate
Implement `parse_flags(argv)` for a tiny CLI: flags `--name value` and boolean `--verbose` present-or-not. Remaining tokens are positional. Return `{"flags": dict, "args": list}`. `--verbose` maps to True.
{"language": "python", "repository": {"files": {"solution.py": "def parse_flags(argv):\n flags = {}\n args = []\n i = 0\n while i < len(argv):\n tok = argv[i]\n if tok == \"--verbose\":\n flags[\"verbose\"] = True\n i += 1\n elif tok.startswith(\"--\"):\n ...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def parse_flags(argv): flags = {} args = [] i = 0 while i < len(argv): tok = argv[i] if tok == "--verbose": flags["verbose"] = True i += 1 elif tok.startswith("--"): name = tok[2:] if i + 1 >= len(argv): raise ValueError("missing") flags[name] = argv[i + 1] i += 2 else: args.append(tok) i += 1 return ...
def parse_flags(argv): flags = {} args = [] i = 0 while i < len(argv): tok = argv[i] if tok == "--verbose": flags["verbose"] = True i += 1 elif tok.startswith("--"): name = tok[2:] if i + 1 >= len(argv): raise ValueError("missing") flags[name] = argv[i + 1] i += 2 else: args.append(tok) i += 1 return ...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:00Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.conditionals
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.75, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.65, "tests": 0.0, "total": 7.0}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "cli_argv...
or-coding-py-makefile-targets-d2abd26b36ee
coding
code_generation
beginner
Implement `make_targets(text)` extracting target names from lines matching `target: deps` at column 0 (no leading whitespace). Skip `.PHONY` and comments.
{"language": "python", "repository": {"files": {"solution.py": "def make_targets(text):\n names = []\n for raw in text.splitlines():\n if not raw or raw.startswith(\"\\t\") or raw.startswith(\" \") or raw.startswith(\"#\"):\n continue\n if \":\" not in raw:\n continue\n ...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def make_targets(text): names = [] for raw in text.splitlines(): if not raw or raw.startswith("\t") or raw.startswith(" ") or raw.startswith("#"): continue if ":" not in raw: continue target = raw.split(":", 1)[0].strip() if target and target != ".PHONY": names.append(target) return names
def make_targets(text): names = [] for raw in text.splitlines(): if not raw or raw.startswith("\t") or raw.startswith(" ") or raw.startswith("#"): continue if ":" not in raw: continue target = raw.split(":", 1)[0].strip() if target and target != ".PHONY": names.append(target) return names
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:00Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.5, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.5, "tests": 0.0, "total": 3.6}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "makefile_t...
or-coding-py-ci-junit-counts-bd792f4e3f79
coding
code_generation
intermediate
Implement `junit_counts(xml)` for a tiny subset: count `failures=` and `tests=` on the first `<testsuite ...>` tag using regex. Return `{"tests": int, "failures": int}`.
{"language": "python", "repository": {"files": {"solution.py": "import re\n\ndef junit_counts(xml):\n m = re.search(r\"<testsuite\\b[^>]*>\", xml)\n if not m:\n raise ValueError(\"no testsuite\")\n tag = m.group(0)\n tests = int(re.search(r'tests=\"(\\d+)\"', tag).group(1))\n failures = int(re.sea...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
import re def junit_counts(xml): m = re.search(r"<testsuite\b[^>]*>", xml) if not m: raise ValueError("no testsuite") tag = m.group(0) tests = int(re.search(r'tests="(\d+)"', tag).group(1)) failures = int(re.search(r'failures="(\d+)"', tag).group(1)) return {"tests": tests, "failures": failures}
import re def junit_counts(xml): m = re.search(r"<testsuite\b[^>]*>", xml) if not m: raise ValueError("no testsuite") tag = m.group(0) tests = int(re.search(r'tests="(\d+)"', tag).group(1)) failures = int(re.search(r'failures="(\d+)"', tag).group(1)) return {"tests": tests, "failures": failures}
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:00Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.475, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.575, "tests": 0.0, "total": 4.65}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "ci_ju...
or-coding-py-healthcheck-backoff-7f8970814d92
coding
code_generation
intermediate
Implement `backoff_delays(retries, base, cap)` returning a list of length `retries` with delays min(cap, base * 2**i) for i=0..retries-1.
{"language": "python", "repository": {"files": {"solution.py": "def backoff_delays(retries, base, cap):\n return [min(cap, base * (2 ** i)) for i in range(retries)]\n", "test_solution.py": "import unittest\nfrom solution import backoff_delays\n\nclass Test(unittest.TestCase):\n def test_cap(self):\n self.a...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def backoff_delays(retries, base, cap): return [min(cap, base * (2 ** i)) for i in range(retries)]
def backoff_delays(retries, base, cap): return [min(cap, base * (2 ** i)) for i in range(retries)]
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:00Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.25, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.25, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.45, "tests": 0.0, "total": 4.550000000000001}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "s...
or-coding-py-hot-path-count-07accf47237f
coding
code_generation
intermediate
Implement `majority_nlogn_forbidden(nums)` finding the element that appears more than n/2 times. Use Boyer-Moore. Guarantee O(n) time, O(1) extra memory aside from the input. The input is guaranteed to have a majority.
{"language": "python", "repository": {"files": {"solution.py": "def majority(nums):\n vote = 0\n cand = None\n for x in nums:\n if vote == 0:\n cand = x\n vote += 1 if x == cand else -1\n return cand\n", "test_solution.py": "import unittest\nfrom solution import majority\n\nclass Te...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def majority(nums): vote = 0 cand = None for x in nums: if vote == 0: cand = x vote += 1 if x == cand else -1 return cand
def majority(nums): vote = 0 cand = None for x in nums: if vote == 0: cand = x vote += 1 if x == cand else -1 return cand
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:01Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.conditionals
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.4, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.75, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.775, "tests": 0.0, "total": 4.525}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "hot_p...
or-coding-py-arena-bump-f435a0b50f59
coding
code_generation
beginner
Implement class `BumpArena(size)` with `alloc(n)` returning the start offset of n contiguous bytes or None if it will not fit, and `reset()` to free everything. No coalescing needed.
{"language": "python", "repository": {"files": {"solution.py": "class BumpArena:\n def __init__(self, size):\n self.size = size\n self.offset = 0\n\n def alloc(self, n):\n if n < 0 or self.offset + n > self.size:\n return None\n start = self.offset\n self.offset += n\...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
class BumpArena: def __init__(self, size): self.size = size self.offset = 0 def alloc(self, n): if n < 0 or self.offset + n > self.size: return None start = self.offset self.offset += n return start def reset(self): self.offset = 0
class BumpArena: def __init__(self, size): self.size = size self.offset = 0 def alloc(self, n): if n < 0 or self.offset + n > self.size: return None start = self.offset self.offset += n return start def reset(self): self.offset = 0
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:01Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.675, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.5, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.7, "tests": 0.0, "total": 4.475}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "arena_...
or-coding-py-debug-arena-bump-5fee1936384d
coding
debugging
advanced
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement class `BumpArena(size)` with `alloc(n)` returning the start offset of n contiguous bytes or None if it will not fit, and `reset()` to free everything. No coalescing needed. --- solution.py (bu...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_alloc (test_solution.Test.test_alloc) ... FAIL\n\n======================================================================\nFAIL: test_alloc (test_soluti...
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
class BumpArena: def __init__(self, size): self.size = size self.offset = 0 def alloc(self, n): if n < 0 or self.offset + n > self.size: return None start = self.offset self.offset += n return start def reset(self): self.offset = 0
class BumpArena: def __init__(self, size): self.size = size self.offset = 0 def alloc(self, n): if n < 0 or self.offset + n > self.size: return None start = self.offset self.offset += n return start def reset(self): self.offset = 0
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:01Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.675, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.975}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {...
or-coding-py-tokenize-c-idents-85906e6bb602
coding
code_generation
intermediate
Implement `c_idents(source)` returning identifiers matching `[A-Za-z_][A-Za-z0-9_]*` in order, skipping those inside double-quoted strings. Do not handle escapes other than `\\` and `\"`. Comments are not supported.
{"language": "python", "repository": {"files": {"solution.py": "def c_idents(source):\n ident = []\n out = []\n i = 0\n n = len(source)\n while i < n:\n ch = source[i]\n if ch == '\"':\n i += 1\n while i < n:\n if source[i] == \"\\\\\":\n ...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def c_idents(source): ident = [] out = [] i = 0 n = len(source) while i < n: ch = source[i] if ch == '"': i += 1 while i < n: if source[i] == "\\": i += 2 continue if source[i] == '"': i += 1 break i += 1 continue if ch.isalnum() or ch == "_": j = i while j < n and (source[j].isalnum() or source[j] ...
def c_idents(source): ident = [] out = [] i = 0 n = len(source) while i < n: ch = source[i] if ch == '"': i += 1 while i < n: if source[i] == "\\": i += 2 continue if source[i] == '"': i += 1 break i += 1 continue if ch.isalnum() or ch == "_": j = i while j < n and (source[j].isalnum() or source[j] ...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:01Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.95, "constraints": 1.4, "keywords": 0.0, "math_ops": 2.375, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.65, "tests": 0.0, "total": 6.575}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "toke...
or-coding-py-debug-tokenize-c-idents-f76b8c1f1103
coding
debugging
expert
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `c_idents(source)` returning identifiers matching `[A-Za-z_][A-Za-z0-9_]*` in order, skipping those inside double-quoted strings. Do not handle escapes other than `\\` and `\"`. Comments are no...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_skip_string (test_solution.Test.test_skip_string) ... FAIL\n\n======================================================================\nFAIL: test_skip_s...
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
def c_idents(source): ident = [] out = [] i = 0 n = len(source) while i < n: ch = source[i] if ch == '"': i += 1 while i < n: if source[i] == "\\": i += 2 continue if source[i] == '"': i += 1 break i += 1 continue if ch.isalnum() or ch == "_": j = i while j < n and (source[j].isalnum() or source[j] ...
def c_idents(source): ident = [] out = [] i = 0 n = len(source) while i < n: ch = source[i] if ch == '"': i += 1 while i < n: if source[i] == "\\": i += 2 continue if source[i] == '"': i += 1 break i += 1 continue if ch.isalnum() or ch == "_": j = i while j < n and (source[j].isalnum() or source[j] ...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:01Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.95, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 11.25}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"e...
or-coding-py-refcount-toy-e57fc477513c
coding
code_generation
beginner
Implement class `Rc` with `inc()`, `dec()`, and `alive()` for a toy refcount. `dec` below zero raises ValueError. Start at 1.
{"language": "python", "repository": {"files": {"solution.py": "class Rc:\n def __init__(self):\n self.count = 1\n\n def inc(self):\n self.count += 1\n\n def dec(self):\n if self.count <= 0:\n raise ValueError(\"underflow\")\n self.count -= 1\n\n def alive(self):\n ...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
class Rc: def __init__(self): self.count = 1 def inc(self): self.count += 1 def dec(self): if self.count <= 0: raise ValueError("underflow") self.count -= 1 def alive(self): return self.count > 0
class Rc: def __init__(self): self.count = 1 def inc(self): self.count += 1 def dec(self): if self.count <= 0: raise ValueError("underflow") self.count -= 1 def alive(self): return self.count > 0
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:01Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.675, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.5, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.5, "tests": 0.0, "total": 4.275}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "refcou...
or-coding-py-zip-longest-fill-fa335858e41a
coding
code_generation
beginner
Implement `zip_fill(*seqs, fill=None)` equivalent to padding all sequences to the longest length then zipping. Return a list of tuples.
{"language": "python", "repository": {"files": {"solution.py": "def zip_fill(*seqs, fill=None):\n seqs = [list(s) for s in seqs]\n if not seqs:\n return []\n n = max(len(s) for s in seqs)\n out = []\n for i in range(n):\n out.append(tuple(s[i] if i < len(s) else fill for s in seqs))\n re...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def zip_fill(*seqs, fill=None): seqs = [list(s) for s in seqs] if not seqs: return [] n = max(len(s) for s in seqs) out = [] for i in range(n): out.append(tuple(s[i] if i < len(s) else fill for s in seqs)) return out
def zip_fill(*seqs, fill=None): seqs = [list(s) for s in seqs] if not seqs: return [] n = max(len(s) for s in seqs) out = [] for i in range(n): out.append(tuple(s[i] if i < len(s) else fill for s in seqs)) return out
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:01Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.conditionals
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.425, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.375, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.475, "tests": 0.0, "total": 3.875}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "zi...
or-coding-py-coverage-uncovered-0981a6b7636b
coding
code_generation
beginner
Implement `uncovered(lines, hit)` where `lines` is a set of executable line numbers and `hit` is a list of line numbers executed (with duplicates). Return sorted executable lines that never appear in `hit`.
{"language": "python", "repository": {"files": {"solution.py": "def uncovered(lines, hit):\n seen = set(hit)\n return sorted(n for n in lines if n not in seen)\n", "test_solution.py": "import unittest\nfrom solution import uncovered\n\nclass Test(unittest.TestCase):\n def test_gap(self):\n self.assertEq...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def uncovered(lines, hit): seen = set(hit) return sorted(n for n in lines if n not in seen)
def uncovered(lines, hit): seen = set(hit) return sorted(n for n in lines if n not in seen)
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:01Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.275, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.8, "tests": 0.0, "total": 3.6750000000000003}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "s...
or-coding-py-flake-rerun-0082fc318002
coding
code_generation
beginner
Implement `classify_flaky(results)` where results is a list of bool pass/fail for the same test. Return `pass` if all True, `fail` if all False, `flaky` otherwise.
{"language": "python", "repository": {"files": {"solution.py": "def classify_flaky(results):\n if not results:\n raise ValueError(\"empty\")\n if all(results):\n return \"pass\"\n if not any(results):\n return \"fail\"\n return \"flaky\"\n", "test_solution.py": "import unittest\nfrom so...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def classify_flaky(results): if not results: raise ValueError("empty") if all(results): return "pass" if not any(results): return "fail" return "flaky"
def classify_flaky(results): if not results: raise ValueError("empty") if all(results): return "pass" if not any(results): return "fail" return "flaky"
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:01Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.45, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.125, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.625, "tests": 0.0, "total": 3.8000000000000003}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0",...
or-coding-py-review-complexity-8e95f6406df3
coding
code_generation
intermediate
Implement `nested_loop_depth(source)` counting the maximum nesting of lines that strip-start with `for ` or `while ` based on leading indent (4 spaces). This is a review heuristic, not a Python parser.
{"language": "python", "repository": {"files": {"solution.py": "def nested_loop_depth(source):\n best = 0\n for raw in source.splitlines():\n if not raw.strip():\n continue\n indent = (len(raw) - len(raw.lstrip(\" \"))) // 4\n stripped = raw.strip()\n if stripped.startswith(...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def nested_loop_depth(source): best = 0 for raw in source.splitlines(): if not raw.strip(): continue indent = (len(raw) - len(raw.lstrip(" "))) // 4 stripped = raw.strip() if stripped.startswith("for ") or stripped.startswith("while "): best = max(best, indent + 1) return best
def nested_loop_depth(source): best = 0 for raw in source.splitlines(): if not raw.strip(): continue indent = (len(raw) - len(raw.lstrip(" "))) // 4 stripped = raw.strip() if stripped.startswith("for ") or stripped.startswith("while "): best = max(best, indent + 1) return best
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:01Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.loops
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.475, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.125, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.775, "tests": 0.0, "total": 4.975}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "re...
or-coding-py-debug-review-complexity-30413396f099
coding
debugging
advanced
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `nested_loop_depth(source)` counting the maximum nesting of lines that strip-start with `for ` or `while ` based on leading indent (4 spaces). This is a review heuristic, not a Python parser. ...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_depth (test_solution.Test.test_depth) ... FAIL\n\n======================================================================\nFAIL: test_depth (test_soluti...
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
def nested_loop_depth(source): best = 0 for raw in source.splitlines(): if not raw.strip(): continue indent = (len(raw) - len(raw.lstrip(" "))) // 4 stripped = raw.strip() if stripped.startswith("for ") or stripped.startswith("while "): best = max(best, indent + 1) return best
def nested_loop_depth(source): best = 0 for raw in source.splitlines(): if not raw.strip(): continue indent = (len(raw) - len(raw.lstrip(" "))) // 4 stripped = raw.strip() if stripped.startswith("for ") or stripped.startswith("while "): best = max(best, indent + 1) return best
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:01Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.475, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.774999999999999}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {...
or-coding-py-wasm-leb-u32-d0df71ce4311
coding
code_generation
beginner
Implement `decode_uleb128(data: bytes)` decoding one unsigned LEB128 integer from the start of data and returning (value, bytes_consumed).
{"language": "python", "repository": {"files": {"solution.py": "def decode_uleb128(data):\n result = 0\n shift = 0\n for i, byte in enumerate(data):\n result |= (byte & 0x7F) << shift\n if byte & 0x80 == 0:\n return result, i + 1\n shift += 7\n if shift > 35:\n ...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def decode_uleb128(data): result = 0 shift = 0 for i, byte in enumerate(data): result |= (byte & 0x7F) << shift if byte & 0x80 == 0: return result, i + 1 shift += 7 if shift > 35: raise ValueError("overflow") raise ValueError("truncated")
def decode_uleb128(data): result = 0 shift = 0 for i, byte in enumerate(data): result |= (byte & 0x7F) << shift if byte & 0x80 == 0: return result, i + 1 shift += 7 if shift > 35: raise ValueError("overflow") raise ValueError("truncated")
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:01Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.525, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.5, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.425, "tests": 0.0, "total": 4.05}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "wasm_...
or-coding-py-debug-wasm-leb-u32-3c9497a82fe3
coding
debugging
advanced
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `decode_uleb128(data: bytes)` decoding one unsigned LEB128 integer from the start of data and returning (value, bytes_consumed). --- solution.py (buggy) --- def decode_uleb128(data): result =...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 1, \"errors\": 1, \"skipped\": 0, \"passed\": false}\n\ntest_multi (test_solution.Test.test_multi) ... FAIL\ntest_small (test_solution.Test.test_small) ... ERROR\n\n===============================================...
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
def decode_uleb128(data): result = 0 shift = 0 for i, byte in enumerate(data): result |= (byte & 0x7F) << shift if byte & 0x80 == 0: return result, i + 1 shift += 7 if shift > 35: raise ValueError("overflow") raise ValueError("truncated")
def decode_uleb128(data): result = 0 shift = 0 for i, byte in enumerate(data): result |= (byte & 0x7F) << shift if byte & 0x80 == 0: return result, i + 1 shift += 7 if shift > 35: raise ValueError("overflow") raise ValueError("truncated")
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:01Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.525, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.825}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {...
or-coding-py-glob-match-star-9bbfe8b3863c
coding
code_generation
intermediate
Implement `glob_match(pat, name)` supporting only `*` (any sequence) and literal characters. No character classes. Match the whole name.
{"language": "python", "repository": {"files": {"solution.py": "def glob_match(pat, name):\n def rec(i, j):\n if i == len(pat):\n return j == len(name)\n if pat[i] == \"*\":\n return rec(i + 1, j) or (j < len(name) and rec(i, j + 1))\n if j < len(name) and pat[i] == name[j]...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def glob_match(pat, name): def rec(i, j): if i == len(pat): return j == len(name) if pat[i] == "*": return rec(i + 1, j) or (j < len(name) and rec(i, j + 1)) if j < len(name) and pat[i] == name[j]: return rec(i + 1, j + 1) return False return rec(0, 0)
def glob_match(pat, name): def rec(i, j): if i == len(pat): return j == len(name) if pat[i] == "*": return rec(i + 1, j) or (j < len(name) and rec(i, j + 1)) if j < len(name) and pat[i] == name[j]: return rec(i + 1, j + 1) return False return rec(0, 0)
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:01Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.5, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.375, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.45, "tests": 0.0, "total": 4.925000000000001}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "s...
or-coding-py-debug-glob-match-star-37ca0c9f3328
coding
debugging
advanced
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `glob_match(pat, name)` supporting only `*` (any sequence) and literal characters. No character classes. Match the whole name. --- solution.py (buggy) --- def glob_match(pat, name): def rec(i...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_star (test_solution.Test.test_star) ... FAIL\n\n======================================================================\nFAIL: test_star (test_solution....
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
def glob_match(pat, name): def rec(i, j): if i == len(pat): return j == len(name) if pat[i] == "*": return rec(i + 1, j) or (j < len(name) and rec(i, j + 1)) if j < len(name) and pat[i] == name[j]: return rec(i + 1, j + 1) return False return rec(0, 0)
def glob_match(pat, name): def rec(i, j): if i == len(pat): return j == len(name) if pat[i] == "*": return rec(i + 1, j) or (j < len(name) and rec(i, j + 1)) if j < len(name) and pat[i] == name[j]: return rec(i + 1, j + 1) return False return rec(0, 0)
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:01Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.5, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 3.975, "tests": 0.0, "total": 10.775}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {...
or-coding-py-env-expand-56b651320e58
coding
code_generation
intermediate
Implement `expand_vars(text, env)` replacing `$NAME` and `${NAME}` where NAME is `[A-Z_][A-Z0-9_]*`. Unknown names become empty string. Do not expand inside single quotes `'...'`.
{"language": "python", "repository": {"files": {"solution.py": "import re\n\nTOKEN = re.compile(r\"\\$({)?([A-Z_][A-Z0-9_]*)(?(1)})\")\n\ndef expand_vars(text, env):\n out = []\n i = 0\n in_single = False\n while i < len(text):\n ch = text[i]\n if ch == \"'\" :\n in_single = not in_...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
import re TOKEN = re.compile(r"\$({)?([A-Z_][A-Z0-9_]*)(?(1)})") def expand_vars(text, env): out = [] i = 0 in_single = False while i < len(text): ch = text[i] if ch == "'" : in_single = not in_single out.append(ch) i += 1 continue if not in_single and ch == "$": m = TOKEN.match(text, i) if m: out.appen...
import re TOKEN = re.compile(r"\$({)?([A-Z_][A-Z0-9_]*)(?(1)})") def expand_vars(text, env): out = [] i = 0 in_single = False while i < len(text): ch = text[i] if ch == "'" : in_single = not in_single out.append(ch) i += 1 continue if not in_single and ch == "$": m = TOKEN.match(text, i) if m: out.appen...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:02Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.85, "constraints": 1.4, "keywords": 0.0, "math_ops": 2.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.575, "tests": 0.0, "total": 6.0249999999999995}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "...
or-coding-py-systemd-wanted-cbf71b9551eb
coding
code_generation
beginner
Implement `parse_wantedby(unit_text)` returning the WantedBy= value from an `[Install]` section, or None. Last matching line wins. Ignore comments.
{"language": "python", "repository": {"files": {"solution.py": "def parse_wantedby(unit_text):\n section = None\n wanted = None\n for raw in unit_text.splitlines():\n line = raw.split(\";\", 1)[0].split(\"#\", 1)[0].strip()\n if not line:\n continue\n if line.startswith(\"[\") a...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def parse_wantedby(unit_text): section = None wanted = None for raw in unit_text.splitlines(): line = raw.split(";", 1)[0].split("#", 1)[0].strip() if not line: continue if line.startswith("[") and line.endswith("]"): section = line[1:-1] continue if section == "Install" and line.startswith("WantedBy="): wan...
def parse_wantedby(unit_text): section = None wanted = None for raw in unit_text.splitlines(): line = raw.split(";", 1)[0].split("#", 1)[0].strip() if not line: continue if line.startswith("[") and line.endswith("]"): section = line[1:-1] continue if section == "Install" and line.startswith("WantedBy="): wan...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:02Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.55, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.25, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.45, "tests": 0.0, "total": 3.8500000000000005}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "...
or-coding-py-debug-systemd-wanted-2d060e31c4f0
coding
debugging
advanced
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `parse_wantedby(unit_text)` returning the WantedBy= value from an `[Install]` section, or None. Last matching line wins. Ignore comments. --- solution.py (buggy) --- def parse_wantedby(unit_te...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_install (test_solution.Test.test_install) ... FAIL\n\n======================================================================\nFAIL: test_install (test_...
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
def parse_wantedby(unit_text): section = None wanted = None for raw in unit_text.splitlines(): line = raw.split(";", 1)[0].split("#", 1)[0].strip() if not line: continue if line.startswith("[") and line.endswith("]"): section = line[1:-1] continue if section == "Install" and line.startswith("WantedBy="): wan...
def parse_wantedby(unit_text): section = None wanted = None for raw in unit_text.splitlines(): line = raw.split(";", 1)[0].split("#", 1)[0].strip() if not line: continue if line.startswith("[") and line.endswith("]"): section = line[1:-1] continue if section == "Install" and line.startswith("WantedBy="): wan...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:02Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.55, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 3.65, "tests": 0.0, "total": 10.5}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"e...
or-coding-py-k8s-resource-parse-75bda9ed0cce
coding
code_generation
beginner
Implement `parse_cpu(value)` converting Kubernetes CPU strings: `100m` -> 0.1, `2` -> 2.0. Raise ValueError otherwise.
{"language": "python", "repository": {"files": {"solution.py": "def parse_cpu(value):\n if value.endswith(\"m\") and value[:-1].isdigit():\n return int(value[:-1]) / 1000.0\n if value.replace(\".\", \"\", 1).isdigit():\n return float(value)\n raise ValueError(value)\n", "test_solution.py": "impor...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def parse_cpu(value): if value.endswith("m") and value[:-1].isdigit(): return int(value[:-1]) / 1000.0 if value.replace(".", "", 1).isdigit(): return float(value) raise ValueError(value)
def parse_cpu(value): if value.endswith("m") and value[:-1].isdigit(): return int(value[:-1]) / 1000.0 if value.replace(".", "", 1).isdigit(): return float(value) raise ValueError(value)
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:02Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.375, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.375, "tests": 0.0, "total": 4.35}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "k8s_r...
or-coding-py-ring-buffer-180e5d3a925c
coding
code_generation
intermediate
Implement `Ring(n)` with `push(x)` (overwrite oldest when full) and `snapshot()` returning items oldest-to-newest.
{"language": "python", "repository": {"files": {"solution.py": "class Ring:\n def __init__(self, n):\n if n < 1:\n raise ValueError(\"n\")\n self.buf = [None] * n\n self.n = n\n self.i = 0\n self.size = 0\n\n def push(self, x):\n self.buf[self.i] = x\n s...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
class Ring: def __init__(self, n): if n < 1: raise ValueError("n") self.buf = [None] * n self.n = n self.i = 0 self.size = 0 def push(self, x): self.buf[self.i] = x self.i = (self.i + 1) % self.n self.size = min(self.size + 1, self.n) def snapshot(self): start = (self.i - self.size) % self.n return [sel...
class Ring: def __init__(self, n): if n < 1: raise ValueError("n") self.buf = [None] * n self.n = n self.i = 0 self.size = 0 def push(self, x): self.buf[self.i] = x self.i = (self.i + 1) % self.n self.size = min(self.size + 1, self.n) def snapshot(self): start = (self.i - self.size) % self.n return [sel...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:02Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.7, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.5, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.325, "tests": 0.0, "total": 5.125}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "ring_b...
or-coding-py-debug-ring-buffer-514ee7f986a6
coding
debugging
expert
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `Ring(n)` with `push(x)` (overwrite oldest when full) and `snapshot()` returning items oldest-to-newest. --- solution.py (buggy) --- class Ring: def __init__(self, n): if n < 1: raise Value...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_wrap (test_solution.Test.test_wrap) ... FAIL\n\n======================================================================\nFAIL: test_wrap (test_solution....
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
class Ring: def __init__(self, n): if n < 1: raise ValueError("n") self.buf = [None] * n self.n = n self.i = 0 self.size = 0 def push(self, x): self.buf[self.i] = x self.i = (self.i + 1) % self.n self.size = min(self.size + 1, self.n) def snapshot(self): start = (self.i - self.size) % self.n return [sel...
class Ring: def __init__(self, n): if n < 1: raise ValueError("n") self.buf = [None] * n self.n = n self.i = 0 self.size = 0 def push(self, x): self.buf[self.i] = x self.i = (self.i + 1) % self.n self.size = min(self.size + 1, self.n) def snapshot(self): start = (self.i - self.size) % self.n return [sel...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:02Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.7, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 11.0}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"err...
or-coding-py-union-find-39864eb16b6c
coding
code_generation
intermediate
Implement `UnionFind(n)` with 0..n-1 elements, `find(i)`, `union(i,j)` returning True if they were in different sets. Use path compression and union by rank.
{"language": "python", "repository": {"files": {"solution.py": "class UnionFind:\n def __init__(self, n):\n self.p = list(range(n))\n self.r = [0] * n\n\n def find(self, i):\n while self.p[i] != i:\n self.p[i] = self.p[self.p[i]]\n i = self.p[i]\n return i\n\n ...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
class UnionFind: def __init__(self, n): self.p = list(range(n)) self.r = [0] * n def find(self, i): while self.p[i] != i: self.p[i] = self.p[self.p[i]] i = self.p[i] return i def union(self, i, j): a, b = self.find(i), self.find(j) if a == b: return False if self.r[a] < self.r[b]: a, b = b, a self.p[b]...
class UnionFind: def __init__(self, n): self.p = list(range(n)) self.r = [0] * n def find(self, i): while self.p[i] != i: self.p[i] = self.p[self.p[i]] i = self.p[i] return i def union(self, i, j): a, b = self.find(i), self.find(j) if a == b: return False if self.r[a] < self.r[b]: a, b = b, a self.p[b]...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:02Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.85, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.625, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.55, "tests": 0.0, "total": 4.625}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "unio...
or-coding-py-debug-union-find-61bad24087bb
coding
debugging
expert
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `UnionFind(n)` with 0..n-1 elements, `find(i)`, `union(i,j)` returning True if they were in different sets. Use path compression and union by rank. --- solution.py (buggy) --- class UnionFind:...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_uf (test_solution.Test.test_uf) ... FAIL\n\n======================================================================\nFAIL: test_uf (test_solution.Test.t...
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
class UnionFind: def __init__(self, n): self.p = list(range(n)) self.r = [0] * n def find(self, i): while self.p[i] != i: self.p[i] = self.p[self.p[i]] i = self.p[i] return i def union(self, i, j): a, b = self.find(i), self.find(j) if a == b: return False if self.r[a] < self.r[b]: a, b = b, a self.p[b]...
class UnionFind: def __init__(self, n): self.p = list(range(n)) self.r = [0] * n def find(self, i): while self.p[i] != i: self.p[i] = self.p[self.p[i]] i = self.p[i] return i def union(self, i, j): a, b = self.find(i), self.find(j) if a == b: return False if self.r[a] < self.r[b]: a, b = b, a self.p[b]...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:02Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.85, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 11.15}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"e...
or-coding-py-knapsack-01-5de1ee8eaac8
coding
code_generation
intermediate
Implement `knapsack(weights, values, cap)` 0/1 knapsack maximum value.
{"language": "python", "repository": {"files": {"solution.py": "def knapsack(weights, values, cap):\n dp = [0] * (cap + 1)\n for w, v in zip(weights, values):\n for c in range(cap, w - 1, -1):\n dp[c] = max(dp[c], dp[c - w] + v)\n return dp[cap]\n", "test_solution.py": "import unittest\nfrom ...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def knapsack(weights, values, cap): dp = [0] * (cap + 1) for w, v in zip(weights, values): for c in range(cap, w - 1, -1): dp[c] = max(dp[c], dp[c - w] + v) return dp[cap]
def knapsack(weights, values, cap): dp = [0] * (cap + 1) for w, v in zip(weights, values): for c in range(cap, w - 1, -1): dp[c] = max(dp[c], dp[c - w] + v) return dp[cap]
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:02Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.35, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.625, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.2, "tests": 0.0, "total": 4.775}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "knaps...
or-coding-py-debug-knapsack-01-21172d049b8a
coding
debugging
advanced
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `knapsack(weights, values, cap)` 0/1 knapsack maximum value. --- solution.py (buggy) --- def knapsack(weights, values, cap): dp = [0] * (cap - 1) for w, v in zip(weights, values): for c in ...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 1, \"skipped\": 0, \"passed\": false}\n\ntest_ks (test_solution.Test.test_ks) ... ERROR\n\n======================================================================\nERROR: test_ks (test_solution.Test...
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
def knapsack(weights, values, cap): dp = [0] * (cap + 1) for w, v in zip(weights, values): for c in range(cap, w - 1, -1): dp[c] = max(dp[c], dp[c - w] + v) return dp[cap]
def knapsack(weights, values, cap): dp = [0] * (cap + 1) for w, v in zip(weights, values): for c in range(cap, w - 1, -1): dp[c] = max(dp[c], dp[c - w] + v) return dp[cap]
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:02Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.35, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 3.9, "tests": 0.0, "total": 10.549999999999999}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"...
or-coding-py-bfs-levels-5c27c81b563d
coding
code_generation
beginner
Implement `bfs_order(graph, start)` returning nodes in BFS order. graph maps node -> iterable of neighbors. Skip missing neighbor keys.
{"language": "python", "repository": {"files": {"solution.py": "from collections import deque\n\ndef bfs_order(graph, start):\n seen = {start}\n q = deque([start])\n order = []\n while q:\n node = q.popleft()\n order.append(node)\n for nxt in graph.get(node, []):\n if nxt not...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
from collections import deque def bfs_order(graph, start): seen = {start} q = deque([start]) order = [] while q: node = q.popleft() order.append(node) for nxt in graph.get(node, []): if nxt not in seen: seen.add(nxt) q.append(nxt) return order
from collections import deque def bfs_order(graph, start): seen = {start} q = deque([start]) order = [] while q: node = q.popleft() order.append(node) for nxt in graph.get(node, []): if nxt not in seen: seen.add(nxt) q.append(nxt) return order
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:02Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.loops
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.575, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.125, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.475, "tests": 0.0, "total": 3.7750000000000004}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0"...
or-coding-py-interval-coverage-973204b58c0f
coding
code_generation
intermediate
Implement `covered_length(ranges)` total length covered by [start,end] half-open intervals. Overlaps count once.
{"language": "python", "repository": {"files": {"solution.py": "def covered_length(ranges):\n if not ranges:\n return 0\n ordered = sorted(ranges)\n total = 0\n cs, ce = ordered[0]\n for s, e in ordered[1:]:\n if s > ce:\n total += ce - cs\n cs, ce = s, e\n else...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def covered_length(ranges): if not ranges: return 0 ordered = sorted(ranges) total = 0 cs, ce = ordered[0] for s, e in ordered[1:]: if s > ce: total += ce - cs cs, ce = s, e else: ce = max(ce, e) total += ce - cs return total
def covered_length(ranges): if not ranges: return 0 ordered = sorted(ranges) total = 0 cs, ce = ordered[0] for s, e in ordered[1:]: if s > ce: total += ce - cs cs, ce = s, e else: ce = max(ce, e) total += ce - cs return total
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:02Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.conditionals
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.55, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.125, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.3, "tests": 0.0, "total": 4.575}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "inter...
or-coding-py-rate-limit-sliding-dfd9e3aba9b3
coding
code_generation
beginner
Implement `SlidingWindow(limit, window)` with `allow(t)` where t is non-decreasing time. At most `limit` events in (t-window, t].
{"language": "python", "repository": {"files": {"solution.py": "from collections import deque\n\nclass SlidingWindow:\n def __init__(self, limit, window):\n self.limit = limit\n self.window = window\n self.q = deque()\n\n def allow(self, t):\n while self.q and self.q[0] <= t - self.win...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
from collections import deque class SlidingWindow: def __init__(self, limit, window): self.limit = limit self.window = window self.q = deque() def allow(self, t): while self.q and self.q[0] <= t - self.window: self.q.popleft() if len(self.q) >= self.limit: return False self.q.append(t) return True
from collections import deque class SlidingWindow: def __init__(self, limit, window): self.limit = limit self.window = window self.q = deque() def allow(self, t): while self.q and self.q[0] <= t - self.window: self.q.popleft() if len(self.q) >= self.limit: return False self.q.append(t) return True
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:02Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.675, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.5, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.425, "tests": 0.0, "total": 4.2}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "rate_l...
or-coding-py-debug-rate-limit-sliding-104b463756ae
coding
debugging
advanced
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `SlidingWindow(limit, window)` with `allow(t)` where t is non-decreasing time. At most `limit` events in (t-window, t]. --- solution.py (buggy) --- from collections import deque class Sliding...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_sw (test_solution.Test.test_sw) ... FAIL\n\n======================================================================\nFAIL: test_sw (test_solution.Test.t...
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
from collections import deque class SlidingWindow: def __init__(self, limit, window): self.limit = limit self.window = window self.q = deque() def allow(self, t): while self.q and self.q[0] <= t - self.window: self.q.popleft() if len(self.q) >= self.limit: return False self.q.append(t) return True
from collections import deque class SlidingWindow: def __init__(self, limit, window): self.limit = limit self.window = window self.q = deque() def allow(self, t): while self.q and self.q[0] <= t - self.window: self.q.popleft() if len(self.q) >= self.limit: return False self.q.append(t) return True
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:02Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.675, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 3.675, "tests": 0.0, "total": 10.649999999999999}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details":...
or-coding-py-base64-pad-5ba7bc4c7cea
coding
code_generation
beginner
Implement `b64_pad(s)` adding the correct `=` padding to a base64 string without padding. Do not decode.
{"language": "python", "repository": {"files": {"solution.py": "def b64_pad(s):\n m = len(s) % 4\n if m == 1:\n raise ValueError(\"invalid\")\n if m:\n s += \"=\" * (4 - m)\n return s\n", "test_solution.py": "import unittest\nfrom solution import b64_pad\n\nclass Test(unittest.TestCase):\n ...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def b64_pad(s): m = len(s) % 4 if m == 1: raise ValueError("invalid") if m: s += "=" * (4 - m) return s
def b64_pad(s): m = len(s) % 4 if m == 1: raise ValueError("invalid") if m: s += "=" * (4 - m) return s
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:02Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.4, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.75, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.4, "tests": 0.0, "total": 4.15}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "base64_p...
or-coding-py-debug-base64-pad-9acf4723aaf4
coding
debugging
advanced
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `b64_pad(s)` adding the correct `=` padding to a base64 string without padding. Do not decode. --- solution.py (buggy) --- def b64_pad(s): m = len(s) % 4 if m != 1: raise ValueError("invali...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 1, \"skipped\": 0, \"passed\": false}\n\ntest_pad (test_solution.Test.test_pad) ... ERROR\n\n======================================================================\nERROR: test_pad (test_solution.T...
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
def b64_pad(s): m = len(s) % 4 if m == 1: raise ValueError("invalid") if m: s += "=" * (4 - m) return s
def b64_pad(s): m = len(s) % 4 if m == 1: raise ValueError("invalid") if m: s += "=" * (4 - m) return s
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:02Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.4, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 3.3, "tests": 0.0, "total": 10.0}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"err...
or-coding-py-retry-predicate-827fb6f0d571
coding
code_generation
beginner
Implement `retry(fn, retries, retry_on)` calling fn until it returns without raising an exception in retry_on, up to retries+1 attempts. Re-raise the last.
{"language": "python", "repository": {"files": {"solution.py": "def retry(fn, retries, retry_on):\n last = None\n for _ in range(retries + 1):\n try:\n return fn()\n except retry_on as exc:\n last = exc\n raise last\n", "test_solution.py": "import unittest\nfrom solution imp...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def retry(fn, retries, retry_on): last = None for _ in range(retries + 1): try: return fn() except retry_on as exc: last = exc raise last
def retry(fn, retries, retry_on): last = None for _ in range(retries + 1): try: return fn() except retry_on as exc: last = exc raise last
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:03Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.exceptions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.575, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.5, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.55, "tests": 0.0, "total": 4.2250000000000005}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "...
or-coding-py-ini-sections-c58ba9a266c7
coding
code_generation
beginner
Implement `parse_ini(text)` returning dict[str, dict[str, str]] for `[section]` and `key=value` lines. Ignore blanks and `;` comments.
{"language": "python", "repository": {"files": {"solution.py": "def parse_ini(text):\n data = {}\n section = None\n for raw in text.splitlines():\n line = raw.split(\";\", 1)[0].strip()\n if not line:\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n ...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
def parse_ini(text): data = {} section = None for raw in text.splitlines(): line = raw.split(";", 1)[0].strip() if not line: continue if line.startswith("[") and line.endswith("]"): section = line[1:-1] data.setdefault(section, {}) continue if section is None or "=" not in line: raise ValueError(line) k, v...
def parse_ini(text): data = {} section = None for raw in text.splitlines(): line = raw.split(";", 1)[0].strip() if not line: continue if line.startswith("[") and line.endswith("]"): section = line[1:-1] data.setdefault(section, {}) continue if section is None or "=" not in line: raise ValueError(line) k, v...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:03Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.625, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.25, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.4, "tests": 0.0, "total": 3.875}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "ini_s...
or-coding-py-dag-longest-b3d7369135cf
coding
code_generation
intermediate
Implement `longest_path_dag(nodes, edges, weight)` where edges are (u,v) and weight[(u,v)] is a number. Graph is DAG. Return the maximum path weight (possibly a single node path of weight 0).
{"language": "python", "repository": {"files": {"solution.py": "from collections import defaultdict, deque\n\ndef longest_path_dag(nodes, edges, weight):\n graph = defaultdict(list)\n indeg = {n: 0 for n in nodes}\n for u, v in edges:\n graph[u].append(v)\n indeg[v] += 1\n dist = {n: 0 for n i...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
from collections import defaultdict, deque def longest_path_dag(nodes, edges, weight): graph = defaultdict(list) indeg = {n: 0 for n in nodes} for u, v in edges: graph[u].append(v) indeg[v] += 1 dist = {n: 0 for n in nodes} q = deque([n for n in nodes if indeg[n] == 0]) seen = 0 while q: u = q.popleft() see...
from collections import defaultdict, deque def longest_path_dag(nodes, edges, weight): graph = defaultdict(list) indeg = {n: 0 for n in nodes} for u, v in edges: graph[u].append(v) indeg[v] += 1 dist = {n: 0 for n in nodes} q = deque([n for n in nodes if indeg[n] == 0]) seen = 0 while q: u = q.popleft() see...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:03Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.loops
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.775, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.725, "tests": 0.0, "total": 5.1000000000000005}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", ...
or-coding-py-debug-dag-longest-d96d6c083461
coding
debugging
expert
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `longest_path_dag(nodes, edges, weight)` where edges are (u,v) and weight[(u,v)] is a number. Graph is DAG. Return the maximum path weight (possibly a single node path of weight 0). --- soluti...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 1, \"skipped\": 0, \"passed\": false}\n\ntest_lp (test_solution.Test.test_lp) ... ERROR\n\n======================================================================\nERROR: test_lp (test_solution.Test...
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
from collections import defaultdict, deque def longest_path_dag(nodes, edges, weight): graph = defaultdict(list) indeg = {n: 0 for n in nodes} for u, v in edges: graph[u].append(v) indeg[v] += 1 dist = {n: 0 for n in nodes} q = deque([n for n in nodes if indeg[n] == 0]) seen = 0 while q: u = q.popleft() see...
from collections import defaultdict, deque def longest_path_dag(nodes, edges, weight): graph = defaultdict(list) indeg = {n: 0 for n in nodes} for u, v in edges: graph[u].append(v) indeg[v] += 1 dist = {n: 0 for n in nodes} q = deque([n for n in nodes if indeg[n] == 0]) seen = 0 while q: u = q.popleft() see...
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:03Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.775, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 11.075}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {...
or-coding-py-min-heap-k-1732990ad1d2
coding
code_generation
beginner
Implement `k_smallest(nums, k)` returning the k smallest values sorted ascending. k may be 0. If k > n, return all sorted.
{"language": "python", "repository": {"files": {"solution.py": "import heapq\n\ndef k_smallest(nums, k):\n if k <= 0:\n return []\n return sorted(heapq.nsmallest(min(k, len(nums)), nums))\n", "test_solution.py": "import unittest\nfrom solution import k_smallest\n\nclass Test(unittest.TestCase):\n def te...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
import heapq def k_smallest(nums, k): if k <= 0: return [] return sorted(heapq.nsmallest(min(k, len(nums)), nums))
import heapq def k_smallest(nums, k): if k <= 0: return [] return sorted(heapq.nsmallest(min(k, len(nums)), nums))
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:03Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.375, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.525, "tests": 0.0, "total": 3.5}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "min_he...
or-coding-py-sha256-prefix-ac24cc8583f0
coding
code_generation
beginner
Implement `constant_eq(a, b)` comparing two strings in time that depends only on the length of the longer input (iterate zip_longest). Return True iff equal.
{"language": "python", "repository": {"files": {"solution.py": "from itertools import zip_longest\n\ndef constant_eq(a, b):\n diff = 0\n for x, y in zip_longest(a, b, fillvalue=None):\n diff |= (x != y)\n return not diff\n", "test_solution.py": "import unittest\nfrom solution import constant_eq\n\nclass...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
from itertools import zip_longest def constant_eq(a, b): diff = 0 for x, y in zip_longest(a, b, fillvalue=None): diff |= (x != y) return not diff
from itertools import zip_longest def constant_eq(a, b): diff = 0 for x, y in zip_longest(a, b, fillvalue=None): diff |= (x != y) return not diff
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:03Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.425, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.6, "tests": 0.0, "total": 3.625}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "sha256...
or-coding-py-debug-sha256-prefix-c13add5c1824
coding
debugging
advanced
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `constant_eq(a, b)` comparing two strings in time that depends only on the length of the longer input (iterate zip_longest). Return True iff equal. --- solution.py (buggy) --- from itertools i...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_eq (test_solution.Test.test_eq) ... FAIL\n\n======================================================================\nFAIL: test_eq (test_solution.Test.t...
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
from itertools import zip_longest def constant_eq(a, b): diff = 0 for x, y in zip_longest(a, b, fillvalue=None): diff |= (x != y) return not diff
from itertools import zip_longest def constant_eq(a, b): diff = 0 for x, y in zip_longest(a, b, fillvalue=None): diff |= (x != y) return not diff
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:03Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.425, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 3.425, "tests": 0.0, "total": 10.149999999999999}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details":...
or-coding-py-log-level-filter-c471621f9dc2
coding
code_generation
beginner
Implement `filter_logs(lines, min_level)` where each line starts with DEBUG|INFO|WARN|ERROR. Levels increase in that order. Keep lines at or above min_level.
{"language": "python", "repository": {"files": {"solution.py": "ORDER = {\"DEBUG\": 0, \"INFO\": 1, \"WARN\": 2, \"ERROR\": 3}\n\ndef filter_logs(lines, min_level):\n threshold = ORDER[min_level]\n out = []\n for line in lines:\n lvl = line.split(\" \", 1)[0]\n if ORDER.get(lvl, -1) >= threshold:...
[]
["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."]
[]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
["Read the specification", "Implement the function or class", "Satisfy the tests"]
ORDER = {"DEBUG": 0, "INFO": 1, "WARN": 2, "ERROR": 3} def filter_logs(lines, min_level): threshold = ORDER[min_level] out = [] for line in lines: lvl = line.split(" ", 1)[0] if ORDER.get(lvl, -1) >= threshold: out.append(line) return out
ORDER = {"DEBUG": 0, "INFO": 1, "WARN": 2, "ERROR": 3} def filter_logs(lines, min_level): threshold = ORDER[min_level] out = [] for line in lines: lvl = line.split(" ", 1)[0] if ORDER.get(lvl, -1) >= threshold: out.append(line) return out
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:03Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.functions
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.475, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.25, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.5, "tests": 0.0, "total": 3.825}, "language": "python", "pipeline_version": "1.4.0", "schema_version": "1.4.0", "slug": "log_l...
or-coding-py-debug-log-level-filter-da77656a8211
coding
debugging
advanced
The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour. Implement `filter_logs(lines, min_level)` where each line starts with DEBUG|INFO|WARN|ERROR. Levels increase in that order. Keep lines at or above min_level. --- solution.py (buggy) --- ORDER = {"DEBUG"...
{"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_filter (test_solution.Test.test_filter) ... FAIL\n\n======================================================================\nFAIL: test_filter (test_sol...
["Seeded mutation of the reference implementation."]
["Do not weaken or delete tests", "Keep the public API"]
[]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"]
ORDER = {"DEBUG": 0, "INFO": 1, "WARN": 2, "ERROR": 3} def filter_logs(lines, min_level): threshold = ORDER[min_level] out = [] for line in lines: lvl = line.split(" ", 1)[0] if ORDER.get(lvl, -1) >= threshold: out.append(line) return out
ORDER = {"DEBUG": 0, "INFO": 1, "WARN": 2, "ERROR": 3} def filter_logs(lines, min_level): threshold = ORDER[min_level] out = [] for line in lines: lvl = line.split(" ", 1)[0] if ORDER.get(lvl, -1) >= threshold: out.append(line) return out
{"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version...
{"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:05:03Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ...
{"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}
null
python.testing
null
["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"]
null
null
en
original
{"concept_id_inferred": true, "difficulty_score": {"code_size": 0.475, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.774999999999999}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {...