Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- 102/tests/test_mbpp_0.py +6 -0
- 102/tests/test_mbpp_2.py +6 -0
- 103/instruction.md +3 -0
- 103/solution/__init__.py +1 -0
- 103/solution/_reference.py +7 -0
- 103/solution/solution.py +22 -0
- 103/solution/solve.sh +12 -0
- 103/task.toml +19 -0
- 103/tests/__init__.py +0 -0
- 103/tests/conftest.py +3 -0
- 103/tests/test_mbpp_0.py +6 -0
- 103/tests/test_mbpp_1.py +6 -0
- 103/tests/test_mbpp_2.py +6 -0
- 104/instruction.md +3 -0
- 104/solution/__init__.py +1 -0
- 104/solution/_reference.py +4 -0
- 104/solution/solution.py +22 -0
- 104/solution/solve.sh +12 -0
- 104/task.toml +19 -0
- 104/tests/__init__.py +0 -0
- 104/tests/conftest.py +3 -0
- 104/tests/test_mbpp_0.py +6 -0
- 104/tests/test_mbpp_1.py +6 -0
- 104/tests/test_mbpp_2.py +6 -0
- 106/instruction.md +3 -0
- 106/solution/__init__.py +1 -0
- 106/solution/_reference.py +4 -0
- 106/solution/solution.py +22 -0
- 106/solution/solve.sh +12 -0
- 106/task.toml +19 -0
- 106/tests/__init__.py +0 -0
- 106/tests/conftest.py +3 -0
- 106/tests/test_mbpp_0.py +6 -0
- 106/tests/test_mbpp_1.py +6 -0
- 106/tests/test_mbpp_2.py +6 -0
- 11/instruction.md +3 -0
- 11/solution/__init__.py +1 -0
- 11/solution/_reference.py +11 -0
- 11/solution/solution.py +22 -0
- 11/solution/solve.sh +12 -0
- 11/task.toml +19 -0
- 11/tests/__init__.py +0 -0
- 11/tests/conftest.py +3 -0
- 11/tests/test_mbpp_0.py +6 -0
- 11/tests/test_mbpp_1.py +6 -0
- 11/tests/test_mbpp_2.py +6 -0
- 115/instruction.md +3 -0
- 115/solution/__init__.py +1 -0
- 115/solution/_reference.py +4 -0
- 115/solution/solution.py +22 -0
102/tests/test_mbpp_0.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Auto-generated by loom_benchmarks.util.pytest_from_test_strings.
|
| 2 |
+
from solution import * # noqa: F401,F403
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def test_mbpp_0() -> None:
|
| 6 |
+
assert snake_to_camel('python_program')=='PythonProgram'
|
102/tests/test_mbpp_2.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Auto-generated by loom_benchmarks.util.pytest_from_test_strings.
|
| 2 |
+
from solution import * # noqa: F401,F403
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def test_mbpp_2() -> None:
|
| 6 |
+
assert snake_to_camel('programming_language')==('ProgrammingLanguage')
|
103/instruction.md
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MBPP 103
|
| 2 |
+
|
| 3 |
+
Write a function to find the Eulerian number a(n, m).
|
103/solution/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
from solution.solution import * # noqa: F401,F403
|
103/solution/_reference.py
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
def eulerian_num(n, m):
|
| 3 |
+
if (m >= n or n == 0):
|
| 4 |
+
return 0
|
| 5 |
+
if (m == 0):
|
| 6 |
+
return 1
|
| 7 |
+
return ((n - m) * eulerian_num(n - 1, m - 1) +(m + 1) * eulerian_num(n - 1, m))
|
103/solution/solution.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Stub solution module — agents must overwrite this file.
|
| 2 |
+
|
| 3 |
+
Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the
|
| 4 |
+
canonical upstream solution at `solution/_reference.py` and this
|
| 5 |
+
stub at `solution/solution.py`. The pytest verifier imports from
|
| 6 |
+
`solution.solution`, so any attempt to run the tests against this
|
| 7 |
+
stub fails loudly with NotImplementedError instead of silently
|
| 8 |
+
passing on a pre-shipped answer.
|
| 9 |
+
|
| 10 |
+
- Non-oracle agents: must overwrite `solution.py` with their own
|
| 11 |
+
attempt (the file the pytest tests import from).
|
| 12 |
+
- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`)
|
| 13 |
+
copies `_reference.py` over `solution.py` before the verifier runs,
|
| 14 |
+
so oracle smoke trials still pass.
|
| 15 |
+
"""
|
| 16 |
+
|
| 17 |
+
def __getattr__(name: str):
|
| 18 |
+
raise NotImplementedError(
|
| 19 |
+
f"solution.solution.{name!r} not implemented — the agent must "
|
| 20 |
+
f"replace this file with a real solution. Oracle agents do "
|
| 21 |
+
f"this via solve.sh, which copies _reference.py."
|
| 22 |
+
)
|
103/solution/solve.sh
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
set -eu
|
| 3 |
+
HERE="$(dirname "$0")"
|
| 4 |
+
if [ -f "$HERE/_reference.py" ]; then
|
| 5 |
+
cd "$HERE"
|
| 6 |
+
elif [ -f "$HERE/solution/_reference.py" ]; then
|
| 7 |
+
cd "$HERE/solution"
|
| 8 |
+
else
|
| 9 |
+
echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2
|
| 10 |
+
exit 1
|
| 11 |
+
fi
|
| 12 |
+
cp -f _reference.py solution.py
|
103/task.toml
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
schema_version = "1"
|
| 2 |
+
|
| 3 |
+
[task]
|
| 4 |
+
id = "mbpp/103"
|
| 5 |
+
name = "MBPP — 103"
|
| 6 |
+
|
| 7 |
+
[environment]
|
| 8 |
+
os = "linux"
|
| 9 |
+
docker_image = "python:3.11-slim"
|
| 10 |
+
|
| 11 |
+
[agent]
|
| 12 |
+
name = "oracle"
|
| 13 |
+
|
| 14 |
+
[verifier]
|
| 15 |
+
name = "pytest"
|
| 16 |
+
|
| 17 |
+
[[steps]]
|
| 18 |
+
name = "main"
|
| 19 |
+
artifacts = ["solution/solution.py"]
|
103/tests/__init__.py
ADDED
|
File without changes
|
103/tests/conftest.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import sys
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
sys.path.insert(0, str(Path(__file__).parent.parent))
|
103/tests/test_mbpp_0.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Auto-generated by loom_benchmarks.util.pytest_from_test_strings.
|
| 2 |
+
from solution import * # noqa: F401,F403
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def test_mbpp_0() -> None:
|
| 6 |
+
assert eulerian_num(3, 1) == 4
|
103/tests/test_mbpp_1.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Auto-generated by loom_benchmarks.util.pytest_from_test_strings.
|
| 2 |
+
from solution import * # noqa: F401,F403
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def test_mbpp_1() -> None:
|
| 6 |
+
assert eulerian_num(4, 1) == 11
|
103/tests/test_mbpp_2.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Auto-generated by loom_benchmarks.util.pytest_from_test_strings.
|
| 2 |
+
from solution import * # noqa: F401,F403
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def test_mbpp_2() -> None:
|
| 6 |
+
assert eulerian_num(5, 3) == 26
|
104/instruction.md
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MBPP 104
|
| 2 |
+
|
| 3 |
+
Write a function to sort each sublist of strings in a given list of lists.
|
104/solution/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
from solution.solution import * # noqa: F401,F403
|
104/solution/_reference.py
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
def sort_sublists(input_list):
|
| 3 |
+
result = [sorted(x, key = lambda x:x[0]) for x in input_list]
|
| 4 |
+
return result
|
104/solution/solution.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Stub solution module — agents must overwrite this file.
|
| 2 |
+
|
| 3 |
+
Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the
|
| 4 |
+
canonical upstream solution at `solution/_reference.py` and this
|
| 5 |
+
stub at `solution/solution.py`. The pytest verifier imports from
|
| 6 |
+
`solution.solution`, so any attempt to run the tests against this
|
| 7 |
+
stub fails loudly with NotImplementedError instead of silently
|
| 8 |
+
passing on a pre-shipped answer.
|
| 9 |
+
|
| 10 |
+
- Non-oracle agents: must overwrite `solution.py` with their own
|
| 11 |
+
attempt (the file the pytest tests import from).
|
| 12 |
+
- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`)
|
| 13 |
+
copies `_reference.py` over `solution.py` before the verifier runs,
|
| 14 |
+
so oracle smoke trials still pass.
|
| 15 |
+
"""
|
| 16 |
+
|
| 17 |
+
def __getattr__(name: str):
|
| 18 |
+
raise NotImplementedError(
|
| 19 |
+
f"solution.solution.{name!r} not implemented — the agent must "
|
| 20 |
+
f"replace this file with a real solution. Oracle agents do "
|
| 21 |
+
f"this via solve.sh, which copies _reference.py."
|
| 22 |
+
)
|
104/solution/solve.sh
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
set -eu
|
| 3 |
+
HERE="$(dirname "$0")"
|
| 4 |
+
if [ -f "$HERE/_reference.py" ]; then
|
| 5 |
+
cd "$HERE"
|
| 6 |
+
elif [ -f "$HERE/solution/_reference.py" ]; then
|
| 7 |
+
cd "$HERE/solution"
|
| 8 |
+
else
|
| 9 |
+
echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2
|
| 10 |
+
exit 1
|
| 11 |
+
fi
|
| 12 |
+
cp -f _reference.py solution.py
|
104/task.toml
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
schema_version = "1"
|
| 2 |
+
|
| 3 |
+
[task]
|
| 4 |
+
id = "mbpp/104"
|
| 5 |
+
name = "MBPP — 104"
|
| 6 |
+
|
| 7 |
+
[environment]
|
| 8 |
+
os = "linux"
|
| 9 |
+
docker_image = "python:3.11-slim"
|
| 10 |
+
|
| 11 |
+
[agent]
|
| 12 |
+
name = "oracle"
|
| 13 |
+
|
| 14 |
+
[verifier]
|
| 15 |
+
name = "pytest"
|
| 16 |
+
|
| 17 |
+
[[steps]]
|
| 18 |
+
name = "main"
|
| 19 |
+
artifacts = ["solution/solution.py"]
|
104/tests/__init__.py
ADDED
|
File without changes
|
104/tests/conftest.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import sys
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
sys.path.insert(0, str(Path(__file__).parent.parent))
|
104/tests/test_mbpp_0.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Auto-generated by loom_benchmarks.util.pytest_from_test_strings.
|
| 2 |
+
from solution import * # noqa: F401,F403
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def test_mbpp_0() -> None:
|
| 6 |
+
assert sort_sublists((["green", "orange"], ["black", "white"], ["white", "black", "orange"]))==[['green', 'orange'], ['black', 'white'], ['black', 'orange', 'white']]
|
104/tests/test_mbpp_1.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Auto-generated by loom_benchmarks.util.pytest_from_test_strings.
|
| 2 |
+
from solution import * # noqa: F401,F403
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def test_mbpp_1() -> None:
|
| 6 |
+
assert sort_sublists(([" red ","green" ],["blue "," black"],[" orange","brown"]))==[[' red ', 'green'], [' black', 'blue '], [' orange', 'brown']]
|
104/tests/test_mbpp_2.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Auto-generated by loom_benchmarks.util.pytest_from_test_strings.
|
| 2 |
+
from solution import * # noqa: F401,F403
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def test_mbpp_2() -> None:
|
| 6 |
+
assert sort_sublists((["zilver","gold"], ["magnesium","aluminium"], ["steel", "bronze"]))==[['gold', 'zilver'],['aluminium', 'magnesium'], ['bronze', 'steel']]
|
106/instruction.md
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MBPP 106
|
| 2 |
+
|
| 3 |
+
Write a function to append the given list to the given tuples.
|
106/solution/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
from solution.solution import * # noqa: F401,F403
|
106/solution/_reference.py
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
def add_lists(test_list, test_tup):
|
| 3 |
+
res = tuple(list(test_tup) + test_list)
|
| 4 |
+
return (res)
|
106/solution/solution.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Stub solution module — agents must overwrite this file.
|
| 2 |
+
|
| 3 |
+
Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the
|
| 4 |
+
canonical upstream solution at `solution/_reference.py` and this
|
| 5 |
+
stub at `solution/solution.py`. The pytest verifier imports from
|
| 6 |
+
`solution.solution`, so any attempt to run the tests against this
|
| 7 |
+
stub fails loudly with NotImplementedError instead of silently
|
| 8 |
+
passing on a pre-shipped answer.
|
| 9 |
+
|
| 10 |
+
- Non-oracle agents: must overwrite `solution.py` with their own
|
| 11 |
+
attempt (the file the pytest tests import from).
|
| 12 |
+
- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`)
|
| 13 |
+
copies `_reference.py` over `solution.py` before the verifier runs,
|
| 14 |
+
so oracle smoke trials still pass.
|
| 15 |
+
"""
|
| 16 |
+
|
| 17 |
+
def __getattr__(name: str):
|
| 18 |
+
raise NotImplementedError(
|
| 19 |
+
f"solution.solution.{name!r} not implemented — the agent must "
|
| 20 |
+
f"replace this file with a real solution. Oracle agents do "
|
| 21 |
+
f"this via solve.sh, which copies _reference.py."
|
| 22 |
+
)
|
106/solution/solve.sh
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
set -eu
|
| 3 |
+
HERE="$(dirname "$0")"
|
| 4 |
+
if [ -f "$HERE/_reference.py" ]; then
|
| 5 |
+
cd "$HERE"
|
| 6 |
+
elif [ -f "$HERE/solution/_reference.py" ]; then
|
| 7 |
+
cd "$HERE/solution"
|
| 8 |
+
else
|
| 9 |
+
echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2
|
| 10 |
+
exit 1
|
| 11 |
+
fi
|
| 12 |
+
cp -f _reference.py solution.py
|
106/task.toml
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
schema_version = "1"
|
| 2 |
+
|
| 3 |
+
[task]
|
| 4 |
+
id = "mbpp/106"
|
| 5 |
+
name = "MBPP — 106"
|
| 6 |
+
|
| 7 |
+
[environment]
|
| 8 |
+
os = "linux"
|
| 9 |
+
docker_image = "python:3.11-slim"
|
| 10 |
+
|
| 11 |
+
[agent]
|
| 12 |
+
name = "oracle"
|
| 13 |
+
|
| 14 |
+
[verifier]
|
| 15 |
+
name = "pytest"
|
| 16 |
+
|
| 17 |
+
[[steps]]
|
| 18 |
+
name = "main"
|
| 19 |
+
artifacts = ["solution/solution.py"]
|
106/tests/__init__.py
ADDED
|
File without changes
|
106/tests/conftest.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import sys
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
sys.path.insert(0, str(Path(__file__).parent.parent))
|
106/tests/test_mbpp_0.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Auto-generated by loom_benchmarks.util.pytest_from_test_strings.
|
| 2 |
+
from solution import * # noqa: F401,F403
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def test_mbpp_0() -> None:
|
| 6 |
+
assert add_lists([5, 6, 7], (9, 10)) == (9, 10, 5, 6, 7)
|
106/tests/test_mbpp_1.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Auto-generated by loom_benchmarks.util.pytest_from_test_strings.
|
| 2 |
+
from solution import * # noqa: F401,F403
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def test_mbpp_1() -> None:
|
| 6 |
+
assert add_lists([6, 7, 8], (10, 11)) == (10, 11, 6, 7, 8)
|
106/tests/test_mbpp_2.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Auto-generated by loom_benchmarks.util.pytest_from_test_strings.
|
| 2 |
+
from solution import * # noqa: F401,F403
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def test_mbpp_2() -> None:
|
| 6 |
+
assert add_lists([7, 8, 9], (11, 12)) == (11, 12, 7, 8, 9)
|
11/instruction.md
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MBPP 11
|
| 2 |
+
|
| 3 |
+
Write a python function to remove first and last occurrence of a given character from the string.
|
11/solution/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
from solution.solution import * # noqa: F401,F403
|
11/solution/_reference.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
def remove_Occ(s,ch):
|
| 3 |
+
for i in range(len(s)):
|
| 4 |
+
if (s[i] == ch):
|
| 5 |
+
s = s[0 : i] + s[i + 1:]
|
| 6 |
+
break
|
| 7 |
+
for i in range(len(s) - 1,-1,-1):
|
| 8 |
+
if (s[i] == ch):
|
| 9 |
+
s = s[0 : i] + s[i + 1:]
|
| 10 |
+
break
|
| 11 |
+
return s
|
11/solution/solution.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Stub solution module — agents must overwrite this file.
|
| 2 |
+
|
| 3 |
+
Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the
|
| 4 |
+
canonical upstream solution at `solution/_reference.py` and this
|
| 5 |
+
stub at `solution/solution.py`. The pytest verifier imports from
|
| 6 |
+
`solution.solution`, so any attempt to run the tests against this
|
| 7 |
+
stub fails loudly with NotImplementedError instead of silently
|
| 8 |
+
passing on a pre-shipped answer.
|
| 9 |
+
|
| 10 |
+
- Non-oracle agents: must overwrite `solution.py` with their own
|
| 11 |
+
attempt (the file the pytest tests import from).
|
| 12 |
+
- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`)
|
| 13 |
+
copies `_reference.py` over `solution.py` before the verifier runs,
|
| 14 |
+
so oracle smoke trials still pass.
|
| 15 |
+
"""
|
| 16 |
+
|
| 17 |
+
def __getattr__(name: str):
|
| 18 |
+
raise NotImplementedError(
|
| 19 |
+
f"solution.solution.{name!r} not implemented — the agent must "
|
| 20 |
+
f"replace this file with a real solution. Oracle agents do "
|
| 21 |
+
f"this via solve.sh, which copies _reference.py."
|
| 22 |
+
)
|
11/solution/solve.sh
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
set -eu
|
| 3 |
+
HERE="$(dirname "$0")"
|
| 4 |
+
if [ -f "$HERE/_reference.py" ]; then
|
| 5 |
+
cd "$HERE"
|
| 6 |
+
elif [ -f "$HERE/solution/_reference.py" ]; then
|
| 7 |
+
cd "$HERE/solution"
|
| 8 |
+
else
|
| 9 |
+
echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2
|
| 10 |
+
exit 1
|
| 11 |
+
fi
|
| 12 |
+
cp -f _reference.py solution.py
|
11/task.toml
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
schema_version = "1"
|
| 2 |
+
|
| 3 |
+
[task]
|
| 4 |
+
id = "mbpp/11"
|
| 5 |
+
name = "MBPP — 11"
|
| 6 |
+
|
| 7 |
+
[environment]
|
| 8 |
+
os = "linux"
|
| 9 |
+
docker_image = "python:3.11-slim"
|
| 10 |
+
|
| 11 |
+
[agent]
|
| 12 |
+
name = "oracle"
|
| 13 |
+
|
| 14 |
+
[verifier]
|
| 15 |
+
name = "pytest"
|
| 16 |
+
|
| 17 |
+
[[steps]]
|
| 18 |
+
name = "main"
|
| 19 |
+
artifacts = ["solution/solution.py"]
|
11/tests/__init__.py
ADDED
|
File without changes
|
11/tests/conftest.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import sys
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
sys.path.insert(0, str(Path(__file__).parent.parent))
|
11/tests/test_mbpp_0.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Auto-generated by loom_benchmarks.util.pytest_from_test_strings.
|
| 2 |
+
from solution import * # noqa: F401,F403
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def test_mbpp_0() -> None:
|
| 6 |
+
assert remove_Occ("hello","l") == "heo"
|
11/tests/test_mbpp_1.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Auto-generated by loom_benchmarks.util.pytest_from_test_strings.
|
| 2 |
+
from solution import * # noqa: F401,F403
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def test_mbpp_1() -> None:
|
| 6 |
+
assert remove_Occ("abcda","a") == "bcd"
|
11/tests/test_mbpp_2.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Auto-generated by loom_benchmarks.util.pytest_from_test_strings.
|
| 2 |
+
from solution import * # noqa: F401,F403
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def test_mbpp_2() -> None:
|
| 6 |
+
assert remove_Occ("PHP","P") == "H"
|
115/instruction.md
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MBPP 115
|
| 2 |
+
|
| 3 |
+
Write a function to check whether all dictionaries in a list are empty or not.
|
115/solution/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
from solution.solution import * # noqa: F401,F403
|
115/solution/_reference.py
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
def empty_dit(list1):
|
| 3 |
+
empty_dit=all(not d for d in list1)
|
| 4 |
+
return empty_dit
|
115/solution/solution.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Stub solution module — agents must overwrite this file.
|
| 2 |
+
|
| 3 |
+
Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the
|
| 4 |
+
canonical upstream solution at `solution/_reference.py` and this
|
| 5 |
+
stub at `solution/solution.py`. The pytest verifier imports from
|
| 6 |
+
`solution.solution`, so any attempt to run the tests against this
|
| 7 |
+
stub fails loudly with NotImplementedError instead of silently
|
| 8 |
+
passing on a pre-shipped answer.
|
| 9 |
+
|
| 10 |
+
- Non-oracle agents: must overwrite `solution.py` with their own
|
| 11 |
+
attempt (the file the pytest tests import from).
|
| 12 |
+
- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`)
|
| 13 |
+
copies `_reference.py` over `solution.py` before the verifier runs,
|
| 14 |
+
so oracle smoke trials still pass.
|
| 15 |
+
"""
|
| 16 |
+
|
| 17 |
+
def __getattr__(name: str):
|
| 18 |
+
raise NotImplementedError(
|
| 19 |
+
f"solution.solution.{name!r} not implemented — the agent must "
|
| 20 |
+
f"replace this file with a real solution. Oracle agents do "
|
| 21 |
+
f"this via solve.sh, which copies _reference.py."
|
| 22 |
+
)
|