sqy201x commited on
Commit
0e69e56
·
verified ·
1 Parent(s): 3410011

Add files using upload-large-folder tool

Browse files
101/solution/solution.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Stub solution module — agents must overwrite this file.
2
+
3
+ Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the
4
+ canonical upstream solution at `solution/_reference.py` and this
5
+ stub at `solution/solution.py`. The pytest verifier imports from
6
+ `solution.solution`, so any attempt to run the tests against this
7
+ stub fails loudly with NotImplementedError instead of silently
8
+ passing on a pre-shipped answer.
9
+
10
+ - Non-oracle agents: must overwrite `solution.py` with their own
11
+ attempt (the file the pytest tests import from).
12
+ - OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`)
13
+ copies `_reference.py` over `solution.py` before the verifier runs,
14
+ so oracle smoke trials still pass.
15
+ """
16
+
17
+ def __getattr__(name: str):
18
+ raise NotImplementedError(
19
+ f"solution.solution.{name!r} not implemented — the agent must "
20
+ f"replace this file with a real solution. Oracle agents do "
21
+ f"this via solve.sh, which copies _reference.py."
22
+ )
101/tests/__init__.py ADDED
File without changes
101/tests/conftest.py ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import sys
2
+ from pathlib import Path
3
+ sys.path.insert(0, str(Path(__file__).parent.parent))
101/tests/test_mbpp_0.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ # Auto-generated by loom_benchmarks.util.pytest_from_test_strings.
2
+ from solution import * # noqa: F401,F403
3
+
4
+
5
+ def test_mbpp_0() -> None:
6
+ assert kth_element([12,3,5,7,19], 2) == 3
101/tests/test_mbpp_1.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ # Auto-generated by loom_benchmarks.util.pytest_from_test_strings.
2
+ from solution import * # noqa: F401,F403
3
+
4
+
5
+ def test_mbpp_1() -> None:
6
+ assert kth_element([17,24,8,23], 3) == 8
101/tests/test_mbpp_2.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ # Auto-generated by loom_benchmarks.util.pytest_from_test_strings.
2
+ from solution import * # noqa: F401,F403
3
+
4
+
5
+ def test_mbpp_2() -> None:
6
+ assert kth_element([16,21,25,36,4], 4) == 36
125/instruction.md ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # MBPP 125
2
+
3
+ Write a function to find the maximum difference between the number of 0s and number of 1s in any sub-string of the given binary string.
125/solution/__init__.py ADDED
@@ -0,0 +1 @@
 
 
1
+ from solution.solution import * # noqa: F401,F403
125/solution/_reference.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ def find_length(string):
3
+ n = len(string)
4
+ current_sum = 0
5
+ max_sum = 0
6
+ for i in range(n):
7
+ current_sum += (1 if string[i] == '0' else -1)
8
+ if current_sum < 0:
9
+ current_sum = 0
10
+ max_sum = max(current_sum, max_sum)
11
+ return max_sum if max_sum else 0
125/solution/solution.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Stub solution module — agents must overwrite this file.
2
+
3
+ Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the
4
+ canonical upstream solution at `solution/_reference.py` and this
5
+ stub at `solution/solution.py`. The pytest verifier imports from
6
+ `solution.solution`, so any attempt to run the tests against this
7
+ stub fails loudly with NotImplementedError instead of silently
8
+ passing on a pre-shipped answer.
9
+
10
+ - Non-oracle agents: must overwrite `solution.py` with their own
11
+ attempt (the file the pytest tests import from).
12
+ - OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`)
13
+ copies `_reference.py` over `solution.py` before the verifier runs,
14
+ so oracle smoke trials still pass.
15
+ """
16
+
17
+ def __getattr__(name: str):
18
+ raise NotImplementedError(
19
+ f"solution.solution.{name!r} not implemented — the agent must "
20
+ f"replace this file with a real solution. Oracle agents do "
21
+ f"this via solve.sh, which copies _reference.py."
22
+ )
125/solution/solve.sh ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+ set -eu
3
+ HERE="$(dirname "$0")"
4
+ if [ -f "$HERE/_reference.py" ]; then
5
+ cd "$HERE"
6
+ elif [ -f "$HERE/solution/_reference.py" ]; then
7
+ cd "$HERE/solution"
8
+ else
9
+ echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2
10
+ exit 1
11
+ fi
12
+ cp -f _reference.py solution.py
125/task.toml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ schema_version = "1"
2
+
3
+ [task]
4
+ id = "mbpp/125"
5
+ name = "MBPP — 125"
6
+
7
+ [environment]
8
+ os = "linux"
9
+ docker_image = "python:3.11-slim"
10
+
11
+ [agent]
12
+ name = "oracle"
13
+
14
+ [verifier]
15
+ name = "pytest"
16
+
17
+ [[steps]]
18
+ name = "main"
19
+ artifacts = ["solution/solution.py"]
125/tests/__init__.py ADDED
File without changes
125/tests/test_mbpp_0.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ # Auto-generated by loom_benchmarks.util.pytest_from_test_strings.
2
+ from solution import * # noqa: F401,F403
3
+
4
+
5
+ def test_mbpp_0() -> None:
6
+ assert find_length("11000010001") == 6
125/tests/test_mbpp_1.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ # Auto-generated by loom_benchmarks.util.pytest_from_test_strings.
2
+ from solution import * # noqa: F401,F403
3
+
4
+
5
+ def test_mbpp_1() -> None:
6
+ assert find_length("10111") == 1
162/instruction.md ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # MBPP 162
2
+
3
+ Write a function to calculate the sum (n - 2*i) from i=0 to n // 2, for instance n + (n-2) + (n-4)... (until n-x =< 0).
162/solution/__init__.py ADDED
@@ -0,0 +1 @@
 
 
1
+ from solution.solution import * # noqa: F401,F403
162/solution/_reference.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+
2
+ def sum_series(n):
3
+ if n < 1:
4
+ return 0
5
+ else:
6
+ return n + sum_series(n - 2)
162/solution/solution.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Stub solution module — agents must overwrite this file.
2
+
3
+ Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the
4
+ canonical upstream solution at `solution/_reference.py` and this
5
+ stub at `solution/solution.py`. The pytest verifier imports from
6
+ `solution.solution`, so any attempt to run the tests against this
7
+ stub fails loudly with NotImplementedError instead of silently
8
+ passing on a pre-shipped answer.
9
+
10
+ - Non-oracle agents: must overwrite `solution.py` with their own
11
+ attempt (the file the pytest tests import from).
12
+ - OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`)
13
+ copies `_reference.py` over `solution.py` before the verifier runs,
14
+ so oracle smoke trials still pass.
15
+ """
16
+
17
+ def __getattr__(name: str):
18
+ raise NotImplementedError(
19
+ f"solution.solution.{name!r} not implemented — the agent must "
20
+ f"replace this file with a real solution. Oracle agents do "
21
+ f"this via solve.sh, which copies _reference.py."
22
+ )
162/task.toml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ schema_version = "1"
2
+
3
+ [task]
4
+ id = "mbpp/162"
5
+ name = "MBPP — 162"
6
+
7
+ [environment]
8
+ os = "linux"
9
+ docker_image = "python:3.11-slim"
10
+
11
+ [agent]
12
+ name = "oracle"
13
+
14
+ [verifier]
15
+ name = "pytest"
16
+
17
+ [[steps]]
18
+ name = "main"
19
+ artifacts = ["solution/solution.py"]
162/tests/__init__.py ADDED
File without changes
162/tests/test_mbpp_0.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ # Auto-generated by loom_benchmarks.util.pytest_from_test_strings.
2
+ from solution import * # noqa: F401,F403
3
+
4
+
5
+ def test_mbpp_0() -> None:
6
+ assert sum_series(6) == 12
235/instruction.md ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # MBPP 235
2
+
3
+ Write a python function to set all even bits of a given number.
235/solution/__init__.py ADDED
@@ -0,0 +1 @@
 
 
1
+ from solution.solution import * # noqa: F401,F403
235/solution/_reference.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+
2
+ def even_bit_set_number(n):
3
+ count = 0;res = 0;temp = n
4
+ while(temp > 0):
5
+ if (count % 2 == 1):
6
+ res |= (1 << count)
7
+ count+=1
8
+ temp >>= 1
9
+ return (n | res)
235/solution/solution.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Stub solution module — agents must overwrite this file.
2
+
3
+ Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the
4
+ canonical upstream solution at `solution/_reference.py` and this
5
+ stub at `solution/solution.py`. The pytest verifier imports from
6
+ `solution.solution`, so any attempt to run the tests against this
7
+ stub fails loudly with NotImplementedError instead of silently
8
+ passing on a pre-shipped answer.
9
+
10
+ - Non-oracle agents: must overwrite `solution.py` with their own
11
+ attempt (the file the pytest tests import from).
12
+ - OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`)
13
+ copies `_reference.py` over `solution.py` before the verifier runs,
14
+ so oracle smoke trials still pass.
15
+ """
16
+
17
+ def __getattr__(name: str):
18
+ raise NotImplementedError(
19
+ f"solution.solution.{name!r} not implemented — the agent must "
20
+ f"replace this file with a real solution. Oracle agents do "
21
+ f"this via solve.sh, which copies _reference.py."
22
+ )
235/solution/solve.sh ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+ set -eu
3
+ HERE="$(dirname "$0")"
4
+ if [ -f "$HERE/_reference.py" ]; then
5
+ cd "$HERE"
6
+ elif [ -f "$HERE/solution/_reference.py" ]; then
7
+ cd "$HERE/solution"
8
+ else
9
+ echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2
10
+ exit 1
11
+ fi
12
+ cp -f _reference.py solution.py
235/task.toml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ schema_version = "1"
2
+
3
+ [task]
4
+ id = "mbpp/235"
5
+ name = "MBPP — 235"
6
+
7
+ [environment]
8
+ os = "linux"
9
+ docker_image = "python:3.11-slim"
10
+
11
+ [agent]
12
+ name = "oracle"
13
+
14
+ [verifier]
15
+ name = "pytest"
16
+
17
+ [[steps]]
18
+ name = "main"
19
+ artifacts = ["solution/solution.py"]
235/tests/__init__.py ADDED
File without changes
235/tests/conftest.py ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import sys
2
+ from pathlib import Path
3
+ sys.path.insert(0, str(Path(__file__).parent.parent))
235/tests/test_mbpp_0.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ # Auto-generated by loom_benchmarks.util.pytest_from_test_strings.
2
+ from solution import * # noqa: F401,F403
3
+
4
+
5
+ def test_mbpp_0() -> None:
6
+ assert even_bit_set_number(10) == 10
235/tests/test_mbpp_1.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ # Auto-generated by loom_benchmarks.util.pytest_from_test_strings.
2
+ from solution import * # noqa: F401,F403
3
+
4
+
5
+ def test_mbpp_1() -> None:
6
+ assert even_bit_set_number(20) == 30
235/tests/test_mbpp_2.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ # Auto-generated by loom_benchmarks.util.pytest_from_test_strings.
2
+ from solution import * # noqa: F401,F403
3
+
4
+
5
+ def test_mbpp_2() -> None:
6
+ assert even_bit_set_number(30) == 30
283/instruction.md ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # MBPP 283
2
+
3
+ Write a python function takes in an integer and check whether the frequency of each digit in the integer is less than or equal to the digit itself.
398/tests/__init__.py ADDED
File without changes
458/solution/__init__.py ADDED
@@ -0,0 +1 @@
 
 
1
+ from solution.solution import * # noqa: F401,F403
458/solution/_reference.py ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+
2
+ def rectangle_area(l,b):
3
+ area=l*b
4
+ return area
458/tests/__init__.py ADDED
File without changes
458/tests/conftest.py ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import sys
2
+ from pathlib import Path
3
+ sys.path.insert(0, str(Path(__file__).parent.parent))
476/instruction.md ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # MBPP 476
2
+
3
+ Write a python function to find the sum of the largest and smallest value in a given array.
87/instruction.md ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # MBPP 87
2
+
3
+ Write a function to merge three dictionaries into a single dictionary.
87/solution/__init__.py ADDED
@@ -0,0 +1 @@
 
 
1
+ from solution.solution import * # noqa: F401,F403
87/solution/_reference.py ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+
2
+ import collections as ct
3
+ def merge_dictionaries_three(dict1,dict2, dict3):
4
+ merged_dict = dict(ct.ChainMap({},dict1,dict2,dict3))
5
+ return merged_dict
87/solution/solution.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Stub solution module — agents must overwrite this file.
2
+
3
+ Code-task bundles (HumanEval, MBPP, LiveCodeBench, ...) ship the
4
+ canonical upstream solution at `solution/_reference.py` and this
5
+ stub at `solution/solution.py`. The pytest verifier imports from
6
+ `solution.solution`, so any attempt to run the tests against this
7
+ stub fails loudly with NotImplementedError instead of silently
8
+ passing on a pre-shipped answer.
9
+
10
+ - Non-oracle agents: must overwrite `solution.py` with their own
11
+ attempt (the file the pytest tests import from).
12
+ - OracleAgent: `solve.sh` (written by `oracle_copy_reference_solve_script`)
13
+ copies `_reference.py` over `solution.py` before the verifier runs,
14
+ so oracle smoke trials still pass.
15
+ """
16
+
17
+ def __getattr__(name: str):
18
+ raise NotImplementedError(
19
+ f"solution.solution.{name!r} not implemented — the agent must "
20
+ f"replace this file with a real solution. Oracle agents do "
21
+ f"this via solve.sh, which copies _reference.py."
22
+ )
87/solution/solve.sh ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+ set -eu
3
+ HERE="$(dirname "$0")"
4
+ if [ -f "$HERE/_reference.py" ]; then
5
+ cd "$HERE"
6
+ elif [ -f "$HERE/solution/_reference.py" ]; then
7
+ cd "$HERE/solution"
8
+ else
9
+ echo "solve.sh: cannot locate _reference.py relative to $HERE" >&2
10
+ exit 1
11
+ fi
12
+ cp -f _reference.py solution.py
87/tests/__init__.py ADDED
File without changes
87/tests/conftest.py ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import sys
2
+ from pathlib import Path
3
+ sys.path.insert(0, str(Path(__file__).parent.parent))
87/tests/test_mbpp_0.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ # Auto-generated by loom_benchmarks.util.pytest_from_test_strings.
2
+ from solution import * # noqa: F401,F403
3
+
4
+
5
+ def test_mbpp_0() -> None:
6
+ assert merge_dictionaries_three({ "R": "Red", "B": "Black", "P": "Pink" }, { "G": "Green", "W": "White" },{ "O": "Orange", "W": "White", "B": "Black" })=={'B': 'Black', 'R': 'Red', 'P': 'Pink', 'G': 'Green', 'W': 'White', 'O': 'Orange'}
87/tests/test_mbpp_1.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ # Auto-generated by loom_benchmarks.util.pytest_from_test_strings.
2
+ from solution import * # noqa: F401,F403
3
+
4
+
5
+ def test_mbpp_1() -> None:
6
+ assert merge_dictionaries_three({ "R": "Red", "B": "Black", "P": "Pink" }, { "G": "Green", "W": "White" },{"L":"lavender","B":"Blue"})=={'W': 'White', 'P': 'Pink', 'B': 'Black', 'R': 'Red', 'G': 'Green', 'L': 'lavender'}
87/tests/test_mbpp_2.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ # Auto-generated by loom_benchmarks.util.pytest_from_test_strings.
2
+ from solution import * # noqa: F401,F403
3
+
4
+
5
+ def test_mbpp_2() -> None:
6
+ assert merge_dictionaries_three({ "R": "Red", "B": "Black", "P": "Pink" },{"L":"lavender","B":"Blue"},{ "G": "Green", "W": "White" })=={'B': 'Black', 'P': 'Pink', 'R': 'Red', 'G': 'Green', 'L': 'lavender', 'W': 'White'}