Datasets:
Publish PyMethods2Test v1: 4,990 kept tasks with verified images
Browse files- pymethods2test_v1/README.md +54 -0
- pymethods2test_v1/archive.parquet +3 -0
- pymethods2test_v1/cached_images/manifest.json +0 -0
- pymethods2test_v1/patch.py +282 -0
- pymethods2test_v1/repairs/import_repairs.json +228 -0
- pymethods2test_v1/repairs/numpy_repairs.json +20 -0
- pymethods2test_v1/repairs/path_repairs.json +185 -0
- pymethods2test_v1/tasks.parquet +3 -0
pymethods2test_v1/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# [PyMethods2Test](https://huggingface.co/datasets/open-thoughts/TaskTrove/tree/946884702046be1a7dcea2638186ad6b0d2ea103/DCAgent__exp_rpt_pymethods2test-large-v2)
|
| 2 |
+
|
| 3 |
+
## Dataset stats
|
| 4 |
+
|
| 5 |
+
- **Original tasks:** 4,990
|
| 6 |
+
- **Kept:** 4,990
|
| 7 |
+
- **Changed:** 4,990
|
| 8 |
+
- **Archived:** 0
|
| 9 |
+
- **Images:** 1 image before, 3 images now.
|
| 10 |
+
|
| 11 |
+
## Dataset characteristics
|
| 12 |
+
|
| 13 |
+
PyMethods2Test turns Python methods and their unit tests into tasks: implement the described function in `/app/solution.py` so that the supplied pytest suite passes.
|
| 14 |
+
|
| 15 |
+
<details><summary>Domains</summary>
|
| 16 |
+
|
| 17 |
+
**Software Engineering:** Every sampled task asks the agent to write one self-contained Python function with a prescribed name and signature into /app/solution.py (e.g. GCD of a list, factorial mod 1e9+7, BFS over digit multiplications, additive-sequence check, triangular-number ranges). A pytest/unittest file derived from the original focal method's unit test is the verifier, and metadata marks each item as source 'pymethods2test' with the repo/path fields blank. The work is pure code implementation from a natural-language spec; there is no existing codebase, system state, data, or external service involved.
|
| 18 |
+
|
| 19 |
+
</details>
|
| 20 |
+
<details><summary>Capabilities</summary>
|
| 21 |
+
|
| 22 |
+
**Specification Adherence:** Intended practice: the hidden tests import a specific function name from /app/solution.py and check exact return shapes (a dict keyed by natural numbers, the tuple ('YES', x, y, z) versus the bare string 'NO', a default argument of '', integer division for means, float tolerance for the Nim probability), so the agent must keep the stated file path, signature, and output contract rather than drift toward a more natural design. Several instructions also contain details the tests contradict or omit (e.g. the additive-sequence example claims '123' is False but the test asserts True; the Nim example output 0.2 does not match the test values), so reward depends on matching the original repository's behavior, not polishing the prose spec. No trajectories were supplied, so this is inferred from task structure, not observed behavior. **Mathematical Derivation:** A minority of sampled tasks require working out the formula before coding: the straw problem needs the insight that the best rectangle splits N into floor(N/4)^2 versus x*(x+1) side lengths, and the Nim problem requires recognizing an XOR-convolution raised to the n-th power by repeated squaring to pass the n=1e9 test within the timeout. Most tasks (string matching, GCD, factorial, scaling scores) need no derivation, so this is a secondary target observed only in the task contents, not in any trajectory. These are intended capabilities inferred from task examples, not measured agent behavior. Labels follow [CLI-Universe](https://arxiv.org/abs/2606.22883v1).
|
| 23 |
+
|
| 24 |
+
</details>
|
| 25 |
+
|
| 26 |
+
Intended benchmark transfer: **HumanEval+**, Same problem shape: implement a single Python function from a natural-language description with examples, graded by hidden functional tests that include edge cases (empty input, minimal values, large inputs). Practicing exact signature/return-type compliance against stricter-than-shown tests directly targets what EvalPlus's expanded tests catch; **MBPP+**, The tasks are short, mostly algorithmic Python functions (GCD, factorial modulo, triangular numbers, sequence checks) with a required function name and assert-style unit tests, which closely matches MBPP+ problems and their extended test suites. The 4,990 verifiable items provide execution-grounded reward for exactly this style of entry-level Python programming.
|
| 27 |
+
|
| 28 |
+
## Per-stage breakdown
|
| 29 |
+
|
| 30 |
+
- **1. Build and setup: 4,990 changed, 0 archived.** Changed all 4,990 tasks to pin pytest, which was installed unpinned, and to use the supported shared verifier environment setting. Changed 19 tasks to install NumPy, which their reference solutions import but their images never installed.
|
| 31 |
+
- **2. Reference solution (reward 1): 4,990 changed, 0 archived.** Changed all 4,990 tasks to add an entry point that runs the supplied reference solution. Changed 38 reference solutions to add a missing standard-library import, such as `from collections import deque`; function bodies and tests are unchanged. All 4,990 reference solutions scored 1.
|
| 32 |
+
- **3. No-op baseline (reward 0): 0 changed, 0 archived.** All 4,990 tasks scored 0 without a solution. Manually approved 176 false positives from the no-op checker, which could not confirm verifier execution; the corresponding reference solutions passed. In each, the tests stopped only because the missing solution module could not be imported.
|
| 33 |
+
- **4. Rule-based checks: 4,990 changed, 0 archived.** Changed all 4,990 tasks so their instruction ends with the time limit and the request not to cheat. Flagged 88 tasks for relative paths. Automatic repair cleared warnings for 15 tasks. 73 tasks still have warnings. Inspected 50: all were fine, naming `solution.py` in the `/app` working directory where the verifier reads it. All other rule-based checks passed. Git-history and timestamp cleanup do not apply: the tasks contain no repository.
|
| 34 |
+
|
| 35 |
+
The reference-solution leak check ran on 177 tasks, all passing; it did not run on the remaining 4,813.
|
| 36 |
+
|
| 37 |
+
## Per-task resource requirements
|
| 38 |
+
|
| 39 |
+
| CPUs | Memory | Agent timeout | Verifier timeout | Tasks |
|
| 40 |
+
| ---: | ---: | ---: | ---: | ---: |
|
| 41 |
+
| Unspecified | Unspecified | 900 s | 720 s | 4,990 |
|
| 42 |
+
|
| 43 |
+
## Runtime and validation time
|
| 44 |
+
|
| 45 |
+
- **Versions:** Python **3.12.14**, Harbor **0.8.1**, Apptainer backend; tasks run Python 3.10 with pytest 9.1.1, or 9.0.2 for the 55 repaired tasks.
|
| 46 |
+
- **Implementation:** [Marin Harbor `7faf878c14b6`](https://github.com/marin-community/harbor/tree/7faf878c14b6d72737579ec936ebf5f74ba3194d) with [our runtime patches](https://github.com/MLI-lab/OT-next-data/tree/main/harbor_patches).
|
| 47 |
+
- **Resources:** CLAIX jobs of **16 CPU cores, 64 GiB RAM** with trial concurrency 4; one repaired task ran on Helma with **8 CPU cores, 15 GiB RAM**; image building uses **4 CPU cores and 8 GiB RAM per image**. Includes the full validation run and reruns of repaired tasks.
|
| 48 |
+
|
| 49 |
+
| Stage | Measured tasks | Summed task time | Mean per task | Median per task |
|
| 50 |
+
| --- | --- | --- | --- | --- |
|
| 51 |
+
| 1. Build and setup (container start and setup) | 4,990 (all kept) | 133.6 h | 96.4 s | 6.2 s |
|
| 52 |
+
| 2. Reference solution | 4,990 (all kept) | 148.5 h | 107.2 s | 23.5 s |
|
| 53 |
+
| 3. No-op baseline | 4,990 (all kept) | 121.6 h | 87.7 s | 23.1 s |
|
| 54 |
+
| 4. Rule-based checks | 4,990 (all kept) | 0.4 h | 0.3 s | 0.3 s |
|
pymethods2test_v1/archive.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d6fb5add101f55322d2bbccdc5cfaf9fb9fbff0cb808706b62358265b4fe5dec
|
| 3 |
+
size 3758533
|
pymethods2test_v1/cached_images/manifest.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
pymethods2test_v1/patch.py
ADDED
|
@@ -0,0 +1,282 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Reproduce the pinned pymethods2test TaskTrove source with reviewed repairs.
|
| 2 |
+
|
| 3 |
+
R1 (stage 1): pin pytest in environment/Dockerfile and tests/test.sh, and drop
|
| 4 |
+
the `2>/dev/null` that makes check-pip-pinning.sh report the package as unpinned.
|
| 5 |
+
The version is the one the unpinned install resolved in the pilot stage-5 logs.
|
| 6 |
+
|
| 7 |
+
R2 (stage 4): add solution/solve.sh, which copies the existing solution/solution.py
|
| 8 |
+
to /app/solution.py.
|
| 9 |
+
|
| 10 |
+
Tests and reward logic are never edited.
|
| 11 |
+
|
| 12 |
+
R3: replace the ignored verifier.restart_environment=false field with the
|
| 13 |
+
supported environment_mode="shared" setting.
|
| 14 |
+
|
| 15 |
+
R4: repair the missing cmp_to_key import in reference 1059 and install the
|
| 16 |
+
missing numpy==2.2.6 dependency during verifier preparation for task 3412.
|
| 17 |
+
|
| 18 |
+
R5: bake numpy==2.2.6 into the task image for 18 further verified NumPy failures.
|
| 19 |
+
The pinned upstream image installs pytest only; no NumPy dependency was removed.
|
| 20 |
+
|
| 21 |
+
R6: add missing standard-library imports to 37 audited reference solutions.
|
| 22 |
+
|
| 23 |
+
R7: replace `solution.py` with `/app/solution.py` in 15 instructions, at the
|
| 24 |
+
positions the validation path resolver observed and applied.
|
| 25 |
+
"""
|
| 26 |
+
|
| 27 |
+
# Support both direct execution and python -m data.<source>.patch.
|
| 28 |
+
import sys
|
| 29 |
+
from pathlib import Path
|
| 30 |
+
sys.path.insert(0, str(Path(__file__).resolve().parents[2]))
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
import argparse
|
| 34 |
+
import copy
|
| 35 |
+
import gzip
|
| 36 |
+
import hashlib
|
| 37 |
+
import io
|
| 38 |
+
import json
|
| 39 |
+
import re
|
| 40 |
+
import tarfile
|
| 41 |
+
import tomllib
|
| 42 |
+
from pathlib import Path
|
| 43 |
+
|
| 44 |
+
REVISION = '946884702046be1a7dcea2638186ad6b0d2ea103'
|
| 45 |
+
PATCH_VERSION = 'pymethods2test-numpy18-import37-paths15-v7'
|
| 46 |
+
REPAIRED_PYTEST_VERSION = '9.0.2'
|
| 47 |
+
EXPECTED_TASK_COUNT = 4990
|
| 48 |
+
|
| 49 |
+
DOCKER_LINE = 'RUN pip install --no-cache-dir pytest'
|
| 50 |
+
DOCKER_LINE_FIXED = 'RUN pip install --no-cache-dir pytest==9.1.1'
|
| 51 |
+
TEST_LINE = 'pip3 install --quiet pytest 2>/dev/null || true'
|
| 52 |
+
TEST_LINE_FIXED = 'pip3 install --quiet pytest==9.1.1 || true'
|
| 53 |
+
SOLVE_SH = b'#!/bin/bash\nset -euo pipefail\ncp /solution/solution.py /app/solution.py\n'
|
| 54 |
+
|
| 55 |
+
from data.utils.task_archive import read_members
|
| 56 |
+
from data.utils.patch_reporting import write_patch_report
|
| 57 |
+
|
| 58 |
+
REFERENCE_HASHES = {
|
| 59 |
+
'pymethods2test-1059': '487e92ef39067b0649af5f61a1435fdcb5e6ddde4693c076977a5c169d14bde8',
|
| 60 |
+
'pymethods2test-3412': 'e76b0b9ba081cda01d4eef0ccaee180c951c9ea66c433ed96401307b1e593f34',
|
| 61 |
+
}
|
| 62 |
+
REPAIR_REASONS = {
|
| 63 |
+
'pymethods2test-1059': 'Added the missing functools.cmp_to_key import to the supplied reference solution; its seven unchanged tests pass locally.',
|
| 64 |
+
'pymethods2test-3412': 'Added numpy==2.2.6 to tests/setup.sh because the supplied reference imports NumPy; its six unchanged tests pass locally. The shared Dockerfile is unchanged by this repair.',
|
| 65 |
+
}
|
| 66 |
+
NUMPY_REFERENCE_HASHES = json.loads((Path(__file__).parent / 'repairs' / 'numpy_repairs.json').read_text())
|
| 67 |
+
IMPORT_REPAIRS = json.loads((Path(__file__).parent / 'repairs' / 'import_repairs.json').read_text())
|
| 68 |
+
PATH_REPAIRS = json.loads((Path(__file__).parent / 'repairs' / 'path_repairs.json').read_text())
|
| 69 |
+
REPAIR_REASONS.update({task: 'Baked numpy==2.2.6 into the task image to repair an undeclared upstream dependency; reference, tests and reward logic unchanged.'
|
| 70 |
+
for task in NUMPY_REFERENCE_HASHES})
|
| 71 |
+
REPAIR_REASONS.update({task: 'Added missing standard-library imports to the supplied reference: '
|
| 72 |
+
+ '; '.join(repair['imports']) + '. Function bodies, instructions, tests and reward logic unchanged.'
|
| 73 |
+
for task, repair in IMPORT_REPAIRS.items()})
|
| 74 |
+
for task in NUMPY_REFERENCE_HASHES.keys() | IMPORT_REPAIRS.keys():
|
| 75 |
+
REPAIR_REASONS[task] += ' Pinned pytest to 9.0.2, the version used for local verification, before image preparation.'
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
def pin_repaired_pytest(task_id, files):
|
| 79 |
+
"""Freeze the verified pytest version before cache verification and validation."""
|
| 80 |
+
if task_id not in NUMPY_REFERENCE_HASHES and task_id not in IMPORT_REPAIRS:
|
| 81 |
+
return {}
|
| 82 |
+
edits = {}
|
| 83 |
+
for name in ('environment/Dockerfile', 'tests/test.sh', 'tests/setup.sh'):
|
| 84 |
+
if name not in files:
|
| 85 |
+
continue
|
| 86 |
+
lines = files[name].decode().splitlines(keepends=True)
|
| 87 |
+
for index, line in enumerate(lines):
|
| 88 |
+
if re.search(r'\bpip[0-9]*\s+install\b', line):
|
| 89 |
+
lines[index] = re.sub(r'\bpytest(?:==9\.1\.1)?(?=\s|$)',
|
| 90 |
+
'pytest==' + REPAIRED_PYTEST_VERSION, line)
|
| 91 |
+
# Keep pip-check parsing unambiguous, as in the existing R1 fix.
|
| 92 |
+
if 'pytest==' + REPAIRED_PYTEST_VERSION in lines[index]:
|
| 93 |
+
lines[index] = lines[index].replace(' 2>/dev/null', '')
|
| 94 |
+
updated = ''.join(lines).encode()
|
| 95 |
+
if updated != files[name]:
|
| 96 |
+
edits[name] = updated
|
| 97 |
+
return edits
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
def repair_numpy_environment(task_id, files):
|
| 101 |
+
"""Repair only audited reference payloads; keep existing image instructions."""
|
| 102 |
+
if task_id not in NUMPY_REFERENCE_HASHES:
|
| 103 |
+
return {}
|
| 104 |
+
if hashlib.sha256(files['solution/solution.py']).hexdigest() != NUMPY_REFERENCE_HASHES[task_id]:
|
| 105 |
+
raise ValueError(f'{task_id}: unexpected NumPy reference solution')
|
| 106 |
+
dockerfile = files['environment/Dockerfile']
|
| 107 |
+
if b'numpy' in dockerfile.lower():
|
| 108 |
+
raise ValueError(f'{task_id}: unexpected existing NumPy image declaration')
|
| 109 |
+
return {'environment/Dockerfile': dockerfile.rstrip(b'\n') + b'\nRUN python -m pip install --no-cache-dir numpy==2.2.6\n'}
|
| 110 |
+
|
| 111 |
+
|
| 112 |
+
def repair_reference(task_id, files):
|
| 113 |
+
"""Return targeted edits and additions, rejecting unexpected source payloads."""
|
| 114 |
+
if task_id in IMPORT_REPAIRS:
|
| 115 |
+
repair = IMPORT_REPAIRS[task_id]
|
| 116 |
+
raw = files['solution/solution.py']
|
| 117 |
+
if hashlib.sha256(raw).hexdigest() != repair['reference_sha256']:
|
| 118 |
+
raise ValueError(f'{task_id}: unexpected reference solution for import repair')
|
| 119 |
+
prefix = ('\n'.join(repair['imports']) + '\n\n').encode()
|
| 120 |
+
return {'solution/solution.py': prefix + raw}, {}
|
| 121 |
+
if task_id not in REFERENCE_HASHES:
|
| 122 |
+
return {}, {}
|
| 123 |
+
if hashlib.sha256(files['solution/solution.py']).hexdigest() != REFERENCE_HASHES[task_id]:
|
| 124 |
+
raise ValueError(f'{task_id}: unexpected reference solution')
|
| 125 |
+
if task_id == 'pymethods2test-1059':
|
| 126 |
+
return {'solution/solution.py': b'from functools import cmp_to_key\n\n' + files['solution/solution.py']}, {}
|
| 127 |
+
if 'tests/setup.sh' in files:
|
| 128 |
+
raise ValueError(f'{task_id}: unexpected existing verifier setup')
|
| 129 |
+
return {}, {'tests/setup.sh': b'#!/bin/bash\nset -euo pipefail\npython -m pip install --quiet numpy==2.2.6\n'}
|
| 130 |
+
|
| 131 |
+
|
| 132 |
+
def repair_instruction_paths(task_id, files):
|
| 133 |
+
"""Apply the resolver's recorded absolute-path edits to the unchanged instruction."""
|
| 134 |
+
if task_id not in PATH_REPAIRS:
|
| 135 |
+
return {}
|
| 136 |
+
repair = PATH_REPAIRS[task_id]
|
| 137 |
+
raw = files['instruction.md']
|
| 138 |
+
if hashlib.sha256(raw).hexdigest() != repair['instruction_sha256']:
|
| 139 |
+
raise ValueError(f'{task_id}: unexpected instruction for path repair')
|
| 140 |
+
text = raw.decode()
|
| 141 |
+
for edit in sorted(repair['edits'], key=lambda e: e['start'], reverse=True):
|
| 142 |
+
if text[edit['start']:edit['end']] != edit['old']:
|
| 143 |
+
raise ValueError(f'{task_id}: path repair does not match the instruction')
|
| 144 |
+
text = text[:edit['start']] + edit['new'] + text[edit['end']:]
|
| 145 |
+
return {'instruction.md': text.encode()}
|
| 146 |
+
|
| 147 |
+
|
| 148 |
+
def replace_single_line(text, old, new, name):
|
| 149 |
+
lines = text.split('\n')
|
| 150 |
+
if lines.count(old) != 1:
|
| 151 |
+
raise ValueError(f'{name}: expected exactly one {old!r} line, got {lines.count(old)}')
|
| 152 |
+
return '\n'.join(new if line == old else line for line in lines)
|
| 153 |
+
|
| 154 |
+
|
| 155 |
+
def pin_pytest(files):
|
| 156 |
+
"""R1. Raises unless each file has exactly one matching line and no other pip line."""
|
| 157 |
+
for name, old, new in (('environment/Dockerfile', DOCKER_LINE, DOCKER_LINE_FIXED),
|
| 158 |
+
('tests/test.sh', TEST_LINE, TEST_LINE_FIXED)):
|
| 159 |
+
text = files[name].decode()
|
| 160 |
+
others = [line for line in text.split('\n') if 'pip' in line and line != old]
|
| 161 |
+
if others:
|
| 162 |
+
raise ValueError(f'{name}: unexpected pip lines {others!r}')
|
| 163 |
+
files[name] = replace_single_line(text, old, new, name).encode()
|
| 164 |
+
|
| 165 |
+
|
| 166 |
+
def add_oracle_wrapper(files):
|
| 167 |
+
"""R2. Raises if solve.sh already exists or solution.py is missing."""
|
| 168 |
+
if 'solution/solve.sh' in files:
|
| 169 |
+
raise ValueError('solution/solve.sh already exists')
|
| 170 |
+
if 'solution/solution.py' not in files:
|
| 171 |
+
raise ValueError('solution/solution.py is missing')
|
| 172 |
+
return SOLVE_SH
|
| 173 |
+
|
| 174 |
+
|
| 175 |
+
def migrate_verifier_mode(content):
|
| 176 |
+
"""Migrate only the upstream false flag, preserving shared verification."""
|
| 177 |
+
verifier = tomllib.loads(content.decode())["verifier"]
|
| 178 |
+
if verifier.get("restart_environment") is not False:
|
| 179 |
+
raise ValueError("expected verifier.restart_environment = false")
|
| 180 |
+
if "environment_mode" in verifier or "environment" in verifier:
|
| 181 |
+
raise ValueError("unexpected existing verifier environment configuration")
|
| 182 |
+
updated, count = re.subn(
|
| 183 |
+
rb'(?m)^([ \t]*)restart_environment[ \t]*=[ \t]*false[ \t]*$',
|
| 184 |
+
rb'\1environment_mode = "shared"', content)
|
| 185 |
+
if count != 1:
|
| 186 |
+
raise ValueError("expected exactly one legacy verifier restart flag")
|
| 187 |
+
return updated
|
| 188 |
+
|
| 189 |
+
|
| 190 |
+
def repack(blob, edits, additions):
|
| 191 |
+
"""Rewrite edited members in place, append each addition after solution/solution.py.
|
| 192 |
+
|
| 193 |
+
Added members copy ownership from the anchor member, with mode 0755 and mtime 0.
|
| 194 |
+
"""
|
| 195 |
+
out = io.BytesIO()
|
| 196 |
+
compress = blob[:2] == b'\x1f\x8b'
|
| 197 |
+
stream = gzip.GzipFile(filename='', fileobj=out, mode='wb', compresslevel=9, mtime=0) if compress else out
|
| 198 |
+
anchor = 'solution/solution.py'
|
| 199 |
+
with tarfile.open(fileobj=io.BytesIO(blob), mode='r:*') as src, \
|
| 200 |
+
tarfile.open(fileobj=stream, mode='w', format=src.format) as dst:
|
| 201 |
+
for member in src:
|
| 202 |
+
info = copy.copy(member)
|
| 203 |
+
info.mtime = 0
|
| 204 |
+
info.pax_headers = {k: v for k, v in member.pax_headers.items()
|
| 205 |
+
if k not in ('mtime', 'atime', 'ctime')}
|
| 206 |
+
if info.name in edits:
|
| 207 |
+
info.size = len(edits[info.name])
|
| 208 |
+
dst.addfile(info, io.BytesIO(edits[info.name]))
|
| 209 |
+
elif member.isfile():
|
| 210 |
+
dst.addfile(info, src.extractfile(member))
|
| 211 |
+
else:
|
| 212 |
+
dst.addfile(info)
|
| 213 |
+
if member.name == anchor:
|
| 214 |
+
for name, data in additions.items():
|
| 215 |
+
new = tarfile.TarInfo(name)
|
| 216 |
+
new.size = len(data)
|
| 217 |
+
new.mode = 0o755
|
| 218 |
+
new.mtime = 0
|
| 219 |
+
new.uid, new.gid = member.uid, member.gid
|
| 220 |
+
new.uname, new.gname = member.uname, member.gname
|
| 221 |
+
dst.addfile(new, io.BytesIO(data))
|
| 222 |
+
if compress:
|
| 223 |
+
stream.close()
|
| 224 |
+
return out.getvalue()
|
| 225 |
+
|
| 226 |
+
|
| 227 |
+
def patch_task(blob, task_id=None):
|
| 228 |
+
files = read_members(blob)
|
| 229 |
+
additions = {'solution/solve.sh': add_oracle_wrapper(files)}
|
| 230 |
+
pin_pytest(files)
|
| 231 |
+
edits = {name: files[name] for name in ('environment/Dockerfile', 'tests/test.sh')}
|
| 232 |
+
edits['task.toml'] = migrate_verifier_mode(files['task.toml'])
|
| 233 |
+
reference_edits, reference_additions = repair_reference(task_id, files)
|
| 234 |
+
edits.update(reference_edits)
|
| 235 |
+
additions.update(reference_additions)
|
| 236 |
+
edits.update(repair_numpy_environment(task_id, files))
|
| 237 |
+
edits.update(pin_repaired_pytest(task_id, {**files, **edits, **additions}))
|
| 238 |
+
edits.update(repair_instruction_paths(task_id, files))
|
| 239 |
+
return repack(blob, edits, additions)
|
| 240 |
+
|
| 241 |
+
|
| 242 |
+
def main():
|
| 243 |
+
import pyarrow as pa
|
| 244 |
+
import pyarrow.parquet as pq
|
| 245 |
+
parser = argparse.ArgumentParser()
|
| 246 |
+
parser.add_argument("--source", type=Path, required=True)
|
| 247 |
+
parser.add_argument("--output", type=Path, required=True)
|
| 248 |
+
args = parser.parse_args()
|
| 249 |
+
args.output.mkdir(parents=True, exist_ok=True)
|
| 250 |
+
source = pq.ParquetFile(args.source)
|
| 251 |
+
if source.metadata.num_rows != EXPECTED_TASK_COUNT:
|
| 252 |
+
raise ValueError(f'Expected {EXPECTED_TASK_COUNT} tasks, got {source.metadata.num_rows}')
|
| 253 |
+
patched = 0
|
| 254 |
+
labels, reasons = {}, {}
|
| 255 |
+
with pq.ParquetWriter(args.output / "tasks.parquet", source.schema_arrow) as writer:
|
| 256 |
+
for batch in source.iter_batches(batch_size=32):
|
| 257 |
+
rows = batch.to_pylist()
|
| 258 |
+
for row in rows:
|
| 259 |
+
task_id = row['path']
|
| 260 |
+
row['task_binary'] = patch_task(row['task_binary'], task_id)
|
| 261 |
+
labels[task_id] = ['pymethods-preparation-repairs']
|
| 262 |
+
reasons[task_id] = ('Pinned pytest, added the reference entry point and migrated the shared verifier schema. '
|
| 263 |
+
+ REPAIR_REASONS.get(task_id, 'The supplied reference solution is unchanged.'))
|
| 264 |
+
patched += 1
|
| 265 |
+
writer.write_table(pa.Table.from_pylist(rows, schema=source.schema_arrow))
|
| 266 |
+
if patched != EXPECTED_TASK_COUNT:
|
| 267 |
+
raise ValueError(f'Patched {patched} tasks, expected {EXPECTED_TASK_COUNT}')
|
| 268 |
+
manifest = {'patch_version': PATCH_VERSION, 'revision': REVISION,
|
| 269 |
+
'r1_pin_pytest_tasks': patched, 'r2_oracle_wrapper_tasks': patched,
|
| 270 |
+
'r3_shared_verifier_schema_tasks': patched,
|
| 271 |
+
'reference_repairs': {task: reason for task, reason in REPAIR_REASONS.items() if task in labels}}
|
| 272 |
+
(args.output / 'manifest.json').write_text(json.dumps(manifest, indent=2, sort_keys=True) + '\n')
|
| 273 |
+
write_patch_report(args.source, args.output / 'tasks.parquet',
|
| 274 |
+
source={'dataset': 'open-thoughts/TaskTrove', 'revision': REVISION,
|
| 275 |
+
'url': 'https://huggingface.co/datasets/open-thoughts/TaskTrove/tree/' + REVISION + '/DCAgent__exp_rpt_pymethods2test-large-v2',
|
| 276 |
+
'subset': 'DCAgent__exp_rpt_pymethods2test-large-v2'},
|
| 277 |
+
dropped={}, change_labels=labels, change_reasons=reasons,
|
| 278 |
+
patcher=__file__)
|
| 279 |
+
|
| 280 |
+
|
| 281 |
+
if __name__ == "__main__":
|
| 282 |
+
main()
|
pymethods2test_v1/repairs/import_repairs.json
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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{
|
| 3 |
+
"reference_sha256": "90e6f4101a630eab04ac70bcc01071780a1bd32e043eff446e75f780a477cc14",
|
| 4 |
+
"imports": [
|
| 5 |
+
"import math"
|
| 6 |
+
]
|
| 7 |
+
},
|
| 8 |
+
"pymethods2test-0310": {
|
| 9 |
+
"reference_sha256": "45b626f9c41bf9fad10611d5eee9ff72bb2664e2edd1d82358d92099ef0698fe",
|
| 10 |
+
"imports": [
|
| 11 |
+
"from collections import defaultdict"
|
| 12 |
+
]
|
| 13 |
+
},
|
| 14 |
+
"pymethods2test-0475": {
|
| 15 |
+
"reference_sha256": "2799b0234bb6e0cebca9032bb295f892a3e5d820fbe1f810f57ccfd70b20ab79",
|
| 16 |
+
"imports": [
|
| 17 |
+
"from heapq import heappop",
|
| 18 |
+
"from heapq import heappush"
|
| 19 |
+
]
|
| 20 |
+
},
|
| 21 |
+
"pymethods2test-0610": {
|
| 22 |
+
"reference_sha256": "37ddef14c395e4f849dc22f291fd95a8e74a7563f557d929db99a4b70cd6fdc5",
|
| 23 |
+
"imports": [
|
| 24 |
+
"from itertools import product"
|
| 25 |
+
]
|
| 26 |
+
},
|
| 27 |
+
"pymethods2test-0739": {
|
| 28 |
+
"reference_sha256": "2bf7ea4619663c05cc1b53aa3473ba1a1b30095d5955b3d2ca4c2f1a0c22d387",
|
| 29 |
+
"imports": [
|
| 30 |
+
"from collections import deque"
|
| 31 |
+
]
|
| 32 |
+
},
|
| 33 |
+
"pymethods2test-0979": {
|
| 34 |
+
"reference_sha256": "2240cbc6e122635bb769518ba3868f774d79d8427e91cf6f0ca9a273bcb30cdb",
|
| 35 |
+
"imports": [
|
| 36 |
+
"from collections import deque"
|
| 37 |
+
]
|
| 38 |
+
},
|
| 39 |
+
"pymethods2test-1055": {
|
| 40 |
+
"reference_sha256": "758dc3eb631976dfda68ffcff3e7f9138148bb2be5ed43f978bcd6b197b8cfca",
|
| 41 |
+
"imports": [
|
| 42 |
+
"from collections import defaultdict"
|
| 43 |
+
]
|
| 44 |
+
},
|
| 45 |
+
"pymethods2test-1191": {
|
| 46 |
+
"reference_sha256": "03afa57d35b88b93d10294c4dd3c7640aae8c55d22a6776fe05bb2ee75f6562a",
|
| 47 |
+
"imports": [
|
| 48 |
+
"from collections import deque"
|
| 49 |
+
]
|
| 50 |
+
},
|
| 51 |
+
"pymethods2test-1327": {
|
| 52 |
+
"reference_sha256": "52a8ba2800ec5497d61dabc2d29f01facb400177ec00ddf94b20ac103e1b1068",
|
| 53 |
+
"imports": [
|
| 54 |
+
"from collections import Counter"
|
| 55 |
+
]
|
| 56 |
+
},
|
| 57 |
+
"pymethods2test-1332": {
|
| 58 |
+
"reference_sha256": "4cc1604cc28af09661e23840a8a60c0dd675843291247b87aa643e53ebbd640a",
|
| 59 |
+
"imports": [
|
| 60 |
+
"import math"
|
| 61 |
+
]
|
| 62 |
+
},
|
| 63 |
+
"pymethods2test-1576": {
|
| 64 |
+
"reference_sha256": "c16acea1bcb3f842615424b50ef667471cee063fb55622e0845597cc692540f6",
|
| 65 |
+
"imports": [
|
| 66 |
+
"import collections"
|
| 67 |
+
]
|
| 68 |
+
},
|
| 69 |
+
"pymethods2test-1763": {
|
| 70 |
+
"reference_sha256": "a76717a7329e2edc84d264dc1bf57d9abefc312082f2e16fed7f7c0f2071bcc1",
|
| 71 |
+
"imports": [
|
| 72 |
+
"import math"
|
| 73 |
+
]
|
| 74 |
+
},
|
| 75 |
+
"pymethods2test-1823": {
|
| 76 |
+
"reference_sha256": "c02e3113ddb1b3967ed2e4ca5fdc55fb6e65f4643918c9498a806ec4be181e6e",
|
| 77 |
+
"imports": [
|
| 78 |
+
"import math"
|
| 79 |
+
]
|
| 80 |
+
},
|
| 81 |
+
"pymethods2test-1970": {
|
| 82 |
+
"reference_sha256": "f1abb9ae7576a90e47c7c3d7fe61ac77ac47bf3b58aeddab7a2973a876cdcb53",
|
| 83 |
+
"imports": [
|
| 84 |
+
"from bisect import bisect_left"
|
| 85 |
+
]
|
| 86 |
+
},
|
| 87 |
+
"pymethods2test-1998": {
|
| 88 |
+
"reference_sha256": "94d0af479b841e8e91ed0a7f7897d42bccd62525461d60b4edc68c3d41154125",
|
| 89 |
+
"imports": [
|
| 90 |
+
"from collections import defaultdict"
|
| 91 |
+
]
|
| 92 |
+
},
|
| 93 |
+
"pymethods2test-2107": {
|
| 94 |
+
"reference_sha256": "c0988b6034adf295c4ee320fabc983c78cd35d6cf2c1d45bd91368f346ac8e53",
|
| 95 |
+
"imports": [
|
| 96 |
+
"import math"
|
| 97 |
+
]
|
| 98 |
+
},
|
| 99 |
+
"pymethods2test-2284": {
|
| 100 |
+
"reference_sha256": "9be6dc2902e2bb9605aa6d7c07c2d5b9693b86876826338917d0bfa97f2df336",
|
| 101 |
+
"imports": [
|
| 102 |
+
"import math"
|
| 103 |
+
]
|
| 104 |
+
},
|
| 105 |
+
"pymethods2test-2386": {
|
| 106 |
+
"reference_sha256": "6549e17d3aac2b4a76fb9593add19d207214344f31caf4e0133673b0e87ae88e",
|
| 107 |
+
"imports": [
|
| 108 |
+
"from collections import deque"
|
| 109 |
+
]
|
| 110 |
+
},
|
| 111 |
+
"pymethods2test-2503": {
|
| 112 |
+
"reference_sha256": "7dfe8313e9ddaaecf18b8289030cf0fce5d91060eee24c2a949e1880dcd0748c",
|
| 113 |
+
"imports": [
|
| 114 |
+
"from itertools import islice"
|
| 115 |
+
]
|
| 116 |
+
},
|
| 117 |
+
"pymethods2test-2675": {
|
| 118 |
+
"reference_sha256": "5c97fc172dcb17c5ad8baa7ced6c0ce85dd00b7dff977b4907318fe0caa9545e",
|
| 119 |
+
"imports": [
|
| 120 |
+
"from collections import deque"
|
| 121 |
+
]
|
| 122 |
+
},
|
| 123 |
+
"pymethods2test-2874": {
|
| 124 |
+
"reference_sha256": "26c9bb73f8658a061718182ba8290290692566d80de1b498b9572b1f1ea708d9",
|
| 125 |
+
"imports": [
|
| 126 |
+
"from collections import deque"
|
| 127 |
+
]
|
| 128 |
+
},
|
| 129 |
+
"pymethods2test-2927": {
|
| 130 |
+
"reference_sha256": "650c9d2b892abaed155c5f48b4db7c09234f5b628e86f2abb2499c16523bdb22",
|
| 131 |
+
"imports": [
|
| 132 |
+
"from collections import deque"
|
| 133 |
+
]
|
| 134 |
+
},
|
| 135 |
+
"pymethods2test-3052": {
|
| 136 |
+
"reference_sha256": "4d94a46d89740695b0acc6f69932320493647ea7c6eadbce9fcb295804570333",
|
| 137 |
+
"imports": [
|
| 138 |
+
"from itertools import zip_longest"
|
| 139 |
+
]
|
| 140 |
+
},
|
| 141 |
+
"pymethods2test-3319": {
|
| 142 |
+
"reference_sha256": "a94ab983968017fafce2bbfc18d1f25b3782699685c6b6f57e724ccdc3b379ae",
|
| 143 |
+
"imports": [
|
| 144 |
+
"from itertools import product"
|
| 145 |
+
]
|
| 146 |
+
},
|
| 147 |
+
"pymethods2test-3355": {
|
| 148 |
+
"reference_sha256": "07887d3d71c08538e19d5740cc8c9abb1a81242a01c29726fcff51bbfc8574cc",
|
| 149 |
+
"imports": [
|
| 150 |
+
"from math import gcd"
|
| 151 |
+
]
|
| 152 |
+
},
|
| 153 |
+
"pymethods2test-3456": {
|
| 154 |
+
"reference_sha256": "134469f84149611d9704737fd861d57406727ca5d761817bd506e9463b39e948",
|
| 155 |
+
"imports": [
|
| 156 |
+
"import math"
|
| 157 |
+
]
|
| 158 |
+
},
|
| 159 |
+
"pymethods2test-3593": {
|
| 160 |
+
"reference_sha256": "2489ac877421296dffd7ea68b4ba1e93b6020bd0ebcbfcd38652a7cc4a857824",
|
| 161 |
+
"imports": [
|
| 162 |
+
"from collections import Counter"
|
| 163 |
+
]
|
| 164 |
+
},
|
| 165 |
+
"pymethods2test-3779": {
|
| 166 |
+
"reference_sha256": "1088e8c80b904bbb2ea80cf79892ff172ee567c88a9f69b6881186109b748c44",
|
| 167 |
+
"imports": [
|
| 168 |
+
"import re"
|
| 169 |
+
]
|
| 170 |
+
},
|
| 171 |
+
"pymethods2test-3851": {
|
| 172 |
+
"reference_sha256": "598ad36ad3363980898f3e76d6ffd750164db2633f1a6193d62f1d1dc767bfc3",
|
| 173 |
+
"imports": [
|
| 174 |
+
"from itertools import product"
|
| 175 |
+
]
|
| 176 |
+
},
|
| 177 |
+
"pymethods2test-3892": {
|
| 178 |
+
"reference_sha256": "08fb1a081330a38cc41fe29ae7c4162e26d275799f521a17780e4c63cc7a3b14",
|
| 179 |
+
"imports": [
|
| 180 |
+
"import sys"
|
| 181 |
+
]
|
| 182 |
+
},
|
| 183 |
+
"pymethods2test-4188": {
|
| 184 |
+
"reference_sha256": "f2dbe5036c1a63846f1a36c5cd8c19e8c466586b5f9aea5ae2a7012043e0c3fe",
|
| 185 |
+
"imports": [
|
| 186 |
+
"from collections import deque"
|
| 187 |
+
]
|
| 188 |
+
},
|
| 189 |
+
"pymethods2test-4209": {
|
| 190 |
+
"reference_sha256": "6cbd02638341c8988437375081eb1e1b7c512c1bc1076c755402a5cb5e6e1aa7",
|
| 191 |
+
"imports": [
|
| 192 |
+
"from math import ceil",
|
| 193 |
+
"from math import floor",
|
| 194 |
+
"from math import sqrt"
|
| 195 |
+
]
|
| 196 |
+
},
|
| 197 |
+
"pymethods2test-4281": {
|
| 198 |
+
"reference_sha256": "ecc7b2fbec7317b6f7bfa3b5d4899ddcf5d9b2dc66512292deef5639ca121746",
|
| 199 |
+
"imports": [
|
| 200 |
+
"import heapq"
|
| 201 |
+
]
|
| 202 |
+
},
|
| 203 |
+
"pymethods2test-4350": {
|
| 204 |
+
"reference_sha256": "8f9ca76f3923ec7c7b4fb2fc0461bc6b373c00bfcf277581260a6ecf3605be90",
|
| 205 |
+
"imports": [
|
| 206 |
+
"from collections import deque"
|
| 207 |
+
]
|
| 208 |
+
},
|
| 209 |
+
"pymethods2test-4514": {
|
| 210 |
+
"reference_sha256": "0df73c75dc4a025d9493390757243d480af7dfee6cad55c3a2064315fd0a84a9",
|
| 211 |
+
"imports": [
|
| 212 |
+
"from collections import defaultdict"
|
| 213 |
+
]
|
| 214 |
+
},
|
| 215 |
+
"pymethods2test-4526": {
|
| 216 |
+
"reference_sha256": "8f8422c8e053e0bd4a758fe05c8a2f55b63f9d497b1b2d77f3928aca6146c057",
|
| 217 |
+
"imports": [
|
| 218 |
+
"from collections import deque"
|
| 219 |
+
]
|
| 220 |
+
},
|
| 221 |
+
"pymethods2test-4569": {
|
| 222 |
+
"reference_sha256": "a2e1c82eb7fb84b0b80f3daefea36f909ea49afcfeab4d550e1e7b5c924e3317",
|
| 223 |
+
"imports": [
|
| 224 |
+
"from collections import Counter",
|
| 225 |
+
"from collections import defaultdict"
|
| 226 |
+
]
|
| 227 |
+
}
|
| 228 |
+
}
|
pymethods2test_v1/repairs/numpy_repairs.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"pymethods2test-0457": "2509961835f09b99321d9be863e28df053a7f1fc4bcb761775585c5b3f4ec8d2",
|
| 3 |
+
"pymethods2test-0469": "a691b1f4248bd5cf09f40accf3a654bdf9741c2c50bbe163a504cdfc0da5f0a4",
|
| 4 |
+
"pymethods2test-0732": "7addc2c7918145a0146221bf19c71da21cf2d004f63aa2b33499058364eff5b7",
|
| 5 |
+
"pymethods2test-0907": "2ab239603b14b8e7cfb86eff4b5de6e6b4ad4b78902eba9e8904ca53ca0bf1b2",
|
| 6 |
+
"pymethods2test-2208": "135154b90c774ded69ce3bec4e4eb76de0aff5fd8d3668a7f0963d54e0b836db",
|
| 7 |
+
"pymethods2test-2331": "2cd77e1bb8f0fc8df80919b9db09ea876ca883b6b823965e872b7c5e68fa40be",
|
| 8 |
+
"pymethods2test-2354": "6bdab6cadeabadaf7f3976847b5a014c2d9058c23ed8944a44147779161f32bc",
|
| 9 |
+
"pymethods2test-2680": "227c22136cd8e5e8930b25aa3675e968cafbd096c0d003a83f7dd141c26de11b",
|
| 10 |
+
"pymethods2test-2995": "fc434955063469f33bb80a4084f74f8f7132c56599bed51618ff5237ea528786",
|
| 11 |
+
"pymethods2test-3005": "02b537187f6a75cd46e1efd82b5248ea9d7d58cb6322cce6e5bc2fbaa7eae29c",
|
| 12 |
+
"pymethods2test-3148": "0355c12c3adb012635af0caa195df4b2825641326bf174aeda160924b550dd46",
|
| 13 |
+
"pymethods2test-3525": "e5bd901e1b5fc80dfb179ab48f9c7c5e608037276b6209e7e6f904e28bb59947",
|
| 14 |
+
"pymethods2test-3701": "e1ee3a3886e9b48c823be78b865a47c5033ef361309af5b27f93e07649d7a9f4",
|
| 15 |
+
"pymethods2test-3772": "0d879b3d91e595ddf9d35dd98054451200f02fc814d9f20cc3bb5beafae7bbe3",
|
| 16 |
+
"pymethods2test-4306": "d46e3d1b7f73f7b37862bd9bd9c7b87e65f6129e1b974b2f3d64a8342334b094",
|
| 17 |
+
"pymethods2test-4434": "59e6bea4cbafc2be216e8482950097dc8440007a79c5d66d8fe7657f03a6520e",
|
| 18 |
+
"pymethods2test-4752": "51f5ec0152261e968ffeb020f1c62b97bcf97a2c268286bf2c3e6df551ba441a",
|
| 19 |
+
"pymethods2test-4921": "b452a65cb0e5bee4006b2351306a2e2c693847f154e87d8754d0db8856446d5c"
|
| 20 |
+
}
|
pymethods2test_v1/repairs/path_repairs.json
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
"new": "/app/solution.py"
|
| 10 |
+
}
|
| 11 |
+
]
|
| 12 |
+
},
|
| 13 |
+
"pymethods2test-0406": {
|
| 14 |
+
"instruction_sha256": "85361801600625eaf5ef96025dddcc151643bff63f0a56b564c1e62f464718bd",
|
| 15 |
+
"edits": [
|
| 16 |
+
{
|
| 17 |
+
"start": 787,
|
| 18 |
+
"end": 798,
|
| 19 |
+
"old": "solution.py",
|
| 20 |
+
"new": "/app/solution.py"
|
| 21 |
+
}
|
| 22 |
+
]
|
| 23 |
+
},
|
| 24 |
+
"pymethods2test-0456": {
|
| 25 |
+
"instruction_sha256": "2b6ece08bb8fcea3e72eb923967a59dec2bcc648fed5dca484619565f37c1b57",
|
| 26 |
+
"edits": [
|
| 27 |
+
{
|
| 28 |
+
"start": 1309,
|
| 29 |
+
"end": 1320,
|
| 30 |
+
"old": "solution.py",
|
| 31 |
+
"new": "/app/solution.py"
|
| 32 |
+
}
|
| 33 |
+
]
|
| 34 |
+
},
|
| 35 |
+
"pymethods2test-0605": {
|
| 36 |
+
"instruction_sha256": "4dee057eb87ec7390c2fd6a9ee879f83ff06971f1d782e73f80bcaa6a88a50ec",
|
| 37 |
+
"edits": [
|
| 38 |
+
{
|
| 39 |
+
"start": 1063,
|
| 40 |
+
"end": 1074,
|
| 41 |
+
"old": "solution.py",
|
| 42 |
+
"new": "/app/solution.py"
|
| 43 |
+
}
|
| 44 |
+
]
|
| 45 |
+
},
|
| 46 |
+
"pymethods2test-1056": {
|
| 47 |
+
"instruction_sha256": "89e6942a19331437337b1a2847a27ac84af9ecb71d305da304ecdb315ec28e0c",
|
| 48 |
+
"edits": [
|
| 49 |
+
{
|
| 50 |
+
"start": 926,
|
| 51 |
+
"end": 937,
|
| 52 |
+
"old": "solution.py",
|
| 53 |
+
"new": "/app/solution.py"
|
| 54 |
+
},
|
| 55 |
+
{
|
| 56 |
+
"start": 984,
|
| 57 |
+
"end": 995,
|
| 58 |
+
"old": "solution.py",
|
| 59 |
+
"new": "/app/solution.py"
|
| 60 |
+
}
|
| 61 |
+
]
|
| 62 |
+
},
|
| 63 |
+
"pymethods2test-1204": {
|
| 64 |
+
"instruction_sha256": "5ddf376bd699a86106cf33000fcf73db80647d804f96959a94c68a7201afd650",
|
| 65 |
+
"edits": [
|
| 66 |
+
{
|
| 67 |
+
"start": 874,
|
| 68 |
+
"end": 885,
|
| 69 |
+
"old": "solution.py",
|
| 70 |
+
"new": "/app/solution.py"
|
| 71 |
+
}
|
| 72 |
+
]
|
| 73 |
+
},
|
| 74 |
+
"pymethods2test-1205": {
|
| 75 |
+
"instruction_sha256": "93460b2371ab9b99651d0c6b389891806fdf4309f77b8195c47144ee73a5a0af",
|
| 76 |
+
"edits": [
|
| 77 |
+
{
|
| 78 |
+
"start": 1393,
|
| 79 |
+
"end": 1404,
|
| 80 |
+
"old": "solution.py",
|
| 81 |
+
"new": "/app/solution.py"
|
| 82 |
+
}
|
| 83 |
+
]
|
| 84 |
+
},
|
| 85 |
+
"pymethods2test-1285": {
|
| 86 |
+
"instruction_sha256": "5f51df5578011f3797e776d9daf655f302c74cc3fe8701237a7695a0e13549ef",
|
| 87 |
+
"edits": [
|
| 88 |
+
{
|
| 89 |
+
"start": 922,
|
| 90 |
+
"end": 933,
|
| 91 |
+
"old": "solution.py",
|
| 92 |
+
"new": "/app/solution.py"
|
| 93 |
+
}
|
| 94 |
+
]
|
| 95 |
+
},
|
| 96 |
+
"pymethods2test-2255": {
|
| 97 |
+
"instruction_sha256": "1c233e6d2e5e0c2df1078e7354e27166749b9c5029be2096426d4127f3c54f6f",
|
| 98 |
+
"edits": [
|
| 99 |
+
{
|
| 100 |
+
"start": 755,
|
| 101 |
+
"end": 766,
|
| 102 |
+
"old": "solution.py",
|
| 103 |
+
"new": "/app/solution.py"
|
| 104 |
+
}
|
| 105 |
+
]
|
| 106 |
+
},
|
| 107 |
+
"pymethods2test-2708": {
|
| 108 |
+
"instruction_sha256": "a7566ba2dc34a197884274695ac6849cf743b7a8882bcaf4f5d25cd5b45ec49e",
|
| 109 |
+
"edits": [
|
| 110 |
+
{
|
| 111 |
+
"start": 1207,
|
| 112 |
+
"end": 1218,
|
| 113 |
+
"old": "solution.py",
|
| 114 |
+
"new": "/app/solution.py"
|
| 115 |
+
}
|
| 116 |
+
]
|
| 117 |
+
},
|
| 118 |
+
"pymethods2test-3059": {
|
| 119 |
+
"instruction_sha256": "f0e0a024dc111c47073cde867392b8722d2d0ca4f67e2a47fb2a9b13ad3f17b1",
|
| 120 |
+
"edits": [
|
| 121 |
+
{
|
| 122 |
+
"start": 1289,
|
| 123 |
+
"end": 1300,
|
| 124 |
+
"old": "solution.py",
|
| 125 |
+
"new": "/app/solution.py"
|
| 126 |
+
},
|
| 127 |
+
{
|
| 128 |
+
"start": 1368,
|
| 129 |
+
"end": 1379,
|
| 130 |
+
"old": "solution.py",
|
| 131 |
+
"new": "/app/solution.py"
|
| 132 |
+
}
|
| 133 |
+
]
|
| 134 |
+
},
|
| 135 |
+
"pymethods2test-3255": {
|
| 136 |
+
"instruction_sha256": "aeca764d345685d5b864026166b2eba942d13add5ef63f5a6eb2b7a80487db48",
|
| 137 |
+
"edits": [
|
| 138 |
+
{
|
| 139 |
+
"start": 823,
|
| 140 |
+
"end": 834,
|
| 141 |
+
"old": "solution.py",
|
| 142 |
+
"new": "/app/solution.py"
|
| 143 |
+
}
|
| 144 |
+
]
|
| 145 |
+
},
|
| 146 |
+
"pymethods2test-3422": {
|
| 147 |
+
"instruction_sha256": "a4a3d42e35303410f895f656820ed3fedc12654542127178c622d0490ece9dd8",
|
| 148 |
+
"edits": [
|
| 149 |
+
{
|
| 150 |
+
"start": 739,
|
| 151 |
+
"end": 750,
|
| 152 |
+
"old": "solution.py",
|
| 153 |
+
"new": "/app/solution.py"
|
| 154 |
+
}
|
| 155 |
+
]
|
| 156 |
+
},
|
| 157 |
+
"pymethods2test-3659": {
|
| 158 |
+
"instruction_sha256": "76adbb52a28552741d555d8ea433eaaa6bfd2a4f4c448029d3d0bc5d19e0da91",
|
| 159 |
+
"edits": [
|
| 160 |
+
{
|
| 161 |
+
"start": 715,
|
| 162 |
+
"end": 726,
|
| 163 |
+
"old": "solution.py",
|
| 164 |
+
"new": "/app/solution.py"
|
| 165 |
+
},
|
| 166 |
+
{
|
| 167 |
+
"start": 771,
|
| 168 |
+
"end": 782,
|
| 169 |
+
"old": "solution.py",
|
| 170 |
+
"new": "/app/solution.py"
|
| 171 |
+
}
|
| 172 |
+
]
|
| 173 |
+
},
|
| 174 |
+
"pymethods2test-4209": {
|
| 175 |
+
"instruction_sha256": "576b3f1cb2b009767869e5ce2d5ed554e5b40273e492f17d67cd25ac801b04e4",
|
| 176 |
+
"edits": [
|
| 177 |
+
{
|
| 178 |
+
"start": 1188,
|
| 179 |
+
"end": 1199,
|
| 180 |
+
"old": "solution.py",
|
| 181 |
+
"new": "/app/solution.py"
|
| 182 |
+
}
|
| 183 |
+
]
|
| 184 |
+
}
|
| 185 |
+
}
|
pymethods2test_v1/tasks.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cbf2edf6a4870f8503914d974832693f01fd1977ae5f98744d5dc56c1c60f0dd
|
| 3 |
+
size 17153849
|