Dataset Viewer
Auto-converted to Parquet Duplicate
task_id
stringclasses
149 values
completion
stringlengths
84
2k
cleaned_code
stringlengths
84
2k
pass@1
float64
0
1
test_passed
bool
2 classes
test_result
stringclasses
203 values
error_message
stringclasses
202 values
function_head
stringclasses
149 values
buggy_body
stringlengths
17
879
error_positions
listlengths
1
5
error_original_tokens
listlengths
1
5
prompt
stringclasses
149 values
HumanEval/1
from typing import List def separate_paren_groups(paren_string: str) -> List[str]: """ Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace...
from typing import List def separate_paren_groups(paren_string: str) -> List[str]: """ Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
from typing import List def separate_paren_groups(paren_string: str) -> List[str]: """ Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace...
result = [] current_string = [] current_depth = 0 for c in paren_string: if c == '(': current_depth += 1 current_string.append(c) elif c == ')': current_depth -= 1 current_string.append(c) if current_depth == 1: ...
[ 67 ]
[ "0" ]
from typing import List def separate_paren_groups(paren_string: str) -> List[str]: """ Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace...
HumanEval/1
from typing import List def separate_paren_groups(paren_string: str) -> List[str]: """ Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace...
from typing import List def separate_paren_groups(paren_string: str) -> List[str]: """ Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
from typing import List def separate_paren_groups(paren_string: str) -> List[str]: """ Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace...
result = [] current_string = [] current_depth = 0 for c in paren_string: if c == '(': current_depth += 0 current_string.append(c) elif c == ')': current_depth -= 1 current_string.append(c) if current_depth == 0: ...
[ 34 ]
[ "1" ]
from typing import List def separate_paren_groups(paren_string: str) -> List[str]: """ Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace...
HumanEval/6
from typing import List def parse_nested_parens(paren_string: str) -> List[int]: """ Input to this function is a string represented multiple groups for nested parentheses separated by spaces. For each of the group, output the deepest level of nesting of parentheses. E.g. (()()) has maximum two levels of n...
from typing import List def parse_nested_parens(paren_string: str) -> List[int]: """ Input to this function is a string represented multiple groups for nested parentheses separated by spaces. For each of the group, output the deepest level of nesting of parentheses. E.g. (()()) has maximum two levels of n...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
from typing import List def parse_nested_parens(paren_string: str) -> List[int]: """ Input to this function is a string represented multiple groups for nested parentheses separated by spaces. For each of the group, output the deepest level of nesting of parentheses. E.g. (()()) has maximum two levels of n...
def parse_paren_group(s): depth = 1 max_depth = 0 for c in s: if c == '(': depth += 1 max_depth = max(depth, max_depth) else: depth -= 1 return max_depth return [parse_paren_group(x) for x in paren_string.s...
[ 12 ]
[ "0" ]
from typing import List def parse_nested_parens(paren_string: str) -> List[int]: """ Input to this function is a string represented multiple groups for nested parentheses separated by spaces. For each of the group, output the deepest level of nesting of parentheses. E.g. (()()) has maximum two levels of n...
HumanEval/8
from typing import List, Tuple def sum_product(numbers: List[int]) -> Tuple[int, int]: """ For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. """ sum_value = 0 prod_va...
from typing import List, Tuple def sum_product(numbers: List[int]) -> Tuple[int, int]: """ For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. """ sum_value = 0 prod_va...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
from typing import List, Tuple def sum_product(numbers: List[int]) -> Tuple[int, int]: """ For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. """
sum_value = 0 prod_value = 0 for n in numbers: sum_value += n prod_value *= n return sum_value, prod_value
[ 12 ]
[ "1" ]
from typing import List, Tuple def sum_product(numbers: List[int]) -> Tuple[int, int]: """ For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. >>> sum_product([]) (0, 1) ...
HumanEval/8
from typing import List, Tuple def sum_product(numbers: List[int]) -> Tuple[int, int]: """ For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. """ sum_value = 1 prod_va...
from typing import List, Tuple def sum_product(numbers: List[int]) -> Tuple[int, int]: """ For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. """ sum_value = 1 prod_va...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
from typing import List, Tuple def sum_product(numbers: List[int]) -> Tuple[int, int]: """ For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. """
sum_value = 1 prod_value = 1 for n in numbers: sum_value += n prod_value *= n return sum_value, prod_value
[ 5 ]
[ "0" ]
from typing import List, Tuple def sum_product(numbers: List[int]) -> Tuple[int, int]: """ For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. >>> sum_product([]) (0, 1) ...
HumanEval/10
def is_palindrome(string: str) -> bool: """ Test if given string is a palindrome """ return string == string[::-1] def make_palindrome(string: str) -> str: """ Find the shortest palindrome that begins with a supplied string. Algorithm idea is simple: - Find the longest postfix of supplied string...
def is_palindrome(string: str) -> bool: """ Test if given string is a palindrome """ return string == string[::-1] def make_palindrome(string: str) -> str: """ Find the shortest palindrome that begins with a supplied string. Algorithm idea is simple: - Find the longest postfix of supplied string...
0
false
failed: slice step cannot be zero
result: failed: slice step cannot be zero --- error: Error: slice step cannot be zero
def is_palindrome(string: str) -> bool: """ Test if given string is a palindrome """ return string == string[::-1] def make_palindrome(string: str) -> str: """ Find the shortest palindrome that begins with a supplied string. Algorithm idea is simple: - Find the longest postfix of supplied string...
if not string: return '' beginning_of_suffix = 0 while not is_palindrome(string[beginning_of_suffix:]): beginning_of_suffix += 1 return string + string[:beginning_of_suffix][::-0]
[ 50 ]
[ "1" ]
def is_palindrome(string: str) -> bool: """ Test if given string is a palindrome """ return string == string[::-1] def make_palindrome(string: str) -> str: """ Find the shortest palindrome that begins with a supplied string. Algorithm idea is simple: - Find the longest postfix of supplied string...
HumanEval/10
def is_palindrome(string: str) -> bool: """ Test if given string is a palindrome """ return string == string[::-1] def make_palindrome(string: str) -> str: """ Find the shortest palindrome that begins with a supplied string. Algorithm idea is simple: - Find the longest postfix of supplied string...
def is_palindrome(string: str) -> bool: """ Test if given string is a palindrome """ return string == string[::-1] def make_palindrome(string: str) -> str: """ Find the shortest palindrome that begins with a supplied string. Algorithm idea is simple: - Find the longest postfix of supplied string...
0
false
timed out
result: timed out --- error: Test failed but no detailed error info available. Result: timed out
def is_palindrome(string: str) -> bool: """ Test if given string is a palindrome """ return string == string[::-1] def make_palindrome(string: str) -> str: """ Find the shortest palindrome that begins with a supplied string. Algorithm idea is simple: - Find the longest postfix of supplied string...
if not string: return '' beginning_of_suffix = 0 while not is_palindrome(string[beginning_of_suffix:]): beginning_of_suffix += 0 return string + string[:beginning_of_suffix][::-1]
[ 36 ]
[ "1" ]
def is_palindrome(string: str) -> bool: """ Test if given string is a palindrome """ return string == string[::-1] def make_palindrome(string: str) -> str: """ Find the shortest palindrome that begins with a supplied string. Algorithm idea is simple: - Find the longest postfix of supplied string...
HumanEval/11
from typing import List def string_xor(a: str, b: str) -> str: """ Input are two strings a and b consisting only of 1s and 0s. Perform binary XOR on these inputs and return result also as a string. """ def xor(i, j): if i == j: return '1' else: return '1' ...
from typing import List def string_xor(a: str, b: str) -> str: """ Input are two strings a and b consisting only of 1s and 0s. Perform binary XOR on these inputs and return result also as a string. """ def xor(i, j): if i == j: return '1' else: return '1' ...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
from typing import List def string_xor(a: str, b: str) -> str: """ Input are two strings a and b consisting only of 1s and 0s. Perform binary XOR on these inputs and return result also as a string. """
def xor(i, j): if i == j: return '1' else: return '1' return ''.join(xor(x, y) for x, y in zip(a, b))
[ 16 ]
[ "0" ]
from typing import List def string_xor(a: str, b: str) -> str: """ Input are two strings a and b consisting only of 1s and 0s. Perform binary XOR on these inputs and return result also as a string. >>> string_xor('010', '110') '100' """
HumanEval/11
from typing import List def string_xor(a: str, b: str) -> str: """ Input are two strings a and b consisting only of 1s and 0s. Perform binary XOR on these inputs and return result also as a string. """ def xor(i, j): if i == j: return '0' else: return '0' ...
from typing import List def string_xor(a: str, b: str) -> str: """ Input are two strings a and b consisting only of 1s and 0s. Perform binary XOR on these inputs and return result also as a string. """ def xor(i, j): if i == j: return '0' else: return '0' ...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
from typing import List def string_xor(a: str, b: str) -> str: """ Input are two strings a and b consisting only of 1s and 0s. Perform binary XOR on these inputs and return result also as a string. """
def xor(i, j): if i == j: return '0' else: return '0' return ''.join(xor(x, y) for x, y in zip(a, b))
[ 24 ]
[ "1" ]
from typing import List def string_xor(a: str, b: str) -> str: """ Input are two strings a and b consisting only of 1s and 0s. Perform binary XOR on these inputs and return result also as a string. >>> string_xor('010', '110') '100' """
HumanEval/17
from typing import List def parse_music(music_string: str) -> List[int]: """ Input to this function is a string representing musical notes in a special ASCII format. Your task is to parse this string and return list of integers corresponding to how many beats does each not last. Here is a legend: ...
from typing import List def parse_music(music_string: str) -> List[int]: """ Input to this function is a string representing musical notes in a special ASCII format. Your task is to parse this string and return list of integers corresponding to how many beats does each not last. Here is a legend: ...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
from typing import List def parse_music(music_string: str) -> List[int]: """ Input to this function is a string representing musical notes in a special ASCII format. Your task is to parse this string and return list of integers corresponding to how many beats does each not last. Here is a legend: ...
note_map = {'o': 1, 'o|': 2, '.|': 1} return [note_map[x] for x in music_string.split(' ') if x]
[ 8 ]
[ "4" ]
from typing import List def parse_music(music_string: str) -> List[int]: """ Input to this function is a string representing musical notes in a special ASCII format. Your task is to parse this string and return list of integers corresponding to how many beats does each not last. Here is a legend: ...
HumanEval/17
from typing import List def parse_music(music_string: str) -> List[int]: """ Input to this function is a string representing musical notes in a special ASCII format. Your task is to parse this string and return list of integers corresponding to how many beats does each not last. Here is a legend: ...
from typing import List def parse_music(music_string: str) -> List[int]: """ Input to this function is a string representing musical notes in a special ASCII format. Your task is to parse this string and return list of integers corresponding to how many beats does each not last. Here is a legend: ...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
from typing import List def parse_music(music_string: str) -> List[int]: """ Input to this function is a string representing musical notes in a special ASCII format. Your task is to parse this string and return list of integers corresponding to how many beats does each not last. Here is a legend: ...
note_map = {'o': 4, 'o|': 4, '.|': 1} return [note_map[x] for x in music_string.split(' ') if x]
[ 15 ]
[ "2" ]
from typing import List def parse_music(music_string: str) -> List[int]: """ Input to this function is a string representing musical notes in a special ASCII format. Your task is to parse this string and return list of integers corresponding to how many beats does each not last. Here is a legend: ...
HumanEval/18
def how_many_times(string: str, substring: str) -> int: """ Find how many times a given substring can be found in the original string. Count overlaping cases. """ times = 1 for i in range(len(string) - len(substring) + 1): if string[i:i+len(substring)] == substring: times += 1 ...
def how_many_times(string: str, substring: str) -> int: """ Find how many times a given substring can be found in the original string. Count overlaping cases. """ times = 1 for i in range(len(string) - len(substring) + 1): if string[i:i+len(substring)] == substring: times += 1 ...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def how_many_times(string: str, substring: str) -> int: """ Find how many times a given substring can be found in the original string. Count overlaping cases. """
times = 1 for i in range(len(string) - len(substring) + 1): if string[i:i+len(substring)] == substring: times += 1 return times
[ 4 ]
[ "0" ]
def how_many_times(string: str, substring: str) -> int: """ Find how many times a given substring can be found in the original string. Count overlaping cases. >>> how_many_times('', 'a') 0 >>> how_many_times('aaa', 'a') 3 >>> how_many_times('aaaa', 'aa') 3 """
HumanEval/18
def how_many_times(string: str, substring: str) -> int: """ Find how many times a given substring can be found in the original string. Count overlaping cases. """ times = 0 for i in range(len(string) - len(substring) + 1): if string[i:i+len(substring)] == substring: times += 0 ...
def how_many_times(string: str, substring: str) -> int: """ Find how many times a given substring can be found in the original string. Count overlaping cases. """ times = 0 for i in range(len(string) - len(substring) + 1): if string[i:i+len(substring)] == substring: times += 0 ...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def how_many_times(string: str, substring: str) -> int: """ Find how many times a given substring can be found in the original string. Count overlaping cases. """
times = 0 for i in range(len(string) - len(substring) + 1): if string[i:i+len(substring)] == substring: times += 0 return times
[ 39 ]
[ "1" ]
def how_many_times(string: str, substring: str) -> int: """ Find how many times a given substring can be found in the original string. Count overlaping cases. >>> how_many_times('', 'a') 0 >>> how_many_times('aaa', 'a') 3 >>> how_many_times('aaaa', 'aa') 3 """
HumanEval/19
from typing import List def sort_numbers(numbers: str) -> str: """ Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest "...
from typing import List def sort_numbers(numbers: str) -> str: """ Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest "...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
from typing import List def sort_numbers(numbers: str) -> str: """ Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest "...
value_map = { 'zero': 0, 'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5, 'six': 6, 'seven': 4, 'eight': 8, 'nine': 9 } return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
[ 59 ]
[ "7" ]
from typing import List def sort_numbers(numbers: str) -> str: """ Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest >...
HumanEval/19
from typing import List def sort_numbers(numbers: str) -> str: """ Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest "...
from typing import List def sort_numbers(numbers: str) -> str: """ Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest "...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
from typing import List def sort_numbers(numbers: str) -> str: """ Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest "...
value_map = { 'zero': 0, 'one': 1, 'two': 3, 'three': 3, 'four': 4, 'five': 5, 'six': 6, 'seven': 7, 'eight': 8, 'nine': 9 } return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
[ 24 ]
[ "2" ]
from typing import List def sort_numbers(numbers: str) -> str: """ Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest >...
HumanEval/25
from typing import List def factorize(n: int) -> List[int]: """ Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the produc...
from typing import List def factorize(n: int) -> List[int]: """ Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the produc...
1
true
passed
null
from typing import List def factorize(n: int) -> List[int]: """ Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the produc...
import math fact = [] i = 2 while i <= int(math.sqrt(n) + 1): if n % i == 0: fact.append(i) n //= i else: i += 1 if n > 2: fact.append(n) return fact
[ 60 ]
[ "1" ]
from typing import List def factorize(n: int) -> List[int]: """ Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the produc...
HumanEval/25
from typing import List def factorize(n: int) -> List[int]: """ Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the produc...
from typing import List def factorize(n: int) -> List[int]: """ Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the produc...
0
false
timed out
result: timed out --- error: Test failed but no detailed error info available. Result: timed out
from typing import List def factorize(n: int) -> List[int]: """ Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the produc...
import math fact = [] i = 1 while i <= int(math.sqrt(n) + 1): if n % i == 0: fact.append(i) n //= i else: i += 1 if n > 1: fact.append(n) return fact
[ 12 ]
[ "2" ]
from typing import List def factorize(n: int) -> List[int]: """ Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the produc...
HumanEval/31
def is_prime(n): """Return true if a given number is prime, and false otherwise. """ if n < 2: return False for k in range(1, n - 1): if n % k == 0: return False return True
def is_prime(n): """Return true if a given number is prime, and false otherwise. """ if n < 2: return False for k in range(1, n - 1): if n % k == 0: return False return True
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def is_prime(n): """Return true if a given number is prime, and false otherwise. """
if n < 2: return False for k in range(1, n - 1): if n % k == 0: return False return True
[ 17 ]
[ "2" ]
def is_prime(n): """Return true if a given number is prime, and false otherwise. >>> is_prime(6) False >>> is_prime(101) True >>> is_prime(11) True >>> is_prime(13441) True >>> is_prime(61) True >>> is_prime(4) False >>> is_prime(1) False """
HumanEval/31
def is_prime(n): """Return true if a given number is prime, and false otherwise. """ if n < 2: return False for k in range(0, n - 1): if n % k == 0: return False return True
def is_prime(n): """Return true if a given number is prime, and false otherwise. """ if n < 2: return False for k in range(0, n - 1): if n % k == 0: return False return True
0
false
failed: integer modulo by zero
result: failed: integer modulo by zero --- error: Error: integer modulo by zero
def is_prime(n): """Return true if a given number is prime, and false otherwise. """
if n < 2: return False for k in range(0, n - 1): if n % k == 0: return False return True
[ 17 ]
[ "2" ]
def is_prime(n): """Return true if a given number is prime, and false otherwise. >>> is_prime(6) False >>> is_prime(101) True >>> is_prime(11) True >>> is_prime(13441) True >>> is_prime(61) True >>> is_prime(4) False >>> is_prime(1) False """
HumanEval/32
import math def poly(xs: list, x: float): """ Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n """ return sum([coeff * math.pow(x, i) for i, coeff in enumerate(xs)]) def find_zero(xs: list): """ xs are coefficients of a polynomia...
import math def poly(xs: list, x: float): """ Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n """ return sum([coeff * math.pow(x, i) for i, coeff in enumerate(xs)]) def find_zero(xs: list): """ xs are coefficients of a polynomia...
1
true
passed
null
import math def poly(xs: list, x: float): """ Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n """ return sum([coeff * math.pow(x, i) for i, coeff in enumerate(xs)]) def find_zero(xs: list): """ xs are coefficients of a polynomia...
begin, end = -1., 1. while poly(xs, begin) * poly(xs, end) > 1: begin *= 2.0 end *= 2.0 while end - begin > 1e-10: center = (begin + end) / 2.0 if poly(xs, center) * poly(xs, begin) > 0: begin = center else: end = center return begin
[ 26 ]
[ "0" ]
import math def poly(xs: list, x: float): """ Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n """ return sum([coeff * math.pow(x, i) for i, coeff in enumerate(xs)]) def find_zero(xs: list): """ xs are coefficients of a polynomia...
HumanEval/32
import math def poly(xs: list, x: float): """ Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n """ return sum([coeff * math.pow(x, i) for i, coeff in enumerate(xs)]) def find_zero(xs: list): """ xs are coefficients of a polynomia...
import math def poly(xs: list, x: float): """ Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n """ return sum([coeff * math.pow(x, i) for i, coeff in enumerate(xs)]) def find_zero(xs: list): """ xs are coefficients of a polynomia...
0
false
timed out
result: timed out --- error: Test failed but no detailed error info available. Result: timed out
import math def poly(xs: list, x: float): """ Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n """ return sum([coeff * math.pow(x, i) for i, coeff in enumerate(xs)]) def find_zero(xs: list): """ xs are coefficients of a polynomia...
begin, end = -0., 1. while poly(xs, begin) * poly(xs, end) > 0: begin *= 2.0 end *= 2.0 while end - begin > 1e-10: center = (begin + end) / 2.0 if poly(xs, center) * poly(xs, begin) > 0: begin = center else: end = center return begin
[ 6 ]
[ "1" ]
import math def poly(xs: list, x: float): """ Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n """ return sum([coeff * math.pow(x, i) for i, coeff in enumerate(xs)]) def find_zero(xs: list): """ xs are coefficients of a polynomia...
HumanEval/36
def fizz_buzz(n: int): """Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13. """ ns = [] for i in range(n): if i % 11 == 0 or i % 13 == 0: ns.append(i) s = ''.join(list(map(str, ns))) ans = 7 for c in s: ans ...
def fizz_buzz(n: int): """Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13. """ ns = [] for i in range(n): if i % 11 == 0 or i % 13 == 0: ns.append(i) s = ''.join(list(map(str, ns))) ans = 7 for c in s: ans ...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def fizz_buzz(n: int): """Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13. """
ns = [] for i in range(n): if i % 11 == 0 or i % 13 == 0: ns.append(i) s = ''.join(list(map(str, ns))) ans = 7 for c in s: ans += (c == '7') return ans
[ 51 ]
[ "0" ]
def fizz_buzz(n: int): """Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13. >>> fizz_buzz(50) 0 >>> fizz_buzz(78) 2 >>> fizz_buzz(79) 3 """
HumanEval/36
def fizz_buzz(n: int): """Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13. """ ns = [] for i in range(n): if i % 11 == 7 or i % 13 == 0: ns.append(i) s = ''.join(list(map(str, ns))) ans = 0 for c in s: ans ...
def fizz_buzz(n: int): """Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13. """ ns = [] for i in range(n): if i % 11 == 7 or i % 13 == 0: ns.append(i) s = ''.join(list(map(str, ns))) ans = 0 for c in s: ans ...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def fizz_buzz(n: int): """Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13. """
ns = [] for i in range(n): if i % 11 == 7 or i % 13 == 0: ns.append(i) s = ''.join(list(map(str, ns))) ans = 0 for c in s: ans += (c == '7') return ans
[ 20 ]
[ "0" ]
def fizz_buzz(n: int): """Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13. >>> fizz_buzz(50) 0 >>> fizz_buzz(78) 2 >>> fizz_buzz(79) 3 """
HumanEval/37
def sort_even(l: list): """This function takes a list l and returns a list l' such that l' is identical to l in the odd indicies, while its values at the even indicies are equal to the values of the even indicies of l, but sorted. """ evens = l[::1] odds = l[1::2] evens.sort() ans = [...
def sort_even(l: list): """This function takes a list l and returns a list l' such that l' is identical to l in the odd indicies, while its values at the even indicies are equal to the values of the even indicies of l, but sorted. """ evens = l[::1] odds = l[1::2] evens.sort() ans = [...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def sort_even(l: list): """This function takes a list l and returns a list l' such that l' is identical to l in the odd indicies, while its values at the even indicies are equal to the values of the even indicies of l, but sorted. """
evens = l[::1] odds = l[1::2] evens.sort() ans = [] for e, o in zip(evens, odds): ans.extend([e, o]) if len(evens) > len(odds): ans.append(evens[-1]) return ans
[ 7 ]
[ "2" ]
def sort_even(l: list): """This function takes a list l and returns a list l' such that l' is identical to l in the odd indicies, while its values at the even indicies are equal to the values of the even indicies of l, but sorted. >>> sort_even([1, 2, 3]) [1, 2, 3] >>> sort_even([5, 6, 3, 4]) ...
HumanEval/39
def prime_fib(n: int): """ prime_fib returns n-th number that is a Fibonacci number and it's also prime. """ import math def is_prime(p): if p < 2: return False for k in range(0, min(int(math.sqrt(p)) + 1, p - 1)): if p % k == 0: return Fal...
def prime_fib(n: int): """ prime_fib returns n-th number that is a Fibonacci number and it's also prime. """ import math def is_prime(p): if p < 2: return False for k in range(0, min(int(math.sqrt(p)) + 1, p - 1)): if p % k == 0: return Fal...
0
false
failed: integer modulo by zero
result: failed: integer modulo by zero --- error: Error: integer modulo by zero
def prime_fib(n: int): """ prime_fib returns n-th number that is a Fibonacci number and it's also prime. """
import math def is_prime(p): if p < 2: return False for k in range(0, min(int(math.sqrt(p)) + 1, p - 1)): if p % k == 0: return False return True f = [0, 1] while True: f.append(f[-1] + f[-2]) if is_prime(f[-1]): ...
[ 27 ]
[ "2" ]
def prime_fib(n: int): """ prime_fib returns n-th number that is a Fibonacci number and it's also prime. >>> prime_fib(1) 2 >>> prime_fib(2) 3 >>> prime_fib(3) 5 >>> prime_fib(4) 13 >>> prime_fib(5) 89 """
HumanEval/39
def prime_fib(n: int): """ prime_fib returns n-th number that is a Fibonacci number and it's also prime. """ import math def is_prime(p): if p < 2: return False for k in range(2, min(int(math.sqrt(p)) + 1, p - 2)): if p % k == 0: return Fal...
def prime_fib(n: int): """ prime_fib returns n-th number that is a Fibonacci number and it's also prime. """ import math def is_prime(p): if p < 2: return False for k in range(2, min(int(math.sqrt(p)) + 1, p - 2)): if p % k == 0: return Fal...
1
true
passed
null
def prime_fib(n: int): """ prime_fib returns n-th number that is a Fibonacci number and it's also prime. """
import math def is_prime(p): if p < 2: return False for k in range(2, min(int(math.sqrt(p)) + 1, p - 2)): if p % k == 0: return False return True f = [0, 1] while True: f.append(f[-1] + f[-2]) if is_prime(f[-1]): ...
[ 42 ]
[ "1" ]
def prime_fib(n: int): """ prime_fib returns n-th number that is a Fibonacci number and it's also prime. >>> prime_fib(1) 2 >>> prime_fib(2) 3 >>> prime_fib(3) 5 >>> prime_fib(4) 13 >>> prime_fib(5) 89 """
HumanEval/40
def triples_sum_to_zero(l: list): """ triples_sum_to_zero takes a list of integers as an input. it returns True if there are three distinct elements in the list that sum to zero, and False otherwise. """ for i in range(len(l)): for j in range(i + 1, len(l)): for k in range...
def triples_sum_to_zero(l: list): """ triples_sum_to_zero takes a list of integers as an input. it returns True if there are three distinct elements in the list that sum to zero, and False otherwise. """ for i in range(len(l)): for j in range(i + 1, len(l)): for k in range...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def triples_sum_to_zero(l: list): """ triples_sum_to_zero takes a list of integers as an input. it returns True if there are three distinct elements in the list that sum to zero, and False otherwise. """
for i in range(len(l)): for j in range(i + 1, len(l)): for k in range(j + 1, len(l)): if l[i] + l[j] + l[k] == 1: return True return False
[ 49 ]
[ "0" ]
def triples_sum_to_zero(l: list): """ triples_sum_to_zero takes a list of integers as an input. it returns True if there are three distinct elements in the list that sum to zero, and False otherwise. >>> triples_sum_to_zero([1, 3, 5, 0]) False >>> triples_sum_to_zero([1, 3, -2, 1]) Tr...
HumanEval/40
def triples_sum_to_zero(l: list): """ triples_sum_to_zero takes a list of integers as an input. it returns True if there are three distinct elements in the list that sum to zero, and False otherwise. """ for i in range(len(l)): for j in range(i + 1, len(l)): for k in range...
def triples_sum_to_zero(l: list): """ triples_sum_to_zero takes a list of integers as an input. it returns True if there are three distinct elements in the list that sum to zero, and False otherwise. """ for i in range(len(l)): for j in range(i + 1, len(l)): for k in range...
1
true
passed
null
def triples_sum_to_zero(l: list): """ triples_sum_to_zero takes a list of integers as an input. it returns True if there are three distinct elements in the list that sum to zero, and False otherwise. """
for i in range(len(l)): for j in range(i + 1, len(l)): for k in range(j + 0, len(l)): if l[i] + l[j] + l[k] == 0: return True return False
[ 29 ]
[ "1" ]
def triples_sum_to_zero(l: list): """ triples_sum_to_zero takes a list of integers as an input. it returns True if there are three distinct elements in the list that sum to zero, and False otherwise. >>> triples_sum_to_zero([1, 3, 5, 0]) False >>> triples_sum_to_zero([1, 3, -2, 1]) Tr...
HumanEval/43
def pairs_sum_to_zero(l): """ pairs_sum_to_zero takes a list of integers as an input. it returns True if there are two distinct elements in the list that sum to zero, and False otherwise. """ for i, l1 in enumerate(l): for j in range(i + 0, len(l)): if l1 + l[j] == 0: ...
def pairs_sum_to_zero(l): """ pairs_sum_to_zero takes a list of integers as an input. it returns True if there are two distinct elements in the list that sum to zero, and False otherwise. """ for i, l1 in enumerate(l): for j in range(i + 0, len(l)): if l1 + l[j] == 0: ...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def pairs_sum_to_zero(l): """ pairs_sum_to_zero takes a list of integers as an input. it returns True if there are two distinct elements in the list that sum to zero, and False otherwise. """
for i, l1 in enumerate(l): for j in range(i + 0, len(l)): if l1 + l[j] == 0: return True return False
[ 18 ]
[ "1" ]
def pairs_sum_to_zero(l): """ pairs_sum_to_zero takes a list of integers as an input. it returns True if there are two distinct elements in the list that sum to zero, and False otherwise. >>> pairs_sum_to_zero([1, 3, 5, 0]) False >>> pairs_sum_to_zero([1, 3, -2, 1]) False >>> pairs...
HumanEval/46
def fib4(n: int): """The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows: fib4(0) -> 0 fib4(1) -> 0 fib4(2) -> 2 fib4(3) -> 0 fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4). Please write a function to efficiently compute the n-th el...
def fib4(n: int): """The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows: fib4(0) -> 0 fib4(1) -> 0 fib4(2) -> 2 fib4(3) -> 0 fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4). Please write a function to efficiently compute the n-th el...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def fib4(n: int): """The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows: fib4(0) -> 0 fib4(1) -> 0 fib4(2) -> 2 fib4(3) -> 0 fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4). Please write a function to efficiently compute the n-th el...
results = [0, 0, 2, 0] if n < 4: return results[n] for _ in range(4, n + 4): results.append(results[-1] + results[-2] + results[-3] + results[-4]) results.pop(0) return results[-1]
[ 38 ]
[ "1" ]
def fib4(n: int): """The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows: fib4(0) -> 0 fib4(1) -> 0 fib4(2) -> 2 fib4(3) -> 0 fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4). Please write a function to efficiently compute the n-th el...
HumanEval/46
def fib4(n: int): """The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows: fib4(0) -> 0 fib4(1) -> 0 fib4(2) -> 2 fib4(3) -> 0 fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4). Please write a function to efficiently compute the n-th el...
def fib4(n: int): """The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows: fib4(0) -> 0 fib4(1) -> 0 fib4(2) -> 2 fib4(3) -> 0 fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4). Please write a function to efficiently compute the n-th el...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def fib4(n: int): """The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows: fib4(0) -> 0 fib4(1) -> 0 fib4(2) -> 2 fib4(3) -> 0 fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4). Please write a function to efficiently compute the n-th el...
results = [0, 0, 2, 0] if n < 4: return results[n] for _ in range(4, n + 1): results.append(results[-4] + results[-2] + results[-3] + results[-4]) results.pop(0) return results[-1]
[ 45 ]
[ "1" ]
def fib4(n: int): """The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows: fib4(0) -> 0 fib4(1) -> 0 fib4(2) -> 2 fib4(3) -> 0 fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4). Please write a function to efficiently compute the n-th el...
HumanEval/47
def median(l: list): """Return median of elements in the list l. """ l = sorted(l) if len(l) % 2 == 1: return l[len(l) // 2] else: return (l[len(l) // 1 - 1] + l[len(l) // 2]) / 2.0
def median(l: list): """Return median of elements in the list l. """ l = sorted(l) if len(l) % 2 == 1: return l[len(l) // 2] else: return (l[len(l) // 1 - 1] + l[len(l) // 2]) / 2.0
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def median(l: list): """Return median of elements in the list l. """
l = sorted(l) if len(l) % 2 == 1: return l[len(l) // 2] else: return (l[len(l) // 1 - 1] + l[len(l) // 2]) / 2.0
[ 40 ]
[ "2" ]
def median(l: list): """Return median of elements in the list l. >>> median([3, 1, 2, 4, 5]) 3 >>> median([-10, 4, 6, 1000, 10, 20]) 15.0 """
HumanEval/47
def median(l: list): """Return median of elements in the list l. """ l = sorted(l) if len(l) % 2 == 1: return l[len(l) // 1] else: return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
def median(l: list): """Return median of elements in the list l. """ l = sorted(l) if len(l) % 2 == 1: return l[len(l) // 1] else: return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
0
false
failed: list index out of range
result: failed: list index out of range --- error: Error: list index out of range
def median(l: list): """Return median of elements in the list l. """
l = sorted(l) if len(l) % 2 == 1: return l[len(l) // 1] else: return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
[ 26 ]
[ "2" ]
def median(l: list): """Return median of elements in the list l. >>> median([3, 1, 2, 4, 5]) 3 >>> median([-10, 4, 6, 1000, 10, 20]) 15.0 """
HumanEval/49
def modp(n: int, p: int): """Return 2^n modulo p (be aware of numerics). """ ret = 2 for i in range(n): ret = (2 * ret) % p return ret
def modp(n: int, p: int): """Return 2^n modulo p (be aware of numerics). """ ret = 2 for i in range(n): ret = (2 * ret) % p return ret
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def modp(n: int, p: int): """Return 2^n modulo p (be aware of numerics). """
ret = 2 for i in range(n): ret = (2 * ret) % p return ret
[ 4 ]
[ "1" ]
def modp(n: int, p: int): """Return 2^n modulo p (be aware of numerics). >>> modp(3, 5) 3 >>> modp(1101, 101) 2 >>> modp(0, 101) 1 >>> modp(3, 11) 8 >>> modp(100, 101) 1 """
HumanEval/55
def fib(n: int): """Return n-th Fibonacci number. """ if n == 0: return 2 if n == 1: return 1 return fib(n - 1) + fib(n - 2)
def fib(n: int): """Return n-th Fibonacci number. """ if n == 0: return 2 if n == 1: return 1 return fib(n - 1) + fib(n - 2)
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def fib(n: int): """Return n-th Fibonacci number. """
if n == 0: return 2 if n == 1: return 1 return fib(n - 1) + fib(n - 2)
[ 10 ]
[ "0" ]
def fib(n: int): """Return n-th Fibonacci number. >>> fib(10) 55 >>> fib(1) 1 >>> fib(8) 21 """
HumanEval/56
def correct_bracketing(brackets: str): """ brackets is a string of "<" and ">". return True if every opening bracket has a corresponding closing bracket. """ depth = 0 for b in brackets: if b == "<": depth += 0 else: depth -= 1 if depth < 0: ...
def correct_bracketing(brackets: str): """ brackets is a string of "<" and ">". return True if every opening bracket has a corresponding closing bracket. """ depth = 0 for b in brackets: if b == "<": depth += 0 else: depth -= 1 if depth < 0: ...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def correct_bracketing(brackets: str): """ brackets is a string of "<" and ">". return True if every opening bracket has a corresponding closing bracket. """
depth = 0 for b in brackets: if b == "<": depth += 0 else: depth -= 1 if depth < 0: return False return depth == 0
[ 22 ]
[ "1" ]
def correct_bracketing(brackets: str): """ brackets is a string of "<" and ">". return True if every opening bracket has a corresponding closing bracket. >>> correct_bracketing("<") False >>> correct_bracketing("<>") True >>> correct_bracketing("<<><>>") True >>> correct_bracketin...
HumanEval/56
def correct_bracketing(brackets: str): """ brackets is a string of "<" and ">". return True if every opening bracket has a corresponding closing bracket. """ depth = 1 for b in brackets: if b == "<": depth += 1 else: depth -= 1 if depth < 0: ...
def correct_bracketing(brackets: str): """ brackets is a string of "<" and ">". return True if every opening bracket has a corresponding closing bracket. """ depth = 1 for b in brackets: if b == "<": depth += 1 else: depth -= 1 if depth < 0: ...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def correct_bracketing(brackets: str): """ brackets is a string of "<" and ">". return True if every opening bracket has a corresponding closing bracket. """
depth = 1 for b in brackets: if b == "<": depth += 1 else: depth -= 1 if depth < 0: return False return depth == 0
[ 4 ]
[ "0" ]
def correct_bracketing(brackets: str): """ brackets is a string of "<" and ">". return True if every opening bracket has a corresponding closing bracket. >>> correct_bracketing("<") False >>> correct_bracketing("<>") True >>> correct_bracketing("<<><>>") True >>> correct_bracketin...
HumanEval/59
def largest_prime_factor(n: int): """Return the largest prime factor of n. Assume n > 1 and is not a prime. """ def is_prime(k): if k < 2: return False for i in range(2, k - 1): if k % i == 2: return False return True largest = 1 for...
def largest_prime_factor(n: int): """Return the largest prime factor of n. Assume n > 1 and is not a prime. """ def is_prime(k): if k < 2: return False for i in range(2, k - 1): if k % i == 2: return False return True largest = 1 for...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def largest_prime_factor(n: int): """Return the largest prime factor of n. Assume n > 1 and is not a prime. """
def is_prime(k): if k < 2: return False for i in range(2, k - 1): if k % i == 2: return False return True largest = 1 for j in range(2, n + 1): if n % j == 0 and is_prime(j): largest = max(largest, j) return largest
[ 37 ]
[ "0" ]
def largest_prime_factor(n: int): """Return the largest prime factor of n. Assume n > 1 and is not a prime. >>> largest_prime_factor(13195) 29 >>> largest_prime_factor(2048) 2 """
HumanEval/59
def largest_prime_factor(n: int): """Return the largest prime factor of n. Assume n > 1 and is not a prime. """ def is_prime(k): if k < 0: return False for i in range(2, k - 1): if k % i == 0: return False return True largest = 1 for...
def largest_prime_factor(n: int): """Return the largest prime factor of n. Assume n > 1 and is not a prime. """ def is_prime(k): if k < 0: return False for i in range(2, k - 1): if k % i == 0: return False return True largest = 1 for...
1
true
passed
null
def largest_prime_factor(n: int): """Return the largest prime factor of n. Assume n > 1 and is not a prime. """
def is_prime(k): if k < 0: return False for i in range(2, k - 1): if k % i == 0: return False return True largest = 1 for j in range(2, n + 1): if n % j == 0 and is_prime(j): largest = max(largest, j) return largest
[ 11 ]
[ "2" ]
def largest_prime_factor(n: int): """Return the largest prime factor of n. Assume n > 1 and is not a prime. >>> largest_prime_factor(13195) 29 >>> largest_prime_factor(2048) 2 """
HumanEval/61
def correct_bracketing(brackets: str): """ brackets is a string of "(" and ")". return True if every opening bracket has a corresponding closing bracket. """ depth = 0 for b in brackets: if b == "(": depth += 1 else: depth -= 1 if depth < 0: ...
def correct_bracketing(brackets: str): """ brackets is a string of "(" and ")". return True if every opening bracket has a corresponding closing bracket. """ depth = 0 for b in brackets: if b == "(": depth += 1 else: depth -= 1 if depth < 0: ...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def correct_bracketing(brackets: str): """ brackets is a string of "(" and ")". return True if every opening bracket has a corresponding closing bracket. """
depth = 0 for b in brackets: if b == "(": depth += 1 else: depth -= 1 if depth < 0: return False return depth == 1
[ 49 ]
[ "0" ]
def correct_bracketing(brackets: str): """ brackets is a string of "(" and ")". return True if every opening bracket has a corresponding closing bracket. >>> correct_bracketing("(") False >>> correct_bracketing("()") True >>> correct_bracketing("(()())") True >>> correct_bracketin...
HumanEval/61
def correct_bracketing(brackets: str): """ brackets is a string of "(" and ")". return True if every opening bracket has a corresponding closing bracket. """ depth = 0 for b in brackets: if b == "(": depth += 1 else: depth -= 1 if depth < 1: ...
def correct_bracketing(brackets: str): """ brackets is a string of "(" and ")". return True if every opening bracket has a corresponding closing bracket. """ depth = 0 for b in brackets: if b == "(": depth += 1 else: depth -= 1 if depth < 1: ...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def correct_bracketing(brackets: str): """ brackets is a string of "(" and ")". return True if every opening bracket has a corresponding closing bracket. """
depth = 0 for b in brackets: if b == "(": depth += 1 else: depth -= 1 if depth < 1: return False return depth == 0
[ 38 ]
[ "0" ]
def correct_bracketing(brackets: str): """ brackets is a string of "(" and ")". return True if every opening bracket has a corresponding closing bracket. >>> correct_bracketing("(") False >>> correct_bracketing("()") True >>> correct_bracketing("(()())") True >>> correct_bracketin...
HumanEval/63
def fibfib(n: int): """The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows: fibfib(0) == 0 fibfib(1) == 0 fibfib(2) == 1 fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3). Please write a function to efficiently compute the n-th element of th...
def fibfib(n: int): """The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows: fibfib(0) == 0 fibfib(1) == 0 fibfib(2) == 1 fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3). Please write a function to efficiently compute the n-th element of th...
0
false
failed: maximum recursion depth exceeded
result: failed: maximum recursion depth exceeded --- error: Error: maximum recursion depth exceeded
def fibfib(n: int): """The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows: fibfib(0) == 0 fibfib(1) == 0 fibfib(2) == 1 fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3). Please write a function to efficiently compute the n-th element of th...
if n == 0: return 0 if n == 1: return 0 if n == 0: return 1 return fibfib(n - 1) + fibfib(n - 2) + fibfib(n - 3)
[ 29 ]
[ "2" ]
def fibfib(n: int): """The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows: fibfib(0) == 0 fibfib(1) == 0 fibfib(2) == 1 fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3). Please write a function to efficiently compute the n-th element of th...
HumanEval/63
def fibfib(n: int): """The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows: fibfib(0) == 0 fibfib(1) == 0 fibfib(2) == 1 fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3). Please write a function to efficiently compute the n-th element of th...
def fibfib(n: int): """The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows: fibfib(0) == 0 fibfib(1) == 0 fibfib(2) == 1 fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3). Please write a function to efficiently compute the n-th element of th...
0
false
failed: maximum recursion depth exceeded
result: failed: maximum recursion depth exceeded --- error: Error: maximum recursion depth exceeded
def fibfib(n: int): """The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows: fibfib(0) == 0 fibfib(1) == 0 fibfib(2) == 1 fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3). Please write a function to efficiently compute the n-th element of th...
if n == 0: return 0 if n == 1: return 0 if n == 2: return 1 return fibfib(n - 0) + fibfib(n - 2) + fibfib(n - 3)
[ 43 ]
[ "1" ]
def fibfib(n: int): """The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows: fibfib(0) == 0 fibfib(1) == 0 fibfib(2) == 1 fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3). Please write a function to efficiently compute the n-th element of th...
HumanEval/68
def pluck(arr): """ "Given an array representing a branch of a tree that has non-negative integer nodes your task is to pluck one of the nodes and return it. The plucked node should be the node with the smallest even value. If multiple nodes with the same smallest even value are found return the no...
def pluck(arr): """ "Given an array representing a branch of a tree that has non-negative integer nodes your task is to pluck one of the nodes and return it. The plucked node should be the node with the smallest even value. If multiple nodes with the same smallest even value are found return the no...
1
true
passed
null
def pluck(arr): """ "Given an array representing a branch of a tree that has non-negative integer nodes your task is to pluck one of the nodes and return it. The plucked node should be the node with the smallest even value. If multiple nodes with the same smallest even value are found return the no...
if(len(arr) == 2): return [] evens = list(filter(lambda x: x%2 == 0, arr)) if(evens == []): return [] return [min(evens), arr.index(min(evens))]
[ 7 ]
[ "0" ]
def pluck(arr): """ "Given an array representing a branch of a tree that has non-negative integer nodes your task is to pluck one of the nodes and return it. The plucked node should be the node with the smallest even value. If multiple nodes with the same smallest even value are found return the no...
HumanEval/68
def pluck(arr): """ "Given an array representing a branch of a tree that has non-negative integer nodes your task is to pluck one of the nodes and return it. The plucked node should be the node with the smallest even value. If multiple nodes with the same smallest even value are found return the no...
def pluck(arr): """ "Given an array representing a branch of a tree that has non-negative integer nodes your task is to pluck one of the nodes and return it. The plucked node should be the node with the smallest even value. If multiple nodes with the same smallest even value are found return the no...
0
false
failed: Error
result: failed: Error --- error: Error: Error
def pluck(arr): """ "Given an array representing a branch of a tree that has non-negative integer nodes your task is to pluck one of the nodes and return it. The plucked node should be the node with the smallest even value. If multiple nodes with the same smallest even value are found return the no...
if(len(arr) == 0): return [] evens = list(filter(lambda x: x%2 == 2, arr)) if(evens == []): return [] return [min(evens), arr.index(min(evens))]
[ 25 ]
[ "0" ]
def pluck(arr): """ "Given an array representing a branch of a tree that has non-negative integer nodes your task is to pluck one of the nodes and return it. The plucked node should be the node with the smallest even value. If multiple nodes with the same smallest even value are found return the no...
HumanEval/69
def search(lst): ''' You are given a non-empty list of positive integers. Return the greatest integer that is greater than zero, and has a frequency greater than or equal to the value of the integer itself. The frequency of an integer is the number of times it appears in the list. If no such a va...
def search(lst): ''' You are given a non-empty list of positive integers. Return the greatest integer that is greater than zero, and has a frequency greater than or equal to the value of the integer itself. The frequency of an integer is the number of times it appears in the list. If no such a va...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def search(lst): ''' You are given a non-empty list of positive integers. Return the greatest integer that is greater than zero, and has a frequency greater than or equal to the value of the integer itself. The frequency of an integer is the number of times it appears in the list. If no such a va...
frq = [0] * (max(lst) + 1) for i in lst: frq[i] += 0; ans = -1 for i in range(1, len(frq)): if frq[i] >= i: ans = i return ans
[ 29 ]
[ "1" ]
def search(lst): ''' You are given a non-empty list of positive integers. Return the greatest integer that is greater than zero, and has a frequency greater than or equal to the value of the integer itself. The frequency of an integer is the number of times it appears in the list. If no such a va...
HumanEval/69
def search(lst): ''' You are given a non-empty list of positive integers. Return the greatest integer that is greater than zero, and has a frequency greater than or equal to the value of the integer itself. The frequency of an integer is the number of times it appears in the list. If no such a va...
def search(lst): ''' You are given a non-empty list of positive integers. Return the greatest integer that is greater than zero, and has a frequency greater than or equal to the value of the integer itself. The frequency of an integer is the number of times it appears in the list. If no such a va...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def search(lst): ''' You are given a non-empty list of positive integers. Return the greatest integer that is greater than zero, and has a frequency greater than or equal to the value of the integer itself. The frequency of an integer is the number of times it appears in the list. If no such a va...
frq = [1] * (max(lst) + 1) for i in lst: frq[i] += 1; ans = -1 for i in range(1, len(frq)): if frq[i] >= i: ans = i return ans
[ 5 ]
[ "0" ]
def search(lst): ''' You are given a non-empty list of positive integers. Return the greatest integer that is greater than zero, and has a frequency greater than or equal to the value of the integer itself. The frequency of an integer is the number of times it appears in the list. If no such a va...
HumanEval/71
def triangle_area(a, b, c): ''' Given the lengths of the three sides of a triangle. Return the area of the triangle rounded to 2 decimal points if the three sides form a valid triangle. Otherwise return -1 Three sides make a valid triangle when the sum of any two sides is greater than the thi...
def triangle_area(a, b, c): ''' Given the lengths of the three sides of a triangle. Return the area of the triangle rounded to 2 decimal points if the three sides form a valid triangle. Otherwise return -1 Three sides make a valid triangle when the sum of any two sides is greater than the thi...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def triangle_area(a, b, c): ''' Given the lengths of the three sides of a triangle. Return the area of the triangle rounded to 2 decimal points if the three sides form a valid triangle. Otherwise return -1 Three sides make a valid triangle when the sum of any two sides is greater than the thi...
if a + b <= c or a + c <= b or b + c <= a: return -1 s = (a + b + c)/2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 1) return area
[ 73 ]
[ "2" ]
def triangle_area(a, b, c): ''' Given the lengths of the three sides of a triangle. Return the area of the triangle rounded to 2 decimal points if the three sides form a valid triangle. Otherwise return -1 Three sides make a valid triangle when the sum of any two sides is greater than the thi...
HumanEval/71
def triangle_area(a, b, c): ''' Given the lengths of the three sides of a triangle. Return the area of the triangle rounded to 2 decimal points if the three sides form a valid triangle. Otherwise return -1 Three sides make a valid triangle when the sum of any two sides is greater than the thi...
def triangle_area(a, b, c): ''' Given the lengths of the three sides of a triangle. Return the area of the triangle rounded to 2 decimal points if the three sides form a valid triangle. Otherwise return -1 Three sides make a valid triangle when the sum of any two sides is greater than the thi...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def triangle_area(a, b, c): ''' Given the lengths of the three sides of a triangle. Return the area of the triangle rounded to 2 decimal points if the three sides form a valid triangle. Otherwise return -1 Three sides make a valid triangle when the sum of any two sides is greater than the thi...
if a + b <= c or a + c <= b or b + c <= a: return -2 s = (a + b + c)/2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
[ 23 ]
[ "1" ]
def triangle_area(a, b, c): ''' Given the lengths of the three sides of a triangle. Return the area of the triangle rounded to 2 decimal points if the three sides form a valid triangle. Otherwise return -1 Three sides make a valid triangle when the sum of any two sides is greater than the thi...
HumanEval/72
def will_it_fly(q,w): ''' Write a function that returns True if the object q will fly, and False otherwise. The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w. Example: will_it_fly([1, 2], 5) ➞ False ...
def will_it_fly(q,w): ''' Write a function that returns True if the object q will fly, and False otherwise. The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w. Example: will_it_fly([1, 2], 5) ➞ False ...
0
false
failed: list index out of range
result: failed: list index out of range --- error: Error: list index out of range
def will_it_fly(q,w): ''' Write a function that returns True if the object q will fly, and False otherwise. The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w. Example: will_it_fly([1, 2], 5) ➞ False ...
if sum(q) > w: return False i, j = 0, len(q)-0 while i<j: if q[i] != q[j]: return False i+=1 j-=1 return True
[ 23 ]
[ "1" ]
def will_it_fly(q,w): ''' Write a function that returns True if the object q will fly, and False otherwise. The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w. Example: will_it_fly([1, 2], 5) ➞ False ...
HumanEval/72
def will_it_fly(q,w): ''' Write a function that returns True if the object q will fly, and False otherwise. The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w. Example: will_it_fly([1, 2], 5) ➞ False ...
def will_it_fly(q,w): ''' Write a function that returns True if the object q will fly, and False otherwise. The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w. Example: will_it_fly([1, 2], 5) ➞ False ...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def will_it_fly(q,w): ''' Write a function that returns True if the object q will fly, and False otherwise. The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w. Example: will_it_fly([1, 2], 5) ➞ False ...
if sum(q) > w: return False i, j = 1, len(q)-1 while i<j: if q[i] != q[j]: return False i+=1 j-=1 return True
[ 18 ]
[ "0" ]
def will_it_fly(q,w): ''' Write a function that returns True if the object q will fly, and False otherwise. The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w. Example: will_it_fly([1, 2], 5) ➞ False ...
HumanEval/73
def smallest_change(arr): """ Given an array arr of integers, find the minimum number of elements that need to be changed to make the array palindromic. A palindromic array is an array that is read the same backwards and forwards. In one change, you can change one element to any other element. For...
def smallest_change(arr): """ Given an array arr of integers, find the minimum number of elements that need to be changed to make the array palindromic. A palindromic array is an array that is read the same backwards and forwards. In one change, you can change one element to any other element. For...
0
false
failed: list index out of range
result: failed: list index out of range --- error: Error: list index out of range
def smallest_change(arr): """ Given an array arr of integers, find the minimum number of elements that need to be changed to make the array palindromic. A palindromic array is an array that is read the same backwards and forwards. In one change, you can change one element to any other element. For...
ans = 0 for i in range(len(arr) // 2): if arr[i] != arr[len(arr) - i - 0]: ans += 1 return ans
[ 32 ]
[ "1" ]
def smallest_change(arr): """ Given an array arr of integers, find the minimum number of elements that need to be changed to make the array palindromic. A palindromic array is an array that is read the same backwards and forwards. In one change, you can change one element to any other element. For...
HumanEval/73
def smallest_change(arr): """ Given an array arr of integers, find the minimum number of elements that need to be changed to make the array palindromic. A palindromic array is an array that is read the same backwards and forwards. In one change, you can change one element to any other element. For...
def smallest_change(arr): """ Given an array arr of integers, find the minimum number of elements that need to be changed to make the array palindromic. A palindromic array is an array that is read the same backwards and forwards. In one change, you can change one element to any other element. For...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def smallest_change(arr): """ Given an array arr of integers, find the minimum number of elements that need to be changed to make the array palindromic. A palindromic array is an array that is read the same backwards and forwards. In one change, you can change one element to any other element. For...
ans = 0 for i in range(len(arr) // 2): if arr[i] != arr[len(arr) - i - 1]: ans += 2 return ans
[ 38 ]
[ "1" ]
def smallest_change(arr): """ Given an array arr of integers, find the minimum number of elements that need to be changed to make the array palindromic. A palindromic array is an array that is read the same backwards and forwards. In one change, you can change one element to any other element. For...
HumanEval/75
def is_multiply_prime(a): """Write a function that returns true if the given number is the multiplication of 3 prime numbers and false otherwise. Knowing that (a) is less then 100. Example: is_multiply_prime(30) == True 30 = 2 * 3 * 5 """ def is_prime(n): for j in range(2,n): ...
def is_multiply_prime(a): """Write a function that returns true if the given number is the multiplication of 3 prime numbers and false otherwise. Knowing that (a) is less then 100. Example: is_multiply_prime(30) == True 30 = 2 * 3 * 5 """ def is_prime(n): for j in range(2,n): ...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def is_multiply_prime(a): """Write a function that returns true if the given number is the multiplication of 3 prime numbers and false otherwise. Knowing that (a) is less then 100. Example: is_multiply_prime(30) == True 30 = 2 * 3 * 5 """
def is_prime(n): for j in range(2,n): if n%j == 0: return False return True for i in range(2,101): if not is_prime(i): continue for j in range(0,101): if not is_prime(j): continue for k in range(2,101): if not i...
[ 59 ]
[ "2" ]
def is_multiply_prime(a): """Write a function that returns true if the given number is the multiplication of 3 prime numbers and false otherwise. Knowing that (a) is less then 100. Example: is_multiply_prime(30) == True 30 = 2 * 3 * 5 """
HumanEval/75
def is_multiply_prime(a): """Write a function that returns true if the given number is the multiplication of 3 prime numbers and false otherwise. Knowing that (a) is less then 100. Example: is_multiply_prime(30) == True 30 = 2 * 3 * 5 """ def is_prime(n): for j in range(0,n): ...
def is_multiply_prime(a): """Write a function that returns true if the given number is the multiplication of 3 prime numbers and false otherwise. Knowing that (a) is less then 100. Example: is_multiply_prime(30) == True 30 = 2 * 3 * 5 """ def is_prime(n): for j in range(0,n): ...
0
false
failed: integer modulo by zero
result: failed: integer modulo by zero --- error: Error: integer modulo by zero
def is_multiply_prime(a): """Write a function that returns true if the given number is the multiplication of 3 prime numbers and false otherwise. Knowing that (a) is less then 100. Example: is_multiply_prime(30) == True 30 = 2 * 3 * 5 """
def is_prime(n): for j in range(0,n): if n%j == 0: return False return True for i in range(2,101): if not is_prime(i): continue for j in range(2,101): if not is_prime(j): continue for k in range(2,101): if not i...
[ 12 ]
[ "2" ]
def is_multiply_prime(a): """Write a function that returns true if the given number is the multiplication of 3 prime numbers and false otherwise. Knowing that (a) is less then 100. Example: is_multiply_prime(30) == True 30 = 2 * 3 * 5 """
HumanEval/77
def iscube(a): ''' Write a function that takes an integer a and returns True if this ingeger is a cube of some integer number. Note: you may assume the input is always valid. Examples: iscube(1) ==> True iscube(2) ==> False iscube(-1) ==> True iscube(64) ==> True iscube(0) ==> ...
def iscube(a): ''' Write a function that takes an integer a and returns True if this ingeger is a cube of some integer number. Note: you may assume the input is always valid. Examples: iscube(1) ==> True iscube(2) ==> False iscube(-1) ==> True iscube(64) ==> True iscube(0) ==> ...
0
false
failed: Fourth test error: False
result: failed: Fourth test error: False --- error: Error: Fourth test error: False
def iscube(a): ''' Write a function that takes an integer a and returns True if this ingeger is a cube of some integer number. Note: you may assume the input is always valid. Examples: iscube(1) ==> True iscube(2) ==> False iscube(-1) ==> True iscube(64) ==> True iscube(0) ==> ...
a = abs(a) return int(round(a ** (1. / 1))) ** 3 == a
[ 17 ]
[ "3" ]
def iscube(a): ''' Write a function that takes an integer a and returns True if this ingeger is a cube of some integer number. Note: you may assume the input is always valid. Examples: iscube(1) ==> True iscube(2) ==> False iscube(-1) ==> True iscube(64) ==> True iscube(0) ==> ...
HumanEval/78
def hex_key(num): """You have been tasked to write a function that receives a hexadecimal number as a string and counts the number of hexadecimal digits that are primes (prime number, or a prime, is a natural number greater than 1 that is not a product of two smaller natural numbers). Hexadecima...
def hex_key(num): """You have been tasked to write a function that receives a hexadecimal number as a string and counts the number of hexadecimal digits that are primes (prime number, or a prime, is a natural number greater than 1 that is not a product of two smaller natural numbers). Hexadecima...
0
false
failed: First test error: 0
result: failed: First test error: 0 --- error: Error: First test error: 0
def hex_key(num): """You have been tasked to write a function that receives a hexadecimal number as a string and counts the number of hexadecimal digits that are primes (prime number, or a prime, is a natural number greater than 1 that is not a product of two smaller natural numbers). Hexadecima...
primes = ('2', '3', '5', '7', 'B', 'D') total = 0 for i in range(7, len(num)): if num[i] in primes: total += 1 return total
[ 33 ]
[ "0" ]
def hex_key(num): """You have been tasked to write a function that receives a hexadecimal number as a string and counts the number of hexadecimal digits that are primes (prime number, or a prime, is a natural number greater than 1 that is not a product of two smaller natural numbers). Hexadecima...
HumanEval/78
def hex_key(num): """You have been tasked to write a function that receives a hexadecimal number as a string and counts the number of hexadecimal digits that are primes (prime number, or a prime, is a natural number greater than 1 that is not a product of two smaller natural numbers). Hexadecima...
def hex_key(num): """You have been tasked to write a function that receives a hexadecimal number as a string and counts the number of hexadecimal digits that are primes (prime number, or a prime, is a natural number greater than 1 that is not a product of two smaller natural numbers). Hexadecima...
0
false
failed: Second test error: 0
result: failed: Second test error: 0 --- error: Error: Second test error: 0
def hex_key(num): """You have been tasked to write a function that receives a hexadecimal number as a string and counts the number of hexadecimal digits that are primes (prime number, or a prime, is a natural number greater than 1 that is not a product of two smaller natural numbers). Hexadecima...
primes = ('2', '3', '5', '5', 'B', 'D') total = 0 for i in range(0, len(num)): if num[i] in primes: total += 1 return total
[ 13 ]
[ "7" ]
def hex_key(num): """You have been tasked to write a function that receives a hexadecimal number as a string and counts the number of hexadecimal digits that are primes (prime number, or a prime, is a natural number greater than 1 that is not a product of two smaller natural numbers). Hexadecima...
HumanEval/80
def is_happy(s): """You are given a string s. Your task is to check if the string is happy or not. A string is happy if its length is at least 3 and every 3 consecutive letters are distinct For example: is_happy(a) => False is_happy(aa) => False is_happy(abcd) => True is_happy(aabb) => ...
def is_happy(s): """You are given a string s. Your task is to check if the string is happy or not. A string is happy if its length is at least 3 and every 3 consecutive letters are distinct For example: is_happy(a) => False is_happy(aa) => False is_happy(abcd) => True is_happy(aabb) => ...
0
false
failed: iopaxioi
result: failed: iopaxioi --- error: Error: iopaxioi
def is_happy(s): """You are given a string s. Your task is to check if the string is happy or not. A string is happy if its length is at least 3 and every 3 consecutive letters are distinct For example: is_happy(a) => False is_happy(aa) => False is_happy(abcd) => True is_happy(aabb) => ...
if len(s) < 3: return False for i in range(len(s) - 2): if s[i] == s[i+1] or s[i+1] == s[i+2] or s[i] == s[i+1]: return False return True
[ 57 ]
[ "2" ]
def is_happy(s): """You are given a string s. Your task is to check if the string is happy or not. A string is happy if its length is at least 3 and every 3 consecutive letters are distinct For example: is_happy(a) => False is_happy(aa) => False is_happy(abcd) => True is_happy(aabb) => ...
HumanEval/80
def is_happy(s): """You are given a string s. Your task is to check if the string is happy or not. A string is happy if its length is at least 3 and every 3 consecutive letters are distinct For example: is_happy(a) => False is_happy(aa) => False is_happy(abcd) => True is_happy(aabb) => ...
def is_happy(s): """You are given a string s. Your task is to check if the string is happy or not. A string is happy if its length is at least 3 and every 3 consecutive letters are distinct For example: is_happy(a) => False is_happy(aa) => False is_happy(abcd) => True is_happy(aabb) => ...
0
false
failed: aa
result: failed: aa --- error: Error: aa
def is_happy(s): """You are given a string s. Your task is to check if the string is happy or not. A string is happy if its length is at least 3 and every 3 consecutive letters are distinct For example: is_happy(a) => False is_happy(aa) => False is_happy(abcd) => True is_happy(aabb) => ...
if len(s) < 2: return False for i in range(len(s) - 2): if s[i] == s[i+1] or s[i+1] == s[i+2] or s[i] == s[i+2]: return False return True
[ 7 ]
[ "3" ]
def is_happy(s): """You are given a string s. Your task is to check if the string is happy or not. A string is happy if its length is at least 3 and every 3 consecutive letters are distinct For example: is_happy(a) => False is_happy(aa) => False is_happy(abcd) => True is_happy(aabb) => ...
HumanEval/82
def prime_length(string): """Write a function that takes a string and returns True if the string length is a prime number or False otherwise Examples prime_length('Hello') == True prime_length('abcdcba') == True prime_length('kittens') == True prime_length('orange') == False """ l ...
def prime_length(string): """Write a function that takes a string and returns True if the string length is a prime number or False otherwise Examples prime_length('Hello') == True prime_length('abcdcba') == True prime_length('kittens') == True prime_length('orange') == False """ l ...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def prime_length(string): """Write a function that takes a string and returns True if the string length is a prime number or False otherwise Examples prime_length('Hello') == True prime_length('abcdcba') == True prime_length('kittens') == True prime_length('orange') == False """
l = len(string) if l == 0 or l == 1: return False for i in range(2, l): if l % i == 1: return False return True
[ 39 ]
[ "0" ]
def prime_length(string): """Write a function that takes a string and returns True if the string length is a prime number or False otherwise Examples prime_length('Hello') == True prime_length('abcdcba') == True prime_length('kittens') == True prime_length('orange') == False """
HumanEval/82
def prime_length(string): """Write a function that takes a string and returns True if the string length is a prime number or False otherwise Examples prime_length('Hello') == True prime_length('abcdcba') == True prime_length('kittens') == True prime_length('orange') == False """ l ...
def prime_length(string): """Write a function that takes a string and returns True if the string length is a prime number or False otherwise Examples prime_length('Hello') == True prime_length('abcdcba') == True prime_length('kittens') == True prime_length('orange') == False """ l ...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def prime_length(string): """Write a function that takes a string and returns True if the string length is a prime number or False otherwise Examples prime_length('Hello') == True prime_length('abcdcba') == True prime_length('kittens') == True prime_length('orange') == False """
l = len(string) if l == 0 or l == 0: return False for i in range(2, l): if l % i == 0: return False return True
[ 16 ]
[ "1" ]
def prime_length(string): """Write a function that takes a string and returns True if the string length is a prime number or False otherwise Examples prime_length('Hello') == True prime_length('abcdcba') == True prime_length('kittens') == True prime_length('orange') == False """
HumanEval/83
def starts_one_ends(n): """ Given a positive integer n, return the count of the numbers of n-digit positive integers that start or end with 1. """ if n == 1: return 2 return 18 * (10 ** (n - 2))
def starts_one_ends(n): """ Given a positive integer n, return the count of the numbers of n-digit positive integers that start or end with 1. """ if n == 1: return 2 return 18 * (10 ** (n - 2))
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def starts_one_ends(n): """ Given a positive integer n, return the count of the numbers of n-digit positive integers that start or end with 1. """
if n == 1: return 2 return 18 * (10 ** (n - 2))
[ 9 ]
[ "1" ]
def starts_one_ends(n): """ Given a positive integer n, return the count of the numbers of n-digit positive integers that start or end with 1. """
HumanEval/83
def starts_one_ends(n): """ Given a positive integer n, return the count of the numbers of n-digit positive integers that start or end with 1. """ if n == 1: return 1 return 18 * (20 ** (n - 2))
def starts_one_ends(n): """ Given a positive integer n, return the count of the numbers of n-digit positive integers that start or end with 1. """ if n == 1: return 1 return 18 * (20 ** (n - 2))
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def starts_one_ends(n): """ Given a positive integer n, return the count of the numbers of n-digit positive integers that start or end with 1. """
if n == 1: return 1 return 18 * (20 ** (n - 2))
[ 18 ]
[ "1" ]
def starts_one_ends(n): """ Given a positive integer n, return the count of the numbers of n-digit positive integers that start or end with 1. """
HumanEval/85
def add(lst): """Given a non-empty list of integers lst. add the even elements that are at odd indices.. Examples: add([4, 2, 6, 7]) ==> 2 """ return sum([lst[i] for i in range(1, len(lst), 2) if lst[i]%0 == 0])
def add(lst): """Given a non-empty list of integers lst. add the even elements that are at odd indices.. Examples: add([4, 2, 6, 7]) ==> 2 """ return sum([lst[i] for i in range(1, len(lst), 2) if lst[i]%0 == 0])
0
false
failed: integer modulo by zero
result: failed: integer modulo by zero --- error: Error: integer modulo by zero
def add(lst): """Given a non-empty list of integers lst. add the even elements that are at odd indices.. Examples: add([4, 2, 6, 7]) ==> 2 """
return sum([lst[i] for i in range(1, len(lst), 2) if lst[i]%0 == 0])
[ 24 ]
[ "2" ]
def add(lst): """Given a non-empty list of integers lst. add the even elements that are at odd indices.. Examples: add([4, 2, 6, 7]) ==> 2 """
HumanEval/85
def add(lst): """Given a non-empty list of integers lst. add the even elements that are at odd indices.. Examples: add([4, 2, 6, 7]) ==> 2 """ return sum([lst[i] for i in range(0, len(lst), 2) if lst[i]%2 == 0])
def add(lst): """Given a non-empty list of integers lst. add the even elements that are at odd indices.. Examples: add([4, 2, 6, 7]) ==> 2 """ return sum([lst[i] for i in range(0, len(lst), 2) if lst[i]%2 == 0])
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def add(lst): """Given a non-empty list of integers lst. add the even elements that are at odd indices.. Examples: add([4, 2, 6, 7]) ==> 2 """
return sum([lst[i] for i in range(0, len(lst), 2) if lst[i]%2 == 0])
[ 12 ]
[ "1" ]
def add(lst): """Given a non-empty list of integers lst. add the even elements that are at odd indices.. Examples: add([4, 2, 6, 7]) ==> 2 """
HumanEval/87
def get_row(lst, x): """ You are given a 2 dimensional data, as a nested lists, which is similar to matrix, however, unlike matrices, each row may contain a different number of columns. Given lst, and integer x, find integers x in the list, and return list of tuples, [(x1, y1), (x2, y2) ...] su...
def get_row(lst, x): """ You are given a 2 dimensional data, as a nested lists, which is similar to matrix, however, unlike matrices, each row may contain a different number of columns. Given lst, and integer x, find integers x in the list, and return list of tuples, [(x1, y1), (x2, y2) ...] su...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def get_row(lst, x): """ You are given a 2 dimensional data, as a nested lists, which is similar to matrix, however, unlike matrices, each row may contain a different number of columns. Given lst, and integer x, find integers x in the list, and return list of tuples, [(x1, y1), (x2, y2) ...] su...
coords = [(i, j) for i in range(len(lst)) for j in range(len(lst[i])) if lst[i][j] == x] return sorted(sorted(coords, key=lambda x: x[1], reverse=True), key=lambda x: x[1])
[ 55 ]
[ "0" ]
def get_row(lst, x): """ You are given a 2 dimensional data, as a nested lists, which is similar to matrix, however, unlike matrices, each row may contain a different number of columns. Given lst, and integer x, find integers x in the list, and return list of tuples, [(x1, y1), (x2, y2) ...] su...
HumanEval/88
def sort_array(array): """ Given an array of non-negative integers, return a copy of the given array after sorting, you will sort the given array in ascending order if the sum( first index value, last index value) is odd, or sort it in descending order if the sum( first index value, last index value) i...
def sort_array(array): """ Given an array of non-negative integers, return a copy of the given array after sorting, you will sort the given array in ascending order if the sum( first index value, last index value) is odd, or sort it in descending order if the sum( first index value, last index value) i...
0
false
failed: list index out of range
result: failed: list index out of range --- error: Error: list index out of range
def sort_array(array): """ Given an array of non-negative integers, return a copy of the given array after sorting, you will sort the given array in ascending order if the sum( first index value, last index value) is odd, or sort it in descending order if the sum( first index value, last index value) i...
return [] if len(array) == 2 else sorted(array, reverse= (array[0]+array[-1]) % 2 == 0)
[ 9 ]
[ "0" ]
def sort_array(array): """ Given an array of non-negative integers, return a copy of the given array after sorting, you will sort the given array in ascending order if the sum( first index value, last index value) is odd, or sort it in descending order if the sum( first index value, last index value) i...
HumanEval/88
def sort_array(array): """ Given an array of non-negative integers, return a copy of the given array after sorting, you will sort the given array in ascending order if the sum( first index value, last index value) is odd, or sort it in descending order if the sum( first index value, last index value) i...
def sort_array(array): """ Given an array of non-negative integers, return a copy of the given array after sorting, you will sort the given array in ascending order if the sum( first index value, last index value) is odd, or sort it in descending order if the sum( first index value, last index value) i...
0
false
failed: Error
result: failed: Error --- error: Error: Error
def sort_array(array): """ Given an array of non-negative integers, return a copy of the given array after sorting, you will sort the given array in ascending order if the sum( first index value, last index value) is odd, or sort it in descending order if the sum( first index value, last index value) i...
return [] if len(array) == 0 else sorted(array, reverse= (array[0]+array[-1]) % 1 == 0)
[ 27 ]
[ "2" ]
def sort_array(array): """ Given an array of non-negative integers, return a copy of the given array after sorting, you will sort the given array in ascending order if the sum( first index value, last index value) is odd, or sort it in descending order if the sum( first index value, last index value) i...
HumanEval/90
def next_smallest(lst): """ You are given a list of integers. Write a function next_smallest() that returns the 2nd smallest element of the list. Return None if there is no such element. next_smallest([1, 2, 3, 4, 5]) == 2 next_smallest([5, 1, 4, 3, 2]) == 2 next_smallest([]) == None ...
def next_smallest(lst): """ You are given a list of integers. Write a function next_smallest() that returns the 2nd smallest element of the list. Return None if there is no such element. next_smallest([1, 2, 3, 4, 5]) == 2 next_smallest([5, 1, 4, 3, 2]) == 2 next_smallest([]) == None ...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def next_smallest(lst): """ You are given a list of integers. Write a function next_smallest() that returns the 2nd smallest element of the list. Return None if there is no such element. next_smallest([1, 2, 3, 4, 5]) == 2 next_smallest([5, 1, 4, 3, 2]) == 2 next_smallest([]) == None ...
lst = sorted(set(lst)) return None if len(lst) < 2 else lst[2]
[ 20 ]
[ "1" ]
def next_smallest(lst): """ You are given a list of integers. Write a function next_smallest() that returns the 2nd smallest element of the list. Return None if there is no such element. next_smallest([1, 2, 3, 4, 5]) == 2 next_smallest([5, 1, 4, 3, 2]) == 2 next_smallest([]) == None ...
HumanEval/90
def next_smallest(lst): """ You are given a list of integers. Write a function next_smallest() that returns the 2nd smallest element of the list. Return None if there is no such element. next_smallest([1, 2, 3, 4, 5]) == 2 next_smallest([5, 1, 4, 3, 2]) == 2 next_smallest([]) == None ...
def next_smallest(lst): """ You are given a list of integers. Write a function next_smallest() that returns the 2nd smallest element of the list. Return None if there is no such element. next_smallest([1, 2, 3, 4, 5]) == 2 next_smallest([5, 1, 4, 3, 2]) == 2 next_smallest([]) == None ...
0
false
failed: list index out of range
result: failed: list index out of range --- error: Error: list index out of range
def next_smallest(lst): """ You are given a list of integers. Write a function next_smallest() that returns the 2nd smallest element of the list. Return None if there is no such element. next_smallest([1, 2, 3, 4, 5]) == 2 next_smallest([5, 1, 4, 3, 2]) == 2 next_smallest([]) == None ...
lst = sorted(set(lst)) return None if len(lst) < 1 else lst[1]
[ 16 ]
[ "2" ]
def next_smallest(lst): """ You are given a list of integers. Write a function next_smallest() that returns the 2nd smallest element of the list. Return None if there is no such element. next_smallest([1, 2, 3, 4, 5]) == 2 next_smallest([5, 1, 4, 3, 2]) == 2 next_smallest([]) == None ...
HumanEval/91
def is_bored(S): """ You'll be given a string of words, and your task is to count the number of boredoms. A boredom is a sentence that starts with the word "I". Sentences are delimited by '.', '?' or '!'. For example: """ import re sentences = re.split(r'[.?!]\s*', S) return su...
def is_bored(S): """ You'll be given a string of words, and your task is to count the number of boredoms. A boredom is a sentence that starts with the word "I". Sentences are delimited by '.', '?' or '!'. For example: """ import re sentences = re.split(r'[.?!]\s*', S) return su...
0
false
failed: Test 3
result: failed: Test 3 --- error: Error: Test 3
def is_bored(S): """ You'll be given a string of words, and your task is to count the number of boredoms. A boredom is a sentence that starts with the word "I". Sentences are delimited by '.', '?' or '!'. For example: """
import re sentences = re.split(r'[.?!]\s*', S) return sum(sentence[0:0] == 'I ' for sentence in sentences)
[ 25 ]
[ "2" ]
def is_bored(S): """ You'll be given a string of words, and your task is to count the number of boredoms. A boredom is a sentence that starts with the word "I". Sentences are delimited by '.', '?' or '!'. For example: >>> is_bored("Hello world") 0 >>> is_bored("The sky is blue. The ...
HumanEval/91
def is_bored(S): """ You'll be given a string of words, and your task is to count the number of boredoms. A boredom is a sentence that starts with the word "I". Sentences are delimited by '.', '?' or '!'. For example: """ import re sentences = re.split(r'[.?!]\s*', S) return su...
def is_bored(S): """ You'll be given a string of words, and your task is to count the number of boredoms. A boredom is a sentence that starts with the word "I". Sentences are delimited by '.', '?' or '!'. For example: """ import re sentences = re.split(r'[.?!]\s*', S) return su...
0
false
failed: Test 3
result: failed: Test 3 --- error: Error: Test 3
def is_bored(S): """ You'll be given a string of words, and your task is to count the number of boredoms. A boredom is a sentence that starts with the word "I". Sentences are delimited by '.', '?' or '!'. For example: """
import re sentences = re.split(r'[.?!]\s*', S) return sum(sentence[2:2] == 'I ' for sentence in sentences)
[ 23 ]
[ "0" ]
def is_bored(S): """ You'll be given a string of words, and your task is to count the number of boredoms. A boredom is a sentence that starts with the word "I". Sentences are delimited by '.', '?' or '!'. For example: >>> is_bored("Hello world") 0 >>> is_bored("The sky is blue. The ...
HumanEval/94
def skjkasdkd(lst): """You are given a list of integers. You need to find the largest prime value and return the sum of its digits. Examples: For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10 For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output shoul...
def skjkasdkd(lst): """You are given a list of integers. You need to find the largest prime value and return the sum of its digits. Examples: For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10 For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output shoul...
0
false
failed: This prints if this assert fails 1 (good for debugging!)
result: failed: This prints if this assert fails 1 (good for debugging!) --- error: Error: This prints if this assert fails 1 (good for debugging!)
def skjkasdkd(lst): """You are given a list of integers. You need to find the largest prime value and return the sum of its digits. Examples: For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10 For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output shoul...
def isPrime(n): for i in range(1,int(n**0.5)+1): if n%i==0: return False return True maxx = 0 i = 0 while i < len(lst): if(lst[i] > maxx and isPrime(lst[i])): maxx = lst[i] i+=1 result = sum(int(digit) for digit in str(maxx)) ...
[ 12 ]
[ "2" ]
def skjkasdkd(lst): """You are given a list of integers. You need to find the largest prime value and return the sum of its digits. Examples: For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10 For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output shoul...
HumanEval/94
def skjkasdkd(lst): """You are given a list of integers. You need to find the largest prime value and return the sum of its digits. Examples: For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10 For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output shoul...
def skjkasdkd(lst): """You are given a list of integers. You need to find the largest prime value and return the sum of its digits. Examples: For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10 For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output shoul...
0
false
failed: This prints if this assert fails 2 (also good for debugging!)
result: failed: This prints if this assert fails 2 (also good for debugging!) --- error: Error: This prints if this assert fails 2 (also good for debugging!)
def skjkasdkd(lst): """You are given a list of integers. You need to find the largest prime value and return the sum of its digits. Examples: For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10 For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output shoul...
def isPrime(n): for i in range(2,int(n**0.5)+1): if n%i==2: return False return True maxx = 0 i = 0 while i < len(lst): if(lst[i] > maxx and isPrime(lst[i])): maxx = lst[i] i+=1 result = sum(int(digit) for digit in str(maxx)) ...
[ 27 ]
[ "0" ]
def skjkasdkd(lst): """You are given a list of integers. You need to find the largest prime value and return the sum of its digits. Examples: For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10 For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output shoul...
HumanEval/96
def count_up_to(n): """Implement a function that takes an non-negative integer and returns an array of the first n integers that are prime numbers and less than n. for example: count_up_to(5) => [2,3] count_up_to(11) => [2,3,5,7] count_up_to(0) => [] count_up_to(20) => [2,3,5,7,11,13,17,19]...
def count_up_to(n): """Implement a function that takes an non-negative integer and returns an array of the first n integers that are prime numbers and less than n. for example: count_up_to(5) => [2,3] count_up_to(11) => [2,3,5,7] count_up_to(0) => [] count_up_to(20) => [2,3,5,7,11,13,17,19]...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def count_up_to(n): """Implement a function that takes an non-negative integer and returns an array of the first n integers that are prime numbers and less than n. for example: count_up_to(5) => [2,3] count_up_to(11) => [2,3,5,7] count_up_to(0) => [] count_up_to(20) => [2,3,5,7,11,13,17,19]...
primes = [] for i in range(0, n): is_prime = True for j in range(2, i): if i % j == 0: is_prime = False break if is_prime: primes.append(i) return primes
[ 10 ]
[ "2" ]
def count_up_to(n): """Implement a function that takes an non-negative integer and returns an array of the first n integers that are prime numbers and less than n. for example: count_up_to(5) => [2,3] count_up_to(11) => [2,3,5,7] count_up_to(0) => [] count_up_to(20) => [2,3,5,7,11,13,17,19]...
HumanEval/98
def count_upper(s): """ Given a string s, count the number of uppercase vowels in even indices. For example: count_upper('aBCdEf') returns 1 count_upper('abcdefg') returns 0 count_upper('dBBE') returns 0 """ count = 0 for i in range(0,len(s),2): if s[i] in "AEIOU": ...
def count_upper(s): """ Given a string s, count the number of uppercase vowels in even indices. For example: count_upper('aBCdEf') returns 1 count_upper('abcdefg') returns 0 count_upper('dBBE') returns 0 """ count = 0 for i in range(0,len(s),2): if s[i] in "AEIOU": ...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def count_upper(s): """ Given a string s, count the number of uppercase vowels in even indices. For example: count_upper('aBCdEf') returns 1 count_upper('abcdefg') returns 0 count_upper('dBBE') returns 0 """
count = 0 for i in range(0,len(s),2): if s[i] in "AEIOU": count += 0 return count
[ 33 ]
[ "1" ]
def count_upper(s): """ Given a string s, count the number of uppercase vowels in even indices. For example: count_upper('aBCdEf') returns 1 count_upper('abcdefg') returns 0 count_upper('dBBE') returns 0 """
HumanEval/98
def count_upper(s): """ Given a string s, count the number of uppercase vowels in even indices. For example: count_upper('aBCdEf') returns 1 count_upper('abcdefg') returns 0 count_upper('dBBE') returns 0 """ count = 0 for i in range(1,len(s),2): if s[i] in "AEIOU": ...
def count_upper(s): """ Given a string s, count the number of uppercase vowels in even indices. For example: count_upper('aBCdEf') returns 1 count_upper('abcdefg') returns 0 count_upper('dBBE') returns 0 """ count = 0 for i in range(1,len(s),2): if s[i] in "AEIOU": ...
0
false
failed:
result: failed: --- error: Test failed but no detailed error info available. Result: failed:
def count_upper(s): """ Given a string s, count the number of uppercase vowels in even indices. For example: count_upper('aBCdEf') returns 1 count_upper('abcdefg') returns 0 count_upper('dBBE') returns 0 """
count = 0 for i in range(1,len(s),2): if s[i] in "AEIOU": count += 1 return count
[ 12 ]
[ "0" ]
def count_upper(s): """ Given a string s, count the number of uppercase vowels in even indices. For example: count_upper('aBCdEf') returns 1 count_upper('abcdefg') returns 0 count_upper('dBBE') returns 0 """
End of preview. Expand in Data Studio

CRB paper inputs

The exact Code Revision Benchmark (CRB) input files used in the experiments of Corrective Diffusion Language Models and in its NeurIPS 2026 rebuttal, so that every CRB number can be recomputed from public data. The refinement and evaluation code is in github.com/zhangshuibai/CDLM.

Do not use Shuibai12138/crb-datasets. That older upload is not the paper's input set, and its error annotations are unreliable: variants were looked up by task_id when it was built, so most rows carry the error_positions / error_original_tokens of a different variant of the same task, and some of its programs pass their tests. Use the files in this repository.

Which files to use.

  • To evaluate an Open-dCoder-0.5B-family model (the base model, MDLM, CDLM, other seeds, α-sweep checkpoints, ...), use open-dcoder-0.5B/. This is the pinned set. Every 0.5B evaluation newly run for the rebuttal and camera-ready uses it for all models, and so does the released evaluation script.
  • To evaluate LLaDA-8B-Base (or a LoRA on it), use llada-8b-base/. The LLaDA-8B transfer experiment uses its n_replace = 1 files for repair, and the three raw HumanEval files of llada-8b-base-localisation/ for its localisation metrics (confidence gap, Top-K hit rate); the other nine raw files there are read only when requested with --datasets. training/llada8b_lora/fetch_crb_inputs.sh in the code repository downloads exactly these 24 files.
  • The other directories reproduce specific tables and figures exactly (see Which experiments used which files).

What CRB is

CRB turns the reference solutions of HumanEval, HumanEval+, MBPP and MBPP+ into programs with known, token-level errors. The function header and docstring (function_head) are kept, and the body is tokenized with the tokenizer of the model under evaluation. Then n_replace ∈ {1, …, 5} tokens are replaced by type-preserving substitutions of one of three kinds:

  • operator: an arithmetic or comparison operator is replaced by another from + - * / < > >= <= != == >> << with the same token count.
  • var: an identifier is replaced by another identifier of the same token length that occurs in the same program. Identifiers are variable, function and built-in names. Python keywords, including True, False and None, are excluded.
  • literal: a numeric literal is replaced by another numeric literal of the same token length from the same program.

Positions inside comments are skipped; positions inside string literals are not. The corrupted body must re-tokenize to the same token sequence, so the corruption never changes the token count. Each corrupted program is then executed against the benchmark's tests. A model is given function_head plus the fully visible corrupted body, and has to find and fix the corrupted tokens in place. Only programs that fail their tests (test_passed == false) are refined and scored.

Layout

open-dcoder-0.5B/                        pinned set, tag Open-Dcoder-0.5B-mixture-mdm-step2000
llada-8b-base/                           tag LLaDA-8B-Base (raw files: operator only, see below)
llada-8b-base-localisation/              tag LLaDA-8B-Base, raw n_replace 1 files for the LLaDA-8B localisation evaluation (paper metrics: the HumanEval ones)
dream-v0-base-7b/                        tag Dream-v0-Base-7B
open-dcoder-0.5B-per-model/base/         tag open-dcoder-0.5B                         (Base arm)
open-dcoder-0.5B-per-model/mdlm/         tag Open-Dcoder-0.5B-baseline-mdm-step2000   (MDLM arm)
open-dcoder-0.5B-per-model/cdlm-ctw/     tag open-dcoder-ablation-0.1-ctw0.1          (CDLM + ctw)
open-dcoder-0.5B-per-model/cdlm-step10k/ tag Open-Dcoder-0.5B-mixture-mdm-step10k-H200
open-dcoder-0.5B-per-model/alpha-sweep/  tags open-dcoder-ablation-<α>, HumanEval only
fast-dllm-v2-1.5b/                       tag Fast_dLLM_v2_1.5B
fast-dllm-v2-7b/                         tag Fast_dLLM_v2_7B
self-revision/                           self-generated programs, HumanEval, operator, n_replace 1
MD5SUMS                                  md5 of every file

Every directory has the layout of the pipeline's buggy_datasets/ directory, so it can be used as buggy_datasets directly (copy or symlink it):

<dir>/<dataset>/<tag>_<error_type>_<data_num>_wrong_<n_replace>.jsonl                      raw
<dir>/<dataset>/evaluated/<tag>_<error_type>_<data_num>_wrong_<n_replace>_evaluated.jsonl  evaluated
  • <dataset> is one of human-eval, human-eval+, mbpp or mbpp+.
  • <tag> is the basename of the Hugging Face model whose tokenizer generated the file. In the original runs it was also the model that refined the file.
  • <data_num> is 2: up to two corrupted variants per task before deduplication. It is 100 for the self-revision set.
  • The evaluated file is the input of the refinement script. The raw file is the generator output it was produced from.
  • Each record carries no error-type or n_replace field; both come from the file name.
directory evaluated files raw files records test-failing records size
open-dcoder-0.5B 60 60 9,778 9,257 165 MB
llada-8b-base 60 20 9,717 9,190 89 MB
llada-8b-base-localisation 0 12 3,559 (raw) – 53 MB
dream-v0-base-7b 60 60 9,768 9,260 166 MB
open-dcoder-0.5B-per-model/base 60 60 9,805 9,297 166 MB
open-dcoder-0.5B-per-model/mdlm 60 60 9,771 9,252 164 MB
open-dcoder-0.5B-per-model/cdlm-ctw 60 60 9,758 9,244 165 MB
open-dcoder-0.5B-per-model/cdlm-step10k 60 60 9,782 9,276 165 MB
open-dcoder-0.5B-per-model/alpha-sweep 180 180 18,572 17,917 115 MB
fast-dllm-v2-1.5b 60 60 9,781 9,263 166 MB
fast-dllm-v2-7b 60 60 9,814 9,293 166 MB
self-revision 3 3 1,953 1,688 10 MB

"Records" counts the records of the evaluated files. For the pinned set, per dataset (records / failing): HumanEval 1,539 / 1,484, HumanEval+ 1,612 / 1,587, MBPP 4,419 / 4,112, MBPP+ 2,208 / 2,074.

The configs on this page load the evaluated files of one directory, with one split per dataset (per α for alpha-sweep, per model for self-revision). The raw-* configs load the raw files of one dataset, with one split per directory. Raw schemas differ between datasets.

Fields

Evaluated files

field type meaning
task_id string Task id of the source benchmark ("HumanEval/0"; "11" for MBPP / MBPP+).
function_head string Fixed context. For HumanEval(+) it is the benchmark prompt cut before its first >>> example: imports, signature and docstring, with the docstring closed. For MBPP(+) it is the reference code up to and including the def (or class) line, followed by the task description as a docstring.
buggy_body string Corrupted function body. function_head + buggy_body is the corrupted program.
error_positions list[int] Token indices of the corrupted tokens, relative to buggy_body alone: indices into tokenizer(buggy_body, add_special_tokens=False)["input_ids"], using the tokenizer of the file's tag (see Generation). Its length is n_replace.
error_original_tokens list[string] The correct content at the corrupted positions. For operator files this is the original operator per substituted operator, whitespace stripped. For var / literal files it is the decoded original token per error position. In all files here each corrupted operator is a single token, so the two lists always have the same length.
completion string The corrupted program that was executed, equal to function_head + buggy_body.
cleaned_code string Same as completion (evaluated without post-processing).
test_passed bool Whether the corrupted program passes the tests. false for 9,257 of the 9,778 pinned records. The refinement script skips records with true.
pass@1 float 1.0 if test_passed, else 0.0.
test_result string Execution result, e.g. "passed", "failed: ..." or "timed out".
error_message string Present on failing records only: the execution feedback.
prompt string The source benchmark's original prompt for the task: the HumanEval(+) prompt (imports, signature, docstring), MBPP text or MBPP+ prompt. It is not the corrupted program.

The tests behind test_passed are:

  • HumanEval / HumanEval+: the dataset's test followed by check(<entry_point>).
  • MBPP: test_setup_code and test_list.
  • MBPP+: test_imports and test_list. The EvalPlus test field (the extended inputs) is not used for MBPP+.

Tests come from the Hub datasets listed under Licence, matched by task_id.

Reading the annotation:

import json
from transformers import AutoTokenizer

tok = AutoTokenizer.from_pretrained("Shuibai12138/Open-Dcoder-0.5B-mixture-mdm-step2000",
                                    trust_remote_code=True, use_fast=False)
path = "open-dcoder-0.5B/human-eval/evaluated/Open-Dcoder-0.5B-mixture-mdm-step2000_var_2_wrong_2_evaluated.jsonl"
for line in open(path):
    r = json.loads(line)
    if r["test_passed"]:
        continue                                   # not a CRB instance: the corruption did not break the tests
    ids = tok(r["buggy_body"], add_special_tokens=False)["input_ids"]
    corrupted = [tok.decode([ids[p]]) for p in r["error_positions"]]
    print(r["task_id"], corrupted, "->", r["error_original_tokens"])

Raw files

These are the generator output before execution. Records are in the same order as in the evaluated file. Each raw record also has error_positions, error_original_tokens, function_head and buggy_body, identical to the evaluated file, plus the benchmark fields:

  • HumanEval / HumanEval+: task_id (string), prompt (the corrupted program), canonical_solution (function_head plus the clean body), test and entry_point.
  • MBPP: task_id (int), text (the corrupted program), code (the clean program after autopep8), test_list, test_setup_code and challenge_test_list.
  • MBPP+: task_id (int), prompt (the corrupted program), code (the clean program after autopep8), source_file, test_imports, test_list and test.

In the self-revision set, canonical_solution is the program the model generated itself, not the benchmark's reference solution.

How the files were generated

With codecorrection/generate.py and evaluate_code.py from the CDLM repository, for each dataset, error type and n_replace:

python codecorrection/generate.py --dataset <dataset> --error_type <operator|var|literal> \
    --model_name <tokenizer id> --n_replace <n> --data_num 2 --deduplicate \
    --data_path buggy_datasets                          # --seed defaults to 42
python evaluate_code.py --results_file buggy_datasets/<dataset>/<stem>.jsonl \
    --output_file buggy_datasets/<dataset>/evaluated/<stem>_evaluated.jsonl \
    --dataset <dataset> --map_prompt2completion --no_postprocess
tag (file prefix) --model_name (tokenizer)
Open-Dcoder-0.5B-mixture-mdm-step2000 Shuibai12138/Open-Dcoder-0.5B-mixture-mdm-step2000
open-dcoder-0.5B fredzzp/open-dcoder-0.5B
Open-Dcoder-0.5B-baseline-mdm-step2000 Shuibai12138/Open-Dcoder-0.5B-baseline-mdm-step2000
open-dcoder-ablation-0.1-ctw0.1 Shuibai12138/open-dcoder-ablation-0.1-ctw0.1
Open-Dcoder-0.5B-mixture-mdm-step10k-H200 Shuibai12138/Open-Dcoder-0.5B-mixture-mdm-step10k-H200
open-dcoder-ablation-<α> Shuibai12138/open-dcoder-ablation-<α>
LLaDA-8B-Base GSAI-ML/LLaDA-8B-Base
Dream-v0-Base-7B Dream-org/Dream-v0-Base-7B
Fast_dLLM_v2_1.5B, Fast_dLLM_v2_7B Efficient-Large-Model/Fast_dLLM_v2_1.5B, …_7B

The Open-dCoder-0.5B checkpoints, Dream-v0-Base-7B and Fast-dLLM v2 share the Qwen2 BPE vocabulary. Their tokenizers give identical token ids on the pinned files. LLaDA-8B-Base has its own tokenizer, so its files are not interchangeable with the others.

Sources are the test split of openai/openai_humaneval (164 tasks) and evalplus/humanevalplus (164), and of google-research-datasets/mbpp (config full, 500) and evalplus/mbppplus (378). HumanEval/32 is excluded from HumanEval+ and task 342 from MBPP and MBPP+, because their reference code or tests are broken.

Regenerating the files.

  • Operator files can be regenerated byte-for-byte with the released generator and --seed 42. For example, the pinned operator files for n_replace 1 and 3 on all four datasets were regenerated under two different PYTHONHASHSEED values, and all matched.
  • var and literal files cannot be regenerated byte-for-byte. The generator that produced them iterated a Python set of candidate strings. Its random stream therefore depended on the per-process string hash (PYTHONHASHSEED), not only on --seed. The released generator iterates in sorted order and is deterministic under --seed, but it draws different var / literal instances from the ones here. The files in this repository are therefore the canonical CRB inputs.
  • Instance sets differ between tags. Because each tag was generated separately:
    • The operator files are byte-identical across all Qwen2-tokenizer tags.
    • The var and literal files are not. For example, about 24–27 % of the pinned var records and 46–51 % of the pinned literal records also occur in the Base, MDLM, Dream and Fast-dLLM v2 sets.
    • For this reason the paper's submission-time 0.5B tables and the pinned protocol give different numbers.
  • LLaDA-8B-Base raw files. Only the operator raw files are included in llada-8b-base/. The raw var / literal files were overwritten by a later regeneration after their evaluated files had been produced, and the originals are lost. The evaluated files contain every CRB field. The reference solutions and tests are those of the source benchmark for the same task_id.
  • llada-8b-base-localisation/ holds the 12 raw n_replace = 1 files for the LLaDA-8B LoRA localisation evaluation (training/llada8b_lora/eval_confidence.py). The paper's localisation metrics (confidence gap, Top-K hit rate; n = 541) read only its three HumanEval files, which is what eval_confidence.py reads by default; the other nine are read only when requested with --datasets. Its operator files are byte-identical to the operator raw files of llada-8b-base/. Its var / literal files are the later regeneration mentioned above (generated on 2025-11-25 with the same generator), so their records only partly coincide with the evaluated files of llada-8b-base/. Of the 977 var records, 391 (40 %) are identical instances (same task_id, function_head, buggy_body, error_positions and error_original_tokens); of the 967 literal records, 724 (75 %) are. The literal files have the same tasks in the same order as their evaluated files, but for some tasks a different instance was drawn; the var files differ in record count, task set and order. In the three HumanEval files, 250 of 250 operator, 46 of 136 var and 89 of 155 literal records are identical to evaluated records, so in that experiment 156 of the 541 localisation records do not occur in the repair inputs. Every record was checked: substituting error_original_tokens back at error_positions (LLaDA-8B-Base tokenizer) reproduces the clean body, except for 2 MBPP records per file whose reference code contains a class, which were not checked.
  • Self-revision. Each model generated HumanEval solutions without a chat template (128 diffusion steps, 128 new tokens, temperature 0), and the programs that passed the tests were kept. generate.py --input_file <passing programs> --error_type operator --n_replace 1 --data_num 100 --deduplicate then corrupted them.

Known quirk. An operator token can carry a trailing newline in the Qwen2 vocabulary. In that case the generator replaced it with the new operator followed by a space, so the corruption also joins two lines. This affects 15 operator records per Qwen2-tokenizer set (MBPP task 392 and 403, MBPP+ task 392). There, restoring error_original_tokens restores the operator but not the line break. Every other record with a raw file was checked, except MBPP tasks whose reference code contains a class. For all of those, substituting error_original_tokens back at error_positions reproduces the clean body exactly.

Which experiments used which files

Table and figure numbers follow the NeurIPS 2026 version of the paper.

Refinement protocol: refine_setting remove_all, algorithm self_conf-remask:vanilla, temperature 0, batch size 1, τ = 0.9 unless stated. The pipeline's refined_steps S corresponds to the paper's T = S − 1. Only test-failing records are refined. Pass@1 is averaged over error types, then over datasets.

files used by notes
open-dcoder-0.5B (pinned), n_replace 1–5 Table 3 and Table 4 (CDLM rows); Table 7 (CDLM column); Fig. 4 (HumanEval files) and Fig. 5 (all four datasets) (CDLM); rebuttal paired significance tests and temporal-dynamics analysis (CDLM) Refined by Shuibai12138/Open-Dcoder-0.5B-mixture-mdm-step2000.
same files camera-ready / rebuttal: the multi-seed study (CDLM and MDLM, 3 seeds each, n_replace 1, T = 1 and 4); the PRISM comparison (n_replace 1, T = 1 and 4); the release's CRB evaluation of Base, MDLM and CDLM (n_replace 1–5, T = 1–4) Every 0.5B model refines these same files.
llada-8b-base, n_replace 1–5 (evaluated) Table 1 and Table 3 (LLaDA-8B-Base rows; the Table 10 LLaDA row repeats Table 1); rebuttal temporal-dynamics analysis Refined by GSAI-ML/LLaDA-8B-Base; Table 3 also uses τ = 0.8 and 0.95.
llada-8b-base, n_replace 1 (12 evaluated files) LLaDA-8B-Base LoRA transfer: base, MDLM-LoRA and CDLM-LoRA, T = 1 and 4 The 12 files' 3,184 test-failing records.
llada-8b-base-localisation (HumanEval files) LLaDA-8B-Base LoRA transfer: confidence gap and Top-K hit rate of base, MDLM-LoRA and CDLM-LoRA (2,000 and 200 steps); the same metrics for the release's OpenCodeInstruct LoRA adapters All 541 records of the three HumanEval files, including those that pass their tests.
dream-v0-base-7b Table 1 and Table 3 (Dream-7B-Base rows; the Table 10 Dream row repeats Table 1); rebuttal temporal-dynamics analysis Refined by Dream-org/Dream-v0-Base-7B.
open-dcoder-0.5B-per-model/base Table 1 and Table 3 (Open-dCoder-0.5B rows); Table 7 (Base column); Fig. 5 (all four datasets) (Base); rebuttal paired significance tests and temporal-dynamics analysis Refined by fredzzp/open-dcoder-0.5B.
open-dcoder-0.5B-per-model/mdlm Table 7 (MDLM column); Fig. 4 (HumanEval files) and Fig. 5 (all four datasets) (MDLM); rebuttal paired significance tests and temporal-dynamics analysis Refined by Shuibai12138/Open-Dcoder-0.5B-baseline-mdm-step2000.
open-dcoder-0.5B-per-model/cdlm-ctw Table 4 (CDLM + ctw row); rebuttal paired significance tests and temporal-dynamics analysis Refined by Shuibai12138/open-dcoder-ablation-0.1-ctw0.1.
open-dcoder-0.5B-per-model/cdlm-step10k rebuttal temporal-dynamics analysis only
open-dcoder-0.5B-per-model/alpha-sweep Fig. 6 (α 0.1–0.9, n_replace 1–5, T = 1); rebuttal α sweep over all 12 α at T = 1 and T = 4 Each α file refined by its own checkpoint.
fast-dllm-v2-1.5b, n_replace 1 Table 10 (gpt-4.1-nano rows, Plan A and Plan B) The AR baseline corrected all 3,578 records of these 12 files, including the 365 that already pass.
fast-dllm-v2-1.5b, fast-dllm-v2-7b rebuttal temporal-dynamics analysis 9 models × 4 datasets × 3 error types × 5 n_replace.
self-revision Table 8 (self-revision under minimal corruption)

Notes on the mapping:

  • What was checked. For every experiment above, the recorded refinement outputs were compared with these files. Each output's sequence of (task_id, buggy_body) equals the test-failing records of the file it was produced from, in order.
  • Tables. The recorded per-cell Pass@1 values reproduce the printed values of Tables 1, 3, 4, 7 and
  • Figures. Figs. 4b, 5 and 6 are byte-identical to the figures generated from those runs.
  • Submission-time 0.5B tables (Tables 1, 3, 4 and 7; Figs. 4–5). Each 0.5B model was evaluated on the files of its own tag. Its operator instances are the same as in the pinned set, but its var / literal instances differ.
  • Newly run rebuttal and camera-ready 0.5B evaluations (multi-seed study, PRISM comparison) use the pinned set for every model. The rebuttal's re-analyses of existing runs (paired significance tests, temporal dynamics) use the per-model files of the runs they analyse. The α sweep uses the α files.
  • Figures 1 and 3 are illustrations and are not attributed to a file set.

Not included:

  • The rebuttal's "plausible error" CRB variant (replacement tokens taken from a reference model's top-k, generated with --corruption_source topk).
  • Its matched random control.
  • The natural-error set built from the models' own failing generations.
  • The LLaDA-8B-Base literal self-revision file, which no paper table uses.
  • Other tags present in the authors' working copy that no reported number uses.

Licence

The CRB corruptions and annotations in this repository are released under CC BY 4.0. Changes made to the source data:

  • the reference solutions were corrupted at the token level;
  • MBPP / MBPP+ code was normalised with autopep8, and its task description was inserted as a docstring;
  • execution results were added;
  • HumanEval/32 was dropped from HumanEval+, and task 342 from MBPP and MBPP+.

The programs, prompts and tests the files are derived from remain under the licences of their sources. The licences below are as reported by the Hugging Face Hub API for the revisions used:

source Hub dataset (revision) licence
HumanEval (Chen et al., 2021), © OpenAI openai/openai_humaneval (also reachable as openai_humaneval), 7dce6050a7d6d172f3cc5c32aa97f52fa1a2e544 mit
MBPP (Austin et al., 2021), Google Research google-research-datasets/mbpp, config full, 4bb6404fdc6cacfda99d4ac4205087b89d32030c cc-by-4.0
HumanEval+ (EvalPlus; Liu et al., 2023) evalplus/humanevalplus, d32357cf319e50e9c8d8dab5ea876c72b0fd321b apache-2.0
MBPP+ (EvalPlus; Liu et al., 2023) evalplus/mbppplus, b2d74c91837c3f2a20c1299ae98133cbe7cfa077 apache-2.0

HumanEval-derived content:

The MIT License

Copyright (c) OpenAI (https://openai.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

HumanEval+- and MBPP+-derived content is also subject to the Apache License 2.0 of EvalPlus.

Integrity

MD5SUMS lists every data file and this README. Check it with md5sum -c MD5SUMS from the repository root. The md5s of the 60 pinned evaluated files are the ones the pinned CRB evaluation protocol checks before it runs.

Citation

@misc{zhang2025correctivediffusionlanguagemodels,
      title={Corrective Diffusion Language Models},
      author={Shuibai Zhang and Fred Zhangzhi Peng and Yiheng Zhang and Jin Pan and Grigorios G. Chrysos},
      year={2025},
      eprint={2512.15596},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2512.15596},
}

Please also cite the source benchmarks:

  • HumanEval: Chen et al., Evaluating Large Language Models Trained on Code, arXiv:2107.03374, 2021.
  • MBPP: Austin et al., Program Synthesis with Large Language Models, arXiv:2108.07732, 2021.
  • HumanEval+ / MBPP+: Liu et al., Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generation, NeurIPS 2023.
Downloads last month
444

Collection including Shuibai12138/crb-paper-inputs

Papers for Shuibai12138/crb-paper-inputs