diff --git a/102/tests/test_mbpp_0.py b/102/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..25907b066c677b7506dfa38b5d1f3f0b75a237d5 --- /dev/null +++ b/102/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert snake_to_camel('python_program')=='PythonProgram' diff --git a/102/tests/test_mbpp_2.py b/102/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..d8ecb876db8caec9638df1fd9e2041c2f377e4a4 --- /dev/null +++ b/102/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert snake_to_camel('programming_language')==('ProgrammingLanguage') diff --git a/103/instruction.md b/103/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..d9ae9685e6833b02df256a28c5258114a4364f2c --- /dev/null +++ b/103/instruction.md @@ -0,0 +1,3 @@ +# MBPP 103 + +Write a function to find the Eulerian number a(n, m). diff --git a/103/solution/__init__.py b/103/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/103/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/103/solution/_reference.py b/103/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..66c487c1dfeb787cf8244b5772353f763ec7a34c --- /dev/null +++ b/103/solution/_reference.py @@ -0,0 +1,7 @@ + +def eulerian_num(n, m): + if (m >= n or n == 0): + return 0 + if (m == 0): + return 1 + return ((n - m) * eulerian_num(n - 1, m - 1) +(m + 1) * eulerian_num(n - 1, m)) \ No newline at end of file diff --git a/103/solution/solution.py b/103/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/103/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/103/solution/solve.sh b/103/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/103/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/103/task.toml b/103/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..8896066e25b25e74528d08f73507244d347510ca --- /dev/null +++ b/103/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/103" +name = "MBPP — 103" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/103/tests/__init__.py b/103/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/103/tests/conftest.py b/103/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/103/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/103/tests/test_mbpp_0.py b/103/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..a80561d08ef21948e2900cc2ae662e61c94a8849 --- /dev/null +++ b/103/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert eulerian_num(3, 1) == 4 diff --git a/103/tests/test_mbpp_1.py b/103/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..8de8ea4faebcf7407de7d0940d47f59903f84fe8 --- /dev/null +++ b/103/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert eulerian_num(4, 1) == 11 diff --git a/103/tests/test_mbpp_2.py b/103/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..bfb39d5a38573e0510db0873048413054fb8f079 --- /dev/null +++ b/103/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert eulerian_num(5, 3) == 26 diff --git a/104/instruction.md b/104/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..814d3db867581ac44c6c15a0748fd28f968a066e --- /dev/null +++ b/104/instruction.md @@ -0,0 +1,3 @@ +# MBPP 104 + +Write a function to sort each sublist of strings in a given list of lists. diff --git a/104/solution/__init__.py b/104/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/104/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/104/solution/_reference.py b/104/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..ea9abe987ab0fcbcd5248e9252fdc8abc93b3295 --- /dev/null +++ b/104/solution/_reference.py @@ -0,0 +1,4 @@ + +def sort_sublists(input_list): + result = [sorted(x, key = lambda x:x[0]) for x in input_list] + return result diff --git a/104/solution/solution.py b/104/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/104/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/104/solution/solve.sh b/104/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/104/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/104/task.toml b/104/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..5a670ce15f09d8d6005140f9cc9ef53b1bf1a982 --- /dev/null +++ b/104/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/104" +name = "MBPP — 104" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/104/tests/__init__.py b/104/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/104/tests/conftest.py b/104/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/104/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/104/tests/test_mbpp_0.py b/104/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..f32ce5d7ede3177bffd9e645545be4ca7637faad --- /dev/null +++ b/104/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert sort_sublists((["green", "orange"], ["black", "white"], ["white", "black", "orange"]))==[['green', 'orange'], ['black', 'white'], ['black', 'orange', 'white']] diff --git a/104/tests/test_mbpp_1.py b/104/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..d72cb02acb9841ea11d452f77dd0ee8e0e877cd4 --- /dev/null +++ b/104/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert sort_sublists(([" red ","green" ],["blue "," black"],[" orange","brown"]))==[[' red ', 'green'], [' black', 'blue '], [' orange', 'brown']] diff --git a/104/tests/test_mbpp_2.py b/104/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..9717c72d73d09b18473c5941cb005a76d7a8864b --- /dev/null +++ b/104/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert sort_sublists((["zilver","gold"], ["magnesium","aluminium"], ["steel", "bronze"]))==[['gold', 'zilver'],['aluminium', 'magnesium'], ['bronze', 'steel']] diff --git a/106/instruction.md b/106/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..e9240a1a2f7f1d46bb2ab5b1cc56e89210418d02 --- /dev/null +++ b/106/instruction.md @@ -0,0 +1,3 @@ +# MBPP 106 + +Write a function to append the given list to the given tuples. diff --git a/106/solution/__init__.py b/106/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/106/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/106/solution/_reference.py b/106/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..2ff5cf8924e7c3301cdeb36f228bedf4dec11312 --- /dev/null +++ b/106/solution/_reference.py @@ -0,0 +1,4 @@ + +def add_lists(test_list, test_tup): + res = tuple(list(test_tup) + test_list) + return (res) \ No newline at end of file diff --git a/106/solution/solution.py b/106/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/106/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/106/solution/solve.sh b/106/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/106/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/106/task.toml b/106/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..9780a7ba06f960b48de3924f535499e3ec0b8b56 --- /dev/null +++ b/106/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/106" +name = "MBPP — 106" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/106/tests/__init__.py b/106/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/106/tests/conftest.py b/106/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/106/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/106/tests/test_mbpp_0.py b/106/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..e0a15fba52ef5e3a0cb545cad9273e8506345dec --- /dev/null +++ b/106/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert add_lists([5, 6, 7], (9, 10)) == (9, 10, 5, 6, 7) diff --git a/106/tests/test_mbpp_1.py b/106/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..2f669a16f9c39bf22bd7433cfde05bdc3ae5f615 --- /dev/null +++ b/106/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert add_lists([6, 7, 8], (10, 11)) == (10, 11, 6, 7, 8) diff --git a/106/tests/test_mbpp_2.py b/106/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..bc40f00c471638b67b02073c5316aa308ad04eda --- /dev/null +++ b/106/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert add_lists([7, 8, 9], (11, 12)) == (11, 12, 7, 8, 9) diff --git a/11/instruction.md b/11/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..37a72c174af08fc2a2408b7387fc4e6088ee8252 --- /dev/null +++ b/11/instruction.md @@ -0,0 +1,3 @@ +# MBPP 11 + +Write a python function to remove first and last occurrence of a given character from the string. diff --git a/11/solution/__init__.py b/11/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/11/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/11/solution/_reference.py b/11/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..f2312c3fddaf6cf88e1956960e20b5617a959ea6 --- /dev/null +++ b/11/solution/_reference.py @@ -0,0 +1,11 @@ + +def remove_Occ(s,ch): + for i in range(len(s)): + if (s[i] == ch): + s = s[0 : i] + s[i + 1:] + break + for i in range(len(s) - 1,-1,-1): + if (s[i] == ch): + s = s[0 : i] + s[i + 1:] + break + return s \ No newline at end of file diff --git a/11/solution/solution.py b/11/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/11/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/11/solution/solve.sh b/11/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/11/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/11/task.toml b/11/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..03cf52a93ef20cf8ea1cf84190490072a0b7b511 --- /dev/null +++ b/11/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/11" +name = "MBPP — 11" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/11/tests/__init__.py b/11/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/11/tests/conftest.py b/11/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/11/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/11/tests/test_mbpp_0.py b/11/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..9fde722e1d5ae0fc1cf8449eddcd795d1856940f --- /dev/null +++ b/11/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert remove_Occ("hello","l") == "heo" diff --git a/11/tests/test_mbpp_1.py b/11/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..693c609e3815674f17190aea1dbd0bdbfcf0c295 --- /dev/null +++ b/11/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert remove_Occ("abcda","a") == "bcd" diff --git a/11/tests/test_mbpp_2.py b/11/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..ab1d8763ca07dc2a930e6a41235b44f9d28f4fc9 --- /dev/null +++ b/11/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert remove_Occ("PHP","P") == "H" diff --git a/115/instruction.md b/115/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..005c5024d7568ada8e67363babfbb7ba5381d7b0 --- /dev/null +++ b/115/instruction.md @@ -0,0 +1,3 @@ +# MBPP 115 + +Write a function to check whether all dictionaries in a list are empty or not. diff --git a/115/solution/__init__.py b/115/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/115/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/115/solution/_reference.py b/115/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..015e686e5bbe874e0eed7e307b9da036498d17e6 --- /dev/null +++ b/115/solution/_reference.py @@ -0,0 +1,4 @@ + +def empty_dit(list1): + empty_dit=all(not d for d in list1) + return empty_dit \ No newline at end of file diff --git a/115/solution/solution.py b/115/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/115/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/115/solution/solve.sh b/115/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/115/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/115/task.toml b/115/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..ffff9ae590f38952ce03f4f01c298185e689815c --- /dev/null +++ b/115/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/115" +name = "MBPP — 115" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/115/tests/__init__.py b/115/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/115/tests/test_mbpp_0.py b/115/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..44db9e481735e003bcebe2d3b5c4c4717cb60ff9 --- /dev/null +++ b/115/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert empty_dit([{},{},{}])==True diff --git a/115/tests/test_mbpp_1.py b/115/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..7267f7c888df13e195a4436ab63a4c33dcfa0387 --- /dev/null +++ b/115/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert empty_dit([{1,2},{},{}])==False diff --git a/115/tests/test_mbpp_2.py b/115/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..dd8c33717f832db14f5a2db1c0443bd63abd3f0d --- /dev/null +++ b/115/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert empty_dit({})==True diff --git a/119/instruction.md b/119/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..dff6026dc885b65af378a5089141e1a91eb568e5 --- /dev/null +++ b/119/instruction.md @@ -0,0 +1,3 @@ +# MBPP 119 + +Write a python function to find the element that appears only once in a sorted array. diff --git a/119/solution/__init__.py b/119/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/119/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/119/solution/_reference.py b/119/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..d5c5b1274f39b96915b5511d7fe7f2b2ac9ce9e3 --- /dev/null +++ b/119/solution/_reference.py @@ -0,0 +1,7 @@ + +def search(arr): + n = len(arr) + XOR = 0 + for i in range(n) : + XOR = XOR ^ arr[i] + return (XOR) \ No newline at end of file diff --git a/119/solution/solution.py b/119/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/119/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/119/solution/solve.sh b/119/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/119/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/119/task.toml b/119/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..43403775ad25285366a34a8783bd50b99975717c --- /dev/null +++ b/119/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/119" +name = "MBPP — 119" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/119/tests/__init__.py b/119/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/119/tests/conftest.py b/119/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/119/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/119/tests/test_mbpp_0.py b/119/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..7021b375c72cd22cd301fde3f1c40bd729f1bf25 --- /dev/null +++ b/119/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert search([1,1,2,2,3]) == 3 diff --git a/119/tests/test_mbpp_1.py b/119/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..a5e494c4fcf7711f41b26b6bc6a49cbfb5289159 --- /dev/null +++ b/119/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert search([1,1,3,3,4,4,5,5,7,7,8]) == 8 diff --git a/119/tests/test_mbpp_2.py b/119/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..e7597a1a77296cc5d6140d5dfe599aec5b7c9c16 --- /dev/null +++ b/119/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert search([1,2,2,3,3,4,4]) == 1 diff --git a/12/instruction.md b/12/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..57214734d0178e6f71cf0ceb246850c137725dce --- /dev/null +++ b/12/instruction.md @@ -0,0 +1,3 @@ +# MBPP 12 + +Write a function to sort a given matrix in ascending order according to the sum of its rows. diff --git a/12/solution/__init__.py b/12/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/12/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/12/solution/_reference.py b/12/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..c906967cbc50f427e7934c91eee24f0d6daae94f --- /dev/null +++ b/12/solution/_reference.py @@ -0,0 +1,4 @@ + +def sort_matrix(M): + result = sorted(M, key=sum) + return result \ No newline at end of file diff --git a/12/solution/solution.py b/12/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/12/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/12/solution/solve.sh b/12/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/12/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/12/task.toml b/12/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..3c1c68ef8b46af85e9595a558da5cba4a645d983 --- /dev/null +++ b/12/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/12" +name = "MBPP — 12" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/12/tests/__init__.py b/12/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/12/tests/conftest.py b/12/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/12/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/12/tests/test_mbpp_0.py b/12/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..e969fba7fc086499056534b479b8a477bfd9c981 --- /dev/null +++ b/12/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert sort_matrix([[1, 2, 3], [2, 4, 5], [1, 1, 1]])==[[1, 1, 1], [1, 2, 3], [2, 4, 5]] diff --git a/12/tests/test_mbpp_1.py b/12/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..2997ede408cf1d39fb82c3db659d1083dd052f77 --- /dev/null +++ b/12/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert sort_matrix([[1, 2, 3], [-2, 4, -5], [1, -1, 1]])==[[-2, 4, -5], [1, -1, 1], [1, 2, 3]] diff --git a/12/tests/test_mbpp_2.py b/12/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..3d576786a3a658105268ec517200182753e018d4 --- /dev/null +++ b/12/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert sort_matrix([[5,8,9],[6,4,3],[2,1,4]])==[[2, 1, 4], [6, 4, 3], [5, 8, 9]] diff --git a/124/instruction.md b/124/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..5e5de429ac40676a5d6fca40ac11bdfacc52bd0d --- /dev/null +++ b/124/instruction.md @@ -0,0 +1,3 @@ +# MBPP 124 + +Write a function to get the angle of a complex number. diff --git a/124/solution/__init__.py b/124/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/124/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/124/solution/_reference.py b/124/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..6fd0532b0a6738c9e69686d10ec78471f9c43760 --- /dev/null +++ b/124/solution/_reference.py @@ -0,0 +1,6 @@ +import math +import cmath +def angle_complex(a,b): + cn=complex(a,b) + angle=cmath.phase(a+b) + return angle \ No newline at end of file diff --git a/124/solution/solution.py b/124/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/124/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/124/solution/solve.sh b/124/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/124/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/124/task.toml b/124/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..5ec2a248f57bd5f193fa3c7b2ac5aac3ed8836e3 --- /dev/null +++ b/124/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/124" +name = "MBPP — 124" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/124/tests/__init__.py b/124/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/124/tests/conftest.py b/124/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/124/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/124/tests/test_mbpp_0.py b/124/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..341a22176cbcf1c98d35c0bee4a3aac669545ade --- /dev/null +++ b/124/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert math.isclose(angle_complex(0,1j), 1.5707963267948966, rel_tol=0.001) diff --git a/124/tests/test_mbpp_1.py b/124/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..c55302cf716578436f49804f343e3012d5042490 --- /dev/null +++ b/124/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert math.isclose(angle_complex(2,1j), 0.4636476090008061, rel_tol=0.001) diff --git a/124/tests/test_mbpp_2.py b/124/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..b6c24b402391312067b4af802ad25510fa625838 --- /dev/null +++ b/124/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert math.isclose(angle_complex(0,2j), 1.5707963267948966, rel_tol=0.001) diff --git a/126/instruction.md b/126/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..8dfee0a9d68f047f1fb4d58ce72f4f148e70d6dc --- /dev/null +++ b/126/instruction.md @@ -0,0 +1,3 @@ +# MBPP 126 + +Write a python function to find the sum of common divisors of two given numbers. diff --git a/126/solution/__init__.py b/126/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/126/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/126/solution/_reference.py b/126/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..2b4fa50a5c52d54752f382953723382edc55113c --- /dev/null +++ b/126/solution/_reference.py @@ -0,0 +1,7 @@ + +def sum(a,b): + sum = 0 + for i in range (1,min(a,b)): + if (a % i == 0 and b % i == 0): + sum += i + return sum \ No newline at end of file diff --git a/126/solution/solution.py b/126/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/126/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/126/solution/solve.sh b/126/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/126/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/126/task.toml b/126/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..8e56da39f785a1d7e3d0d97962d5405600790e93 --- /dev/null +++ b/126/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/126" +name = "MBPP — 126" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/126/tests/__init__.py b/126/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/126/tests/conftest.py b/126/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/126/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/126/tests/test_mbpp_0.py b/126/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..bcd151d9584383568c9761f2126841aaba987927 --- /dev/null +++ b/126/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert sum(10,15) == 6 diff --git a/126/tests/test_mbpp_1.py b/126/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..e7272d819f97852062608ac64e6b0535bd8c71c3 --- /dev/null +++ b/126/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert sum(100,150) == 93 diff --git a/126/tests/test_mbpp_2.py b/126/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..768fa97e1bc919b84847340a49076a0b2c96c5fb --- /dev/null +++ b/126/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert sum(4,6) == 3 diff --git a/128/instruction.md b/128/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..56e63f5f6b4d383b1a21f708518e5dd42748e7ce --- /dev/null +++ b/128/instruction.md @@ -0,0 +1,3 @@ +# MBPP 128 + +Write a function to find words that are longer than n characters from a given list of words. diff --git a/128/solution/__init__.py b/128/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/128/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/128/solution/_reference.py b/128/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..79fde9ae54448718540034235bc59a149a298255 --- /dev/null +++ b/128/solution/_reference.py @@ -0,0 +1,8 @@ + +def long_words(n, str): + word_len = [] + txt = str.split(" ") + for x in txt: + if len(x) > n: + word_len.append(x) + return word_len \ No newline at end of file diff --git a/128/solution/solution.py b/128/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/128/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/128/solution/solve.sh b/128/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/128/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/128/task.toml b/128/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..fa70567288b38d75d7d95df505f5ba075e8a9e01 --- /dev/null +++ b/128/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/128" +name = "MBPP — 128" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/128/tests/__init__.py b/128/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/128/tests/conftest.py b/128/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/128/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/128/tests/test_mbpp_0.py b/128/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..e944b127f9a067fae7b1da02fbb9323ac482e770 --- /dev/null +++ b/128/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert long_words(3,"python is a programming language")==['python','programming','language'] diff --git a/128/tests/test_mbpp_1.py b/128/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..7c1fee895aa6fb16b835f364f59b0e2e4bb4e945 --- /dev/null +++ b/128/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert long_words(2,"writing a program")==['writing','program'] diff --git a/128/tests/test_mbpp_2.py b/128/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..20dbc52f5da1c44fc9841b80aa20cd0975edfd9a --- /dev/null +++ b/128/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert long_words(5,"sorting list")==['sorting'] diff --git a/133/instruction.md b/133/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..8b15ebf20a0862a1e724a6111879f9783e915459 --- /dev/null +++ b/133/instruction.md @@ -0,0 +1,3 @@ +# MBPP 133 + +Write a function to calculate the sum of the negative numbers of a given list of numbers. diff --git a/133/solution/__init__.py b/133/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/133/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/133/solution/_reference.py b/133/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..1bafc1f08d7c6d0b5ed8d4f4c014ebc5cfe63163 --- /dev/null +++ b/133/solution/_reference.py @@ -0,0 +1,4 @@ + +def sum_negativenum(nums): + sum_negativenum = list(filter(lambda nums:nums<0,nums)) + return sum(sum_negativenum) \ No newline at end of file diff --git a/133/solution/solution.py b/133/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/133/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/133/solution/solve.sh b/133/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/133/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/133/task.toml b/133/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..eaca6edc8e8f5954fe6fbdce9a1b06c60503d7fa --- /dev/null +++ b/133/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/133" +name = "MBPP — 133" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/133/tests/__init__.py b/133/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/133/tests/conftest.py b/133/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/133/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/133/tests/test_mbpp_0.py b/133/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..89e9dd17c1aa5879fee48d6896c7515ede447a64 --- /dev/null +++ b/133/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert sum_negativenum([2, 4, -6, -9, 11, -12, 14, -5, 17])==-32 diff --git a/133/tests/test_mbpp_1.py b/133/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..dd1d6c5b65438c22076f59060922f23087e42b6d --- /dev/null +++ b/133/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert sum_negativenum([10,15,-14,13,-18,12,-20])==-52 diff --git a/133/tests/test_mbpp_2.py b/133/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..e59998404500159b7b13b58e03d26cd59f0afc3b --- /dev/null +++ b/133/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert sum_negativenum([19, -65, 57, 39, 152,-639, 121, 44, 90, -190])==-894 diff --git a/135/instruction.md b/135/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..1513ac77679a6c98383ef3fb1ce8650f8dbc6d4e --- /dev/null +++ b/135/instruction.md @@ -0,0 +1,3 @@ +# MBPP 135 + +Write a function to find the nth hexagonal number. diff --git a/135/solution/__init__.py b/135/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/135/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/135/solution/_reference.py b/135/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..8552369ebedab93a73107d3dab6358ac1555fb0a --- /dev/null +++ b/135/solution/_reference.py @@ -0,0 +1,3 @@ + +def hexagonal_num(n): + return n*(2*n - 1) \ No newline at end of file diff --git a/135/solution/solution.py b/135/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/135/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/135/solution/solve.sh b/135/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/135/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/135/task.toml b/135/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..f290371d953586d0162bbb096849c3db34f3ecfe --- /dev/null +++ b/135/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/135" +name = "MBPP — 135" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/135/tests/__init__.py b/135/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/135/tests/conftest.py b/135/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/135/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/135/tests/test_mbpp_0.py b/135/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..49e7de7f26ab87c83c64d9d7c114665c4f1b7e2a --- /dev/null +++ b/135/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert hexagonal_num(10) == 190 diff --git a/135/tests/test_mbpp_1.py b/135/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..1bce22b2326ececbf54710c5ad346a839194f737 --- /dev/null +++ b/135/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert hexagonal_num(5) == 45 diff --git a/135/tests/test_mbpp_2.py b/135/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..2ff5fae70d611fc905e5b1d2676419bec5f42600 --- /dev/null +++ b/135/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert hexagonal_num(7) == 91 diff --git a/137/instruction.md b/137/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..12902923cefcb6f52283372082cb2b126b00088e --- /dev/null +++ b/137/instruction.md @@ -0,0 +1,3 @@ +# MBPP 137 + +Write a function to find the ratio of zeroes to non-zeroes in an array of integers. diff --git a/137/solution/__init__.py b/137/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/137/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/137/solution/_reference.py b/137/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..a6bcc9eeab1c1f0f80da6253b17f1e802bcf3de6 --- /dev/null +++ b/137/solution/_reference.py @@ -0,0 +1,11 @@ +import math +from array import array +def zero_count(nums): + n = len(nums) + n1 = 0 + for x in nums: + if x == 0: + n1 += 1 + else: + None + return n1/(n-n1) \ No newline at end of file diff --git a/137/solution/solution.py b/137/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/137/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/137/solution/solve.sh b/137/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/137/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/137/task.toml b/137/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..3e382a28b729a0a61ddcf2da357ed5f4587f1d99 --- /dev/null +++ b/137/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/137" +name = "MBPP — 137" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/137/tests/__init__.py b/137/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/137/tests/conftest.py b/137/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/137/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/137/tests/test_mbpp_0.py b/137/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..0d7a9e371c69e697fe14084f5a81edba1893ed55 --- /dev/null +++ b/137/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert math.isclose(zero_count([0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8]), 0.181818, rel_tol=0.001) diff --git a/137/tests/test_mbpp_1.py b/137/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..776178ae4775ba7eeb508e3ac16e192ed9a9fe91 --- /dev/null +++ b/137/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert math.isclose(zero_count([2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8]), 0.00, rel_tol=0.001) diff --git a/137/tests/test_mbpp_2.py b/137/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..6c52e803c46f6b6f786bbdfa591246bd47a06b48 --- /dev/null +++ b/137/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert math.isclose(zero_count([2, 4, -6, -9, 11, -12, 14, -5, 17]), 0.00, rel_tol=0.001) diff --git a/138/instruction.md b/138/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..549fd873fffcb7b929a618596b8e3fe12f7f0a13 --- /dev/null +++ b/138/instruction.md @@ -0,0 +1,3 @@ +# MBPP 138 + +Write a python function to check whether the given number can be represented as sum of non-zero powers of 2 or not. diff --git a/138/solution/__init__.py b/138/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/138/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/138/solution/_reference.py b/138/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..187e2ede3610b20270449a52f753bb132c69a521 --- /dev/null +++ b/138/solution/_reference.py @@ -0,0 +1,6 @@ + +def is_Sum_Of_Powers_Of_Two(n): + if (n % 2 == 1): + return False + else: + return True \ No newline at end of file diff --git a/138/solution/solution.py b/138/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/138/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/138/solution/solve.sh b/138/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/138/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/138/task.toml b/138/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..8db6b1c3b04a92ae9c291631dac4022215d75ea2 --- /dev/null +++ b/138/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/138" +name = "MBPP — 138" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/138/tests/__init__.py b/138/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/138/tests/conftest.py b/138/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/138/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/138/tests/test_mbpp_0.py b/138/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..42658dc08cef68b58180d8329a5af97c7d69ab80 --- /dev/null +++ b/138/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert is_Sum_Of_Powers_Of_Two(10) == True diff --git a/138/tests/test_mbpp_1.py b/138/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..b6abb07838a798052e002e22c0a143a09a385289 --- /dev/null +++ b/138/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert is_Sum_Of_Powers_Of_Two(7) == False diff --git a/138/tests/test_mbpp_2.py b/138/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..14fa0fb66ca56e90735baea5ef4631886d5aa425 --- /dev/null +++ b/138/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert is_Sum_Of_Powers_Of_Two(14) == True diff --git a/139/instruction.md b/139/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..1a9c6860a08a3bd0dfd4c98dc6650435150a29d3 --- /dev/null +++ b/139/instruction.md @@ -0,0 +1,3 @@ +# MBPP 139 + +Write a function to find the circumference of a circle. diff --git a/139/solution/__init__.py b/139/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/139/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/139/solution/_reference.py b/139/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..b275e9c775e7268e861c6819d8d90f703db8bbd9 --- /dev/null +++ b/139/solution/_reference.py @@ -0,0 +1,4 @@ +import math +def circle_circumference(r): + perimeter=2*3.1415*r + return perimeter \ No newline at end of file diff --git a/139/solution/solution.py b/139/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/139/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/139/solution/solve.sh b/139/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/139/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/139/task.toml b/139/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..c996bb5f93630de6bda280687904422f356c7b12 --- /dev/null +++ b/139/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/139" +name = "MBPP — 139" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/139/tests/__init__.py b/139/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/139/tests/conftest.py b/139/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/139/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/139/tests/test_mbpp_0.py b/139/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..454c7630ab9391a10ba37802cd5275989939e950 --- /dev/null +++ b/139/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert math.isclose(circle_circumference(10), 62.830000000000005, rel_tol=0.001) diff --git a/139/tests/test_mbpp_1.py b/139/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..819daf16a1f29e88333b41aaad3eff173bfc0511 --- /dev/null +++ b/139/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert math.isclose(circle_circumference(5), 31.415000000000003, rel_tol=0.001) diff --git a/139/tests/test_mbpp_2.py b/139/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..967d32ea87f04d033b85b1fbf8d096a2b103af33 --- /dev/null +++ b/139/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert math.isclose(circle_circumference(4), 25.132, rel_tol=0.001) diff --git a/14/instruction.md b/14/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..89b68ee49f6d2c35a110f1475c1dbaa703722edc --- /dev/null +++ b/14/instruction.md @@ -0,0 +1,3 @@ +# MBPP 14 + +Write a python function to find the volume of a triangular prism. diff --git a/14/solution/__init__.py b/14/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/14/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/14/solution/_reference.py b/14/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..325b209dfa048a88e5a7e2e5a4baf460adcfbb8c --- /dev/null +++ b/14/solution/_reference.py @@ -0,0 +1,3 @@ + +def find_Volume(l,b,h) : + return ((l * b * h) / 2) \ No newline at end of file diff --git a/14/solution/solution.py b/14/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/14/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/14/solution/solve.sh b/14/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/14/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/14/task.toml b/14/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..69fffbbd986ceaacd0ad76a89b683dd34cbfd6b1 --- /dev/null +++ b/14/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/14" +name = "MBPP — 14" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/14/tests/__init__.py b/14/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/14/tests/conftest.py b/14/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/14/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/14/tests/test_mbpp_0.py b/14/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..a20d4ef2f10b4d0482ebc5144e145af3c4d41820 --- /dev/null +++ b/14/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert find_Volume(10,8,6) == 240 diff --git a/14/tests/test_mbpp_1.py b/14/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..65b264f9db2cd58382dd088c7c0ce7f64ae5350b --- /dev/null +++ b/14/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert find_Volume(3,2,2) == 6 diff --git a/14/tests/test_mbpp_2.py b/14/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..9ae767a26dde1fc789b1278ed130fd9f70cf8a0b --- /dev/null +++ b/14/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert find_Volume(1,2,1) == 1 diff --git a/141/instruction.md b/141/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..55ab735cf1f7179c54f70b0acf894415695feeb4 --- /dev/null +++ b/141/instruction.md @@ -0,0 +1,3 @@ +# MBPP 141 + +Write a function to sort a list of elements. diff --git a/141/solution/__init__.py b/141/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/141/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/141/solution/_reference.py b/141/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..4f6cf0392e68796c6358e3671a617e6fcde7ea3e --- /dev/null +++ b/141/solution/_reference.py @@ -0,0 +1,9 @@ + +def pancake_sort(nums): + arr_len = len(nums) + while arr_len > 1: + mi = nums.index(max(nums[0:arr_len])) + nums = nums[mi::-1] + nums[mi+1:len(nums)] + nums = nums[arr_len-1::-1] + nums[arr_len:len(nums)] + arr_len -= 1 + return nums \ No newline at end of file diff --git a/141/solution/solution.py b/141/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/141/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/141/solution/solve.sh b/141/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/141/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/141/task.toml b/141/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..6cdccdb4384605fefd7663d63e6786750b3ddcbf --- /dev/null +++ b/141/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/141" +name = "MBPP — 141" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/141/tests/__init__.py b/141/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/141/tests/conftest.py b/141/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/141/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/141/tests/test_mbpp_0.py b/141/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..c6c105b18144944a0fe14097c97ac8e7ce3fc350 --- /dev/null +++ b/141/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert pancake_sort([15, 79, 25, 38, 69]) == [15, 25, 38, 69, 79] diff --git a/141/tests/test_mbpp_1.py b/141/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..6da01deab3e1deda04101d4182cf061067f08ff9 --- /dev/null +++ b/141/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert pancake_sort([98, 12, 54, 36, 85]) == [12, 36, 54, 85, 98] diff --git a/141/tests/test_mbpp_2.py b/141/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..0b7026869c94a47acd5dc9e7408105beac92944f --- /dev/null +++ b/141/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert pancake_sort([41, 42, 32, 12, 23]) == [12, 23, 32, 41, 42] diff --git a/142/instruction.md b/142/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..ba83ae3b2199d9edd8afcd41699f7f165b555458 --- /dev/null +++ b/142/instruction.md @@ -0,0 +1,3 @@ +# MBPP 142 + +Write a function to count number items that are identical in the same position of three given lists. diff --git a/142/solution/__init__.py b/142/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/142/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/142/solution/_reference.py b/142/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..95ad9b5d94ec5c56b5bdec1a4fb711580d508003 --- /dev/null +++ b/142/solution/_reference.py @@ -0,0 +1,4 @@ + +def count_samepair(list1,list2,list3): + result = sum(m == n == o for m, n, o in zip(list1,list2,list3)) + return result \ No newline at end of file diff --git a/142/solution/solution.py b/142/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/142/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/142/solution/solve.sh b/142/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/142/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/142/task.toml b/142/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..a40747bb13e5ff19d4b50d4eb2954a7b528b58df --- /dev/null +++ b/142/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/142" +name = "MBPP — 142" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/142/tests/__init__.py b/142/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/142/tests/conftest.py b/142/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/142/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/142/tests/test_mbpp_0.py b/142/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..6a9697422993adcf21b2b3a477a0ef15780c155c --- /dev/null +++ b/142/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert count_samepair([1,2,3,4,5,6,7,8],[2,2,3,1,2,6,7,9],[2,1,3,1,2,6,7,9])==3 diff --git a/142/tests/test_mbpp_1.py b/142/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..8e14c254de86b88300f048044f5c1535647ff5bf --- /dev/null +++ b/142/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert count_samepair([1,2,3,4,5,6,7,8],[2,2,3,1,2,6,7,8],[2,1,3,1,2,6,7,8])==4 diff --git a/142/tests/test_mbpp_2.py b/142/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..bbd648eed144e2f6a56ea7a840382961053bf1c4 --- /dev/null +++ b/142/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert count_samepair([1,2,3,4,2,6,7,8],[2,2,3,1,2,6,7,8],[2,1,3,1,2,6,7,8])==5 diff --git a/143/instruction.md b/143/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..88c6a1f967c5ed829203a8f8b91462b40652a8ff --- /dev/null +++ b/143/instruction.md @@ -0,0 +1,3 @@ +# MBPP 143 + +Write a function to find number of lists present in the given tuple. diff --git a/143/solution/__init__.py b/143/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/143/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/143/solution/_reference.py b/143/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..a694ab5d7cb91b758d442ed1cf957ffb37acfdc7 --- /dev/null +++ b/143/solution/_reference.py @@ -0,0 +1,6 @@ + +def find_lists(Input): + if isinstance(Input, list): + return 1 + else: + return len(Input) \ No newline at end of file diff --git a/143/solution/solution.py b/143/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/143/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/143/solution/solve.sh b/143/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/143/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/143/task.toml b/143/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..d8f09a565f3e81807d3e7e0bff0f9631598a6d33 --- /dev/null +++ b/143/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/143" +name = "MBPP — 143" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/143/tests/__init__.py b/143/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/143/tests/conftest.py b/143/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/143/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/143/tests/test_mbpp_0.py b/143/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..a45f3621bcd17a6ce11f25d7481ac665093c10fa --- /dev/null +++ b/143/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert find_lists(([1, 2, 3, 4], [5, 6, 7, 8])) == 2 diff --git a/143/tests/test_mbpp_1.py b/143/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..2c35433b74273026312dd3d8136c05ac5b54e082 --- /dev/null +++ b/143/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert find_lists(([1, 2], [3, 4], [5, 6])) == 3 diff --git a/143/tests/test_mbpp_2.py b/143/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..d4261bdd7a4cd717a98058d840d3ed04409c2f1b --- /dev/null +++ b/143/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert find_lists(([9, 8, 7, 6, 5, 4, 3, 2, 1])) == 1 diff --git a/16/instruction.md b/16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..088a6fa20188a80ff58753ef7f895114699c30d0 --- /dev/null +++ b/16/instruction.md @@ -0,0 +1,3 @@ +# MBPP 16 + +Write a function to that returns true if the input string contains sequences of lowercase letters joined with an underscore and false otherwise. diff --git a/16/solution/__init__.py b/16/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/16/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/16/solution/_reference.py b/16/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..22036f9511f31f5f03f26ee010310952c75e5f17 --- /dev/null +++ b/16/solution/_reference.py @@ -0,0 +1,8 @@ + +import re +def text_lowercase_underscore(text): + patterns = '^[a-z]+_[a-z]+$' + if re.search(patterns, text): + return True + else: + return False \ No newline at end of file diff --git a/16/solution/solution.py b/16/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/16/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/16/solution/solve.sh b/16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/16/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/16/task.toml b/16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..5d3a0e8c951271ce91c5b16306764ab962de32f9 --- /dev/null +++ b/16/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/16" +name = "MBPP — 16" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/16/tests/__init__.py b/16/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/16/tests/conftest.py b/16/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/16/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/16/tests/test_mbpp_0.py b/16/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..31348d0b0d9d23fbecaec6a630561f0888503c1f --- /dev/null +++ b/16/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert text_lowercase_underscore("aab_cbbbc")==(True) diff --git a/16/tests/test_mbpp_1.py b/16/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..29b33b1b16b9d42a6b7a8ae6ddcf2261f4be9276 --- /dev/null +++ b/16/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert text_lowercase_underscore("aab_Abbbc")==(False) diff --git a/16/tests/test_mbpp_2.py b/16/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..0e899a6e03917f2a72bc6a127cd847abcdb8cfed --- /dev/null +++ b/16/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert text_lowercase_underscore("Aaab_abbbc")==(False) diff --git a/161/instruction.md b/161/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..e3aaf3fd8e15e5cd17bb3e1450688fc245607f78 --- /dev/null +++ b/161/instruction.md @@ -0,0 +1,3 @@ +# MBPP 161 + +Write a function to remove all elements from a given list present in another list. diff --git a/161/solution/__init__.py b/161/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/161/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/161/solution/_reference.py b/161/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..09a417b0a7223b9b955d24d89eab6af68f2d92ab --- /dev/null +++ b/161/solution/_reference.py @@ -0,0 +1,4 @@ + +def remove_elements(list1, list2): + result = [x for x in list1 if x not in list2] + return result \ No newline at end of file diff --git a/161/solution/solution.py b/161/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/161/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/161/solution/solve.sh b/161/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/161/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/161/task.toml b/161/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..33a8a3cfe699b09922ca44358b5eee2b1f8d5af5 --- /dev/null +++ b/161/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/161" +name = "MBPP — 161" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/161/tests/__init__.py b/161/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/161/tests/conftest.py b/161/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/161/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/161/tests/test_mbpp_0.py b/161/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..915c6ad0555f58af89fa00ecd85488aaf813244d --- /dev/null +++ b/161/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert remove_elements([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [2, 4, 6, 8]) == [1, 3, 5, 7, 9, 10] diff --git a/161/tests/test_mbpp_1.py b/161/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..77133d50b1962c5ededa0d92476af61d1006f2d1 --- /dev/null +++ b/161/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert remove_elements([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 3, 5, 7]) == [2, 4, 6, 8, 9, 10] diff --git a/161/tests/test_mbpp_2.py b/161/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..ac52859f5cb6d5d29f15450435de365310774d07 --- /dev/null +++ b/161/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert remove_elements([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [5, 7]) == [1, 2, 3, 4, 6, 8, 9, 10] diff --git a/165/instruction.md b/165/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..4be82403e6a2814b8fcf071bd9726aa2f8ae6b1c --- /dev/null +++ b/165/instruction.md @@ -0,0 +1,3 @@ +# MBPP 165 + +Write a function to count the number of characters in a string that occur at the same position in the string as in the English alphabet (case insensitive). diff --git a/165/solution/__init__.py b/165/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/165/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/165/solution/_reference.py b/165/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..9f3a74cb91c97759df9224575add2c67dca9cecc --- /dev/null +++ b/165/solution/_reference.py @@ -0,0 +1,8 @@ + +def count_char_position(str1): + count_chars = 0 + for i in range(len(str1)): + if ((i == ord(str1[i]) - ord('A')) or + (i == ord(str1[i]) - ord('a'))): + count_chars += 1 + return count_chars \ No newline at end of file diff --git a/165/solution/solution.py b/165/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/165/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/165/solution/solve.sh b/165/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/165/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/165/task.toml b/165/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..3822183c69925409d1d9f5810eb5529304c1237d --- /dev/null +++ b/165/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/165" +name = "MBPP — 165" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/165/tests/__init__.py b/165/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/165/tests/conftest.py b/165/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/165/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/165/tests/test_mbpp_0.py b/165/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..ff85d2cfb5670e08b0be707c1ff4683102acea73 --- /dev/null +++ b/165/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert count_char_position("xbcefg") == 2 diff --git a/165/tests/test_mbpp_1.py b/165/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..5859b7052d2fd51e10a6187f2c8f7ed361e4685b --- /dev/null +++ b/165/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert count_char_position("ABcED") == 3 diff --git a/165/tests/test_mbpp_2.py b/165/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..f7b741bc492da682db4f541fd396a95237d6a553 --- /dev/null +++ b/165/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert count_char_position("AbgdeF") == 5 diff --git a/166/instruction.md b/166/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..0e8623c2217900356715f9c6b44c6aaf26a31d1d --- /dev/null +++ b/166/instruction.md @@ -0,0 +1,3 @@ +# MBPP 166 + +Write a function that counts the number of pairs of integers in a list that xor to an even number. diff --git a/166/solution/__init__.py b/166/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/166/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/166/solution/_reference.py b/166/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..8f8dce5290a746b44c7bb570b17316f4e548695e --- /dev/null +++ b/166/solution/_reference.py @@ -0,0 +1,9 @@ + +def find_even_pair(A): + count = 0 + for i in range(0, len(A)): + for j in range(i+1, len(A)): + if ((A[i] ^ A[j]) % 2 == 0): + count += 1 + + return count \ No newline at end of file diff --git a/166/solution/solution.py b/166/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/166/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/166/solution/solve.sh b/166/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/166/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/166/task.toml b/166/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..c921c26aa223dcd7132c7b54b2d9461e7d9e7a0c --- /dev/null +++ b/166/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/166" +name = "MBPP — 166" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/166/tests/__init__.py b/166/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/166/tests/conftest.py b/166/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/166/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/166/tests/test_mbpp_0.py b/166/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..c5d479192520b22cf462ef924cfe18be607148fc --- /dev/null +++ b/166/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert find_even_pair([5, 4, 7, 2, 1]) == 4 diff --git a/166/tests/test_mbpp_1.py b/166/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..9d4a070653ebd1cce71cc4f6daf3b90b250c2bab --- /dev/null +++ b/166/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert find_even_pair([7, 2, 8, 1, 0, 5, 11]) == 9 diff --git a/166/tests/test_mbpp_2.py b/166/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..cf7205c651ae483b6fdb7226c03c4d806806ca49 --- /dev/null +++ b/166/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert find_even_pair([1, 2, 3]) == 1 diff --git a/17/instruction.md b/17/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..1044b915d919016aa8fb0b09d04659f53f58f708 --- /dev/null +++ b/17/instruction.md @@ -0,0 +1,3 @@ +# MBPP 17 + +Write a function that returns the perimeter of a square given its side length as input. diff --git a/17/solution/__init__.py b/17/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/17/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/17/solution/_reference.py b/17/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..e00876422eb0784e6f181795376abc85de2606c3 --- /dev/null +++ b/17/solution/_reference.py @@ -0,0 +1,4 @@ + +def square_perimeter(a): + perimeter=4*a + return perimeter \ No newline at end of file diff --git a/17/solution/solution.py b/17/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/17/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/17/solution/solve.sh b/17/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/17/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/17/task.toml b/17/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..88e65832a1b989d561bd236445f23e37b4e4a20e --- /dev/null +++ b/17/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/17" +name = "MBPP — 17" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/17/tests/__init__.py b/17/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/17/tests/conftest.py b/17/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/17/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/17/tests/test_mbpp_0.py b/17/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..3852af952fa782fb0ea1c7960f7facfc171e859d --- /dev/null +++ b/17/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert square_perimeter(10)==40 diff --git a/17/tests/test_mbpp_1.py b/17/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..550e1c49d0101241176ce1740d8de3c6ed9304ac --- /dev/null +++ b/17/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert square_perimeter(5)==20 diff --git a/17/tests/test_mbpp_2.py b/17/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..646e4fa370271b61e249621192b2119c621b47dd --- /dev/null +++ b/17/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert square_perimeter(4)==16 diff --git a/172/instruction.md b/172/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..7598049a8543dce7af0a4c31a6b45ee8f2f78c1a --- /dev/null +++ b/172/instruction.md @@ -0,0 +1,3 @@ +# MBPP 172 + +Write a function to count the number of occurence of the string 'std' in a given string. diff --git a/172/solution/__init__.py b/172/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/172/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/172/solution/_reference.py b/172/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..a68ce4d46f4b0e1b0855c079612d25fd24be0f78 --- /dev/null +++ b/172/solution/_reference.py @@ -0,0 +1,7 @@ + +def count_occurance(s): + count = 0 + for i in range(len(s) - 2): + if (s[i] == 's' and s[i+1] == 't' and s[i+2] == 'd'): + count = count + 1 + return count \ No newline at end of file diff --git a/172/solution/solution.py b/172/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/172/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/172/solution/solve.sh b/172/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/172/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/172/task.toml b/172/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..fe842f34030068a21f41b0108f0f6f0bee0e199f --- /dev/null +++ b/172/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/172" +name = "MBPP — 172" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/172/tests/__init__.py b/172/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/172/tests/conftest.py b/172/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/172/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/172/tests/test_mbpp_0.py b/172/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..ee6c4f51c155f402432603a0b08c7ca0fb42a3c0 --- /dev/null +++ b/172/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert count_occurance("letstdlenstdporstd") == 3 diff --git a/172/tests/test_mbpp_1.py b/172/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..4d25d8fd031bc110beed372ccccd3240b2e7674c --- /dev/null +++ b/172/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert count_occurance("truststdsolensporsd") == 1 diff --git a/172/tests/test_mbpp_2.py b/172/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..9052153f614caf8ef3bfe182f1104402457291fa --- /dev/null +++ b/172/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert count_occurance("makestdsostdworthit") == 2 diff --git a/172/tests/test_mbpp_3.py b/172/tests/test_mbpp_3.py new file mode 100644 index 0000000000000000000000000000000000000000..d82d8888866d59e90995e9179e6d8822159e82e7 --- /dev/null +++ b/172/tests/test_mbpp_3.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_3() -> None: + assert count_occurance("stds") == 1 diff --git a/172/tests/test_mbpp_4.py b/172/tests/test_mbpp_4.py new file mode 100644 index 0000000000000000000000000000000000000000..f50d38620f7b8d35a54fb8ea96031aa278984058 --- /dev/null +++ b/172/tests/test_mbpp_4.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_4() -> None: + assert count_occurance("") == 0 diff --git a/222/instruction.md b/222/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..83d798cd6ef87329c23cfd29760228dd5293c143 --- /dev/null +++ b/222/instruction.md @@ -0,0 +1,3 @@ +# MBPP 222 + +Write a function to check if all the elements in tuple have same data type or not. diff --git a/222/solution/__init__.py b/222/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/222/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/222/solution/_reference.py b/222/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..dc0bbeeb8393d60bf765b9b7fc32712afe28aee0 --- /dev/null +++ b/222/solution/_reference.py @@ -0,0 +1,8 @@ + +def check_type(test_tuple): + res = True + for ele in test_tuple: + if not isinstance(ele, type(test_tuple[0])): + res = False + break + return (res) \ No newline at end of file diff --git a/222/solution/solution.py b/222/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/222/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/222/solution/solve.sh b/222/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/222/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/222/task.toml b/222/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..63610031f07a6fbdd8f01a52eb8bf70a9064d30c --- /dev/null +++ b/222/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/222" +name = "MBPP — 222" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/222/tests/__init__.py b/222/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/222/tests/conftest.py b/222/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/222/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/222/tests/test_mbpp_0.py b/222/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..d313cf0261631cf4916f4622322bde8273ee2353 --- /dev/null +++ b/222/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert check_type((5, 6, 7, 3, 5, 6) ) == True diff --git a/222/tests/test_mbpp_1.py b/222/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..514a2fa5ace282c9e9fa724b5ebebc6c44860678 --- /dev/null +++ b/222/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert check_type((1, 2, "4") ) == False diff --git a/222/tests/test_mbpp_2.py b/222/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..c062e422753f48ccd13f08730c9c3d8fc6257dab --- /dev/null +++ b/222/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert check_type((3, 2, 1, 4, 5) ) == True diff --git a/224/instruction.md b/224/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..3be6ad5812b3f4e93957715eeda62f9b4621e2dd --- /dev/null +++ b/224/instruction.md @@ -0,0 +1,3 @@ +# MBPP 224 + +Write a python function to count the number of set bits (binary digits with value 1) in a given number. diff --git a/224/solution/__init__.py b/224/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/224/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/224/solution/_reference.py b/224/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..6b6c50a56ea66bcc49935df52912a1ed05fcf48a --- /dev/null +++ b/224/solution/_reference.py @@ -0,0 +1,7 @@ + +def count_Set_Bits(n): + count = 0 + while (n): + count += n & 1 + n >>= 1 + return count \ No newline at end of file diff --git a/224/solution/solution.py b/224/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/224/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/224/solution/solve.sh b/224/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/224/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/224/task.toml b/224/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..9d94e5b48b37942f22425f4b72ab65432f28987d --- /dev/null +++ b/224/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/224" +name = "MBPP — 224" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/224/tests/__init__.py b/224/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/224/tests/conftest.py b/224/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/224/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/224/tests/test_mbpp_0.py b/224/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..e0e8a6f6afc812ef1c3c5e2870d25bd0d285c79f --- /dev/null +++ b/224/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert count_Set_Bits(2) == 1 diff --git a/224/tests/test_mbpp_1.py b/224/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..9798e15664f9e3854cd9b3a2d89555fe2fcefc5c --- /dev/null +++ b/224/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert count_Set_Bits(4) == 1 diff --git a/224/tests/test_mbpp_2.py b/224/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..a8435e78b001f1f93c35d2af7b0ce51b06e95e33 --- /dev/null +++ b/224/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert count_Set_Bits(6) == 2 diff --git a/226/instruction.md b/226/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..43695eabd4405377fa0952fcae5fa961d9721967 --- /dev/null +++ b/226/instruction.md @@ -0,0 +1,3 @@ +# MBPP 226 + +Write a python function to remove the characters which have odd index values of a given string. diff --git a/226/solution/__init__.py b/226/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/226/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/226/solution/_reference.py b/226/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..69d3d740a7608bc9b9fc741f12d32404df41024b --- /dev/null +++ b/226/solution/_reference.py @@ -0,0 +1,7 @@ + +def odd_values_string(str): + result = "" + for i in range(len(str)): + if i % 2 == 0: + result = result + str[i] + return result \ No newline at end of file diff --git a/226/solution/solution.py b/226/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/226/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/226/solution/solve.sh b/226/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/226/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/226/task.toml b/226/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..03181747c77061cf46fa9fef4dfa596bd20001ab --- /dev/null +++ b/226/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/226" +name = "MBPP — 226" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/226/tests/__init__.py b/226/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/226/tests/conftest.py b/226/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/226/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/226/tests/test_mbpp_0.py b/226/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..27e206634fac98054d3126ea2b81aebb1d6fb2b9 --- /dev/null +++ b/226/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert odd_values_string('abcdef') == 'ace' diff --git a/226/tests/test_mbpp_1.py b/226/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..efb66389b20e81f139b03eb2e495fe92d61ad30c --- /dev/null +++ b/226/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert odd_values_string('python') == 'pto' diff --git a/226/tests/test_mbpp_2.py b/226/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..588610fc43a703609eb22870c0c9f98972f2b447 --- /dev/null +++ b/226/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert odd_values_string('data') == 'dt' diff --git a/226/tests/test_mbpp_3.py b/226/tests/test_mbpp_3.py new file mode 100644 index 0000000000000000000000000000000000000000..9ba65eba0acff525671987510976d80e7f921a7e --- /dev/null +++ b/226/tests/test_mbpp_3.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_3() -> None: + assert odd_values_string('lambs') == 'lms' diff --git a/227/instruction.md b/227/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..0320c8cdecd9adca2e5f7fbb15f72ed46c93813f --- /dev/null +++ b/227/instruction.md @@ -0,0 +1,3 @@ +# MBPP 227 + +Write a function to find minimum of three numbers. diff --git a/227/solution/__init__.py b/227/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/227/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/227/solution/_reference.py b/227/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..5cdebb4887c82a7f7a16b25eb8e925bdd5f29d97 --- /dev/null +++ b/227/solution/_reference.py @@ -0,0 +1,9 @@ + +def min_of_three(a,b,c): + if (a <= b) and (a <= c): + smallest = a + elif (b <= a) and (b <= c): + smallest = b + else: + smallest = c + return smallest \ No newline at end of file diff --git a/227/solution/solution.py b/227/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/227/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/227/solution/solve.sh b/227/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/227/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/227/task.toml b/227/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..3ca8a21c6569476223bbfb9b15a10ecf6c24bf4e --- /dev/null +++ b/227/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/227" +name = "MBPP — 227" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/227/tests/__init__.py b/227/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/227/tests/conftest.py b/227/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/227/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/227/tests/test_mbpp_0.py b/227/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..d60b06aefc8af73ce37b246b6a132a4dbbb8d609 --- /dev/null +++ b/227/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert min_of_three(10,20,0)==0 diff --git a/227/tests/test_mbpp_1.py b/227/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..da6e36ef14987394aba4edb139bc040dd0003634 --- /dev/null +++ b/227/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert min_of_three(19,15,18)==15 diff --git a/227/tests/test_mbpp_2.py b/227/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..5e1ce7eed6ef16efee462a260cc4ddd5fb3db709 --- /dev/null +++ b/227/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert min_of_three(-10,-20,-30)==-30 diff --git a/230/instruction.md b/230/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..710eb222e4895f5292bfa4b4c4eeb88b59a30388 --- /dev/null +++ b/230/instruction.md @@ -0,0 +1,3 @@ +# MBPP 230 + +Write a function that takes in a string and character, replaces blank spaces in the string with the character, and returns the string. diff --git a/230/solution/__init__.py b/230/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/230/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/230/solution/_reference.py b/230/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..970d79452e9870917668405b9d241150ae17baf9 --- /dev/null +++ b/230/solution/_reference.py @@ -0,0 +1,4 @@ + +def replace_blank(str1,char): + str2 = str1.replace(' ', char) + return str2 \ No newline at end of file diff --git a/230/solution/solution.py b/230/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/230/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/230/solution/solve.sh b/230/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/230/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/230/task.toml b/230/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..846f9f2089b7a0e7d773fbe7803da763ef2afa82 --- /dev/null +++ b/230/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/230" +name = "MBPP — 230" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/230/tests/__init__.py b/230/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/230/tests/conftest.py b/230/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/230/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/230/tests/test_mbpp_0.py b/230/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..e9718adebcfe5168ca5a6b71beb0a7c18c6ac4b4 --- /dev/null +++ b/230/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert replace_blank("hello people",'@')==("hello@people") diff --git a/230/tests/test_mbpp_1.py b/230/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..5f8bbf289fe5bb73c646b089ee1d61cb2d40f065 --- /dev/null +++ b/230/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert replace_blank("python program language",'$')==("python$program$language") diff --git a/230/tests/test_mbpp_2.py b/230/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..77c9c21c869bbce474dd5c37351cd6530b15e326 --- /dev/null +++ b/230/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert replace_blank("blank space","-")==("blank-space") diff --git a/233/instruction.md b/233/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..d1eee2f7c5c95bbaf9a99cb5fe1e0faa03d18dc1 --- /dev/null +++ b/233/instruction.md @@ -0,0 +1,3 @@ +# MBPP 233 + +Write a function to find the lateral surface area of a cylinder. diff --git a/233/solution/__init__.py b/233/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/233/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/233/solution/_reference.py b/233/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..72422b8babb1d6d876d48b767921f9522034f297 --- /dev/null +++ b/233/solution/_reference.py @@ -0,0 +1,4 @@ +import math +def lateralsuface_cylinder(r,h): + lateralsurface= 2*3.1415*r*h + return lateralsurface \ No newline at end of file diff --git a/233/solution/solution.py b/233/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/233/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/233/solution/solve.sh b/233/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/233/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/233/task.toml b/233/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..b8bef6440308b5544ebe6fbb9b8bada682cd0dbd --- /dev/null +++ b/233/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/233" +name = "MBPP — 233" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/233/tests/__init__.py b/233/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/233/tests/conftest.py b/233/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/233/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/233/tests/test_mbpp_0.py b/233/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..5e58c52aa412bdaf1a978df386d2e9a2aa2a6ab2 --- /dev/null +++ b/233/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert math.isclose(lateralsuface_cylinder(10,5), 314.15000000000003, rel_tol=0.001) diff --git a/233/tests/test_mbpp_1.py b/233/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..1da1838fa5edea63dfed946cb03c4abd714b4206 --- /dev/null +++ b/233/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert math.isclose(lateralsuface_cylinder(4,5), 125.66000000000001, rel_tol=0.001) diff --git a/233/tests/test_mbpp_2.py b/233/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..7f4748182e5177afe2c523bf89e4df25943b9763 --- /dev/null +++ b/233/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert math.isclose(lateralsuface_cylinder(4,10), 251.32000000000002, rel_tol=0.001) diff --git a/238/instruction.md b/238/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..41014f72e25b4beee667d3e7051e5c9923733a7e --- /dev/null +++ b/238/instruction.md @@ -0,0 +1,3 @@ +# MBPP 238 + +Write a python function to count the number of non-empty substrings of a given string. diff --git a/238/solution/__init__.py b/238/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/238/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/238/solution/_reference.py b/238/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..307730294145c83ab11a0dfa115b38607b9a92e7 --- /dev/null +++ b/238/solution/_reference.py @@ -0,0 +1,4 @@ + +def number_of_substrings(str): + str_len = len(str); + return int(str_len * (str_len + 1) / 2); \ No newline at end of file diff --git a/238/solution/solution.py b/238/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/238/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/238/solution/solve.sh b/238/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/238/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/238/task.toml b/238/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..fdecfa8aa62720b22d496dd4d2fdc8e49ba9f907 --- /dev/null +++ b/238/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/238" +name = "MBPP — 238" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/238/tests/__init__.py b/238/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/238/tests/conftest.py b/238/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/238/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/238/tests/test_mbpp_0.py b/238/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..50774e9e5375480c7098742509d333400c3d5f90 --- /dev/null +++ b/238/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert number_of_substrings("abc") == 6 diff --git a/238/tests/test_mbpp_1.py b/238/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..fc323304f24fe4407f7faaf64d7c916789ac5547 --- /dev/null +++ b/238/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert number_of_substrings("abcd") == 10 diff --git a/238/tests/test_mbpp_2.py b/238/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..f630197d0df148b5acde334f3b1849fa5b85c5a7 --- /dev/null +++ b/238/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert number_of_substrings("abcde") == 15 diff --git a/242/instruction.md b/242/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..407e9a6fa69ecf9c779940ac0834b9c3991673c1 --- /dev/null +++ b/242/instruction.md @@ -0,0 +1,3 @@ +# MBPP 242 + +Write a function to count the total number of characters in a string. diff --git a/242/solution/__init__.py b/242/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/242/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/242/solution/_reference.py b/242/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..f12ac28ad77249c7e6cf8096e07a11893d9317ee --- /dev/null +++ b/242/solution/_reference.py @@ -0,0 +1,6 @@ + +def count_charac(str1): + total = 0 + for i in str1: + total = total + 1 + return total \ No newline at end of file diff --git a/242/solution/solution.py b/242/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/242/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/242/solution/solve.sh b/242/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/242/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/242/task.toml b/242/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..f22ee4a3390f3794544e39808f25fc9629f4e0b5 --- /dev/null +++ b/242/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/242" +name = "MBPP — 242" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/242/tests/__init__.py b/242/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/242/tests/conftest.py b/242/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/242/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/242/tests/test_mbpp_0.py b/242/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..339d9a08dfcff20c2388bdc2907bd954aadc1b6b --- /dev/null +++ b/242/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert count_charac("python programming")==18 diff --git a/242/tests/test_mbpp_1.py b/242/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..09d222546da4cca2b1979e7f23382d19dce5c6ab --- /dev/null +++ b/242/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert count_charac("language")==8 diff --git a/242/tests/test_mbpp_2.py b/242/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..b6c54c39556dd8936ec441fe358d43b1301dbe7d --- /dev/null +++ b/242/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert count_charac("words")==5 diff --git a/247/instruction.md b/247/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..861bd09594d3c343550d2998ca7624ea8b443e3f --- /dev/null +++ b/247/instruction.md @@ -0,0 +1,3 @@ +# MBPP 247 + +Write a function to find the length of the longest palindromic subsequence in the given string. diff --git a/247/solution/__init__.py b/247/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/247/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/247/solution/_reference.py b/247/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..1a3e424a517355e15cec9e0e4b33851551ee8bb0 --- /dev/null +++ b/247/solution/_reference.py @@ -0,0 +1,16 @@ + +def lps(str): + n = len(str) + L = [[0 for x in range(n)] for x in range(n)] + for i in range(n): + L[i][i] = 1 + for cl in range(2, n+1): + for i in range(n-cl+1): + j = i+cl-1 + if str[i] == str[j] and cl == 2: + L[i][j] = 2 + elif str[i] == str[j]: + L[i][j] = L[i+1][j-1] + 2 + else: + L[i][j] = max(L[i][j-1], L[i+1][j]); + return L[0][n-1] \ No newline at end of file diff --git a/247/solution/solution.py b/247/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/247/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/247/solution/solve.sh b/247/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/247/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/247/task.toml b/247/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..b5db083bb5e7d6afec08edabf4996057a64f175b --- /dev/null +++ b/247/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/247" +name = "MBPP — 247" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/247/tests/__init__.py b/247/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/247/tests/conftest.py b/247/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/247/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/247/tests/test_mbpp_0.py b/247/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..8e2ee15bb900daf6e430d7451239ef0f5d352998 --- /dev/null +++ b/247/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert lps("TENS FOR TENS") == 5 diff --git a/247/tests/test_mbpp_1.py b/247/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..346bb66b241d25d78ecb105e47f849f74bac3bb3 --- /dev/null +++ b/247/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert lps("CARDIO FOR CARDS") == 7 diff --git a/247/tests/test_mbpp_2.py b/247/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..4f9290e2e160db794a8c92595824d913ae97c0de --- /dev/null +++ b/247/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert lps("PART OF THE JOURNEY IS PART") == 9 diff --git a/248/instruction.md b/248/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..0bdd416006ee70f383a0595019c171e982cbd752 --- /dev/null +++ b/248/instruction.md @@ -0,0 +1,3 @@ +# MBPP 248 + +Write a function that takes in an integer n and calculates the harmonic sum of n-1. diff --git a/248/solution/__init__.py b/248/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/248/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/248/solution/_reference.py b/248/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..df95b2f1141b3dc0c4db9c75e9c12a57b42ffd62 --- /dev/null +++ b/248/solution/_reference.py @@ -0,0 +1,6 @@ +import math +def harmonic_sum(n): + if n < 2: + return 1 + else: + return 1 / n + (harmonic_sum(n - 1)) \ No newline at end of file diff --git a/248/solution/solution.py b/248/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/248/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/248/solution/solve.sh b/248/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/248/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/248/task.toml b/248/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..5ce5bc56f77d8726b45e36aea4631aff84944486 --- /dev/null +++ b/248/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/248" +name = "MBPP — 248" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/248/tests/__init__.py b/248/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/248/tests/conftest.py b/248/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/248/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/248/tests/test_mbpp_0.py b/248/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..91a38d1f4fa72bb892c2ce0a248a14b2b038479b --- /dev/null +++ b/248/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert math.isclose(harmonic_sum(7), 2.5928571428571425, rel_tol=0.001) diff --git a/248/tests/test_mbpp_1.py b/248/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..d5d3109597ffd25cedd761fa5a44719c84c33d2b --- /dev/null +++ b/248/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert math.isclose(harmonic_sum(4), 2.083333333333333, rel_tol=0.001) diff --git a/248/tests/test_mbpp_2.py b/248/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..0eb9026b02c5edf2833c9c6af7f5058bc046ef89 --- /dev/null +++ b/248/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert math.isclose(harmonic_sum(19), 3.547739657143682, rel_tol=0.001) diff --git a/249/instruction.md b/249/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..ba1b4643ebea2b3c2c82f27f0fbf0708b266ced7 --- /dev/null +++ b/249/instruction.md @@ -0,0 +1,3 @@ +# MBPP 249 + +Write a function to find the intersection of two arrays. diff --git a/249/solution/__init__.py b/249/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/249/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/249/solution/_reference.py b/249/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..569d995c34c91405de054c4d19fcd2aa2d08b29b --- /dev/null +++ b/249/solution/_reference.py @@ -0,0 +1,4 @@ + +def intersection_array(array_nums1,array_nums2): + result = list(filter(lambda x: x in array_nums1, array_nums2)) + return result \ No newline at end of file diff --git a/249/solution/solution.py b/249/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/249/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/249/solution/solve.sh b/249/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/249/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/249/task.toml b/249/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..89d0ed979a16965bfea95b769d993bb8a73a7440 --- /dev/null +++ b/249/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/249" +name = "MBPP — 249" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/249/tests/__init__.py b/249/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/249/tests/conftest.py b/249/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/249/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/249/tests/test_mbpp_0.py b/249/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..5053c97df5c0087aeffcdf0e51b89ba38d7da24b --- /dev/null +++ b/249/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert intersection_array([1, 2, 3, 5, 7, 8, 9, 10],[1, 2, 4, 8, 9])==[1, 2, 8, 9] diff --git a/249/tests/test_mbpp_1.py b/249/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..1e2ca3262db2f3c35c607f2511fd5669707e2271 --- /dev/null +++ b/249/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert intersection_array([1, 2, 3, 5, 7, 8, 9, 10],[3,5,7,9])==[3,5,7,9] diff --git a/249/tests/test_mbpp_2.py b/249/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..167bcecf1fcdd897aa64c8aab165e097299b15cd --- /dev/null +++ b/249/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert intersection_array([1, 2, 3, 5, 7, 8, 9, 10],[10,20,30,40])==[10] diff --git a/251/instruction.md b/251/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..08ab63e4511378523101f5a59afd47d48eec8d90 --- /dev/null +++ b/251/instruction.md @@ -0,0 +1,3 @@ +# MBPP 251 + +Write a function that takes in a list and an element and inserts the element before each element in the list, and returns the resulting list. diff --git a/251/solution/__init__.py b/251/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/251/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/251/solution/_reference.py b/251/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..c52feebf3ac172dee7c372e96aaea08f91920467 --- /dev/null +++ b/251/solution/_reference.py @@ -0,0 +1,4 @@ + +def insert_element(list,element): + list = [v for elt in list for v in (element, elt)] + return list \ No newline at end of file diff --git a/251/solution/solution.py b/251/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/251/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/251/solution/solve.sh b/251/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/251/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/251/task.toml b/251/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..d220d47c173f85345f3189183e36551ea16756e7 --- /dev/null +++ b/251/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/251" +name = "MBPP — 251" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/251/tests/__init__.py b/251/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/251/tests/conftest.py b/251/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/251/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/251/tests/test_mbpp_0.py b/251/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..b2c4a651e66f0297e2e5c40f2ff660228cf0d6f4 --- /dev/null +++ b/251/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert insert_element(['Red', 'Green', 'Black'] ,'c')==['c', 'Red', 'c', 'Green', 'c', 'Black'] diff --git a/251/tests/test_mbpp_1.py b/251/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..ce1527090e591c7a0ebd06a670027a345234d68e --- /dev/null +++ b/251/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert insert_element(['python', 'java'] ,'program')==['program', 'python', 'program', 'java'] diff --git a/251/tests/test_mbpp_2.py b/251/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..6eccfadcddc1704075347fe91c9c7931acbcceef --- /dev/null +++ b/251/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert insert_element(['happy', 'sad'] ,'laugh')==['laugh', 'happy', 'laugh', 'sad'] diff --git a/261/instruction.md b/261/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..a2a9b3ae88fec3ccc36b6bec137eabaa269b6d34 --- /dev/null +++ b/261/instruction.md @@ -0,0 +1,3 @@ +# MBPP 261 + +Write a function that takes in two tuples and performs mathematical division operation element-wise across the given tuples. diff --git a/261/solution/__init__.py b/261/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/261/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/261/solution/_reference.py b/261/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..535eb824145bfcb3566adba1db54a6b4e8310e44 --- /dev/null +++ b/261/solution/_reference.py @@ -0,0 +1,4 @@ + +def division_elements(test_tup1, test_tup2): + res = tuple(ele1 // ele2 for ele1, ele2 in zip(test_tup1, test_tup2)) + return (res) \ No newline at end of file diff --git a/261/solution/solution.py b/261/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/261/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/261/solution/solve.sh b/261/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/261/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/261/task.toml b/261/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..1b5c660fea674d52e871ca868e652da7a28e949c --- /dev/null +++ b/261/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/261" +name = "MBPP — 261" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/261/tests/__init__.py b/261/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/261/tests/conftest.py b/261/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/261/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/261/tests/test_mbpp_0.py b/261/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..80260ff87168f351485294029a841426591ebd56 --- /dev/null +++ b/261/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert division_elements((10, 4, 6, 9),(5, 2, 3, 3)) == (2, 2, 2, 3) diff --git a/261/tests/test_mbpp_1.py b/261/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..86d0233b93f51bc4e2d6c7efbc17a8b1e5232b0c --- /dev/null +++ b/261/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert division_elements((12, 6, 8, 16),(6, 3, 4, 4)) == (2, 2, 2, 4) diff --git a/261/tests/test_mbpp_2.py b/261/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..06b84d06ead063a9233558c31dc515e55c60813a --- /dev/null +++ b/261/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert division_elements((20, 14, 36, 18),(5, 7, 6, 9)) == (4, 2, 6, 2) diff --git a/267/instruction.md b/267/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..88094d5a824bb28b9d39b26c3ec84f22757ef2ed --- /dev/null +++ b/267/instruction.md @@ -0,0 +1,3 @@ +# MBPP 267 + +Write a python function that takes in an integer n and returns the sum of the squares of the first n odd natural numbers. diff --git a/267/solution/__init__.py b/267/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/267/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/267/solution/_reference.py b/267/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..bc805ccac8b84f14a0f87c423a3250b0e659415e --- /dev/null +++ b/267/solution/_reference.py @@ -0,0 +1,3 @@ + +def square_Sum(n): + return int(n*(4*n*n-1)/3) \ No newline at end of file diff --git a/267/solution/solution.py b/267/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/267/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/267/solution/solve.sh b/267/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/267/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/267/task.toml b/267/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..7c4879aee58138cce5ec20b2658863c0917e0b61 --- /dev/null +++ b/267/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/267" +name = "MBPP — 267" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/267/tests/__init__.py b/267/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/267/tests/conftest.py b/267/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/267/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/267/tests/test_mbpp_0.py b/267/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..688974bf7408bcfebcec4e440f9156a6792191c5 --- /dev/null +++ b/267/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert square_Sum(2) == 10 diff --git a/267/tests/test_mbpp_1.py b/267/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..eb56301a9fd3e7b7af34538d38af673b5f4892d7 --- /dev/null +++ b/267/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert square_Sum(3) == 35 diff --git a/267/tests/test_mbpp_2.py b/267/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..0cc90d333ac16ac8a9bab96bd97861b4a976f8b9 --- /dev/null +++ b/267/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert square_Sum(4) == 84 diff --git a/268/instruction.md b/268/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..58550826ac1c6626c13f5c1ffab05a1f2c0a802c --- /dev/null +++ b/268/instruction.md @@ -0,0 +1,3 @@ +# MBPP 268 + +Write a function to find the n'th star number. diff --git a/268/solution/__init__.py b/268/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/268/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/268/solution/_reference.py b/268/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..04a6b9f56aa9c099baa6e01a696bc324b34292d0 --- /dev/null +++ b/268/solution/_reference.py @@ -0,0 +1,3 @@ + +def find_star_num(n): + return (6 * n * (n - 1) + 1) \ No newline at end of file diff --git a/268/solution/solution.py b/268/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/268/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/268/solution/solve.sh b/268/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/268/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/268/task.toml b/268/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..6df94fa3144474bf9e0e7c0face3724c8179d0cf --- /dev/null +++ b/268/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/268" +name = "MBPP — 268" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/268/tests/__init__.py b/268/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/268/tests/conftest.py b/268/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/268/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/268/tests/test_mbpp_0.py b/268/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..2be81a738239925420127dce46c00eb7208df253 --- /dev/null +++ b/268/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert find_star_num(3) == 37 diff --git a/268/tests/test_mbpp_1.py b/268/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..f53f7477fb7dacf4e677f99afd6b941f2ba721cc --- /dev/null +++ b/268/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert find_star_num(4) == 73 diff --git a/268/tests/test_mbpp_2.py b/268/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..eb030e1effeb267e5bff68fb31973dd20d64fb7d --- /dev/null +++ b/268/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert find_star_num(5) == 121 diff --git a/269/instruction.md b/269/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..04da3bd773f29e6d96ac73731dff759857ccae28 --- /dev/null +++ b/269/instruction.md @@ -0,0 +1,3 @@ +# MBPP 269 + +Write a function to find the ascii value of a character. diff --git a/269/solution/__init__.py b/269/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/269/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/269/solution/_reference.py b/269/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..d6409d15605b585e6d9409d493773e5600622681 --- /dev/null +++ b/269/solution/_reference.py @@ -0,0 +1,4 @@ + +def ascii_value(k): + ch=k + return ord(ch) \ No newline at end of file diff --git a/269/solution/solution.py b/269/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/269/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/269/solution/solve.sh b/269/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/269/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/269/task.toml b/269/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..44a8cb2895221fc0c0deea7f1d4217761b97e684 --- /dev/null +++ b/269/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/269" +name = "MBPP — 269" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/269/tests/__init__.py b/269/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/269/tests/conftest.py b/269/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/269/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/269/tests/test_mbpp_0.py b/269/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..606f784f1ef9e446ed17a81afedc1e3ce86fbb26 --- /dev/null +++ b/269/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert ascii_value('A')==65 diff --git a/269/tests/test_mbpp_1.py b/269/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..36e4f50b67208f0ad8a9c957fb8a8af070c6f163 --- /dev/null +++ b/269/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert ascii_value('R')==82 diff --git a/269/tests/test_mbpp_2.py b/269/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..818f44e7005aab276ecf789a91f6f5723d748ad7 --- /dev/null +++ b/269/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert ascii_value('S')==83 diff --git a/271/instruction.md b/271/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c21cf5f0b0a78aa7e29abaa6a872cd679a1c4973 --- /dev/null +++ b/271/instruction.md @@ -0,0 +1,3 @@ +# MBPP 271 + +Write a python function that takes in an integer n and finds the sum of the first n even natural numbers that are raised to the fifth power. diff --git a/271/solution/__init__.py b/271/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/271/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/271/solution/_reference.py b/271/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..0dae5f86df4d1bc5114124c40b3af3bc55d51a8d --- /dev/null +++ b/271/solution/_reference.py @@ -0,0 +1,7 @@ + +def even_Power_Sum(n): + sum = 0; + for i in range(1,n+1): + j = 2*i; + sum = sum + (j*j*j*j*j); + return sum; \ No newline at end of file diff --git a/271/solution/solution.py b/271/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/271/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/271/solution/solve.sh b/271/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/271/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/271/task.toml b/271/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..8aa3ccc3bc13050bb17fe6c901e9b3ddcaf9b488 --- /dev/null +++ b/271/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/271" +name = "MBPP — 271" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/271/tests/__init__.py b/271/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/271/tests/conftest.py b/271/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/271/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/271/tests/test_mbpp_0.py b/271/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..5c733a917f82df132c0cf3ee9344c23255a418f5 --- /dev/null +++ b/271/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert even_Power_Sum(2) == 1056 diff --git a/271/tests/test_mbpp_1.py b/271/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..e30d17e8761183f16fcb4ecaa268f1f919d5bbbb --- /dev/null +++ b/271/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert even_Power_Sum(3) == 8832 diff --git a/271/tests/test_mbpp_2.py b/271/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..51b0ca131494c71f981997ccc79b3da77152a95a --- /dev/null +++ b/271/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert even_Power_Sum(1) == 32 diff --git a/278/instruction.md b/278/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..0e36d1c1dd112c86f0dfbefdcf6fb7aef53ff8b5 --- /dev/null +++ b/278/instruction.md @@ -0,0 +1,3 @@ +# MBPP 278 + +Write a function to find the number of elements that occurs before the tuple element in the given tuple. diff --git a/278/solution/__init__.py b/278/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/278/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/278/solution/_reference.py b/278/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..f5e00bee66ae6a0209796fbfc1192bc6a4d3930e --- /dev/null +++ b/278/solution/_reference.py @@ -0,0 +1,6 @@ + +def count_first_elements(test_tup): + for count, ele in enumerate(test_tup): + if isinstance(ele, tuple): + break + return (count) \ No newline at end of file diff --git a/278/solution/solution.py b/278/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/278/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/278/solution/solve.sh b/278/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/278/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/278/task.toml b/278/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..e94802b08e50aec7080394517e40dc8367543d7a --- /dev/null +++ b/278/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/278" +name = "MBPP — 278" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/278/tests/__init__.py b/278/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/278/tests/conftest.py b/278/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/278/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/278/tests/test_mbpp_0.py b/278/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..06df421e7dc1a560577d05eee965f583d028789c --- /dev/null +++ b/278/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert count_first_elements((1, 5, 7, (4, 6), 10) ) == 3 diff --git a/278/tests/test_mbpp_1.py b/278/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..1b1e4725e862c0b29a32a1b8e1275791b9c75c3a --- /dev/null +++ b/278/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert count_first_elements((2, 9, (5, 7), 11) ) == 2 diff --git a/278/tests/test_mbpp_2.py b/278/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..dd249d1571e06e6f36788fbdcc6853e44c58de37 --- /dev/null +++ b/278/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert count_first_elements((11, 15, 5, 8, (2, 3), 8) ) == 4 diff --git a/281/instruction.md b/281/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..67f852d28da9ad38d9d7b26dd9ff555c2d25285b --- /dev/null +++ b/281/instruction.md @@ -0,0 +1,3 @@ +# MBPP 281 + +Write a python function to check if the elements of a given list are unique or not. diff --git a/281/solution/__init__.py b/281/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/281/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/281/solution/_reference.py b/281/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..f3a863100262f1bfb4fc53025505aa5317f2f2b8 --- /dev/null +++ b/281/solution/_reference.py @@ -0,0 +1,5 @@ + +def all_unique(test_list): + if len(test_list) > len(set(test_list)): + return False + return True \ No newline at end of file diff --git a/281/solution/solution.py b/281/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/281/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/281/solution/solve.sh b/281/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/281/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/281/task.toml b/281/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..dda330b2b3e125db96ce7320a198f7ea2b5cdd14 --- /dev/null +++ b/281/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/281" +name = "MBPP — 281" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/281/tests/__init__.py b/281/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/281/tests/conftest.py b/281/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/281/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/281/tests/test_mbpp_0.py b/281/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..0ccf39cb20595e90263299b9621a804d80eaa362 --- /dev/null +++ b/281/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert all_unique([1,2,3]) == True diff --git a/281/tests/test_mbpp_1.py b/281/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..cbdad08656be19d1db3d34fd8b275c8b6664cf9d --- /dev/null +++ b/281/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert all_unique([1,2,1,2]) == False diff --git a/281/tests/test_mbpp_2.py b/281/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..802b9be957e9692568b8d5a12cde970651346776 --- /dev/null +++ b/281/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert all_unique([1,2,3,4,5]) == True diff --git a/282/instruction.md b/282/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..d202e9151a8a8959d38bcfbb53a95a645420f393 --- /dev/null +++ b/282/instruction.md @@ -0,0 +1,3 @@ +# MBPP 282 + +Write a function to subtract two lists element-wise. diff --git a/282/solution/__init__.py b/282/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/282/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/282/solution/_reference.py b/282/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..705c76a4933fd323d3dbeb83249105a80d1683f9 --- /dev/null +++ b/282/solution/_reference.py @@ -0,0 +1,4 @@ + +def sub_list(nums1,nums2): + result = map(lambda x, y: x - y, nums1, nums2) + return list(result) \ No newline at end of file diff --git a/282/solution/solution.py b/282/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/282/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/282/solution/solve.sh b/282/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/282/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/282/task.toml b/282/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..be6bd5cdb14e48b92b4332c8b7b329a83657f871 --- /dev/null +++ b/282/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/282" +name = "MBPP — 282" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/282/tests/__init__.py b/282/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/282/tests/conftest.py b/282/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/282/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/282/tests/test_mbpp_0.py b/282/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..0fef8203caa796041f4fad1db9bca6657ae3a415 --- /dev/null +++ b/282/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert sub_list([1, 2, 3],[4,5,6])==[-3,-3,-3] diff --git a/282/tests/test_mbpp_1.py b/282/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..ddb30cc2766344574b2999e6fc26a0577b38e85e --- /dev/null +++ b/282/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert sub_list([1,2],[3,4])==[-2,-2] diff --git a/282/tests/test_mbpp_2.py b/282/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..0a255d7965aabefbe126c660d5b24463885baad1 --- /dev/null +++ b/282/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert sub_list([90,120],[50,70])==[40,50] diff --git a/285/instruction.md b/285/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..e11c5da88ec591ea38a9b1447626717c293b9a8c --- /dev/null +++ b/285/instruction.md @@ -0,0 +1,3 @@ +# MBPP 285 + +Write a function that checks whether a string contains the 'a' character followed by two or three 'b' characters. diff --git a/285/solution/__init__.py b/285/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/285/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/285/solution/_reference.py b/285/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..741f4fbae12b36ef9bce65b28c49a9445c6bacd5 --- /dev/null +++ b/285/solution/_reference.py @@ -0,0 +1,8 @@ + +import re +def text_match_two_three(text): + patterns = 'ab{2,3}' + if re.search(patterns, text): + return True + else: + return False \ No newline at end of file diff --git a/285/solution/solution.py b/285/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/285/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/285/solution/solve.sh b/285/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/285/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/285/task.toml b/285/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..5c7559b646005ce64c0d03fb570363130afe8a62 --- /dev/null +++ b/285/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/285" +name = "MBPP — 285" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/285/tests/__init__.py b/285/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/285/tests/conftest.py b/285/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/285/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/285/tests/test_mbpp_0.py b/285/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..c0aff5b7705c5bb978b7376484770abd0fcf9e34 --- /dev/null +++ b/285/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert text_match_two_three("ac")==(False) diff --git a/285/tests/test_mbpp_1.py b/285/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..89e78f29c330e8d0d5091bf51af19c23335273ac --- /dev/null +++ b/285/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert text_match_two_three("dc")==(False) diff --git a/285/tests/test_mbpp_2.py b/285/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..1cbc6146c5673754fbe600a2e00c1cfc7f03b832 --- /dev/null +++ b/285/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert text_match_two_three("abbbba")==(True) diff --git a/286/instruction.md b/286/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..4960b95532bd7b650569634b8c9c9415a4532831 --- /dev/null +++ b/286/instruction.md @@ -0,0 +1,3 @@ +# MBPP 286 + +Write a function to find the largest sum of a contiguous array in the modified array which is formed by repeating the given array k times. diff --git a/286/solution/__init__.py b/286/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/286/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/286/solution/_reference.py b/286/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..f0b97875bcd6e917ca462479a337e49a67654f09 --- /dev/null +++ b/286/solution/_reference.py @@ -0,0 +1,11 @@ + +def max_sub_array_sum_repeated(a, n, k): + max_so_far = -2147483648 + max_ending_here = 0 + for i in range(n*k): + max_ending_here = max_ending_here + a[i%n] + if (max_so_far < max_ending_here): + max_so_far = max_ending_here + if (max_ending_here < 0): + max_ending_here = 0 + return max_so_far \ No newline at end of file diff --git a/286/solution/solution.py b/286/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/286/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/286/solution/solve.sh b/286/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/286/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/286/task.toml b/286/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..b6cef863c392a9c1c2a392e7aa32378be7a58630 --- /dev/null +++ b/286/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/286" +name = "MBPP — 286" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/286/tests/__init__.py b/286/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/286/tests/conftest.py b/286/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/286/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/286/tests/test_mbpp_0.py b/286/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..637abd6e975402c3472e06fe0b5a4a049b995822 --- /dev/null +++ b/286/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert max_sub_array_sum_repeated([10, 20, -30, -1], 4, 3) == 30 diff --git a/286/tests/test_mbpp_1.py b/286/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..ebd54f2f3af1393041204115df8b56c9cadb3d0f --- /dev/null +++ b/286/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert max_sub_array_sum_repeated([-1, 10, 20], 3, 2) == 59 diff --git a/286/tests/test_mbpp_2.py b/286/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..55be0146754902c5ee408e826bde976344a7bc76 --- /dev/null +++ b/286/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert max_sub_array_sum_repeated([-1, -2, -3], 3, 3) == -1 diff --git a/294/instruction.md b/294/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c6cef3af1d406d0bc0fdb6f4ea0ac31879dcb57d --- /dev/null +++ b/294/instruction.md @@ -0,0 +1,3 @@ +# MBPP 294 + +Write a function to find the maximum value in a given heterogeneous list. diff --git a/294/solution/__init__.py b/294/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/294/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/294/solution/_reference.py b/294/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..05f563d7735c0aceeff1a49ea9cae378aacbdb9f --- /dev/null +++ b/294/solution/_reference.py @@ -0,0 +1,4 @@ + +def max_val(listval): + max_val = max(i for i in listval if isinstance(i, int)) + return(max_val) \ No newline at end of file diff --git a/294/solution/solution.py b/294/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/294/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/294/solution/solve.sh b/294/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/294/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/294/task.toml b/294/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..d2698f2fee4efec03743dc67b73cae05c3b4f589 --- /dev/null +++ b/294/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/294" +name = "MBPP — 294" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/294/tests/__init__.py b/294/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/294/tests/conftest.py b/294/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/294/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/294/tests/test_mbpp_0.py b/294/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..fe8dfaee67ef6ad847556297dfa8802be6edc71c --- /dev/null +++ b/294/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert max_val(['Python', 3, 2, 4, 5, 'version'])==5 diff --git a/294/tests/test_mbpp_1.py b/294/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..fe903ab6299882f0e7f7ebd7dfb1b7a077859f4a --- /dev/null +++ b/294/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert max_val(['Python', 15, 20, 25])==25 diff --git a/294/tests/test_mbpp_2.py b/294/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..2041f47aec8937efecf3a990818ac27f9bd176ad --- /dev/null +++ b/294/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert max_val(['Python', 30, 20, 40, 50, 'version'])==50 diff --git a/295/instruction.md b/295/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c5e9807030bae95aae139f06615927140c2b38c3 --- /dev/null +++ b/295/instruction.md @@ -0,0 +1,3 @@ +# MBPP 295 + +Write a function to return the sum of all divisors of a number. diff --git a/295/solution/__init__.py b/295/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/295/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/295/solution/_reference.py b/295/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..b9989cd5de050a0f0b866dc346145c44b7ccb0e0 --- /dev/null +++ b/295/solution/_reference.py @@ -0,0 +1,7 @@ + +def sum_div(number): + divisors = [1] + for i in range(2, number): + if (number % i)==0: + divisors.append(i) + return sum(divisors) \ No newline at end of file diff --git a/295/solution/solution.py b/295/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/295/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/295/solution/solve.sh b/295/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/295/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/295/task.toml b/295/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..596301e99b404793dbe9c6a57e0397a09a3747f4 --- /dev/null +++ b/295/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/295" +name = "MBPP — 295" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/295/tests/__init__.py b/295/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/295/tests/conftest.py b/295/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/295/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/295/tests/test_mbpp_0.py b/295/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..b567db7a2895b721169951cc5460e75b924779d6 --- /dev/null +++ b/295/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert sum_div(8)==7 diff --git a/295/tests/test_mbpp_1.py b/295/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..7edbd0402edc8bd2c0c5950049dd59ec3fd0faaf --- /dev/null +++ b/295/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert sum_div(12)==16 diff --git a/295/tests/test_mbpp_2.py b/295/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..bc388eb0bd0b921b64a0932a6b788de9d4bab774 --- /dev/null +++ b/295/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert sum_div(7)==1 diff --git a/296/instruction.md b/296/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..efc63f809dbff444c197790536d9207a21eca998 --- /dev/null +++ b/296/instruction.md @@ -0,0 +1,3 @@ +# MBPP 296 + +Write a python function to count inversions in an array. diff --git a/296/solution/__init__.py b/296/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/296/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/296/solution/_reference.py b/296/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..fc354393c6db981d778b4ebfd67651bdba9a3a48 --- /dev/null +++ b/296/solution/_reference.py @@ -0,0 +1,8 @@ + +def get_Inv_Count(arr): + inv_count = 0 + for i in range(len(arr)): + for j in range(i + 1, len(arr)): + if (arr[i] > arr[j]): + inv_count += 1 + return inv_count \ No newline at end of file diff --git a/296/solution/solution.py b/296/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/296/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/296/solution/solve.sh b/296/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/296/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/296/task.toml b/296/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..95f0df3ff156316981c5df6293229f5445342c31 --- /dev/null +++ b/296/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/296" +name = "MBPP — 296" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/296/tests/__init__.py b/296/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/296/tests/conftest.py b/296/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/296/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/296/tests/test_mbpp_0.py b/296/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..40892252450bde2506fdb80b99692963e7d1fbc2 --- /dev/null +++ b/296/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert get_Inv_Count([1,20,6,4,5]) == 5 diff --git a/296/tests/test_mbpp_1.py b/296/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..268b24f4b847540de8761ebca85ff1af55376a06 --- /dev/null +++ b/296/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert get_Inv_Count([1,2,1]) == 1 diff --git a/296/tests/test_mbpp_2.py b/296/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..6941b15615b4d57916429c023adb53db6311f7bd --- /dev/null +++ b/296/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert get_Inv_Count([1,2,5,6,1]) == 3 diff --git a/297/instruction.md b/297/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..463292a427baa08977eceba958684094d964466f --- /dev/null +++ b/297/instruction.md @@ -0,0 +1,3 @@ +# MBPP 297 + +Write a function to flatten a given nested list structure. diff --git a/297/solution/__init__.py b/297/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/297/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/297/solution/_reference.py b/297/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..9513f5ad36b08dfc585fe8ad0f34659a684ae55a --- /dev/null +++ b/297/solution/_reference.py @@ -0,0 +1,14 @@ + +def flatten_list(list1): + result_list = [] + if not list1: return result_list + stack = [list(list1)] + while stack: + c_num = stack.pop() + next = c_num.pop() + if c_num: stack.append(c_num) + if isinstance(next, list): + if next: stack.append(list(next)) + else: result_list.append(next) + result_list.reverse() + return result_list \ No newline at end of file diff --git a/297/solution/solution.py b/297/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/297/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/297/solution/solve.sh b/297/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/297/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/297/task.toml b/297/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..5fb1032c8b05aaea451be2105dde74d40ee12295 --- /dev/null +++ b/297/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/297" +name = "MBPP — 297" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/297/tests/__init__.py b/297/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/297/tests/conftest.py b/297/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/297/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/297/tests/test_mbpp_0.py b/297/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..128ed59fa3e2be9b3d3335e45acbc112e075ba97 --- /dev/null +++ b/297/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert flatten_list([0, 10, [20, 30], 40, 50, [60, 70, 80], [90, 100, 110, 120]])==[0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120] diff --git a/297/tests/test_mbpp_1.py b/297/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..5a4be5a08dcae724c1177c013f5de9c7fb4061cb --- /dev/null +++ b/297/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert flatten_list([[10, 20], [40], [30, 56, 25], [10, 20], [33], [40]])==[10, 20, 40, 30, 56, 25, 10, 20, 33, 40] diff --git a/297/tests/test_mbpp_2.py b/297/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..2b741f9c4c5a50c91ea4aa7fcdce1951f5c9d7bd --- /dev/null +++ b/297/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert flatten_list([[1,2,3], [4,5,6], [10,11,12], [7,8,9]])==[1, 2, 3, 4, 5, 6, 10, 11, 12, 7, 8, 9] diff --git a/299/instruction.md b/299/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..ed33604ba75b760257f65c401d583f2a8a175ff1 --- /dev/null +++ b/299/instruction.md @@ -0,0 +1,3 @@ +# MBPP 299 + +Write a function to calculate the maximum aggregate from the list of tuples. diff --git a/299/solution/__init__.py b/299/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/299/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/299/solution/_reference.py b/299/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..e82fe618741260b5114777805170c21ccc43ba2e --- /dev/null +++ b/299/solution/_reference.py @@ -0,0 +1,7 @@ + +from collections import defaultdict +def max_aggregate(stdata): + temp = defaultdict(int) + for name, marks in stdata: + temp[name] += marks + return max(temp.items(), key=lambda x: x[1]) \ No newline at end of file diff --git a/299/solution/solution.py b/299/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/299/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/299/solution/solve.sh b/299/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/299/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/299/task.toml b/299/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..9d6f06fe995b2811d332cc4ca011bd23ce4805bf --- /dev/null +++ b/299/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/299" +name = "MBPP — 299" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/299/tests/__init__.py b/299/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/299/tests/conftest.py b/299/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/299/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/299/tests/test_mbpp_0.py b/299/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..ac3f2d3f47237ec62b7298096cc104e4615f8a0c --- /dev/null +++ b/299/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert max_aggregate([('Juan Whelan',90),('Sabah Colley',88),('Peter Nichols',7),('Juan Whelan',122),('Sabah Colley',84)])==('Juan Whelan', 212) diff --git a/299/tests/test_mbpp_1.py b/299/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..20e36e0c5a4ec9b8a3c4548969c5273b5c5f779e --- /dev/null +++ b/299/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert max_aggregate([('Juan Whelan',50),('Sabah Colley',48),('Peter Nichols',37),('Juan Whelan',22),('Sabah Colley',14)])==('Juan Whelan', 72) diff --git a/299/tests/test_mbpp_2.py b/299/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..375e7d1b9fe8db1849435a3e5f76638257fb66b9 --- /dev/null +++ b/299/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert max_aggregate([('Juan Whelan',10),('Sabah Colley',20),('Peter Nichols',30),('Juan Whelan',40),('Sabah Colley',50)])==('Sabah Colley', 70) diff --git a/300/instruction.md b/300/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..ea9b78d9164df9e32ba45fad0e1fd26419825b04 --- /dev/null +++ b/300/instruction.md @@ -0,0 +1,3 @@ +# MBPP 300 + +Write a function to find the count of all binary sequences of length 2n such that sum of first n bits is same as sum of last n bits. diff --git a/300/solution/__init__.py b/300/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/300/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/300/solution/_reference.py b/300/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..1fb8ef644132297a7621b23b3325c5cdd2d96402 --- /dev/null +++ b/300/solution/_reference.py @@ -0,0 +1,8 @@ +import math +def count_binary_seq(n): + nCr = 1 + res = 1 + for r in range(1, n + 1): + nCr = (nCr * (n + 1 - r)) / r + res += nCr * nCr + return res \ No newline at end of file diff --git a/300/solution/solution.py b/300/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/300/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/300/solution/solve.sh b/300/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/300/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/300/task.toml b/300/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..39cc4620f03838811ea81a1cecf2aa39f8c995c8 --- /dev/null +++ b/300/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/300" +name = "MBPP — 300" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/300/tests/__init__.py b/300/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/300/tests/conftest.py b/300/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/300/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/300/tests/test_mbpp_0.py b/300/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..cd749e88d12ddd4f8c442e65f2e7a412f8352f87 --- /dev/null +++ b/300/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert math.isclose(count_binary_seq(1), 2.0, rel_tol=0.001) diff --git a/300/tests/test_mbpp_1.py b/300/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..13f687fc27c2e59eccd0a75031afaddd1ddbb8eb --- /dev/null +++ b/300/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert math.isclose(count_binary_seq(2), 6.0, rel_tol=0.001) diff --git a/300/tests/test_mbpp_2.py b/300/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..7d9a7c2fd6b78c2a771d5b392e00c2b88ecaf9dd --- /dev/null +++ b/300/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert math.isclose(count_binary_seq(3), 20.0, rel_tol=0.001) diff --git a/304/instruction.md b/304/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..60803046793551f0d67889d607c42dcbd92c7e90 --- /dev/null +++ b/304/instruction.md @@ -0,0 +1,3 @@ +# MBPP 304 + +Write a python function to find element at a given index after number of rotations. diff --git a/304/solution/__init__.py b/304/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/304/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/304/solution/_reference.py b/304/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..f134d345dc396b782f53914a805b0e14f5c4cba9 --- /dev/null +++ b/304/solution/_reference.py @@ -0,0 +1,11 @@ + +def find_Element(arr,ranges,rotations,index) : + for i in range(rotations - 1,-1,-1 ) : + left = ranges[i][0] + right = ranges[i][1] + if (left <= index and right >= index) : + if (index == left) : + index = right + else : + index = index - 1 + return arr[index] \ No newline at end of file diff --git a/304/solution/solution.py b/304/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/304/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/304/solution/solve.sh b/304/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/304/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/304/task.toml b/304/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..56de33cd47c25fbaf1828c8eee7d2b20d1993e4d --- /dev/null +++ b/304/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/304" +name = "MBPP — 304" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/304/tests/__init__.py b/304/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/304/tests/conftest.py b/304/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/304/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/304/tests/test_mbpp_0.py b/304/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..9d1d424a59db8cebbcd14c8059565f3f411769e9 --- /dev/null +++ b/304/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert find_Element([1,2,3,4,5],[[0,2],[0,3]],2,1) == 3 diff --git a/304/tests/test_mbpp_1.py b/304/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..587618c326bdc39f8cff3ba4961e7acf0e1edfa3 --- /dev/null +++ b/304/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert find_Element([1,2,3,4],[[0,1],[0,2]],1,2) == 3 diff --git a/304/tests/test_mbpp_2.py b/304/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..23a4e6b6d997556286c843ec5ecfadf44fdeabef --- /dev/null +++ b/304/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert find_Element([1,2,3,4,5,6],[[0,1],[0,2]],1,1) == 1 diff --git a/307/instruction.md b/307/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b02128923e9cb1f5bb99c42b77c9bbde655d5b1a --- /dev/null +++ b/307/instruction.md @@ -0,0 +1,3 @@ +# MBPP 307 + +Write a function to get a colon of a tuple. diff --git a/307/solution/__init__.py b/307/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/307/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/307/solution/_reference.py b/307/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..60c128ee2053e4b83abe8a063df466818a5abb2c --- /dev/null +++ b/307/solution/_reference.py @@ -0,0 +1,6 @@ + +from copy import deepcopy +def colon_tuplex(tuplex,m,n): + tuplex_colon = deepcopy(tuplex) + tuplex_colon[m].append(n) + return tuplex_colon \ No newline at end of file diff --git a/307/solution/solution.py b/307/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/307/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/307/solution/solve.sh b/307/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/307/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/307/task.toml b/307/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..90e0a93623253612b2a6016728ab0c9cb1226288 --- /dev/null +++ b/307/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/307" +name = "MBPP — 307" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/307/tests/__init__.py b/307/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/307/tests/conftest.py b/307/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/307/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/307/tests/test_mbpp_0.py b/307/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..54e16838436936603c6704740fc2d02964fe3067 --- /dev/null +++ b/307/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert colon_tuplex(("HELLO", 5, [], True) ,2,50)==("HELLO", 5, [50], True) diff --git a/307/tests/test_mbpp_1.py b/307/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..b13f198f9c7c0f0b2e6d5b134bac8e0792528c99 --- /dev/null +++ b/307/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert colon_tuplex(("HELLO", 5, [], True) ,2,100)==(("HELLO", 5, [100],True)) diff --git a/307/tests/test_mbpp_2.py b/307/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..91a63f377e6ae241d8c02bd4e95036ee49e77632 --- /dev/null +++ b/307/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert colon_tuplex(("HELLO", 5, [], True) ,2,500)==("HELLO", 5, [500], True) diff --git a/310/instruction.md b/310/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..3c3bbbfc7672d091fc9878296a99da7093fb3579 --- /dev/null +++ b/310/instruction.md @@ -0,0 +1,3 @@ +# MBPP 310 + +Write a function to convert a given string to a tuple of characters. diff --git a/310/solution/__init__.py b/310/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/310/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/310/solution/_reference.py b/310/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..55415a019704865b4f168741b99932838463b943 --- /dev/null +++ b/310/solution/_reference.py @@ -0,0 +1,4 @@ + +def string_to_tuple(str1): + result = tuple(x for x in str1 if not x.isspace()) + return result \ No newline at end of file diff --git a/310/solution/solution.py b/310/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/310/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/310/solution/solve.sh b/310/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/310/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/310/task.toml b/310/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..84ea5262000d62d56e6050a37ac53ea2c8ef5525 --- /dev/null +++ b/310/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/310" +name = "MBPP — 310" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/310/tests/__init__.py b/310/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/310/tests/conftest.py b/310/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/310/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/310/tests/test_mbpp_0.py b/310/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..99e8cd2a7e9d45b75305556fe244ad5605fb700a --- /dev/null +++ b/310/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert string_to_tuple("python 3.0")==('p', 'y', 't', 'h', 'o', 'n', '3', '.', '0') diff --git a/310/tests/test_mbpp_1.py b/310/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..1b3ada8afc5bfa5e6405adcd7c4a8859f3ca82c0 --- /dev/null +++ b/310/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert string_to_tuple("item1")==('i', 't', 'e', 'm', '1') diff --git a/310/tests/test_mbpp_2.py b/310/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..69a2caabf506768b8a169870a7b1b62a4c3b9315 --- /dev/null +++ b/310/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert string_to_tuple("15.10")==('1', '5', '.', '1', '0') diff --git a/311/instruction.md b/311/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..9b09ad82f4fa8c3edf4caac39e5c9c359f357d2a --- /dev/null +++ b/311/instruction.md @@ -0,0 +1,3 @@ +# MBPP 311 + +Write a python function to set the left most unset bit. diff --git a/311/solution/__init__.py b/311/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/311/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/311/solution/_reference.py b/311/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..bed6b588bd742ce2c4887469b73afe99b601c8b5 --- /dev/null +++ b/311/solution/_reference.py @@ -0,0 +1,10 @@ + +def set_left_most_unset_bit(n): + if not (n & (n + 1)): + return n + pos, temp, count = 0, n, 0 + while temp: + if not (temp & 1): + pos = count + count += 1; temp>>=1 + return (n | (1 << (pos))) \ No newline at end of file diff --git a/311/solution/solution.py b/311/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/311/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/311/solution/solve.sh b/311/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/311/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/311/task.toml b/311/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..790228d4090eedc2b0e3b5496c239ea1881cc7a7 --- /dev/null +++ b/311/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/311" +name = "MBPP — 311" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/311/tests/__init__.py b/311/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/311/tests/conftest.py b/311/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/311/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/311/tests/test_mbpp_0.py b/311/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..1e8e3d523d3b3d2a8b09f32bac9856f367dd9a7d --- /dev/null +++ b/311/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert set_left_most_unset_bit(10) == 14 diff --git a/311/tests/test_mbpp_1.py b/311/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..980ae6ad1dd05a645b155a0b1c63ab761e52fa29 --- /dev/null +++ b/311/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert set_left_most_unset_bit(12) == 14 diff --git a/311/tests/test_mbpp_2.py b/311/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..3db27badd6fe77e1b7245ec7fa967ad93eb9ea52 --- /dev/null +++ b/311/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert set_left_most_unset_bit(15) == 15 diff --git a/390/instruction.md b/390/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..f67ab10477625c9adda446a95e03a92cf79f93eb --- /dev/null +++ b/390/instruction.md @@ -0,0 +1,3 @@ +# MBPP 390 + +Write a function to apply a given format string to all of the elements in a list. diff --git a/390/solution/__init__.py b/390/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/390/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/390/solution/_reference.py b/390/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..f3429afa0d5d00d9b5a5bf780931aa19cf3a212d --- /dev/null +++ b/390/solution/_reference.py @@ -0,0 +1,4 @@ + +def add_string(list_, string): + add_string=[string.format(i) for i in list_] + return add_string \ No newline at end of file diff --git a/390/solution/solution.py b/390/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/390/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/390/solution/solve.sh b/390/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/390/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/390/task.toml b/390/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..fb27cba699bdc0f51b8f9d095db47e51daaed430 --- /dev/null +++ b/390/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/390" +name = "MBPP — 390" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/390/tests/__init__.py b/390/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/390/tests/conftest.py b/390/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/390/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/390/tests/test_mbpp_0.py b/390/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..021078e3c82a067877fb5051d78fe9b9d0187a06 --- /dev/null +++ b/390/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert add_string([1,2,3,4],'temp{0}')==['temp1', 'temp2', 'temp3', 'temp4'] diff --git a/390/tests/test_mbpp_1.py b/390/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..43331dbadd6e1e15a05cf69bca5cbb8438db2c80 --- /dev/null +++ b/390/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert add_string(['a','b','c','d'], 'python{0}')==[ 'pythona', 'pythonb', 'pythonc', 'pythond'] diff --git a/390/tests/test_mbpp_2.py b/390/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..0ecd753fc7f9d742fce15142afe20828cdd8b0c7 --- /dev/null +++ b/390/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert add_string([5,6,7,8],'string{0}')==['string5', 'string6', 'string7', 'string8'] diff --git a/391/instruction.md b/391/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..70c7a1afbffbe3998a648fefb6d647715ce6ee44 --- /dev/null +++ b/391/instruction.md @@ -0,0 +1,3 @@ +# MBPP 391 + +Write a function to convert more than one list to nested dictionary. diff --git a/391/solution/__init__.py b/391/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/391/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/391/solution/_reference.py b/391/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..2fe21f148edd8a8b0dd167730367aca8333e1b9d --- /dev/null +++ b/391/solution/_reference.py @@ -0,0 +1,4 @@ + +def convert_list_dictionary(l1, l2, l3): + result = [{x: {y: z}} for (x, y, z) in zip(l1, l2, l3)] + return result \ No newline at end of file diff --git a/391/solution/solution.py b/391/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/391/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/391/solution/solve.sh b/391/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/391/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/391/task.toml b/391/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..f9352e645d7cfe0d21f4748abbf5f3c84f7e955e --- /dev/null +++ b/391/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/391" +name = "MBPP — 391" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/391/tests/__init__.py b/391/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/391/tests/conftest.py b/391/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/391/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/391/tests/test_mbpp_0.py b/391/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..58659dde1897af95de91f9bb8a4c1790053ba9b9 --- /dev/null +++ b/391/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert convert_list_dictionary(["S001", "S002", "S003", "S004"],["Adina Park", "Leyton Marsh", "Duncan Boyle", "Saim Richards"] ,[85, 98, 89, 92])==[{'S001': {'Adina Park': 85}}, {'S002': {'Leyton Marsh': 98}}, {'S003': {'Duncan Boyle': 89}}, {'S004': {'Saim Richards': 92}}] diff --git a/391/tests/test_mbpp_1.py b/391/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..834214e866f10076602f7371635f9f8d84993d11 --- /dev/null +++ b/391/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert convert_list_dictionary(["abc","def","ghi","jkl"],["python","program","language","programs"],[100,200,300,400])==[{'abc':{'python':100}},{'def':{'program':200}},{'ghi':{'language':300}},{'jkl':{'programs':400}}] diff --git a/391/tests/test_mbpp_2.py b/391/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..c5665886e697945357c4878770238f96a5749e08 --- /dev/null +++ b/391/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert convert_list_dictionary(["A1","A2","A3","A4"],["java","C","C++","DBMS"],[10,20,30,40])==[{'A1':{'java':10}},{'A2':{'C':20}},{'A3':{'C++':30}},{'A4':{'DBMS':40}}] diff --git a/392/instruction.md b/392/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..01f06c708ccad482bc71048a7a9fd547e1a94ce0 --- /dev/null +++ b/392/instruction.md @@ -0,0 +1,3 @@ +# MBPP 392 + +Write a function to find the maximum sum possible by using the given equation f(n) = max( (f(n/2) + f(n/3) + f(n/4) + f(n/5)), n). diff --git a/392/solution/__init__.py b/392/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/392/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/392/solution/_reference.py b/392/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..8c65b35285c1c98fb1d75665d615a68b3134b8a7 --- /dev/null +++ b/392/solution/_reference.py @@ -0,0 +1,13 @@ + +def get_max_sum (n): + res = list() + res.append(0) + res.append(1) + i = 2 + while i&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/392/task.toml b/392/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..e4511054bfa527e380734469038e09c76d41aa35 --- /dev/null +++ b/392/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/392" +name = "MBPP — 392" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/392/tests/__init__.py b/392/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/392/tests/conftest.py b/392/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/392/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/392/tests/test_mbpp_0.py b/392/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..ef94b4c82f8a41c8f2ddab319a73cfde72c0e94b --- /dev/null +++ b/392/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert get_max_sum(60) == 106 diff --git a/392/tests/test_mbpp_1.py b/392/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..11fa09c49f4026e7b7c5ab5ef55ccd11266a4c6f --- /dev/null +++ b/392/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert get_max_sum(10) == 12 diff --git a/392/tests/test_mbpp_2.py b/392/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..c5d42f146f7d403dcba467bc71e74d48de8d4215 --- /dev/null +++ b/392/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert get_max_sum(2) == 2 diff --git a/393/instruction.md b/393/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..ad56fcecadfad41f35db652432ad6495b392b509 --- /dev/null +++ b/393/instruction.md @@ -0,0 +1,3 @@ +# MBPP 393 + +Write a function to find the list with maximum length. diff --git a/393/solution/__init__.py b/393/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/393/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/393/solution/_reference.py b/393/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..01ce0c3695c4a527d7b53f9cc95d4ef363a9c66f --- /dev/null +++ b/393/solution/_reference.py @@ -0,0 +1,5 @@ + +def max_length_list(input_list): + max_length = max(len(x) for x in input_list ) + max_list = max(input_list, key = lambda i: len(i)) + return(max_length, max_list) \ No newline at end of file diff --git a/393/solution/solution.py b/393/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/393/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/393/solution/solve.sh b/393/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/393/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/393/task.toml b/393/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..c6fde10118054c0d31188c760ea19efc42494adb --- /dev/null +++ b/393/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/393" +name = "MBPP — 393" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/393/tests/__init__.py b/393/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/393/tests/conftest.py b/393/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/393/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/393/tests/test_mbpp_0.py b/393/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..c87aef1c32fb9c69a9a69eaf32225ddf1ea9baad --- /dev/null +++ b/393/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert max_length_list([[0], [1, 3], [5, 7], [9, 11], [13, 15, 17]])==(3, [13, 15, 17]) diff --git a/393/tests/test_mbpp_1.py b/393/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..4c549ae31a5eac62f3220fc6ba258a7d61b6082c --- /dev/null +++ b/393/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert max_length_list([[1,2,3,4,5],[1,2,3,4],[1,2,3],[1,2],[1]])==(5,[1,2,3,4,5]) diff --git a/393/tests/test_mbpp_2.py b/393/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..e0719a139d04b4bbffd8b95369578ca50a8aa0f6 --- /dev/null +++ b/393/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert max_length_list([[3,4,5],[6,7,8,9],[10,11,12]])==(4,[6,7,8,9]) diff --git a/394/instruction.md b/394/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..46ce4f28a0ccc7090f43b2d7c8203e3996f0f2d1 --- /dev/null +++ b/394/instruction.md @@ -0,0 +1,3 @@ +# MBPP 394 + +Write a function to check if given tuple contains no duplicates. diff --git a/394/solution/__init__.py b/394/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/394/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/394/solution/_reference.py b/394/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..95d643cb774b6d7901cbdab825d10d625f12883a --- /dev/null +++ b/394/solution/_reference.py @@ -0,0 +1,10 @@ + +def check_distinct(test_tup): + res = True + temp = set() + for ele in test_tup: + if ele in temp: + res = False + break + temp.add(ele) + return res \ No newline at end of file diff --git a/394/solution/solution.py b/394/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/394/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/394/solution/solve.sh b/394/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/394/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/394/task.toml b/394/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..3dd419ba4888a2788c018899c705e3d46f246d6b --- /dev/null +++ b/394/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/394" +name = "MBPP — 394" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/394/tests/__init__.py b/394/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/394/tests/conftest.py b/394/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/394/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/394/tests/test_mbpp_0.py b/394/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..47875d8f9bb0a23ab823ac397cfa58c6a660f9b3 --- /dev/null +++ b/394/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert check_distinct((1, 4, 5, 6, 1, 4)) == False diff --git a/394/tests/test_mbpp_1.py b/394/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..ae1b1d049d596093cc544f627231f827e420a3d2 --- /dev/null +++ b/394/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert check_distinct((1, 4, 5, 6)) == True diff --git a/394/tests/test_mbpp_2.py b/394/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..90ab5492f6eed435e339557a922a25e634021091 --- /dev/null +++ b/394/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert check_distinct((2, 3, 4, 5, 6)) == True diff --git a/395/solution/__init__.py b/395/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/395/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/395/tests/__init__.py b/395/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/395/tests/conftest.py b/395/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/395/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/395/tests/test_mbpp_0.py b/395/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..7b34d6bd7a90dd26ba5d3b7cdc4011788a942c64 --- /dev/null +++ b/395/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert first_non_repeating_character("abcabc") == None diff --git a/395/tests/test_mbpp_1.py b/395/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..8ec69437d4bc05a5ab1c34acb670408b0b13cacf --- /dev/null +++ b/395/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert first_non_repeating_character("abc") == "a" diff --git a/395/tests/test_mbpp_2.py b/395/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..fd9f52956b747365278578d061a4e28ac21bb209 --- /dev/null +++ b/395/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert first_non_repeating_character("ababc") == "c" diff --git a/396/instruction.md b/396/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..4427fa3b0ffa051e55f5a88f9d55591c99eee1a6 --- /dev/null +++ b/396/instruction.md @@ -0,0 +1,3 @@ +# MBPP 396 + +Write a function to check whether the given string starts and ends with the same character or not. diff --git a/396/solution/__init__.py b/396/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/396/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/396/solution/_reference.py b/396/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..3b8b75a8b2772fb0ad4a8db4282b03b43273c11c --- /dev/null +++ b/396/solution/_reference.py @@ -0,0 +1,8 @@ + +import re +regex = r'^[a-z]$|^([a-z]).*\1$' +def check_char(string): + if(re.search(regex, string)): + return "Valid" + else: + return "Invalid" \ No newline at end of file diff --git a/396/solution/solution.py b/396/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/396/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/396/solution/solve.sh b/396/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/396/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/396/task.toml b/396/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..9161b572e68461916efdf3238d2c34d01b592aca --- /dev/null +++ b/396/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/396" +name = "MBPP — 396" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/396/tests/__init__.py b/396/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/396/tests/conftest.py b/396/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/396/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/396/tests/test_mbpp_0.py b/396/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..453e68e0a4a085cd3deeaab4791e427fe57b9ef0 --- /dev/null +++ b/396/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert check_char("abba") == "Valid" diff --git a/396/tests/test_mbpp_1.py b/396/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..b2d7aead8d9dec8db9473e947983dd2e0b91ff5f --- /dev/null +++ b/396/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert check_char("a") == "Valid" diff --git a/396/tests/test_mbpp_2.py b/396/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..6b45e6b45e316da02c4e0e304129147618f0a4df --- /dev/null +++ b/396/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert check_char("abcd") == "Invalid" diff --git a/400/instruction.md b/400/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..d35e6118b582990f3695facaeeb22b7312942386 --- /dev/null +++ b/400/instruction.md @@ -0,0 +1,3 @@ +# MBPP 400 + +Write a function to extract the number of unique tuples in the given list. diff --git a/400/solution/__init__.py b/400/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/400/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/400/solution/_reference.py b/400/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..cc5487a60a7f4adfd3ce3b7ef2d647b79ec57993 --- /dev/null +++ b/400/solution/_reference.py @@ -0,0 +1,4 @@ + +def extract_freq(test_list): + res = len(list(set(tuple(sorted(sub)) for sub in test_list))) + return (res) \ No newline at end of file diff --git a/400/solution/solution.py b/400/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/400/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/400/solution/solve.sh b/400/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/400/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/400/task.toml b/400/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..f7a0f45e94663652253e895c4786e0d9da4863d4 --- /dev/null +++ b/400/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/400" +name = "MBPP — 400" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/400/tests/__init__.py b/400/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/400/tests/conftest.py b/400/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/400/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/400/tests/test_mbpp_0.py b/400/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..2812b19f68318267c02e09ea8b3b46e9ae69be90 --- /dev/null +++ b/400/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert extract_freq([(3, 4), (1, 2), (4, 3), (5, 6)] ) == 3 diff --git a/400/tests/test_mbpp_1.py b/400/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..974c9619ff89ea97a4906f13ef520dc9f0c9dc53 --- /dev/null +++ b/400/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert extract_freq([(4, 15), (2, 3), (5, 4), (6, 7)] ) == 4 diff --git a/400/tests/test_mbpp_2.py b/400/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..af960c93df030e4ab0e08bd02c5d4a9e5a40e1cb --- /dev/null +++ b/400/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert extract_freq([(5, 16), (2, 3), (6, 5), (6, 9)] ) == 4 diff --git a/406/instruction.md b/406/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..3fa0ac9ef3aac7f1518ad0b4dbd9eb24d4b32cc4 --- /dev/null +++ b/406/instruction.md @@ -0,0 +1,3 @@ +# MBPP 406 + +Write a python function to find whether the parity of a given number is odd. diff --git a/406/solution/__init__.py b/406/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/406/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/406/solution/_reference.py b/406/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..eddf46cf5d4348ee012da56d2db8ff26138b2bd4 --- /dev/null +++ b/406/solution/_reference.py @@ -0,0 +1,10 @@ + +def find_Parity(x): + y = x ^ (x >> 1); + y = y ^ (y >> 2); + y = y ^ (y >> 4); + y = y ^ (y >> 8); + y = y ^ (y >> 16); + if (y & 1): + return True + return False \ No newline at end of file diff --git a/406/solution/solution.py b/406/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/406/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/406/solution/solve.sh b/406/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/406/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/406/task.toml b/406/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..6080763ddb52d2ce8b8bafd0f7abdbea6bbfab9d --- /dev/null +++ b/406/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/406" +name = "MBPP — 406" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/406/tests/__init__.py b/406/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/406/tests/conftest.py b/406/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/406/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/406/tests/test_mbpp_0.py b/406/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..31badb2cfb4fddf9f4bade00280705ffaf7bc36c --- /dev/null +++ b/406/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert find_Parity(12) == False diff --git a/406/tests/test_mbpp_1.py b/406/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..266940cba1d2a16aef0df6121d2af40f56387920 --- /dev/null +++ b/406/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert find_Parity(7) == True diff --git a/406/tests/test_mbpp_2.py b/406/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..48a1c58645c642070d344323cf802e593f07d2e6 --- /dev/null +++ b/406/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert find_Parity(10) == False diff --git a/407/instruction.md b/407/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..509033c477be932c9dd92a5c22b69cca581c2c51 --- /dev/null +++ b/407/instruction.md @@ -0,0 +1,3 @@ +# MBPP 407 + +Write a function to create the next bigger number by rearranging the digits of a given number. diff --git a/407/solution/__init__.py b/407/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/407/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/407/solution/_reference.py b/407/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..b9ba702ad6f30779fc8c595aa39fcf86f0d7d352 --- /dev/null +++ b/407/solution/_reference.py @@ -0,0 +1,12 @@ + +def rearrange_bigger(n): + nums = list(str(n)) + for i in range(len(nums)-2,-1,-1): + if nums[i] < nums[i+1]: + z = nums[i:] + y = min(filter(lambda x: x > z[0], z)) + z.remove(y) + z.sort() + nums[i:] = [y] + z + return int("".join(nums)) + return False \ No newline at end of file diff --git a/407/solution/solution.py b/407/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/407/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/407/solution/solve.sh b/407/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/407/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/407/task.toml b/407/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..a86a3e90dc7a1685fcda8ba2b66d5bf6753bd195 --- /dev/null +++ b/407/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/407" +name = "MBPP — 407" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/407/tests/__init__.py b/407/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/407/tests/conftest.py b/407/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/407/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/407/tests/test_mbpp_0.py b/407/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..f20c21acf1bce06715888f39d32603aeddebaa3e --- /dev/null +++ b/407/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert rearrange_bigger(12)==21 diff --git a/407/tests/test_mbpp_1.py b/407/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..5ade6de329a885b58c6669157340fe8447f10ea4 --- /dev/null +++ b/407/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert rearrange_bigger(10)==False diff --git a/407/tests/test_mbpp_2.py b/407/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..ac3f35abaeccda9d1a2d88da04bbd7bcd2066748 --- /dev/null +++ b/407/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert rearrange_bigger(102)==120 diff --git a/412/instruction.md b/412/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..3d5648b0ffed300140c4906220504118f8eab365 --- /dev/null +++ b/412/instruction.md @@ -0,0 +1,3 @@ +# MBPP 412 + +Write a python function to remove odd numbers from a given list. diff --git a/412/solution/__init__.py b/412/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/412/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/412/solution/_reference.py b/412/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..8d020987557dff67819c73d7ac719a05264c2bfb --- /dev/null +++ b/412/solution/_reference.py @@ -0,0 +1,6 @@ + +def remove_odd(l): + for i in l: + if i % 2 != 0: + l.remove(i) + return l \ No newline at end of file diff --git a/412/solution/solution.py b/412/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/412/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/412/solution/solve.sh b/412/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/412/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/412/task.toml b/412/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..545cae09177a1d23013cb56c2c3754c6f1a31c74 --- /dev/null +++ b/412/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/412" +name = "MBPP — 412" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/412/tests/__init__.py b/412/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/412/tests/conftest.py b/412/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/412/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/412/tests/test_mbpp_0.py b/412/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..c04f9b704f2fb7d92d8e10d2f8b3683dc0a2ec64 --- /dev/null +++ b/412/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert remove_odd([1,2,3]) == [2] diff --git a/412/tests/test_mbpp_1.py b/412/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..a6737834689090386f9914fd2a31b85c3ee6fd53 --- /dev/null +++ b/412/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert remove_odd([2,4,6]) == [2,4,6] diff --git a/412/tests/test_mbpp_2.py b/412/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..fa2fdcfb4b286137fb949c935ac658ffeaa8e295 --- /dev/null +++ b/412/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert remove_odd([10,20,3]) == [10,20] diff --git a/413/instruction.md b/413/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..5f1e59ae3c91f9a7c2c30d3566418dcc8bb79ef4 --- /dev/null +++ b/413/instruction.md @@ -0,0 +1,3 @@ +# MBPP 413 + +Write a function to extract the nth element from a given list of tuples. diff --git a/413/solution/__init__.py b/413/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/413/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/413/solution/_reference.py b/413/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..82e9ecd373a906bf25776c9af2090e4dd4847fa8 --- /dev/null +++ b/413/solution/_reference.py @@ -0,0 +1,4 @@ + +def extract_nth_element(list1, n): + result = [x[n] for x in list1] + return result \ No newline at end of file diff --git a/413/solution/solution.py b/413/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/413/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/413/solution/solve.sh b/413/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/413/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/413/task.toml b/413/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..84a00fa6745d4a2f7b36d08d43a59d5acf5fae9e --- /dev/null +++ b/413/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/413" +name = "MBPP — 413" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/413/tests/__init__.py b/413/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/413/tests/conftest.py b/413/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/413/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/413/tests/test_mbpp_0.py b/413/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..c0d3d4af8a5d0cc43a774f9226e8de1588b05f30 --- /dev/null +++ b/413/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert extract_nth_element([('Greyson Fulton', 98, 99), ('Brady Kent', 97, 96), ('Wyatt Knott', 91, 94), ('Beau Turnbull', 94, 98)] ,0)==['Greyson Fulton', 'Brady Kent', 'Wyatt Knott', 'Beau Turnbull'] diff --git a/413/tests/test_mbpp_1.py b/413/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..dd81f6cb1cf929f0e7ecc24261fcddd12864088c --- /dev/null +++ b/413/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert extract_nth_element([('Greyson Fulton', 98, 99), ('Brady Kent', 97, 96), ('Wyatt Knott', 91, 94), ('Beau Turnbull', 94, 98)] ,2)==[99, 96, 94, 98] diff --git a/413/tests/test_mbpp_2.py b/413/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..f1291ea68191ab51fe6cc20ec7ad0015553519dd --- /dev/null +++ b/413/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert extract_nth_element([('Greyson Fulton', 98, 99), ('Brady Kent', 97, 96), ('Wyatt Knott', 91, 94), ('Beau Turnbull', 94, 98)],1)==[98, 97, 91, 94] diff --git a/435/instruction.md b/435/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..324dd1e1d5f88436161576dfeaa7ed07f15c8b93 --- /dev/null +++ b/435/instruction.md @@ -0,0 +1,3 @@ +# MBPP 435 + +Write a python function to find the last digit of a given number. diff --git a/435/solution/__init__.py b/435/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/435/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/435/solution/_reference.py b/435/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..5a62081847eff58d9cc8292beec5ab73d134fab0 --- /dev/null +++ b/435/solution/_reference.py @@ -0,0 +1,3 @@ + +def last_Digit(n) : + return (n % 10) \ No newline at end of file diff --git a/435/solution/solution.py b/435/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/435/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/435/solution/solve.sh b/435/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/435/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/435/task.toml b/435/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..4ea31c1eea1376b923d5dedf2a95c15436fa25f6 --- /dev/null +++ b/435/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/435" +name = "MBPP — 435" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/435/tests/__init__.py b/435/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/435/tests/test_mbpp_0.py b/435/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..21d9cd470899120b75f1176a18ab1cdb9e6b9aba --- /dev/null +++ b/435/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert last_Digit(123) == 3 diff --git a/435/tests/test_mbpp_1.py b/435/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..04d936fd8e9c96267ff4afb47ff03acf1869f92a --- /dev/null +++ b/435/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert last_Digit(25) == 5 diff --git a/435/tests/test_mbpp_2.py b/435/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..87ba1ec48693f60063700783c93f499129f50cb2 --- /dev/null +++ b/435/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert last_Digit(30) == 0 diff --git a/436/instruction.md b/436/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..6e66ef8977bfff7823221eb262e5536c20fdf811 --- /dev/null +++ b/436/instruction.md @@ -0,0 +1,3 @@ +# MBPP 436 + +Write a python function to return the negative numbers in a list. diff --git a/436/solution/__init__.py b/436/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/436/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/436/solution/_reference.py b/436/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..cd158109198554b5fe373c1785fb16076c8eb2ca --- /dev/null +++ b/436/solution/_reference.py @@ -0,0 +1,7 @@ + +def neg_nos(list1): + out = [] + for num in list1: + if num < 0: + out.append(num) + return out \ No newline at end of file diff --git a/436/solution/solution.py b/436/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/436/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/436/tests/__init__.py b/436/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/436/tests/conftest.py b/436/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/436/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/436/tests/test_mbpp_1.py b/436/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..85e752e980e078b5e0b6a081512f9e0351a057bb --- /dev/null +++ b/436/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert neg_nos([-1,-2,3,4]) == [-1,-2] diff --git a/436/tests/test_mbpp_2.py b/436/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..06f344292125744e99d844884f2b6fab15f660a9 --- /dev/null +++ b/436/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert neg_nos([-7,-6,8,9]) == [-7,-6] diff --git a/444/instruction.md b/444/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..a846886637491c8146e5df40dccab99f59e71216 --- /dev/null +++ b/444/instruction.md @@ -0,0 +1,3 @@ +# MBPP 444 + +Write a function to trim each tuple by k in the given tuple list. diff --git a/444/solution/_reference.py b/444/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..2c6f2e3d499454d64749141e4cf6a85cf2ce4acc --- /dev/null +++ b/444/solution/_reference.py @@ -0,0 +1,7 @@ + +def trim_tuple(test_list, K): + res = [] + for ele in test_list: + N = len(ele) + res.append(tuple(list(ele)[K: N - K])) + return (str(res)) \ No newline at end of file diff --git a/444/task.toml b/444/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..bb45a51633f7298fd8c022fdd2965a0a899381da --- /dev/null +++ b/444/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/444" +name = "MBPP — 444" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/447/instruction.md b/447/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..f384f26ca2108be80913412dc4a97bc3cabd3964 --- /dev/null +++ b/447/instruction.md @@ -0,0 +1,3 @@ +# MBPP 447 + +Write a function to find cubes of individual elements in a list. diff --git a/447/solution/__init__.py b/447/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/447/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/447/solution/_reference.py b/447/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..9924c430b552f2d7a44d3aeadc15c7141087eddb --- /dev/null +++ b/447/solution/_reference.py @@ -0,0 +1,4 @@ + +def cube_nums(nums): + cube_nums = list(map(lambda x: x ** 3, nums)) + return cube_nums \ No newline at end of file diff --git a/447/solution/solution.py b/447/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/447/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/447/solution/solve.sh b/447/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/447/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/447/task.toml b/447/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..9d27fe313b9b25ce93d047fd18bbc20fac3c3ac1 --- /dev/null +++ b/447/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/447" +name = "MBPP — 447" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/447/tests/__init__.py b/447/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/447/tests/conftest.py b/447/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/447/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/447/tests/test_mbpp_0.py b/447/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..8c8d6f20755e6af57486ee770876a5ebc13b82bd --- /dev/null +++ b/447/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert cube_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])==[1, 8, 27, 64, 125, 216, 343, 512, 729, 1000] diff --git a/447/tests/test_mbpp_1.py b/447/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..8699b0f56b865d7c40a15bf01c9d62be9aebab9e --- /dev/null +++ b/447/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert cube_nums([10,20,30])==([1000, 8000, 27000]) diff --git a/447/tests/test_mbpp_2.py b/447/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..8531969de6ff7d225dcb64e34c57c0bde619d312 --- /dev/null +++ b/447/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert cube_nums([12,15])==([1728, 3375]) diff --git a/452/instruction.md b/452/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..a26ba077930af7a26b9a2aa0d6455881418c6f55 --- /dev/null +++ b/452/instruction.md @@ -0,0 +1,3 @@ +# MBPP 452 + +Write a function that gives loss amount on a sale if the given amount has loss else return 0. diff --git a/452/solution/__init__.py b/452/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/452/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/452/solution/_reference.py b/452/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..7176a1249e265e15cd6001a16cfa8673fd0c747d --- /dev/null +++ b/452/solution/_reference.py @@ -0,0 +1,7 @@ + +def loss_amount(actual_cost,sale_amount): + if(sale_amount > actual_cost): + amount = sale_amount - actual_cost + return amount + else: + return 0 \ No newline at end of file diff --git a/452/solution/solution.py b/452/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/452/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/452/solution/solve.sh b/452/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/452/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/452/task.toml b/452/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..97dcb6141d87ee236f5d22291a47ad9f8af27644 --- /dev/null +++ b/452/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/452" +name = "MBPP — 452" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/452/tests/__init__.py b/452/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/452/tests/conftest.py b/452/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/452/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/452/tests/test_mbpp_0.py b/452/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..08bf2c3d6e40b4cd0c78c26cff650def749f8a71 --- /dev/null +++ b/452/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert loss_amount(1500,1200)==0 diff --git a/452/tests/test_mbpp_1.py b/452/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..a3c3f4a51affaa2afc2d1e40e4fdeeceb6ef1348 --- /dev/null +++ b/452/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert loss_amount(100,200)==100 diff --git a/452/tests/test_mbpp_2.py b/452/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..023e589a1c3ada9fb4feac49e4fce449059a587e --- /dev/null +++ b/452/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert loss_amount(2000,5000)==3000 diff --git a/454/instruction.md b/454/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..11bf717b4513f56df8e8dfa16c92aaf6817552aa --- /dev/null +++ b/454/instruction.md @@ -0,0 +1,3 @@ +# MBPP 454 + +Write a function that matches a word containing 'z'. diff --git a/454/solution/__init__.py b/454/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/454/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/454/solution/_reference.py b/454/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..e485ca5a993591ebf3c3a6d70d859e0f2d8d6b36 --- /dev/null +++ b/454/solution/_reference.py @@ -0,0 +1,8 @@ + +import re +def text_match_wordz(text): + patterns = '\w*z.\w*' + if re.search(patterns, text): + return True + else: + return False \ No newline at end of file diff --git a/454/solution/solution.py b/454/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/454/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/454/solution/solve.sh b/454/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/454/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/454/task.toml b/454/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..dd881f327c659bbad3acd79c0415156b5c976f21 --- /dev/null +++ b/454/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/454" +name = "MBPP — 454" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/454/tests/__init__.py b/454/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/454/tests/conftest.py b/454/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/454/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/454/tests/test_mbpp_0.py b/454/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..c6b3b22bf7e62a69925bddd76e90c1bdc9c287b3 --- /dev/null +++ b/454/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert text_match_wordz("pythonz.")==True diff --git a/454/tests/test_mbpp_1.py b/454/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..8d97bd75bcb673dee0da6cc01411dddc736e8e8d --- /dev/null +++ b/454/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert text_match_wordz("xyz.")==True diff --git a/454/tests/test_mbpp_2.py b/454/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..c3fb742883cd532003368c33d359a5074fad97a2 --- /dev/null +++ b/454/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert text_match_wordz(" lang .")==False diff --git a/457/instruction.md b/457/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..8b8896374b6e67ea1311d3ba4747b98152622aa6 --- /dev/null +++ b/457/instruction.md @@ -0,0 +1,3 @@ +# MBPP 457 + +Write a python function to find the sublist having minimum length. diff --git a/457/solution/__init__.py b/457/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/457/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/457/solution/_reference.py b/457/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..efedc0999f5754370966d68e36f3ebc1d5fe6e33 --- /dev/null +++ b/457/solution/_reference.py @@ -0,0 +1,3 @@ + +def Find_Min(lst): + return min(lst, key=len) \ No newline at end of file diff --git a/457/solution/solution.py b/457/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/457/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/457/solution/solve.sh b/457/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/457/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/457/task.toml b/457/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..2b5dc9992daed473c679f70fec515b709fcb2ae8 --- /dev/null +++ b/457/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/457" +name = "MBPP — 457" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/457/tests/__init__.py b/457/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/457/tests/conftest.py b/457/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/457/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/457/tests/test_mbpp_0.py b/457/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..e1bcd229bdd5f1392ff36243e5c6af53c5fbd032 --- /dev/null +++ b/457/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert Find_Min([[1],[1,2],[1,2,3]]) == [1] diff --git a/457/tests/test_mbpp_1.py b/457/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..54adda52cc1be1992c6ba75729a75e0f6ff99b05 --- /dev/null +++ b/457/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert Find_Min([[1,1],[1,1,1],[1,2,7,8]]) == [1,1] diff --git a/457/tests/test_mbpp_2.py b/457/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..0a41c42aa03fe602530692d43392954b8952ad31 --- /dev/null +++ b/457/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert Find_Min([['x'],['x','y'],['x','y','z']]) == ['x'] diff --git a/463/instruction.md b/463/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..0059a3adecba15f33b4bd0767235e6cb1cec20f6 --- /dev/null +++ b/463/instruction.md @@ -0,0 +1,3 @@ +# MBPP 463 + +Write a function to find the maximum product subarray of the given array. diff --git a/463/solution/__init__.py b/463/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/463/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/463/solution/_reference.py b/463/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..42cf0b0d20c137638925b321d80b1159fee85c1c --- /dev/null +++ b/463/solution/_reference.py @@ -0,0 +1,24 @@ + +def max_subarray_product(arr): + n = len(arr) + max_ending_here = 1 + min_ending_here = 1 + max_so_far = 0 + flag = 0 + for i in range(0, n): + if arr[i] > 0: + max_ending_here = max_ending_here * arr[i] + min_ending_here = min (min_ending_here * arr[i], 1) + flag = 1 + elif arr[i] == 0: + max_ending_here = 1 + min_ending_here = 1 + else: + temp = max_ending_here + max_ending_here = max (min_ending_here * arr[i], 1) + min_ending_here = temp * arr[i] + if (max_so_far < max_ending_here): + max_so_far = max_ending_here + if flag == 0 and max_so_far == 0: + return 0 + return max_so_far \ No newline at end of file diff --git a/463/solution/solution.py b/463/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/463/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/463/solution/solve.sh b/463/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/463/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/463/task.toml b/463/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..b2ce76f30e7988f275733579815ec7180a633be2 --- /dev/null +++ b/463/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/463" +name = "MBPP — 463" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/463/tests/__init__.py b/463/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/463/tests/conftest.py b/463/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/463/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/463/tests/test_mbpp_0.py b/463/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..38c729c663623fffea52f1bd2445e80df1f0327d --- /dev/null +++ b/463/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert max_subarray_product([1, -2, -3, 0, 7, -8, -2]) == 112 diff --git a/463/tests/test_mbpp_1.py b/463/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..12eeb6d93d83ad5f5d765d4202f6e7bc6ad3bd3d --- /dev/null +++ b/463/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert max_subarray_product([6, -3, -10, 0, 2]) == 180 diff --git a/463/tests/test_mbpp_2.py b/463/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..f50a6c3dfe0604a5b5fcadf2596b6c18f9a4907c --- /dev/null +++ b/463/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert max_subarray_product([-2, -40, 0, -2, -3]) == 80 diff --git a/464/instruction.md b/464/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..f47cb8d56932b7f8f40e4c92c29742cc3923c1c9 --- /dev/null +++ b/464/instruction.md @@ -0,0 +1,3 @@ +# MBPP 464 + +Write a function to check if all values are same in a dictionary. diff --git a/464/solution/__init__.py b/464/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/464/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/464/solution/_reference.py b/464/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..e959c8a89c15d550c51d8906e10deff28416404a --- /dev/null +++ b/464/solution/_reference.py @@ -0,0 +1,4 @@ + +def check_value(dict, n): + result = all(x == n for x in dict.values()) + return result \ No newline at end of file diff --git a/464/solution/solution.py b/464/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/464/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/464/solution/solve.sh b/464/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/464/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/464/task.toml b/464/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..768a3bb33081873f236932c432f74ef9e29a0ae5 --- /dev/null +++ b/464/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/464" +name = "MBPP — 464" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/464/tests/__init__.py b/464/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/464/tests/conftest.py b/464/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/464/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/464/tests/test_mbpp_0.py b/464/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..cc97e74a9dd8333c1a3622b870f5d0853a818ebb --- /dev/null +++ b/464/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert check_value({'Cierra Vega': 12, 'Alden Cantrell': 12, 'Kierra Gentry': 12, 'Pierre Cox': 12},10)==False diff --git a/464/tests/test_mbpp_1.py b/464/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..6bda9348cb9694b36c13621c2bc897aa75fd7d1b --- /dev/null +++ b/464/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert check_value({'Cierra Vega': 12, 'Alden Cantrell': 12, 'Kierra Gentry': 12, 'Pierre Cox': 12},12)==True diff --git a/464/tests/test_mbpp_2.py b/464/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..f9874edd82c3fec25aa196bb62fbe5e8d78ccad6 --- /dev/null +++ b/464/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert check_value({'Cierra Vega': 12, 'Alden Cantrell': 12, 'Kierra Gentry': 12, 'Pierre Cox': 12},5)==False diff --git a/472/instruction.md b/472/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..ec1733af457cde28f2a32013fde100c5aea7ed2a --- /dev/null +++ b/472/instruction.md @@ -0,0 +1,3 @@ +# MBPP 472 + +Write a python function to check whether the given list contains consecutive numbers or not. diff --git a/472/solution/__init__.py b/472/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/472/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/472/solution/_reference.py b/472/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..ef0ef145d2574a67c843e9f55db165cb53fda157 --- /dev/null +++ b/472/solution/_reference.py @@ -0,0 +1,3 @@ + +def check_Consecutive(l): + return sorted(l) == list(range(min(l),max(l)+1)) \ No newline at end of file diff --git a/472/solution/solution.py b/472/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/472/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/472/solution/solve.sh b/472/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/472/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/472/task.toml b/472/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..1728e4016ddc0b0c4eaa42d1216cad9e669b4ab3 --- /dev/null +++ b/472/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/472" +name = "MBPP — 472" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/472/tests/__init__.py b/472/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/472/tests/conftest.py b/472/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/472/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/472/tests/test_mbpp_0.py b/472/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..f01969d456b7309dbe1214b2f0e0bb5db49f25de --- /dev/null +++ b/472/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert check_Consecutive([1,2,3,4,5]) == True diff --git a/472/tests/test_mbpp_1.py b/472/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..e42b456bc805db3343d040838c2496ed52d44c2a --- /dev/null +++ b/472/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert check_Consecutive([1,2,3,5,6]) == False diff --git a/472/tests/test_mbpp_2.py b/472/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..75d28540c8f9a38513fcc66f6b05f89b8fe4acaf --- /dev/null +++ b/472/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert check_Consecutive([1,2,1]) == False diff --git a/58/instruction.md b/58/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..95d82c3822e63cfb6de08563c7ebd8f695ed205e --- /dev/null +++ b/58/instruction.md @@ -0,0 +1,3 @@ +# MBPP 58 + +Write a python function to check whether the given two integers have opposite sign or not. diff --git a/58/solution/__init__.py b/58/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/58/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/58/solution/_reference.py b/58/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..8cceea03ae74a71a9069e0cab9411eb484b13ea9 --- /dev/null +++ b/58/solution/_reference.py @@ -0,0 +1,3 @@ + +def opposite_Signs(x,y): + return ((x ^ y) < 0); \ No newline at end of file diff --git a/58/solution/solution.py b/58/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/58/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/58/solution/solve.sh b/58/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/58/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/58/task.toml b/58/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..67d689f9bc5cd379183aef009d9611465673b589 --- /dev/null +++ b/58/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/58" +name = "MBPP — 58" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/58/tests/__init__.py b/58/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/58/tests/conftest.py b/58/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/58/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/58/tests/test_mbpp_0.py b/58/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..583cb63a6785390e1e23ca1c65dbc365e3081341 --- /dev/null +++ b/58/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert opposite_Signs(1,-2) == True diff --git a/58/tests/test_mbpp_1.py b/58/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..519ad6edca54941c2d306d01def8f383e5fb4120 --- /dev/null +++ b/58/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert opposite_Signs(3,2) == False diff --git a/58/tests/test_mbpp_2.py b/58/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..524c295d38fec291306b94767dd356bf4ecd3118 --- /dev/null +++ b/58/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert opposite_Signs(-10,-10) == False diff --git a/58/tests/test_mbpp_3.py b/58/tests/test_mbpp_3.py new file mode 100644 index 0000000000000000000000000000000000000000..c4feceee660e472e89198491fb74b88f9dfc0c5f --- /dev/null +++ b/58/tests/test_mbpp_3.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_3() -> None: + assert opposite_Signs(-2,2) == True diff --git a/59/instruction.md b/59/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..1e48671a90cb329b290cd5c8593ea456d4a3d0dc --- /dev/null +++ b/59/instruction.md @@ -0,0 +1,3 @@ +# MBPP 59 + +Write a function to find the nth octagonal number. diff --git a/59/solution/__init__.py b/59/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/59/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/59/solution/_reference.py b/59/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..91369989cd3be2537256abd691b16ac0c1dd4c57 --- /dev/null +++ b/59/solution/_reference.py @@ -0,0 +1,3 @@ + +def is_octagonal(n): + return 3 * n * n - 2 * n \ No newline at end of file diff --git a/59/solution/solution.py b/59/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/59/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/59/solution/solve.sh b/59/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/59/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/59/task.toml b/59/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..dd4fb11adf58106a89ba6e8b0fa126348f677908 --- /dev/null +++ b/59/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/59" +name = "MBPP — 59" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/59/tests/__init__.py b/59/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/59/tests/conftest.py b/59/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/59/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/59/tests/test_mbpp_0.py b/59/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..645610285e369cb4b8641ec3197e910dd9a829fc --- /dev/null +++ b/59/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert is_octagonal(5) == 65 diff --git a/59/tests/test_mbpp_1.py b/59/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..5b5743b97dd25cfb9f15ae0d75867f2dba57efa7 --- /dev/null +++ b/59/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert is_octagonal(10) == 280 diff --git a/59/tests/test_mbpp_2.py b/59/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..7d5bce25f0b65eeb9075888d4f25e033160c8e37 --- /dev/null +++ b/59/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert is_octagonal(15) == 645 diff --git a/62/instruction.md b/62/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..1fc23a9e531a16a10b6b86a508c8835f15c99bb6 --- /dev/null +++ b/62/instruction.md @@ -0,0 +1,3 @@ +# MBPP 62 + +Write a python function to find smallest number in a list. diff --git a/62/solution/__init__.py b/62/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/62/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/62/solution/_reference.py b/62/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..861fe07f28e4cd3b2a2c4837090d45137c06b60c --- /dev/null +++ b/62/solution/_reference.py @@ -0,0 +1,3 @@ + +def smallest_num(xs): + return min(xs) diff --git a/62/solution/solution.py b/62/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/62/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/62/solution/solve.sh b/62/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/62/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/62/task.toml b/62/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..6c2060244b56acf36ce1330ee7faa011b16c4779 --- /dev/null +++ b/62/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/62" +name = "MBPP — 62" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/62/tests/__init__.py b/62/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/62/tests/conftest.py b/62/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/62/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/62/tests/test_mbpp_0.py b/62/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..d7e523ed0160fb2bfc186209766887aef89aad2c --- /dev/null +++ b/62/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert smallest_num([10, 20, 1, 45, 99]) == 1 diff --git a/62/tests/test_mbpp_1.py b/62/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..5a82ac19618fd7a438b674e66ad1e89972bcc421 --- /dev/null +++ b/62/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert smallest_num([1, 2, 3]) == 1 diff --git a/62/tests/test_mbpp_2.py b/62/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..af5cb4f6a2883c48c6de0f80012f4268d6b7efa6 --- /dev/null +++ b/62/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert smallest_num([45, 46, 50, 60]) == 45 diff --git a/64/instruction.md b/64/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b5cce50b5bdec14cda30e57e487df27a4dc2b590 --- /dev/null +++ b/64/instruction.md @@ -0,0 +1,3 @@ +# MBPP 64 + +Write a function to sort a list of tuples using the second value of each tuple. diff --git a/64/solution/__init__.py b/64/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/64/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/64/solution/_reference.py b/64/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..be3e067e26b20c7ceb2622a49cccce3574dfb28c --- /dev/null +++ b/64/solution/_reference.py @@ -0,0 +1,5 @@ + +def subject_marks(subjectmarks): +#subject_marks = [('English', 88), ('Science', 90), ('Maths', 97), ('Social sciences', 82)]) + subjectmarks.sort(key = lambda x: x[1]) + return subjectmarks \ No newline at end of file diff --git a/64/solution/solution.py b/64/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/64/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/64/solution/solve.sh b/64/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/64/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/64/task.toml b/64/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..07e688c387beaad2098f935f6a60e0236fc0c99d --- /dev/null +++ b/64/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/64" +name = "MBPP — 64" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/64/tests/__init__.py b/64/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/64/tests/conftest.py b/64/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/64/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/64/tests/test_mbpp_0.py b/64/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..b24e096db7a78a4d0b7e20a1b1c91916f65070b4 --- /dev/null +++ b/64/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert subject_marks([('English', 88), ('Science', 90), ('Maths', 97), ('Social sciences', 82)])==[('Social sciences', 82), ('English', 88), ('Science', 90), ('Maths', 97)] diff --git a/64/tests/test_mbpp_1.py b/64/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..0091591b37d136b2c515a08b566dc3352cd5b64b --- /dev/null +++ b/64/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert subject_marks([('Telugu',49),('Hindhi',54),('Social',33)])==([('Social',33),('Telugu',49),('Hindhi',54)]) diff --git a/64/tests/test_mbpp_2.py b/64/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..62e6cb2b2f948e139f149a53a8ba37b491e945c4 --- /dev/null +++ b/64/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert subject_marks([('Physics',96),('Chemistry',97),('Biology',45)])==([('Biology',45),('Physics',96),('Chemistry',97)]) diff --git a/67/instruction.md b/67/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c0714bf227352dd1527f06cc3b20a86e2ab85718 --- /dev/null +++ b/67/instruction.md @@ -0,0 +1,3 @@ +# MBPP 67 + +Write a function to find the number of ways to partition a set of Bell numbers. diff --git a/67/solution/__init__.py b/67/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/67/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/67/solution/_reference.py b/67/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..4a4360a37d7d7a9f0031fbbe2af3c4c0a19e40b7 --- /dev/null +++ b/67/solution/_reference.py @@ -0,0 +1,9 @@ + +def bell_number(n): + bell = [[0 for i in range(n+1)] for j in range(n+1)] + bell[0][0] = 1 + for i in range(1, n+1): + bell[i][0] = bell[i-1][i-1] + for j in range(1, i+1): + bell[i][j] = bell[i-1][j-1] + bell[i][j-1] + return bell[n][0] \ No newline at end of file diff --git a/67/solution/solution.py b/67/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/67/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/67/solution/solve.sh b/67/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/67/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/67/task.toml b/67/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..1e001076879295062fb257bf577b7735c0d27837 --- /dev/null +++ b/67/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/67" +name = "MBPP — 67" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/67/tests/__init__.py b/67/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/67/tests/conftest.py b/67/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/67/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/67/tests/test_mbpp_0.py b/67/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..510fe6c2c0fe334f15db10e94116b64d72fb5240 --- /dev/null +++ b/67/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert bell_number(2)==2 diff --git a/67/tests/test_mbpp_1.py b/67/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..9f1838dbbef3ecc4049407306bb06d93a34ef821 --- /dev/null +++ b/67/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert bell_number(10)==115975 diff --git a/67/tests/test_mbpp_2.py b/67/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..ef55cd9ad475d532974bbc0bb54a24ca808d2d9f --- /dev/null +++ b/67/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert bell_number(56)==6775685320645824322581483068371419745979053216268760300 diff --git a/72/instruction.md b/72/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..da9ac2c7795d73a7ba14e1fbcaa2bd12158b7195 --- /dev/null +++ b/72/instruction.md @@ -0,0 +1,3 @@ +# MBPP 72 + +Write a python function to check whether the given number can be represented as the difference of two squares or not. diff --git a/72/solution/__init__.py b/72/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/72/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/72/solution/_reference.py b/72/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..c5ca5d66d4870da16a53690a034062505c4e60fe --- /dev/null +++ b/72/solution/_reference.py @@ -0,0 +1,5 @@ + +def dif_Square(n): + if (n % 4 != 2): + return True + return False \ No newline at end of file diff --git a/72/solution/solution.py b/72/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/72/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/72/solution/solve.sh b/72/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/72/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/72/task.toml b/72/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..aa87b760f6c50e83863db59fe25e6698ca52376e --- /dev/null +++ b/72/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/72" +name = "MBPP — 72" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/72/tests/__init__.py b/72/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/72/tests/conftest.py b/72/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/72/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/72/tests/test_mbpp_0.py b/72/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..6796dab72a446f659851e5dc3042b78385e38fc9 --- /dev/null +++ b/72/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert dif_Square(5) == True diff --git a/72/tests/test_mbpp_1.py b/72/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..6f9ea617c5651082cc689f1fa8ff690e47d71731 --- /dev/null +++ b/72/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert dif_Square(10) == False diff --git a/72/tests/test_mbpp_2.py b/72/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..2b1ea5246b1a0c197a3a289f86c815188ebfd3ed --- /dev/null +++ b/72/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert dif_Square(15) == True diff --git a/74/instruction.md b/74/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..24797d54bb5708edef20c7ed534c7a391919db97 --- /dev/null +++ b/74/instruction.md @@ -0,0 +1,3 @@ +# MBPP 74 + +Write a function to check whether it follows the sequence given in the patterns array. diff --git a/74/solution/__init__.py b/74/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/74/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/74/solution/_reference.py b/74/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..7c8097de2f959db0feace3de343ea93723c031c5 --- /dev/null +++ b/74/solution/_reference.py @@ -0,0 +1,27 @@ + +def is_samepatterns(colors, patterns): + if len(colors) != len(patterns): + return False + sdict = {} + pset = set() + sset = set() + for i in range(len(patterns)): + pset.add(patterns[i]) + sset.add(colors[i]) + if patterns[i] not in sdict.keys(): + sdict[patterns[i]] = [] + + keys = sdict[patterns[i]] + keys.append(colors[i]) + sdict[patterns[i]] = keys + + if len(pset) != len(sset): + return False + + for values in sdict.values(): + + for i in range(len(values) - 1): + if values[i] != values[i+1]: + return False + + return True \ No newline at end of file diff --git a/74/solution/solution.py b/74/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/74/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/74/solution/solve.sh b/74/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/74/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/74/task.toml b/74/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..6b97e0d9ad8115e035a6cd1f04523dbf88104c09 --- /dev/null +++ b/74/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/74" +name = "MBPP — 74" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/74/tests/__init__.py b/74/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/74/tests/conftest.py b/74/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/74/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/74/tests/test_mbpp_0.py b/74/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..bee41b15fa1f4804b8a95b37e40b0b0e00001795 --- /dev/null +++ b/74/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert is_samepatterns(["red","green","green"], ["a", "b", "b"])==True diff --git a/74/tests/test_mbpp_1.py b/74/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..924290edf80a75d21d200ef666ebcc46aec00eab --- /dev/null +++ b/74/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert is_samepatterns(["red","green","greenn"], ["a","b","b"])==False diff --git a/74/tests/test_mbpp_2.py b/74/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..7c1624faaa7715b4a05ebdca5e4fc4537e1eee77 --- /dev/null +++ b/74/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert is_samepatterns(["red","green","greenn"], ["a","b"])==False diff --git a/75/instruction.md b/75/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..3a274c5eaf1fcf5f6388e2186881f32e521d6dff --- /dev/null +++ b/75/instruction.md @@ -0,0 +1,3 @@ +# MBPP 75 + +Write a function to find tuples which have all elements divisible by k from the given list of tuples. diff --git a/75/solution/__init__.py b/75/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/75/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/75/solution/_reference.py b/75/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..3d6ced4551b95ed4120e43870fd04f544bd7dcc1 --- /dev/null +++ b/75/solution/_reference.py @@ -0,0 +1,4 @@ + +def find_tuples(test_list, K): + res = [sub for sub in test_list if all(ele % K == 0 for ele in sub)] + return res \ No newline at end of file diff --git a/75/solution/solution.py b/75/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/75/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/75/solution/solve.sh b/75/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/75/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/75/task.toml b/75/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..316e3f8c6e2f498b4ecb36eb5eb32d4e76501f42 --- /dev/null +++ b/75/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/75" +name = "MBPP — 75" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/75/tests/__init__.py b/75/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/75/tests/conftest.py b/75/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/75/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/75/tests/test_mbpp_0.py b/75/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..9b0ae820c949c9dfd8b8c10817bde3eb91bab748 --- /dev/null +++ b/75/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert find_tuples([(6, 24, 12), (7, 9, 6), (12, 18, 21)], 6) == [(6, 24, 12)] diff --git a/75/tests/test_mbpp_1.py b/75/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..3fde84a0e5634994b185b48c3532dddde85e4f18 --- /dev/null +++ b/75/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert find_tuples([(5, 25, 30), (4, 2, 3), (7, 8, 9)], 5) == [(5, 25, 30)] diff --git a/75/tests/test_mbpp_2.py b/75/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..0c160dd10cd745f5dbaf8e1a40a3819bfadee2f3 --- /dev/null +++ b/75/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert find_tuples([(7, 9, 16), (8, 16, 4), (19, 17, 18)], 4) == [(8, 16, 4)] diff --git a/77/instruction.md b/77/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..f478f742889cde63a3e88c39357282eb58e144c6 --- /dev/null +++ b/77/instruction.md @@ -0,0 +1,3 @@ +# MBPP 77 + +Write a python function to find whether a number is divisible by 11. diff --git a/77/solution/__init__.py b/77/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/77/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/77/solution/_reference.py b/77/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..a4799a89ffbb3ed5e44f4db3cf14747f96d0c63f --- /dev/null +++ b/77/solution/_reference.py @@ -0,0 +1,3 @@ + +def is_Diff(n): + return (n % 11 == 0) \ No newline at end of file diff --git a/77/solution/solution.py b/77/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/77/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/77/solution/solve.sh b/77/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/77/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/77/task.toml b/77/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..3e96fdb3ff5e08881236f596f6416f19e1555e2e --- /dev/null +++ b/77/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/77" +name = "MBPP — 77" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/77/tests/__init__.py b/77/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/77/tests/conftest.py b/77/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/77/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/77/tests/test_mbpp_0.py b/77/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..6a14581d5dbe56b0b086bfdafbaaf42fae1e35fe --- /dev/null +++ b/77/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert is_Diff (12345) == False diff --git a/77/tests/test_mbpp_1.py b/77/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..fedeb9f1faa86f5abec3b4f9e2f2d9cae02b023f --- /dev/null +++ b/77/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert is_Diff(1212112) == True diff --git a/77/tests/test_mbpp_2.py b/77/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..435478f52db5ff762c4683772409c0a364ca09fd --- /dev/null +++ b/77/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert is_Diff(1212) == False diff --git a/83/instruction.md b/83/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..6496622d7bfc6060633a0d68de1527070877f8cd --- /dev/null +++ b/83/instruction.md @@ -0,0 +1,3 @@ +# MBPP 83 + +Write a python function to find the character made by adding the ASCII value of all the characters of the given string modulo 26. diff --git a/83/solution/__init__.py b/83/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/83/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/83/solution/_reference.py b/83/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..5a7cc79e75587ea2e3e7da9323463aae9374f647 --- /dev/null +++ b/83/solution/_reference.py @@ -0,0 +1,10 @@ + +def get_Char(strr): + summ = 0 + for i in range(len(strr)): + summ += (ord(strr[i]) - ord('a') + 1) + if (summ % 26 == 0): + return ord('z') + else: + summ = summ % 26 + return chr(ord('a') + summ - 1) \ No newline at end of file diff --git a/83/solution/solution.py b/83/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/83/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/83/solution/solve.sh b/83/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/83/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/83/task.toml b/83/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..1ab257d36878737f2dc69f6d317bbe9bc6205b73 --- /dev/null +++ b/83/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/83" +name = "MBPP — 83" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/83/tests/__init__.py b/83/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/83/tests/conftest.py b/83/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/83/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/83/tests/test_mbpp_0.py b/83/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..07da8ba5ee4cb9cd1c197e798b788732413daaa8 --- /dev/null +++ b/83/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert get_Char("abc") == "f" diff --git a/83/tests/test_mbpp_1.py b/83/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..eea6848ec1044e5bc83d67cc232347671911a13e --- /dev/null +++ b/83/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert get_Char("gfg") == "t" diff --git a/83/tests/test_mbpp_2.py b/83/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..e1873faef3544c767fe3dfbb244b80682ff3779d --- /dev/null +++ b/83/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert get_Char("ab") == "c" diff --git a/84/instruction.md b/84/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..166c1a8c81e9af290343e7578882571a55d7d424 --- /dev/null +++ b/84/instruction.md @@ -0,0 +1,3 @@ +# MBPP 84 + +Write a function to find the nth number in the newman conway sequence. diff --git a/84/solution/__init__.py b/84/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/84/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/84/solution/_reference.py b/84/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..f45a370aea66cc65316393ff754d25778f7c055a --- /dev/null +++ b/84/solution/_reference.py @@ -0,0 +1,6 @@ + +def sequence(n): + if n == 1 or n == 2: + return 1 + else: + return sequence(sequence(n-1)) + sequence(n-sequence(n-1)) \ No newline at end of file diff --git a/84/solution/solution.py b/84/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/84/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/84/solution/solve.sh b/84/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/84/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/84/task.toml b/84/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..95e6f3e4ef8212f14fc4974e19d738b902f788eb --- /dev/null +++ b/84/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/84" +name = "MBPP — 84" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/84/tests/__init__.py b/84/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/84/tests/conftest.py b/84/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/84/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/84/tests/test_mbpp_0.py b/84/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..7528b412debd310909422102b6a103ba60b4b6a7 --- /dev/null +++ b/84/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert sequence(10) == 6 diff --git a/84/tests/test_mbpp_1.py b/84/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..10d5bcb94c09c39812dfe115e31cbede174bef7b --- /dev/null +++ b/84/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert sequence(2) == 1 diff --git a/84/tests/test_mbpp_2.py b/84/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..618e61b1bc823539bfea20eb9e9313c384541ea5 --- /dev/null +++ b/84/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert sequence(3) == 2 diff --git a/85/instruction.md b/85/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..7965c673badcab8c43854a87588f53c9c12739d1 --- /dev/null +++ b/85/instruction.md @@ -0,0 +1,3 @@ +# MBPP 85 + +Write a function to find the surface area of a sphere. diff --git a/85/solution/__init__.py b/85/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/85/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/85/solution/_reference.py b/85/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..0a6f7ae55fbed07f43fa1bfa2fef8086a0e9c395 --- /dev/null +++ b/85/solution/_reference.py @@ -0,0 +1,5 @@ +import math +import math +def surfacearea_sphere(r): + surfacearea=4*math.pi*r*r + return surfacearea \ No newline at end of file diff --git a/85/solution/solution.py b/85/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/85/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/85/solution/solve.sh b/85/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/85/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/85/task.toml b/85/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..66593bdac21795f0fd6136196b1c9b9b9f947ebc --- /dev/null +++ b/85/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/85" +name = "MBPP — 85" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/85/tests/__init__.py b/85/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/85/tests/conftest.py b/85/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/85/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/85/tests/test_mbpp_0.py b/85/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..2096af07df4f09bd30d6290aef91b4ed8c9e1364 --- /dev/null +++ b/85/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert math.isclose(surfacearea_sphere(10), 1256.6370614359173, rel_tol=0.001) diff --git a/85/tests/test_mbpp_1.py b/85/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..42b012524cf574ed7f90ff2513e45393f986f3d9 --- /dev/null +++ b/85/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert math.isclose(surfacearea_sphere(15), 2827.4333882308138, rel_tol=0.001) diff --git a/85/tests/test_mbpp_2.py b/85/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..bd02e51c1453e80cf03c18c1a4caed61c0c24094 --- /dev/null +++ b/85/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert math.isclose(surfacearea_sphere(20), 5026.548245743669, rel_tol=0.001) diff --git a/95/instruction.md b/95/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..024eff4d798cc35a016a53d7da8b48474346fd62 --- /dev/null +++ b/95/instruction.md @@ -0,0 +1,3 @@ +# MBPP 95 + +Write a python function to find the length of the smallest list in a list of lists. diff --git a/95/solution/__init__.py b/95/solution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62ea3cdf9d652175e42198b21ae6d71dc49d3471 --- /dev/null +++ b/95/solution/__init__.py @@ -0,0 +1 @@ +from solution.solution import * # noqa: F401,F403 diff --git a/95/solution/_reference.py b/95/solution/_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..8195f6b3de0a20632591e0a959e9b640bdb159a1 --- /dev/null +++ b/95/solution/_reference.py @@ -0,0 +1,4 @@ + +def Find_Min_Length(lst): + minLength = min(len(x) for x in lst ) + return minLength \ No newline at end of file diff --git a/95/solution/solution.py b/95/solution/solution.py new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75ed7fbf399f024e3405ba11b08b4ba3da70 --- /dev/null +++ b/95/solution/solution.py @@ -0,0 +1,22 @@ +"""Stub solution module — agents must overwrite this file. + +Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the +canonical upstream solution at `solution/_reference.py` and this +stub at `solution/solution.py`. The pytest verifier imports from +`solution.solution`, so any attempt to run the tests against this +stub fails loudly with NotImplementedError instead of silently +passing on a pre-shipped answer. + +- Non-oracle agents: must overwrite `solution.py` with their own + attempt (the file the pytest tests import from). +- OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`) + copies `_reference.py` over `solution.py` before the verifier runs, + so oracle smoke trials still pass. +""" + +def __getattr__(name: str): + raise NotImplementedError( + f"solution.solution.{name!r} not implemented — the agent must " + f"replace this file with a real solution. Oracle agents do " + f"this via solve.sh, which copies _reference.py." + ) diff --git a/95/solution/solve.sh b/95/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0271f470918d28239240e27f502057047a05593 --- /dev/null +++ b/95/solution/solve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +HERE="$(dirname "$0")" +if [ -f "$HERE/_reference.py" ]; then + cd "$HERE" +elif [ -f "$HERE/solution/_reference.py" ]; then + cd "$HERE/solution" +else + echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2 + exit 1 +fi +cp -f _reference.py solution.py diff --git a/95/task.toml b/95/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..e9edf3374d91be3ac40b355af22ac7eab7166f1d --- /dev/null +++ b/95/task.toml @@ -0,0 +1,19 @@ +schema_version = "1" + +[task] +id = "mbpp/95" +name = "MBPP — 95" + +[environment] +os = "linux" +docker_image = "python:3.11-slim" + +[agent] +name = "oracle" + +[verifier] +name = "pytest" + +[[steps]] +name = "main" +artifacts = ["solution/solution.py"] diff --git a/95/tests/__init__.py b/95/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/95/tests/conftest.py b/95/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..15276a2c2c5ff47e715e1c78bfa99635064e69b4 --- /dev/null +++ b/95/tests/conftest.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).parent.parent)) diff --git a/95/tests/test_mbpp_0.py b/95/tests/test_mbpp_0.py new file mode 100644 index 0000000000000000000000000000000000000000..1cb0d60e6621176cd1aa84ae7ef53afed4d44a3f --- /dev/null +++ b/95/tests/test_mbpp_0.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_0() -> None: + assert Find_Min_Length([[1],[1,2]]) == 1 diff --git a/95/tests/test_mbpp_1.py b/95/tests/test_mbpp_1.py new file mode 100644 index 0000000000000000000000000000000000000000..17601d05ff755c193be6806f9b8afe59694fcab5 --- /dev/null +++ b/95/tests/test_mbpp_1.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_1() -> None: + assert Find_Min_Length([[1,2],[1,2,3],[1,2,3,4]]) == 2 diff --git a/95/tests/test_mbpp_2.py b/95/tests/test_mbpp_2.py new file mode 100644 index 0000000000000000000000000000000000000000..9bddbf9ea55f7f79f035327080e2a3e8e5a75765 --- /dev/null +++ b/95/tests/test_mbpp_2.py @@ -0,0 +1,6 @@ +# Auto-generated by loom_benchmarks.util.pytest_from_test_strings. +from solution import * # noqa: F401,F403 + + +def test_mbpp_2() -> None: + assert Find_Min_Length([[3,3,3],[4,4,4,4]]) == 3