Add files using upload-large-folder tool
Browse files- 102/instruction.md +3 -0
- 102/solution/__init__.py +1 -0
- 102/solution/_reference.py +4 -0
- 102/solution/solution.py +22 -0
- 102/solution/solve.sh +12 -0
- 102/task.toml +19 -0
- 102/tests/__init__.py +0 -0
- 102/tests/conftest.py +3 -0
- 102/tests/test_mbpp_1.py +6 -0
- 115/tests/conftest.py +3 -0
- 405/instruction.md +3 -0
- 405/solution/__init__.py +1 -0
- 405/solution/_reference.py +6 -0
- 405/solution/solution.py +22 -0
- 405/solution/solve.sh +12 -0
- 405/task.toml +19 -0
- 405/tests/__init__.py +0 -0
- 405/tests/conftest.py +3 -0
- 405/tests/test_mbpp_0.py +6 -0
- 405/tests/test_mbpp_1.py +6 -0
- 405/tests/test_mbpp_2.py +6 -0
- 435/tests/conftest.py +3 -0
- 436/solution/solve.sh +12 -0
- 436/task.toml +19 -0
- 436/tests/test_mbpp_0.py +6 -0
- 444/solution/__init__.py +1 -0
- 444/solution/solution.py +22 -0
- 444/solution/solve.sh +12 -0
- 444/tests/__init__.py +0 -0
- 444/tests/conftest.py +3 -0
- 444/tests/test_mbpp_0.py +6 -0
- 444/tests/test_mbpp_1.py +6 -0
- 444/tests/test_mbpp_2.py +6 -0
102/instruction.md
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MBPP 102
|
| 2 |
+
|
| 3 |
+
Write a function to convert a snake case string to camel case string.
|
102/solution/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
from solution.solution import * # noqa: F401,F403
|
102/solution/_reference.py
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
def snake_to_camel(word):
|
| 3 |
+
import re
|
| 4 |
+
return ''.join(x.capitalize() or '_' for x in word.split('_'))
|
102/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 |
+
)
|
102/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
|
102/task.toml
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
schema_version = "1"
|
| 2 |
+
|
| 3 |
+
[task]
|
| 4 |
+
id = "mbpp/102"
|
| 5 |
+
name = "MBPP — 102"
|
| 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"]
|
102/tests/__init__.py
ADDED
|
File without changes
|
102/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))
|
102/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 snake_to_camel('python_language')==('PythonLanguage')
|
115/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))
|
405/instruction.md
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MBPP 405
|
| 2 |
+
|
| 3 |
+
Write a function to check whether an element exists within a tuple.
|
405/solution/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
from solution.solution import * # noqa: F401,F403
|
405/solution/_reference.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
def check_tuplex(tuplex,tuple1):
|
| 3 |
+
if tuple1 in tuplex:
|
| 4 |
+
return True
|
| 5 |
+
else:
|
| 6 |
+
return False
|
405/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 |
+
)
|
405/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
|
405/task.toml
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
schema_version = "1"
|
| 2 |
+
|
| 3 |
+
[task]
|
| 4 |
+
id = "mbpp/405"
|
| 5 |
+
name = "MBPP — 405"
|
| 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"]
|
405/tests/__init__.py
ADDED
|
File without changes
|
405/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))
|
405/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 check_tuplex(("w", 3, "r", "e", "s", "o", "u", "r", "c", "e"),'r')==True
|
405/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 check_tuplex(("w", 3, "r", "e", "s", "o", "u", "r", "c", "e"),'5')==False
|
405/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 check_tuplex(("w", 3, "r", "e", "s", "o", "u", "r", "c","e"),3)==True
|
435/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))
|
436/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
|
436/task.toml
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
schema_version = "1"
|
| 2 |
+
|
| 3 |
+
[task]
|
| 4 |
+
id = "mbpp/436"
|
| 5 |
+
name = "MBPP — 436"
|
| 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"]
|
436/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 neg_nos([-1,4,5,-6]) == [-1,-6]
|
444/solution/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
from solution.solution import * # noqa: F401,F403
|
444/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 |
+
)
|
444/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
|
444/tests/__init__.py
ADDED
|
File without changes
|
444/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))
|
444/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 trim_tuple([(5, 3, 2, 1, 4), (3, 4, 9, 2, 1),(9, 1, 2, 3, 5), (4, 8, 2, 1, 7)], 2) == '[(2,), (9,), (2,), (2,)]'
|
444/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 trim_tuple([(5, 3, 2, 1, 4), (3, 4, 9, 2, 1), (9, 1, 2, 3, 5), (4, 8, 2, 1, 7)], 1) == '[(3, 2, 1), (4, 9, 2), (1, 2, 3), (8, 2, 1)]'
|
444/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 trim_tuple([(7, 8, 4, 9), (11, 8, 12, 4),(4, 1, 7, 8), (3, 6, 9, 7)], 1) == '[(8, 4), (8, 12), (1, 7), (6, 9)]'
|