import_str
sequencelengths
0
1
doc_string
stringclasses
164 values
suffix
stringlengths
0
837
compare_func
sequencelengths
0
0
data_id
stringlengths
34
37
task_name
stringclasses
1 value
solution
stringlengths
6
141
demos
sequencelengths
0
8
prefix
stringlengths
65
1.8k
dataset_name
stringclasses
1 value
entry_func
stringclasses
158 values
tgt_lang
stringclasses
1 value
src_lang
stringclasses
1 value
test_cases
sequencelengths
0
100
[]
prime_fib returns n-th number that is a Fibonacci number and it's also prime.
return False for k in range(2, 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]): n -= 1 if n == 0: return f[-1]
[]
SingleLineInfilling/HumanEval/39/L3
code_infilling
if p < 2:
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ] ]
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):
HumanEval_SingleLineInfillingLight
prime_fib
python
python
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ], [ "6", "233" ], [ "7", "1597" ], [ "8", "28657" ], [ "9", "514229" ], [ "10", "433494437" ] ]
[]
prime_fib returns n-th number that is a Fibonacci number and it's also prime.
for k in range(2, 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]): n -= 1 if n == 0: return f[-1]
[]
SingleLineInfilling/HumanEval/39/L4
code_infilling
return False
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ] ]
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:
HumanEval_SingleLineInfillingLight
prime_fib
python
python
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ], [ "6", "233" ], [ "7", "1597" ], [ "8", "28657" ], [ "9", "514229" ], [ "10", "433494437" ] ]
[]
prime_fib returns n-th number that is a Fibonacci number and it's also prime.
if p % k == 0: return False return True f = [0, 1] while True: f.append(f[-1] + f[-2]) if is_prime(f[-1]): n -= 1 if n == 0: return f[-1]
[]
SingleLineInfilling/HumanEval/39/L5
code_infilling
for k in range(2, min(int(math.sqrt(p)) + 1, p - 1)):
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ] ]
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
HumanEval_SingleLineInfillingLight
prime_fib
python
python
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ], [ "6", "233" ], [ "7", "1597" ], [ "8", "28657" ], [ "9", "514229" ], [ "10", "433494437" ] ]
[]
prime_fib returns n-th number that is a Fibonacci number and it's also prime.
return False return True f = [0, 1] while True: f.append(f[-1] + f[-2]) if is_prime(f[-1]): n -= 1 if n == 0: return f[-1]
[]
SingleLineInfilling/HumanEval/39/L6
code_infilling
if p % k == 0:
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ] ]
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 - 1)):
HumanEval_SingleLineInfillingLight
prime_fib
python
python
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ], [ "6", "233" ], [ "7", "1597" ], [ "8", "28657" ], [ "9", "514229" ], [ "10", "433494437" ] ]
[]
prime_fib returns n-th number that is a Fibonacci number and it's also prime.
return True f = [0, 1] while True: f.append(f[-1] + f[-2]) if is_prime(f[-1]): n -= 1 if n == 0: return f[-1]
[]
SingleLineInfilling/HumanEval/39/L7
code_infilling
return False
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ] ]
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 - 1)): if p % k == 0:
HumanEval_SingleLineInfillingLight
prime_fib
python
python
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ], [ "6", "233" ], [ "7", "1597" ], [ "8", "28657" ], [ "9", "514229" ], [ "10", "433494437" ] ]
[]
prime_fib returns n-th number that is a Fibonacci number and it's also prime.
f = [0, 1] while True: f.append(f[-1] + f[-2]) if is_prime(f[-1]): n -= 1 if n == 0: return f[-1]
[]
SingleLineInfilling/HumanEval/39/L8
code_infilling
return True
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ] ]
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 - 1)): if p % k == 0: return False
HumanEval_SingleLineInfillingLight
prime_fib
python
python
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ], [ "6", "233" ], [ "7", "1597" ], [ "8", "28657" ], [ "9", "514229" ], [ "10", "433494437" ] ]
[]
prime_fib returns n-th number that is a Fibonacci number and it's also prime.
while True: f.append(f[-1] + f[-2]) if is_prime(f[-1]): n -= 1 if n == 0: return f[-1]
[]
SingleLineInfilling/HumanEval/39/L9
code_infilling
f = [0, 1]
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ] ]
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 - 1)): if p % k == 0: return False return True
HumanEval_SingleLineInfillingLight
prime_fib
python
python
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ], [ "6", "233" ], [ "7", "1597" ], [ "8", "28657" ], [ "9", "514229" ], [ "10", "433494437" ] ]
[]
prime_fib returns n-th number that is a Fibonacci number and it's also prime.
f.append(f[-1] + f[-2]) if is_prime(f[-1]): n -= 1 if n == 0: return f[-1]
[]
SingleLineInfilling/HumanEval/39/L10
code_infilling
while True:
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ] ]
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 - 1)): if p % k == 0: return False return True f = [0, 1]
HumanEval_SingleLineInfillingLight
prime_fib
python
python
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ], [ "6", "233" ], [ "7", "1597" ], [ "8", "28657" ], [ "9", "514229" ], [ "10", "433494437" ] ]
[]
prime_fib returns n-th number that is a Fibonacci number and it's also prime.
if is_prime(f[-1]): n -= 1 if n == 0: return f[-1]
[]
SingleLineInfilling/HumanEval/39/L11
code_infilling
f.append(f[-1] + f[-2])
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ] ]
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 - 1)): if p % k == 0: return False return True f = [0, 1] while True:
HumanEval_SingleLineInfillingLight
prime_fib
python
python
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ], [ "6", "233" ], [ "7", "1597" ], [ "8", "28657" ], [ "9", "514229" ], [ "10", "433494437" ] ]
[]
prime_fib returns n-th number that is a Fibonacci number and it's also prime.
n -= 1 if n == 0: return f[-1]
[]
SingleLineInfilling/HumanEval/39/L12
code_infilling
if is_prime(f[-1]):
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ] ]
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 - 1)): if p % k == 0: return False return True f = [0, 1] while True: f.append(f[-1] + f[-2])
HumanEval_SingleLineInfillingLight
prime_fib
python
python
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ], [ "6", "233" ], [ "7", "1597" ], [ "8", "28657" ], [ "9", "514229" ], [ "10", "433494437" ] ]
[]
prime_fib returns n-th number that is a Fibonacci number and it's also prime.
if n == 0: return f[-1]
[]
SingleLineInfilling/HumanEval/39/L13
code_infilling
n -= 1
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ] ]
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 - 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]):
HumanEval_SingleLineInfillingLight
prime_fib
python
python
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ], [ "6", "233" ], [ "7", "1597" ], [ "8", "28657" ], [ "9", "514229" ], [ "10", "433494437" ] ]
[]
prime_fib returns n-th number that is a Fibonacci number and it's also prime.
return f[-1]
[]
SingleLineInfilling/HumanEval/39/L14
code_infilling
if n == 0:
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ] ]
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 - 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]): n -= 1
HumanEval_SingleLineInfillingLight
prime_fib
python
python
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ], [ "6", "233" ], [ "7", "1597" ], [ "8", "28657" ], [ "9", "514229" ], [ "10", "433494437" ] ]
[]
prime_fib returns n-th number that is a Fibonacci number and it's also prime.
[]
SingleLineInfilling/HumanEval/39/L15
code_infilling
return f[-1]
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ] ]
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 - 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]): n -= 1 if n == 0:
HumanEval_SingleLineInfillingLight
prime_fib
python
python
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ], [ "6", "233" ], [ "7", "1597" ], [ "8", "28657" ], [ "9", "514229" ], [ "10", "433494437" ] ]
[]
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 j in range(i + 1, len(l)): for k in range(j + 1, len(l)): if l[i] + l[j] + l[k] == 0: return True return False
[]
SingleLineInfilling/HumanEval/40/L0
code_infilling
for i in range(len(l)):
[ [ "[1, 3, 5, 0]", "False" ], [ "[1, 3, -2, 1]", "True" ], [ "[1, 2, 3, 7]", "False" ], [ "[2, 4, -5, 3, 9, 7]", "True" ], [ "[1]", "False" ] ]
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. """
HumanEval_SingleLineInfillingLight
triples_sum_to_zero
python
python
[ [ "[1, 3, 5, 0]", "False" ], [ "[1, 3, 5, -1]", "False" ], [ "[1, 3, -2, 1]", "True" ], [ "[1, 2, 3, 7]", "False" ], [ "[1, 2, 5, 7]", "False" ], [ "[2, 4, -5, 3, 9, 7]", "True" ], [ "[1]", "False" ], [ "[1, 3, 5, -100]", "False" ], [ "[100, 3, 5, -100]", "False" ] ]
[]
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 k in range(j + 1, len(l)): if l[i] + l[j] + l[k] == 0: return True return False
[]
SingleLineInfilling/HumanEval/40/L1
code_infilling
for j in range(i + 1, len(l)):
[ [ "[1, 3, 5, 0]", "False" ], [ "[1, 3, -2, 1]", "True" ], [ "[1, 2, 3, 7]", "False" ], [ "[2, 4, -5, 3, 9, 7]", "True" ], [ "[1]", "False" ] ]
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)):
HumanEval_SingleLineInfillingLight
triples_sum_to_zero
python
python
[ [ "[1, 3, 5, 0]", "False" ], [ "[1, 3, 5, -1]", "False" ], [ "[1, 3, -2, 1]", "True" ], [ "[1, 2, 3, 7]", "False" ], [ "[1, 2, 5, 7]", "False" ], [ "[2, 4, -5, 3, 9, 7]", "True" ], [ "[1]", "False" ], [ "[1, 3, 5, -100]", "False" ], [ "[100, 3, 5, -100]", "False" ] ]
[]
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.
if l[i] + l[j] + l[k] == 0: return True return False
[]
SingleLineInfilling/HumanEval/40/L2
code_infilling
for k in range(j + 1, len(l)):
[ [ "[1, 3, 5, 0]", "False" ], [ "[1, 3, -2, 1]", "True" ], [ "[1, 2, 3, 7]", "False" ], [ "[2, 4, -5, 3, 9, 7]", "True" ], [ "[1]", "False" ] ]
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)):
HumanEval_SingleLineInfillingLight
triples_sum_to_zero
python
python
[ [ "[1, 3, 5, 0]", "False" ], [ "[1, 3, 5, -1]", "False" ], [ "[1, 3, -2, 1]", "True" ], [ "[1, 2, 3, 7]", "False" ], [ "[1, 2, 5, 7]", "False" ], [ "[2, 4, -5, 3, 9, 7]", "True" ], [ "[1]", "False" ], [ "[1, 3, 5, -100]", "False" ], [ "[100, 3, 5, -100]", "False" ] ]
[]
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.
return True return False
[]
SingleLineInfilling/HumanEval/40/L3
code_infilling
if l[i] + l[j] + l[k] == 0:
[ [ "[1, 3, 5, 0]", "False" ], [ "[1, 3, -2, 1]", "True" ], [ "[1, 2, 3, 7]", "False" ], [ "[2, 4, -5, 3, 9, 7]", "True" ], [ "[1]", "False" ] ]
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)):
HumanEval_SingleLineInfillingLight
triples_sum_to_zero
python
python
[ [ "[1, 3, 5, 0]", "False" ], [ "[1, 3, 5, -1]", "False" ], [ "[1, 3, -2, 1]", "True" ], [ "[1, 2, 3, 7]", "False" ], [ "[1, 2, 5, 7]", "False" ], [ "[2, 4, -5, 3, 9, 7]", "True" ], [ "[1]", "False" ], [ "[1, 3, 5, -100]", "False" ], [ "[100, 3, 5, -100]", "False" ] ]
[]
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.
return False
[]
SingleLineInfilling/HumanEval/40/L4
code_infilling
return True
[ [ "[1, 3, 5, 0]", "False" ], [ "[1, 3, -2, 1]", "True" ], [ "[1, 2, 3, 7]", "False" ], [ "[2, 4, -5, 3, 9, 7]", "True" ], [ "[1]", "False" ] ]
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] == 0:
HumanEval_SingleLineInfillingLight
triples_sum_to_zero
python
python
[ [ "[1, 3, 5, 0]", "False" ], [ "[1, 3, 5, -1]", "False" ], [ "[1, 3, -2, 1]", "True" ], [ "[1, 2, 3, 7]", "False" ], [ "[1, 2, 5, 7]", "False" ], [ "[2, 4, -5, 3, 9, 7]", "True" ], [ "[1]", "False" ], [ "[1, 3, 5, -100]", "False" ], [ "[100, 3, 5, -100]", "False" ] ]
[]
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.
[]
SingleLineInfilling/HumanEval/40/L5
code_infilling
return False
[ [ "[1, 3, 5, 0]", "False" ], [ "[1, 3, -2, 1]", "True" ], [ "[1, 2, 3, 7]", "False" ], [ "[2, 4, -5, 3, 9, 7]", "True" ], [ "[1]", "False" ] ]
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] == 0: return True
HumanEval_SingleLineInfillingLight
triples_sum_to_zero
python
python
[ [ "[1, 3, 5, 0]", "False" ], [ "[1, 3, 5, -1]", "False" ], [ "[1, 3, -2, 1]", "True" ], [ "[1, 2, 3, 7]", "False" ], [ "[1, 2, 5, 7]", "False" ], [ "[2, 4, -5, 3, 9, 7]", "True" ], [ "[1]", "False" ], [ "[1, 3, 5, -100]", "False" ], [ "[100, 3, 5, -100]", "False" ] ]
[]
Imagine a road that's a perfectly straight infinitely long line. n cars are driving left to right; simultaneously, a different set of n cars are driving right to left. The two sets of cars start out being very far from each other. All cars move in the same speed. Two cars are said to collide when a car that's moving left to right hits a car that's moving right to left. However, the cars are infinitely sturdy and strong; as a result, they continue moving in their trajectory as if they did not collide. This function outputs the number of such collisions.
[]
SingleLineInfilling/HumanEval/41/L0
code_infilling
return n**2
[]
def car_race_collision(n: int): """ Imagine a road that's a perfectly straight infinitely long line. n cars are driving left to right; simultaneously, a different set of n cars are driving right to left. The two sets of cars start out being very far from each other. All cars move in the same speed. Two cars are said to collide when a car that's moving left to right hits a car that's moving right to left. However, the cars are infinitely sturdy and strong; as a result, they continue moving in their trajectory as if they did not collide. This function outputs the number of such collisions. """
HumanEval_SingleLineInfillingLight
car_race_collision
python
python
[ [ "2", "4" ], [ "3", "9" ], [ "4", "16" ], [ "8", "64" ], [ "10", "100" ] ]
[]
Return list with elements incremented by 1.
[]
SingleLineInfilling/HumanEval/42/L0
code_infilling
return [(e + 1) for e in l]
[ [ "[1, 2, 3]", "[2, 3, 4]" ], [ "[5, 3, 5, 2, 3, 3, 9, 0, 123]", "[6, 4, 6, 3, 4, 4, 10, 1, 124]" ] ]
def incr_list(l: list): """Return list with elements incremented by 1. """
HumanEval_SingleLineInfillingLight
incr_list
python
python
[ [ "[]", "[]" ], [ "[3, 2, 1]", "[4, 3, 2]" ], [ "[5, 2, 5, 2, 3, 3, 9, 0, 123]", "[6, 3, 6, 3, 4, 4, 10, 1, 124]" ] ]
[]
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 j in range(i + 1, len(l)): if l1 + l[j] == 0: return True return False
[]
SingleLineInfilling/HumanEval/43/L0
code_infilling
for i, l1 in enumerate(l):
[ [ "[1, 3, 5, 0]", "False" ], [ "[1, 3, -2, 1]", "False" ], [ "[1, 2, 3, 7]", "False" ], [ "[2, 4, -5, 3, 5, 7]", "True" ], [ "[1]", "False" ] ]
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. """
HumanEval_SingleLineInfillingLight
pairs_sum_to_zero
python
python
[ [ "[1, 3, 5, 0]", "False" ], [ "[1, 3, -2, 1]", "False" ], [ "[1, 2, 3, 7]", "False" ], [ "[2, 4, -5, 3, 5, 7]", "True" ], [ "[1]", "False" ], [ "[-3, 9, -1, 3, 2, 30]", "True" ], [ "[-3, 9, -1, 3, 2, 31]", "True" ], [ "[-3, 9, -1, 4, 2, 30]", "False" ], [ "[-3, 9, -1, 4, 2, 31]", "False" ] ]
[]
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.
if l1 + l[j] == 0: return True return False
[]
SingleLineInfilling/HumanEval/43/L1
code_infilling
for j in range(i + 1, len(l)):
[ [ "[1, 3, 5, 0]", "False" ], [ "[1, 3, -2, 1]", "False" ], [ "[1, 2, 3, 7]", "False" ], [ "[2, 4, -5, 3, 5, 7]", "True" ], [ "[1]", "False" ] ]
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):
HumanEval_SingleLineInfillingLight
pairs_sum_to_zero
python
python
[ [ "[1, 3, 5, 0]", "False" ], [ "[1, 3, -2, 1]", "False" ], [ "[1, 2, 3, 7]", "False" ], [ "[2, 4, -5, 3, 5, 7]", "True" ], [ "[1]", "False" ], [ "[-3, 9, -1, 3, 2, 30]", "True" ], [ "[-3, 9, -1, 3, 2, 31]", "True" ], [ "[-3, 9, -1, 4, 2, 30]", "False" ], [ "[-3, 9, -1, 4, 2, 31]", "False" ] ]
[]
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.
return True return False
[]
SingleLineInfilling/HumanEval/43/L2
code_infilling
if l1 + l[j] == 0:
[ [ "[1, 3, 5, 0]", "False" ], [ "[1, 3, -2, 1]", "False" ], [ "[1, 2, 3, 7]", "False" ], [ "[2, 4, -5, 3, 5, 7]", "True" ], [ "[1]", "False" ] ]
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 + 1, len(l)):
HumanEval_SingleLineInfillingLight
pairs_sum_to_zero
python
python
[ [ "[1, 3, 5, 0]", "False" ], [ "[1, 3, -2, 1]", "False" ], [ "[1, 2, 3, 7]", "False" ], [ "[2, 4, -5, 3, 5, 7]", "True" ], [ "[1]", "False" ], [ "[-3, 9, -1, 3, 2, 30]", "True" ], [ "[-3, 9, -1, 3, 2, 31]", "True" ], [ "[-3, 9, -1, 4, 2, 30]", "False" ], [ "[-3, 9, -1, 4, 2, 31]", "False" ] ]
[]
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.
return False
[]
SingleLineInfilling/HumanEval/43/L3
code_infilling
return True
[ [ "[1, 3, 5, 0]", "False" ], [ "[1, 3, -2, 1]", "False" ], [ "[1, 2, 3, 7]", "False" ], [ "[2, 4, -5, 3, 5, 7]", "True" ], [ "[1]", "False" ] ]
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 + 1, len(l)): if l1 + l[j] == 0:
HumanEval_SingleLineInfillingLight
pairs_sum_to_zero
python
python
[ [ "[1, 3, 5, 0]", "False" ], [ "[1, 3, -2, 1]", "False" ], [ "[1, 2, 3, 7]", "False" ], [ "[2, 4, -5, 3, 5, 7]", "True" ], [ "[1]", "False" ], [ "[-3, 9, -1, 3, 2, 30]", "True" ], [ "[-3, 9, -1, 3, 2, 31]", "True" ], [ "[-3, 9, -1, 4, 2, 30]", "False" ], [ "[-3, 9, -1, 4, 2, 31]", "False" ] ]
[]
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.
[]
SingleLineInfilling/HumanEval/43/L4
code_infilling
return False
[ [ "[1, 3, 5, 0]", "False" ], [ "[1, 3, -2, 1]", "False" ], [ "[1, 2, 3, 7]", "False" ], [ "[2, 4, -5, 3, 5, 7]", "True" ], [ "[1]", "False" ] ]
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 + 1, len(l)): if l1 + l[j] == 0: return True
HumanEval_SingleLineInfillingLight
pairs_sum_to_zero
python
python
[ [ "[1, 3, 5, 0]", "False" ], [ "[1, 3, -2, 1]", "False" ], [ "[1, 2, 3, 7]", "False" ], [ "[2, 4, -5, 3, 5, 7]", "True" ], [ "[1]", "False" ], [ "[-3, 9, -1, 3, 2, 30]", "True" ], [ "[-3, 9, -1, 3, 2, 31]", "True" ], [ "[-3, 9, -1, 4, 2, 30]", "False" ], [ "[-3, 9, -1, 4, 2, 31]", "False" ] ]
[]
Change numerical base of input number x to base. return string representation after the conversion. base numbers are less than 10.
while x > 0: ret = str(x % base) + ret x //= base return ret
[]
SingleLineInfilling/HumanEval/44/L0
code_infilling
ret = ""
[ [ "8, 3", "'22'" ], [ "8, 2", "'1000'" ], [ "7, 2", "'111'" ] ]
def change_base(x: int, base: int): """Change numerical base of input number x to base. return string representation after the conversion. base numbers are less than 10. """
HumanEval_SingleLineInfillingLight
change_base
python
python
[ [ "8, 3", "\"22\"" ], [ "9, 3", "\"100\"" ], [ "234, 2", "\"11101010\"" ], [ "16, 2", "\"10000\"" ], [ "8, 2", "\"1000\"" ], [ "7, 2", "\"111\"" ] ]
[]
Change numerical base of input number x to base. return string representation after the conversion. base numbers are less than 10.
ret = str(x % base) + ret x //= base return ret
[]
SingleLineInfilling/HumanEval/44/L1
code_infilling
while x > 0:
[ [ "8, 3", "'22'" ], [ "8, 2", "'1000'" ], [ "7, 2", "'111'" ] ]
def change_base(x: int, base: int): """Change numerical base of input number x to base. return string representation after the conversion. base numbers are less than 10. """ ret = ""
HumanEval_SingleLineInfillingLight
change_base
python
python
[ [ "8, 3", "\"22\"" ], [ "9, 3", "\"100\"" ], [ "234, 2", "\"11101010\"" ], [ "16, 2", "\"10000\"" ], [ "8, 2", "\"1000\"" ], [ "7, 2", "\"111\"" ] ]
[]
Change numerical base of input number x to base. return string representation after the conversion. base numbers are less than 10.
x //= base return ret
[]
SingleLineInfilling/HumanEval/44/L2
code_infilling
ret = str(x % base) + ret
[ [ "8, 3", "'22'" ], [ "8, 2", "'1000'" ], [ "7, 2", "'111'" ] ]
def change_base(x: int, base: int): """Change numerical base of input number x to base. return string representation after the conversion. base numbers are less than 10. """ ret = "" while x > 0:
HumanEval_SingleLineInfillingLight
change_base
python
python
[ [ "8, 3", "\"22\"" ], [ "9, 3", "\"100\"" ], [ "234, 2", "\"11101010\"" ], [ "16, 2", "\"10000\"" ], [ "8, 2", "\"1000\"" ], [ "7, 2", "\"111\"" ] ]
[]
Change numerical base of input number x to base. return string representation after the conversion. base numbers are less than 10.
return ret
[]
SingleLineInfilling/HumanEval/44/L3
code_infilling
x //= base
[ [ "8, 3", "'22'" ], [ "8, 2", "'1000'" ], [ "7, 2", "'111'" ] ]
def change_base(x: int, base: int): """Change numerical base of input number x to base. return string representation after the conversion. base numbers are less than 10. """ ret = "" while x > 0: ret = str(x % base) + ret
HumanEval_SingleLineInfillingLight
change_base
python
python
[ [ "8, 3", "\"22\"" ], [ "9, 3", "\"100\"" ], [ "234, 2", "\"11101010\"" ], [ "16, 2", "\"10000\"" ], [ "8, 2", "\"1000\"" ], [ "7, 2", "\"111\"" ] ]
[]
Change numerical base of input number x to base. return string representation after the conversion. base numbers are less than 10.
[]
SingleLineInfilling/HumanEval/44/L4
code_infilling
return ret
[ [ "8, 3", "'22'" ], [ "8, 2", "'1000'" ], [ "7, 2", "'111'" ] ]
def change_base(x: int, base: int): """Change numerical base of input number x to base. return string representation after the conversion. base numbers are less than 10. """ ret = "" while x > 0: ret = str(x % base) + ret x //= base
HumanEval_SingleLineInfillingLight
change_base
python
python
[ [ "8, 3", "\"22\"" ], [ "9, 3", "\"100\"" ], [ "234, 2", "\"11101010\"" ], [ "16, 2", "\"10000\"" ], [ "8, 2", "\"1000\"" ], [ "7, 2", "\"111\"" ] ]
[]
Given length of a side and high return area for a triangle.
[]
SingleLineInfilling/HumanEval/45/L0
code_infilling
return a * h / 2.0
[ [ "5, 3", "7.5" ] ]
def triangle_area(a, h): """Given length of a side and high return area for a triangle. """
HumanEval_SingleLineInfillingLight
triangle_area
python
python
[ [ "5, 3", "7.5" ], [ "2, 2", "2.0" ], [ "10, 8", "40.0" ] ]
[]
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 element of the fib4 number sequence. Do not use recursion. >>> fib4(5) 4 >>> fib4(6) 8 >>> fib4(7) 14
if n < 4: return results[n] for _ in range(4, n + 1): results.append(results[-1] + results[-2] + results[-3] + results[-4]) results.pop(0) return results[-1]
[]
SingleLineInfilling/HumanEval/46/L0
code_infilling
results = [0, 0, 2, 0]
[ [ "5", "4" ], [ "6", "8" ], [ "7", "14" ] ]
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 element of the fib4 number sequence. Do not use recursion. >>> fib4(5) 4 >>> fib4(6) 8 >>> fib4(7) 14 """
HumanEval_SingleLineInfillingLight
fib4
python
python
[ [ "5", "4" ], [ "8", "28" ], [ "10", "104" ], [ "12", "386" ] ]
[]
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 element of the fib4 number sequence. Do not use recursion. >>> fib4(5) 4 >>> fib4(6) 8 >>> fib4(7) 14
return results[n] for _ in range(4, n + 1): results.append(results[-1] + results[-2] + results[-3] + results[-4]) results.pop(0) return results[-1]
[]
SingleLineInfilling/HumanEval/46/L1
code_infilling
if n < 4:
[ [ "5", "4" ], [ "6", "8" ], [ "7", "14" ] ]
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 element of the fib4 number sequence. Do not use recursion. >>> fib4(5) 4 >>> fib4(6) 8 >>> fib4(7) 14 """ results = [0, 0, 2, 0]
HumanEval_SingleLineInfillingLight
fib4
python
python
[ [ "5", "4" ], [ "8", "28" ], [ "10", "104" ], [ "12", "386" ] ]
[]
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 element of the fib4 number sequence. Do not use recursion. >>> fib4(5) 4 >>> fib4(6) 8 >>> fib4(7) 14
for _ in range(4, n + 1): results.append(results[-1] + results[-2] + results[-3] + results[-4]) results.pop(0) return results[-1]
[]
SingleLineInfilling/HumanEval/46/L2
code_infilling
return results[n]
[ [ "5", "4" ], [ "6", "8" ], [ "7", "14" ] ]
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 element of the fib4 number sequence. Do not use recursion. >>> fib4(5) 4 >>> fib4(6) 8 >>> fib4(7) 14 """ results = [0, 0, 2, 0] if n < 4:
HumanEval_SingleLineInfillingLight
fib4
python
python
[ [ "5", "4" ], [ "8", "28" ], [ "10", "104" ], [ "12", "386" ] ]
[]
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 element of the fib4 number sequence. Do not use recursion. >>> fib4(5) 4 >>> fib4(6) 8 >>> fib4(7) 14
results.append(results[-1] + results[-2] + results[-3] + results[-4]) results.pop(0) return results[-1]
[]
SingleLineInfilling/HumanEval/46/L4
code_infilling
for _ in range(4, n + 1):
[ [ "5", "4" ], [ "6", "8" ], [ "7", "14" ] ]
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 element of the fib4 number sequence. Do not use recursion. >>> fib4(5) 4 >>> fib4(6) 8 >>> fib4(7) 14 """ results = [0, 0, 2, 0] if n < 4: return results[n]
HumanEval_SingleLineInfillingLight
fib4
python
python
[ [ "5", "4" ], [ "8", "28" ], [ "10", "104" ], [ "12", "386" ] ]
[]
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 element of the fib4 number sequence. Do not use recursion. >>> fib4(5) 4 >>> fib4(6) 8 >>> fib4(7) 14
results.pop(0) return results[-1]
[]
SingleLineInfilling/HumanEval/46/L5
code_infilling
results.append(results[-1] + results[-2] + results[-3] + results[-4])
[ [ "5", "4" ], [ "6", "8" ], [ "7", "14" ] ]
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 element of the fib4 number sequence. Do not use recursion. >>> fib4(5) 4 >>> fib4(6) 8 >>> fib4(7) 14 """ results = [0, 0, 2, 0] if n < 4: return results[n] for _ in range(4, n + 1):
HumanEval_SingleLineInfillingLight
fib4
python
python
[ [ "5", "4" ], [ "8", "28" ], [ "10", "104" ], [ "12", "386" ] ]
[]
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 element of the fib4 number sequence. Do not use recursion. >>> fib4(5) 4 >>> fib4(6) 8 >>> fib4(7) 14
return results[-1]
[]
SingleLineInfilling/HumanEval/46/L6
code_infilling
results.pop(0)
[ [ "5", "4" ], [ "6", "8" ], [ "7", "14" ] ]
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 element of the fib4 number sequence. Do not use recursion. >>> fib4(5) 4 >>> fib4(6) 8 >>> fib4(7) 14 """ results = [0, 0, 2, 0] if n < 4: return results[n] for _ in range(4, n + 1): results.append(results[-1] + results[-2] + results[-3] + results[-4])
HumanEval_SingleLineInfillingLight
fib4
python
python
[ [ "5", "4" ], [ "8", "28" ], [ "10", "104" ], [ "12", "386" ] ]
[]
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 element of the fib4 number sequence. Do not use recursion. >>> fib4(5) 4 >>> fib4(6) 8 >>> fib4(7) 14
[]
SingleLineInfilling/HumanEval/46/L8
code_infilling
return results[-1]
[ [ "5", "4" ], [ "6", "8" ], [ "7", "14" ] ]
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 element of the fib4 number sequence. Do not use recursion. >>> fib4(5) 4 >>> fib4(6) 8 >>> fib4(7) 14 """ results = [0, 0, 2, 0] if n < 4: return results[n] for _ in range(4, n + 1): results.append(results[-1] + results[-2] + results[-3] + results[-4]) results.pop(0)
HumanEval_SingleLineInfillingLight
fib4
python
python
[ [ "5", "4" ], [ "8", "28" ], [ "10", "104" ], [ "12", "386" ] ]
[]
Return median of elements in the list l.
if len(l) % 2 == 1: return l[len(l) // 2] else: return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
[]
SingleLineInfilling/HumanEval/47/L0
code_infilling
l = sorted(l)
[ [ "[3, 1, 2, 4, 5]", "3" ], [ "[-10, 4, 6, 1000, 10, 20]", "15.0" ] ]
def median(l: list): """Return median of elements in the list l. """
HumanEval_SingleLineInfillingLight
median
python
python
[ [ "[3, 1, 2, 4, 5]", "3" ], [ "[-10, 4, 6, 1000, 10, 20]", "8.0" ], [ "[5]", "5" ], [ "[6, 5]", "5.5" ], [ "[8, 1, 3, 9, 9, 2, 7]", "7" ] ]
[]
Return median of elements in the list l.
return l[len(l) // 2] else: return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
[]
SingleLineInfilling/HumanEval/47/L1
code_infilling
if len(l) % 2 == 1:
[ [ "[3, 1, 2, 4, 5]", "3" ], [ "[-10, 4, 6, 1000, 10, 20]", "15.0" ] ]
def median(l: list): """Return median of elements in the list l. """ l = sorted(l)
HumanEval_SingleLineInfillingLight
median
python
python
[ [ "[3, 1, 2, 4, 5]", "3" ], [ "[-10, 4, 6, 1000, 10, 20]", "8.0" ], [ "[5]", "5" ], [ "[6, 5]", "5.5" ], [ "[8, 1, 3, 9, 9, 2, 7]", "7" ] ]
[]
Return median of elements in the list l.
else: return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
[]
SingleLineInfilling/HumanEval/47/L2
code_infilling
return l[len(l) // 2]
[ [ "[3, 1, 2, 4, 5]", "3" ], [ "[-10, 4, 6, 1000, 10, 20]", "15.0" ] ]
def median(l: list): """Return median of elements in the list l. """ l = sorted(l) if len(l) % 2 == 1:
HumanEval_SingleLineInfillingLight
median
python
python
[ [ "[3, 1, 2, 4, 5]", "3" ], [ "[-10, 4, 6, 1000, 10, 20]", "8.0" ], [ "[5]", "5" ], [ "[6, 5]", "5.5" ], [ "[8, 1, 3, 9, 9, 2, 7]", "7" ] ]
[]
Return median of elements in the list l.
return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
[]
SingleLineInfilling/HumanEval/47/L3
code_infilling
else:
[ [ "[3, 1, 2, 4, 5]", "3" ], [ "[-10, 4, 6, 1000, 10, 20]", "15.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]
HumanEval_SingleLineInfillingLight
median
python
python
[ [ "[3, 1, 2, 4, 5]", "3" ], [ "[-10, 4, 6, 1000, 10, 20]", "8.0" ], [ "[5]", "5" ], [ "[6, 5]", "5.5" ], [ "[8, 1, 3, 9, 9, 2, 7]", "7" ] ]
[]
Return median of elements in the list l.
[]
SingleLineInfilling/HumanEval/47/L4
code_infilling
return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
[ [ "[3, 1, 2, 4, 5]", "3" ], [ "[-10, 4, 6, 1000, 10, 20]", "15.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:
HumanEval_SingleLineInfillingLight
median
python
python
[ [ "[3, 1, 2, 4, 5]", "3" ], [ "[-10, 4, 6, 1000, 10, 20]", "8.0" ], [ "[5]", "5" ], [ "[6, 5]", "5.5" ], [ "[8, 1, 3, 9, 9, 2, 7]", "7" ] ]
[]
Checks if given string is a palindrome
if text[i] != text[len(text) - 1 - i]: return False return True
[]
SingleLineInfilling/HumanEval/48/L0
code_infilling
for i in range(len(text)):
[ [ "''", "True" ], [ "'aba'", "True" ], [ "'aaaaa'", "True" ], [ "'zbcd'", "False" ] ]
def is_palindrome(text: str): """ Checks if given string is a palindrome """
HumanEval_SingleLineInfillingLight
is_palindrome
python
python
[ [ "''", "True" ], [ "'aba'", "True" ], [ "'aaaaa'", "True" ], [ "'zbcd'", "False" ], [ "'xywyx'", "True" ], [ "'xywyz'", "False" ], [ "'xywzx'", "False" ] ]
[]
Checks if given string is a palindrome
return False return True
[]
SingleLineInfilling/HumanEval/48/L1
code_infilling
if text[i] != text[len(text) - 1 - i]:
[ [ "''", "True" ], [ "'aba'", "True" ], [ "'aaaaa'", "True" ], [ "'zbcd'", "False" ] ]
def is_palindrome(text: str): """ Checks if given string is a palindrome """ for i in range(len(text)):
HumanEval_SingleLineInfillingLight
is_palindrome
python
python
[ [ "''", "True" ], [ "'aba'", "True" ], [ "'aaaaa'", "True" ], [ "'zbcd'", "False" ], [ "'xywyx'", "True" ], [ "'xywyz'", "False" ], [ "'xywzx'", "False" ] ]
[]
Checks if given string is a palindrome
return True
[]
SingleLineInfilling/HumanEval/48/L2
code_infilling
return False
[ [ "''", "True" ], [ "'aba'", "True" ], [ "'aaaaa'", "True" ], [ "'zbcd'", "False" ] ]
def is_palindrome(text: str): """ Checks if given string is a palindrome """ for i in range(len(text)): if text[i] != text[len(text) - 1 - i]:
HumanEval_SingleLineInfillingLight
is_palindrome
python
python
[ [ "''", "True" ], [ "'aba'", "True" ], [ "'aaaaa'", "True" ], [ "'zbcd'", "False" ], [ "'xywyx'", "True" ], [ "'xywyz'", "False" ], [ "'xywzx'", "False" ] ]
[]
Checks if given string is a palindrome
[]
SingleLineInfilling/HumanEval/48/L3
code_infilling
return True
[ [ "''", "True" ], [ "'aba'", "True" ], [ "'aaaaa'", "True" ], [ "'zbcd'", "False" ] ]
def is_palindrome(text: str): """ Checks if given string is a palindrome """ for i in range(len(text)): if text[i] != text[len(text) - 1 - i]: return False
HumanEval_SingleLineInfillingLight
is_palindrome
python
python
[ [ "''", "True" ], [ "'aba'", "True" ], [ "'aaaaa'", "True" ], [ "'zbcd'", "False" ], [ "'xywyx'", "True" ], [ "'xywyz'", "False" ], [ "'xywzx'", "False" ] ]
[]
Return 2^n modulo p (be aware of numerics).
for i in range(n): ret = (2 * ret) % p return ret
[]
SingleLineInfilling/HumanEval/49/L0
code_infilling
ret = 1
[ [ "3, 5", "3" ], [ "1101, 101", "2" ], [ "0, 101", "1" ], [ "3, 11", "8" ], [ "100, 101", "1" ] ]
def modp(n: int, p: int): """Return 2^n modulo p (be aware of numerics). """
HumanEval_SingleLineInfillingLight
modp
python
python
[ [ "3, 5", "3" ], [ "1101, 101", "2" ], [ "0, 101", "1" ], [ "3, 11", "8" ], [ "100, 101", "1" ], [ "30, 5", "4" ], [ "31, 5", "3" ] ]
[]
Return 2^n modulo p (be aware of numerics).
ret = (2 * ret) % p return ret
[]
SingleLineInfilling/HumanEval/49/L1
code_infilling
for i in range(n):
[ [ "3, 5", "3" ], [ "1101, 101", "2" ], [ "0, 101", "1" ], [ "3, 11", "8" ], [ "100, 101", "1" ] ]
def modp(n: int, p: int): """Return 2^n modulo p (be aware of numerics). """ ret = 1
HumanEval_SingleLineInfillingLight
modp
python
python
[ [ "3, 5", "3" ], [ "1101, 101", "2" ], [ "0, 101", "1" ], [ "3, 11", "8" ], [ "100, 101", "1" ], [ "30, 5", "4" ], [ "31, 5", "3" ] ]
[]
Return 2^n modulo p (be aware of numerics).
return ret
[]
SingleLineInfilling/HumanEval/49/L2
code_infilling
ret = (2 * ret) % p
[ [ "3, 5", "3" ], [ "1101, 101", "2" ], [ "0, 101", "1" ], [ "3, 11", "8" ], [ "100, 101", "1" ] ]
def modp(n: int, p: int): """Return 2^n modulo p (be aware of numerics). """ ret = 1 for i in range(n):
HumanEval_SingleLineInfillingLight
modp
python
python
[ [ "3, 5", "3" ], [ "1101, 101", "2" ], [ "0, 101", "1" ], [ "3, 11", "8" ], [ "100, 101", "1" ], [ "30, 5", "4" ], [ "31, 5", "3" ] ]
[]
Return 2^n modulo p (be aware of numerics).
[]
SingleLineInfilling/HumanEval/49/L3
code_infilling
return ret
[ [ "3, 5", "3" ], [ "1101, 101", "2" ], [ "0, 101", "1" ], [ "3, 11", "8" ], [ "100, 101", "1" ] ]
def modp(n: int, p: int): """Return 2^n modulo p (be aware of numerics). """ ret = 1 for i in range(n): ret = (2 * ret) % p
HumanEval_SingleLineInfillingLight
modp
python
python
[ [ "3, 5", "3" ], [ "1101, 101", "2" ], [ "0, 101", "1" ], [ "3, 11", "8" ], [ "100, 101", "1" ], [ "30, 5", "4" ], [ "31, 5", "3" ] ]
[]
returns encoded string by shifting every character by 5 in the alphabet.
[]
SingleLineInfilling/HumanEval/50/L0
code_infilling
return "".join([chr(((ord(ch) - 5 - ord("a")) % 26) + ord("a")) for ch in s])
[]
def encode_shift(s: str): """ returns encoded string by shifting every character by 5 in the alphabet. """ return "".join([chr(((ord(ch) + 5 - ord("a")) % 26) + ord("a")) for ch in s]) def decode_shift(s: str): """ takes as input string encoded with encode_shift function. Returns decoded string. """
HumanEval_SingleLineInfillingLight
decode_shift
python
python
[ [ "\"nppetuavkhytds\"", "\"ikkzopvqfctoyn\"" ], [ "\"jkwevzwwetoiui\"", "\"efrzqurrzojdpd\"" ], [ "\"deqhgbmrgyvolvllvgu\"", "\"yzlcbwhmbtqjgqggqbp\"" ], [ "\"adwtpwmzzsba\"", "\"vyrokrhuunwv\"" ], [ "\"kviyfxcqqk\"", "\"fqdtasxllf\"" ], [ "\"owuxsmtkqyi\"", "\"jrpsnhofltd\"" ], [ "\"nnmfgsupnnlfnyke\"", "\"iihabnpkiigaitfz\"" ], [ "\"neklmdclmzoro\"", "\"izfghyxghujmj\"" ], [ "\"lesnecsgpsgcya\"", "\"gznizxnbknbxtv\"" ], [ "\"oxbtwcbwsxinxvdwir\"", "\"jsworxwrnsdisqyrdm\"" ], [ "\"sdghpnyvoqrwpzgvdu\"", "\"nybckitqjlmrkubqyp\"" ], [ "\"jyzljgmjrbquen\"", "\"etugebhemwlpzi\"" ], [ "\"zgyrlfbwabpjhperjslh\"", "\"ubtmgawrvwkeckzmengc\"" ], [ "\"qleffvhomvtyngciggde\"", "\"lgzaaqcjhqotibxdbbyz\"" ], [ "\"qqpicuvmrtkj\"", "\"llkdxpqhmofe\"" ], [ "\"jyyevmecuetxqrirfd\"", "\"ettzqhzxpzoslmdmay\"" ], [ "\"lmbsrqvjevdtb\"", "\"ghwnmlqezqyow\"" ], [ "\"whxcodekelxlmln\"", "\"rcsxjyzfzgsghgi\"" ], [ "\"delrtygeoyvml\"", "\"yzgmotbzjtqhg\"" ], [ "\"apdqbcrttlq\"", "\"vkylwxmoogl\"" ], [ "\"xttskzvkfh\"", "\"soonfuqfac\"" ], [ "\"olbwqqdnru\"", "\"jgwrllyimp\"" ], [ "\"ehdpgbpcwbqsqr\"", "\"zcykbwkxrwlnlm\"" ], [ "\"oxbdypniamafgtsz\"", "\"jswytkidvhvabonu\"" ], [ "\"sdnuydcckyvllunfbxi\"", "\"nyiptyxxftqggpiawsd\"" ], [ "\"antvcacedbucqjmhl\"", "\"vioqxvxzywpxlehcg\"" ], [ "\"zogbormycllavatve\"", "\"ujbwjmhtxggvqvoqz\"" ], [ "\"fuueutygaxwywovpnigy\"", "\"appzpotbvsrtrjqkidbt\"" ], [ "\"jknughmjbqvtcrulb\"", "\"efipbchewlqoxmpgw\"" ], [ "\"xbvxtynbqwz\"", "\"swqsotiwlru\"" ], [ "\"mgctjkezbtnklcsw\"", "\"hbxoefzuwoifgxnr\"" ], [ "\"fmelllajoemkowluz\"", "\"ahzgggvejzhfjrgpu\"" ], [ "\"ptozvzdtyvnhzime\"", "\"kojuquyotqicudhz\"" ], [ "\"xxhgplwbzs\"", "\"sscbkgrwun\"" ], [ "\"rfzoarauxuka\"", "\"maujvmvpspfv\"" ], [ "\"twqnkxildqtbrbjwyqrh\"", "\"orlifsdgylowmwertlmc\"" ], [ "\"eildvqeupsl\"", "\"zdgyqlzpkng\"" ], [ "\"pnzptdzfhzxpn\"", "\"kiukoyuacuski\"" ], [ "\"hbmzwirdoar\"", "\"cwhurdmyjvm\"" ], [ "\"gaqxkjkpnwkca\"", "\"bvlsfefkirfxv\"" ], [ "\"xddhfaftiziqebsa\"", "\"syycavaodudlzwnv\"" ], [ "\"ydyqdhblfckp\"", "\"tytlycwgaxfk\"" ], [ "\"ymypgwmwogoudeq\"", "\"thtkbrhrjbjpyzl\"" ], [ "\"unvmuxgbdyhchso\"", "\"piqhpsbwytcxcnj\"" ], [ "\"dhghjsovcb\"", "\"ycbcenjqxw\"" ], [ "\"piinwbmppf\"", "\"kddirwhkka\"" ], [ "\"zvyoceomaxjcgwprqm\"", "\"uqtjxzjhvsexbrkmlh\"" ], [ "\"eijmnrfqtqudyv\"", "\"zdehimalolpytq\"" ], [ "\"qpeqklfmwnry\"", "\"lkzlfgahrimt\"" ], [ "\"fwnkdnyqbo\"", "\"arifyitlwj\"" ], [ "\"smcxegzdxbfd\"", "\"nhxszbuysway\"" ], [ "\"jvtkgaecmqnpszjvf\"", "\"eqofbvzxhliknueqa\"" ], [ "\"aurjwvkebktdv\"", "\"vpmerqfzwfoyq\"" ], [ "\"nfmmmhjeliakugh\"", "\"iahhhcezgdvfpbc\"" ], [ "\"eyfxptmpshohi\"", "\"ztaskohkncjcd\"" ], [ "\"glaoltrkxsmxspdvow\"", "\"bgvjgomfsnhsnkyqjr\"" ], [ "\"zwyupdxanebym\"", "\"urtpkysvizwth\"" ], [ "\"xkoigfpvcvqcxcgeoq\"", "\"sfjdbakqxqlxsxbzjl\"" ], [ "\"fgizxalyjcpkvkt\"", "\"abdusvgtexkfqfo\"" ], [ "\"zirsuhlzwi\"", "\"udmnpcgurd\"" ], [ "\"zhwqbyhkbqeomarlldcb\"", "\"ucrlwtcfwlzjhvmggyxw\"" ], [ "\"rvshqbrvsxnjfjakul\"", "\"mqnclwmqnsieaevfpg\"" ], [ "\"nktgcnuxplhfsm\"", "\"ifobxipskgcanh\"" ], [ "\"baoiqymypxkvlrn\"", "\"wvjdlthtksfqgmi\"" ], [ "\"nwagelwecafiphlj\"", "\"irvbzgrzxvadkcge\"" ], [ "\"kbqtmzbujxumptcvyl\"", "\"fwlohuwpesphkoxqtg\"" ], [ "\"dujvyrdslwf\"", "\"ypeqtmyngra\"" ], [ "\"vujolzbqoqekvv\"", "\"qpejguwljlzfqq\"" ], [ "\"hbbdoumleckjwhws\"", "\"cwwyjphgzxfercrn\"" ], [ "\"aykhykkfnxckhmzndki\"", "\"vtfctffaisxfchuiyfd\"" ], [ "\"wpidhybggvempzrfa\"", "\"rkdyctwbbqzhkumav\"" ], [ "\"dwgrdroeuiduby\"", "\"yrbmymjzpdypwt\"" ], [ "\"yptrachqjtgrgqxy\"", "\"tkomvxcleobmblst\"" ], [ "\"gjragaaocfbadfbeebky\"", "\"bemvbvvjxawvyawzzwft\"" ], [ "\"rnisigwzqqshj\"", "\"midndbrullnce\"" ], [ "\"gzivhmjtyysqsuqubbur\"", "\"budqcheottnlnplpwwpm\"" ], [ "\"gfmeiuvbyuuiiflplahw\"", "\"bahzdpqwtppddagkgvcr\"" ], [ "\"iczpwzppirpxfm\"", "\"dxukrukkdmksah\"" ], [ "\"hwtxjblmlsikphbivd\"", "\"crosewghgndfkcwdqy\"" ], [ "\"fwzjefnnnjwhv\"", "\"aruezaiiiercq\"" ], [ "\"sysvhbbqkh\"", "\"ntnqcwwlfc\"" ], [ "\"lbwiwpvlcdtvh\"", "\"gwrdrkqgxyoqc\"" ], [ "\"rlehhmhevv\"", "\"mgzcchczqq\"" ], [ "\"qtrfjsocbsldii\"", "\"lomaenjxwngydd\"" ], [ "\"eszhonrsle\"", "\"znucjimngz\"" ], [ "\"jvzxprqiyfqfj\"", "\"equskmldtalae\"" ], [ "\"wdzasevrfyobkbro\"", "\"ryuvnzqmatjwfwmj\"" ], [ "\"hzvhjetyyntxiplf\"", "\"cuqcezottiosdkga\"" ], [ "\"yfskmymfdjqooty\"", "\"tanfhthayeljjot\"" ], [ "\"rrtepprngbbv\"", "\"mmozkkmibwwq\"" ], [ "\"zsqaqzsbxtwpqa\"", "\"unlvlunwsorklv\"" ], [ "\"kneyiarobkgl\"", "\"fiztdvmjwfbg\"" ], [ "\"xxbudxuwlhi\"", "\"sswpysprgcd\"" ], [ "\"fetivyuynb\"", "\"azodqtptiw\"" ], [ "\"syswumgxpgxmcwzgedq\"", "\"ntnrphbskbshxrubzyl\"" ], [ "\"xychwdsfyfoly\"", "\"stxcrynatajgt\"" ], [ "\"nfwrujwavgavutrxuzsg\"", "\"iarmpervqbvqpomspunb\"" ], [ "\"vuhhhndgmzkwplolb\"", "\"qpccciybhufrkgjgw\"" ], [ "\"fwqxfhbqjbgryci\"", "\"arlsacwlewbmtxd\"" ], [ "\"amzcptlnzkor\"", "\"vhuxkogiufjm\"" ] ]
[]
remove_vowels is a function that takes string and returns string without vowels.
[]
SingleLineInfilling/HumanEval/51/L0
code_infilling
return "".join([s for s in text if s.lower() not in ["a", "e", "i", "o", "u"]])
[ [ "''", "''" ], [ "\"abcdef\\nghijklm\"", "'bcdf\\nghjklm'" ], [ "'abcdef'", "'bcdf'" ], [ "'aaaaa'", "''" ], [ "'aaBAA'", "'B'" ], [ "'zbcd'", "'zbcd'" ] ]
def remove_vowels(text): """ remove_vowels is a function that takes string and returns string without vowels. """
HumanEval_SingleLineInfillingLight
remove_vowels
python
python
[ [ "''", "''" ], [ "\"abcdef\\nghijklm\"", "'bcdf\\nghjklm'" ], [ "'fedcba'", "'fdcb'" ], [ "'eeeee'", "''" ], [ "'acBAA'", "'cB'" ], [ "'EcBOO'", "'cB'" ], [ "'ybcd'", "'ybcd'" ] ]
[]
Return True if all numbers in the list l are below threshold t.
if e >= t: return False return True
[]
SingleLineInfilling/HumanEval/52/L0
code_infilling
for e in l:
[ [ "[1, 2, 4, 10], 100", "True" ], [ "[1, 20, 4, 10], 5", "False" ] ]
def below_threshold(l: list, t: int): """Return True if all numbers in the list l are below threshold t. """
HumanEval_SingleLineInfillingLight
below_threshold
python
python
[]
[]
Return True if all numbers in the list l are below threshold t.
return False return True
[]
SingleLineInfilling/HumanEval/52/L1
code_infilling
if e >= t:
[ [ "[1, 2, 4, 10], 100", "True" ], [ "[1, 20, 4, 10], 5", "False" ] ]
def below_threshold(l: list, t: int): """Return True if all numbers in the list l are below threshold t. """ for e in l:
HumanEval_SingleLineInfillingLight
below_threshold
python
python
[]
[]
Return True if all numbers in the list l are below threshold t.
return True
[]
SingleLineInfilling/HumanEval/52/L2
code_infilling
return False
[ [ "[1, 2, 4, 10], 100", "True" ], [ "[1, 20, 4, 10], 5", "False" ] ]
def below_threshold(l: list, t: int): """Return True if all numbers in the list l are below threshold t. """ for e in l: if e >= t:
HumanEval_SingleLineInfillingLight
below_threshold
python
python
[]
[]
Return True if all numbers in the list l are below threshold t.
[]
SingleLineInfilling/HumanEval/52/L3
code_infilling
return True
[ [ "[1, 2, 4, 10], 100", "True" ], [ "[1, 20, 4, 10], 5", "False" ] ]
def below_threshold(l: list, t: int): """Return True if all numbers in the list l are below threshold t. """ for e in l: if e >= t: return False
HumanEval_SingleLineInfillingLight
below_threshold
python
python
[]
[]
Add two numbers x and y
[]
SingleLineInfilling/HumanEval/53/L0
code_infilling
return x + y
[ [ "2, 3", "5" ], [ "5, 7", "12" ] ]
def add(x: int, y: int): """Add two numbers x and y """
HumanEval_SingleLineInfillingLight
add
python
python
[ [ "0, 1", "1" ], [ "1, 0", "1" ], [ "2, 3", "5" ], [ "5, 7", "12" ], [ "7, 5", "12" ] ]
[]
Check if two words have the same characters.
[]
SingleLineInfilling/HumanEval/54/L0
code_infilling
return set(s0) == set(s1)
[ [ "'eabcdzzzz', 'dddzzzzzzzddeddabc'", "True" ], [ "'abcd', 'dddddddabc'", "True" ], [ "'dddddddabc', 'abcd'", "True" ], [ "'eabcd', 'dddddddabc'", "False" ], [ "'abcd', 'dddddddabce'", "False" ], [ "'eabcdzzzz', 'dddzzzzzzzddddabc'", "False" ] ]
def same_chars(s0: str, s1: str): """ Check if two words have the same characters. """
HumanEval_SingleLineInfillingLight
same_chars
python
python
[ [ "'eabcdzzzz', 'dddzzzzzzzddeddabc'", "True" ], [ "'abcd', 'dddddddabc'", "True" ], [ "'dddddddabc', 'abcd'", "True" ], [ "'eabcd', 'dddddddabc'", "False" ], [ "'abcd', 'dddddddabcf'", "False" ], [ "'eabcdzzzz', 'dddzzzzzzzddddabc'", "False" ], [ "'aabb', 'aaccc'", "False" ] ]
[]
Return n-th Fibonacci number.
return 0 if n == 1: return 1 return fib(n - 1) + fib(n - 2)
[]
SingleLineInfilling/HumanEval/55/L0
code_infilling
if n == 0:
[ [ "10", "55" ], [ "1", "1" ], [ "8", "21" ] ]
def fib(n: int): """Return n-th Fibonacci number. """
HumanEval_SingleLineInfillingLight
fib
python
python
[ [ "10", "55" ], [ "1", "1" ], [ "8", "21" ], [ "11", "89" ], [ "12", "144" ] ]
[]
Return n-th Fibonacci number.
if n == 1: return 1 return fib(n - 1) + fib(n - 2)
[]
SingleLineInfilling/HumanEval/55/L1
code_infilling
return 0
[ [ "10", "55" ], [ "1", "1" ], [ "8", "21" ] ]
def fib(n: int): """Return n-th Fibonacci number. """ if n == 0:
HumanEval_SingleLineInfillingLight
fib
python
python
[ [ "10", "55" ], [ "1", "1" ], [ "8", "21" ], [ "11", "89" ], [ "12", "144" ] ]
[]
Return n-th Fibonacci number.
return 1 return fib(n - 1) + fib(n - 2)
[]
SingleLineInfilling/HumanEval/55/L2
code_infilling
if n == 1:
[ [ "10", "55" ], [ "1", "1" ], [ "8", "21" ] ]
def fib(n: int): """Return n-th Fibonacci number. """ if n == 0: return 0
HumanEval_SingleLineInfillingLight
fib
python
python
[ [ "10", "55" ], [ "1", "1" ], [ "8", "21" ], [ "11", "89" ], [ "12", "144" ] ]
[]
Return n-th Fibonacci number.
return fib(n - 1) + fib(n - 2)
[]
SingleLineInfilling/HumanEval/55/L3
code_infilling
return 1
[ [ "10", "55" ], [ "1", "1" ], [ "8", "21" ] ]
def fib(n: int): """Return n-th Fibonacci number. """ if n == 0: return 0 if n == 1:
HumanEval_SingleLineInfillingLight
fib
python
python
[ [ "10", "55" ], [ "1", "1" ], [ "8", "21" ], [ "11", "89" ], [ "12", "144" ] ]
[]
Return n-th Fibonacci number.
[]
SingleLineInfilling/HumanEval/55/L4
code_infilling
return fib(n - 1) + fib(n - 2)
[ [ "10", "55" ], [ "1", "1" ], [ "8", "21" ] ]
def fib(n: int): """Return n-th Fibonacci number. """ if n == 0: return 0 if n == 1: return 1
HumanEval_SingleLineInfillingLight
fib
python
python
[ [ "10", "55" ], [ "1", "1" ], [ "8", "21" ], [ "11", "89" ], [ "12", "144" ] ]
[]
brackets is a string of "<" and ">". return True if every opening bracket has a corresponding closing bracket.
for b in brackets: if b == "<": depth += 1 else: depth -= 1 if depth < 0: return False return depth == 0
[]
SingleLineInfilling/HumanEval/56/L0
code_infilling
depth = 0
[ [ "\"<\"", "False" ], [ "\"<>\"", "True" ], [ "\"<<><>>\"", "True" ], [ "\"><<>\"", "False" ] ]
def correct_bracketing(brackets: str): """ brackets is a string of "<" and ">". return True if every opening bracket has a corresponding closing bracket. """
HumanEval_SingleLineInfillingLight
correct_bracketing
python
python
[]
[]
brackets is a string of "<" and ">". return True if every opening bracket has a corresponding closing bracket.
if b == "<": depth += 1 else: depth -= 1 if depth < 0: return False return depth == 0
[]
SingleLineInfilling/HumanEval/56/L1
code_infilling
for b in brackets:
[ [ "\"<\"", "False" ], [ "\"<>\"", "True" ], [ "\"<<><>>\"", "True" ], [ "\"><<>\"", "False" ] ]
def correct_bracketing(brackets: str): """ brackets is a string of "<" and ">". return True if every opening bracket has a corresponding closing bracket. """ depth = 0
HumanEval_SingleLineInfillingLight
correct_bracketing
python
python
[]
[]
brackets is a string of "<" and ">". return True if every opening bracket has a corresponding closing bracket.
depth += 1 else: depth -= 1 if depth < 0: return False return depth == 0
[]
SingleLineInfilling/HumanEval/56/L2
code_infilling
if b == "<":
[ [ "\"<\"", "False" ], [ "\"<>\"", "True" ], [ "\"<<><>>\"", "True" ], [ "\"><<>\"", "False" ] ]
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:
HumanEval_SingleLineInfillingLight
correct_bracketing
python
python
[]
[]
brackets is a string of "<" and ">". return True if every opening bracket has a corresponding closing bracket.
else: depth -= 1 if depth < 0: return False return depth == 0
[]
SingleLineInfilling/HumanEval/56/L3
code_infilling
depth += 1
[ [ "\"<\"", "False" ], [ "\"<>\"", "True" ], [ "\"<<><>>\"", "True" ], [ "\"><<>\"", "False" ] ]
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 == "<":
HumanEval_SingleLineInfillingLight
correct_bracketing
python
python
[]
[]
brackets is a string of "<" and ">". return True if every opening bracket has a corresponding closing bracket.
depth -= 1 if depth < 0: return False return depth == 0
[]
SingleLineInfilling/HumanEval/56/L4
code_infilling
else:
[ [ "\"<\"", "False" ], [ "\"<>\"", "True" ], [ "\"<<><>>\"", "True" ], [ "\"><<>\"", "False" ] ]
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
HumanEval_SingleLineInfillingLight
correct_bracketing
python
python
[]
[]
brackets is a string of "<" and ">". return True if every opening bracket has a corresponding closing bracket.
if depth < 0: return False return depth == 0
[]
SingleLineInfilling/HumanEval/56/L5
code_infilling
depth -= 1
[ [ "\"<\"", "False" ], [ "\"<>\"", "True" ], [ "\"<<><>>\"", "True" ], [ "\"><<>\"", "False" ] ]
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:
HumanEval_SingleLineInfillingLight
correct_bracketing
python
python
[]
[]
brackets is a string of "<" and ">". return True if every opening bracket has a corresponding closing bracket.
return False return depth == 0
[]
SingleLineInfilling/HumanEval/56/L6
code_infilling
if depth < 0:
[ [ "\"<\"", "False" ], [ "\"<>\"", "True" ], [ "\"<<><>>\"", "True" ], [ "\"><<>\"", "False" ] ]
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
HumanEval_SingleLineInfillingLight
correct_bracketing
python
python
[]
[]
brackets is a string of "<" and ">". return True if every opening bracket has a corresponding closing bracket.
return depth == 0
[]
SingleLineInfilling/HumanEval/56/L7
code_infilling
return False
[ [ "\"<\"", "False" ], [ "\"<>\"", "True" ], [ "\"<<><>>\"", "True" ], [ "\"><<>\"", "False" ] ]
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:
HumanEval_SingleLineInfillingLight
correct_bracketing
python
python
[]
[]
brackets is a string of "<" and ">". return True if every opening bracket has a corresponding closing bracket.
[]
SingleLineInfilling/HumanEval/56/L8
code_infilling
return depth == 0
[ [ "\"<\"", "False" ], [ "\"<>\"", "True" ], [ "\"<<><>>\"", "True" ], [ "\"><<>\"", "False" ] ]
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
HumanEval_SingleLineInfillingLight
correct_bracketing
python
python
[]
[]
Return True is list elements are monotonically increasing or decreasing.
return True return False
[]
SingleLineInfilling/HumanEval/57/L0
code_infilling
if l == sorted(l) or l == sorted(l, reverse=True):
[ [ "[1, 2, 4, 20]", "True" ], [ "[1, 20, 4, 10]", "False" ], [ "[4, 1, 0, -10]", "True" ] ]
def monotonic(l: list): """Return True is list elements are monotonically increasing or decreasing. """
HumanEval_SingleLineInfillingLight
monotonic
python
python
[ [ "[1, 2, 4, 10]", "True" ], [ "[1, 2, 4, 20]", "True" ], [ "[1, 20, 4, 10]", "False" ], [ "[4, 1, 0, -10]", "True" ], [ "[4, 1, 1, 0]", "True" ], [ "[1, 2, 3, 2, 5, 60]", "False" ], [ "[1, 2, 3, 4, 5, 60]", "True" ], [ "[9, 9, 9, 9]", "True" ] ]
[]
Return True is list elements are monotonically increasing or decreasing.
return False
[]
SingleLineInfilling/HumanEval/57/L1
code_infilling
return True
[ [ "[1, 2, 4, 20]", "True" ], [ "[1, 20, 4, 10]", "False" ], [ "[4, 1, 0, -10]", "True" ] ]
def monotonic(l: list): """Return True is list elements are monotonically increasing or decreasing. """ if l == sorted(l) or l == sorted(l, reverse=True):
HumanEval_SingleLineInfillingLight
monotonic
python
python
[ [ "[1, 2, 4, 10]", "True" ], [ "[1, 2, 4, 20]", "True" ], [ "[1, 20, 4, 10]", "False" ], [ "[4, 1, 0, -10]", "True" ], [ "[4, 1, 1, 0]", "True" ], [ "[1, 2, 3, 2, 5, 60]", "False" ], [ "[1, 2, 3, 4, 5, 60]", "True" ], [ "[9, 9, 9, 9]", "True" ] ]
[]
Return True is list elements are monotonically increasing or decreasing.
[]
SingleLineInfilling/HumanEval/57/L2
code_infilling
return False
[ [ "[1, 2, 4, 20]", "True" ], [ "[1, 20, 4, 10]", "False" ], [ "[4, 1, 0, -10]", "True" ] ]
def monotonic(l: list): """Return True is list elements are monotonically increasing or decreasing. """ if l == sorted(l) or l == sorted(l, reverse=True): return True
HumanEval_SingleLineInfillingLight
monotonic
python
python
[ [ "[1, 2, 4, 10]", "True" ], [ "[1, 2, 4, 20]", "True" ], [ "[1, 20, 4, 10]", "False" ], [ "[4, 1, 0, -10]", "True" ], [ "[4, 1, 1, 0]", "True" ], [ "[1, 2, 3, 2, 5, 60]", "False" ], [ "[1, 2, 3, 4, 5, 60]", "True" ], [ "[9, 9, 9, 9]", "True" ] ]
[]
Return sorted unique common elements for two lists.
for e1 in l1: for e2 in l2: if e1 == e2: ret.add(e1) return sorted(list(ret))
[]
SingleLineInfilling/HumanEval/58/L0
code_infilling
ret = set()
[ [ "[1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]", "[1, 5, 653]" ], [ "[5, 3, 2, 8], [3, 2]", "[2, 3]" ] ]
def common(l1: list, l2: list): """Return sorted unique common elements for two lists. """
HumanEval_SingleLineInfillingLight
common
python
python
[ [ "[1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]", "[1, 5, 653]" ], [ "[5, 3, 2, 8], [3, 2]", "[2, 3]" ], [ "[4, 3, 2, 8], [3, 2, 4]", "[2, 3, 4]" ], [ "[4, 3, 2, 8], []", "[]" ] ]
[]
Return sorted unique common elements for two lists.
for e2 in l2: if e1 == e2: ret.add(e1) return sorted(list(ret))
[]
SingleLineInfilling/HumanEval/58/L1
code_infilling
for e1 in l1:
[ [ "[1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]", "[1, 5, 653]" ], [ "[5, 3, 2, 8], [3, 2]", "[2, 3]" ] ]
def common(l1: list, l2: list): """Return sorted unique common elements for two lists. """ ret = set()
HumanEval_SingleLineInfillingLight
common
python
python
[ [ "[1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]", "[1, 5, 653]" ], [ "[5, 3, 2, 8], [3, 2]", "[2, 3]" ], [ "[4, 3, 2, 8], [3, 2, 4]", "[2, 3, 4]" ], [ "[4, 3, 2, 8], []", "[]" ] ]
[]
Return sorted unique common elements for two lists.
if e1 == e2: ret.add(e1) return sorted(list(ret))
[]
SingleLineInfilling/HumanEval/58/L2
code_infilling
for e2 in l2:
[ [ "[1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]", "[1, 5, 653]" ], [ "[5, 3, 2, 8], [3, 2]", "[2, 3]" ] ]
def common(l1: list, l2: list): """Return sorted unique common elements for two lists. """ ret = set() for e1 in l1:
HumanEval_SingleLineInfillingLight
common
python
python
[ [ "[1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]", "[1, 5, 653]" ], [ "[5, 3, 2, 8], [3, 2]", "[2, 3]" ], [ "[4, 3, 2, 8], [3, 2, 4]", "[2, 3, 4]" ], [ "[4, 3, 2, 8], []", "[]" ] ]
[]
Return sorted unique common elements for two lists.
ret.add(e1) return sorted(list(ret))
[]
SingleLineInfilling/HumanEval/58/L3
code_infilling
if e1 == e2:
[ [ "[1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]", "[1, 5, 653]" ], [ "[5, 3, 2, 8], [3, 2]", "[2, 3]" ] ]
def common(l1: list, l2: list): """Return sorted unique common elements for two lists. """ ret = set() for e1 in l1: for e2 in l2:
HumanEval_SingleLineInfillingLight
common
python
python
[ [ "[1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]", "[1, 5, 653]" ], [ "[5, 3, 2, 8], [3, 2]", "[2, 3]" ], [ "[4, 3, 2, 8], [3, 2, 4]", "[2, 3, 4]" ], [ "[4, 3, 2, 8], []", "[]" ] ]
[]
Return sorted unique common elements for two lists.
return sorted(list(ret))
[]
SingleLineInfilling/HumanEval/58/L4
code_infilling
ret.add(e1)
[ [ "[1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]", "[1, 5, 653]" ], [ "[5, 3, 2, 8], [3, 2]", "[2, 3]" ] ]
def common(l1: list, l2: list): """Return sorted unique common elements for two lists. """ ret = set() for e1 in l1: for e2 in l2: if e1 == e2:
HumanEval_SingleLineInfillingLight
common
python
python
[ [ "[1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]", "[1, 5, 653]" ], [ "[5, 3, 2, 8], [3, 2]", "[2, 3]" ], [ "[4, 3, 2, 8], [3, 2, 4]", "[2, 3, 4]" ], [ "[4, 3, 2, 8], []", "[]" ] ]
[]
Return sorted unique common elements for two lists.
[]
SingleLineInfilling/HumanEval/58/L5
code_infilling
return sorted(list(ret))
[ [ "[1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]", "[1, 5, 653]" ], [ "[5, 3, 2, 8], [3, 2]", "[2, 3]" ] ]
def common(l1: list, l2: list): """Return sorted unique common elements for two lists. """ ret = set() for e1 in l1: for e2 in l2: if e1 == e2: ret.add(e1)
HumanEval_SingleLineInfillingLight
common
python
python
[ [ "[1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]", "[1, 5, 653]" ], [ "[5, 3, 2, 8], [3, 2]", "[2, 3]" ], [ "[4, 3, 2, 8], [3, 2, 4]", "[2, 3, 4]" ], [ "[4, 3, 2, 8], []", "[]" ] ]
[]
Return the largest prime factor of n. Assume n > 1 and is not a prime.
if k < 2: 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
[]
SingleLineInfilling/HumanEval/59/L0
code_infilling
def is_prime(k):
[ [ "13195", "29" ], [ "2048", "2" ] ]
def largest_prime_factor(n: int): """Return the largest prime factor of n. Assume n > 1 and is not a prime. """
HumanEval_SingleLineInfillingLight
largest_prime_factor
python
python
[ [ "15", "5" ], [ "27", "3" ], [ "63", "7" ], [ "330", "11" ], [ "13195", "29" ] ]
[]
Return the largest prime factor of n. Assume n > 1 and is not a prime.
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
[]
SingleLineInfilling/HumanEval/59/L1
code_infilling
if k < 2:
[ [ "13195", "29" ], [ "2048", "2" ] ]
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):
HumanEval_SingleLineInfillingLight
largest_prime_factor
python
python
[ [ "15", "5" ], [ "27", "3" ], [ "63", "7" ], [ "330", "11" ], [ "13195", "29" ] ]
[]
Return the largest prime factor of n. Assume n > 1 and is not a prime.
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
[]
SingleLineInfilling/HumanEval/59/L2
code_infilling
return False
[ [ "13195", "29" ], [ "2048", "2" ] ]
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:
HumanEval_SingleLineInfillingLight
largest_prime_factor
python
python
[ [ "15", "5" ], [ "27", "3" ], [ "63", "7" ], [ "330", "11" ], [ "13195", "29" ] ]
[]
Return the largest prime factor of n. Assume n > 1 and is not a prime.
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
[]
SingleLineInfilling/HumanEval/59/L3
code_infilling
for i in range(2, k - 1):
[ [ "13195", "29" ], [ "2048", "2" ] ]
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
HumanEval_SingleLineInfillingLight
largest_prime_factor
python
python
[ [ "15", "5" ], [ "27", "3" ], [ "63", "7" ], [ "330", "11" ], [ "13195", "29" ] ]
[]
Return the largest prime factor of n. Assume n > 1 and is not a prime.
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
[]
SingleLineInfilling/HumanEval/59/L4
code_infilling
if k % i == 0:
[ [ "13195", "29" ], [ "2048", "2" ] ]
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):
HumanEval_SingleLineInfillingLight
largest_prime_factor
python
python
[ [ "15", "5" ], [ "27", "3" ], [ "63", "7" ], [ "330", "11" ], [ "13195", "29" ] ]
[]
Return the largest prime factor of n. Assume n > 1 and is not a prime.
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
[]
SingleLineInfilling/HumanEval/59/L5
code_infilling
return False
[ [ "13195", "29" ], [ "2048", "2" ] ]
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 == 0:
HumanEval_SingleLineInfillingLight
largest_prime_factor
python
python
[ [ "15", "5" ], [ "27", "3" ], [ "63", "7" ], [ "330", "11" ], [ "13195", "29" ] ]
[]
Return the largest prime factor of n. Assume n > 1 and is not a prime.
largest = 1 for j in range(2, n + 1): if n % j == 0 and is_prime(j): largest = max(largest, j) return largest
[]
SingleLineInfilling/HumanEval/59/L6
code_infilling
return True
[ [ "13195", "29" ], [ "2048", "2" ] ]
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 == 0: return False
HumanEval_SingleLineInfillingLight
largest_prime_factor
python
python
[ [ "15", "5" ], [ "27", "3" ], [ "63", "7" ], [ "330", "11" ], [ "13195", "29" ] ]
[]
Return the largest prime factor of n. Assume n > 1 and is not a prime.
for j in range(2, n + 1): if n % j == 0 and is_prime(j): largest = max(largest, j) return largest
[]
SingleLineInfilling/HumanEval/59/L7
code_infilling
largest = 1
[ [ "13195", "29" ], [ "2048", "2" ] ]
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 == 0: return False return True
HumanEval_SingleLineInfillingLight
largest_prime_factor
python
python
[ [ "15", "5" ], [ "27", "3" ], [ "63", "7" ], [ "330", "11" ], [ "13195", "29" ] ]
[]
Return the largest prime factor of n. Assume n > 1 and is not a prime.
if n % j == 0 and is_prime(j): largest = max(largest, j) return largest
[]
SingleLineInfilling/HumanEval/59/L8
code_infilling
for j in range(2, n + 1):
[ [ "13195", "29" ], [ "2048", "2" ] ]
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 == 0: return False return True largest = 1
HumanEval_SingleLineInfillingLight
largest_prime_factor
python
python
[ [ "15", "5" ], [ "27", "3" ], [ "63", "7" ], [ "330", "11" ], [ "13195", "29" ] ]
[]
Return the largest prime factor of n. Assume n > 1 and is not a prime.
largest = max(largest, j) return largest
[]
SingleLineInfilling/HumanEval/59/L9
code_infilling
if n % j == 0 and is_prime(j):
[ [ "13195", "29" ], [ "2048", "2" ] ]
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 == 0: return False return True largest = 1 for j in range(2, n + 1):
HumanEval_SingleLineInfillingLight
largest_prime_factor
python
python
[ [ "15", "5" ], [ "27", "3" ], [ "63", "7" ], [ "330", "11" ], [ "13195", "29" ] ]
[]
Return the largest prime factor of n. Assume n > 1 and is not a prime.
return largest
[]
SingleLineInfilling/HumanEval/59/L10
code_infilling
largest = max(largest, j)
[ [ "13195", "29" ], [ "2048", "2" ] ]
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 == 0: return False return True largest = 1 for j in range(2, n + 1): if n % j == 0 and is_prime(j):
HumanEval_SingleLineInfillingLight
largest_prime_factor
python
python
[ [ "15", "5" ], [ "27", "3" ], [ "63", "7" ], [ "330", "11" ], [ "13195", "29" ] ]
[]
Return the largest prime factor of n. Assume n > 1 and is not a prime.
[]
SingleLineInfilling/HumanEval/59/L11
code_infilling
return largest
[ [ "13195", "29" ], [ "2048", "2" ] ]
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 == 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)
HumanEval_SingleLineInfillingLight
largest_prime_factor
python
python
[ [ "15", "5" ], [ "27", "3" ], [ "63", "7" ], [ "330", "11" ], [ "13195", "29" ] ]
[]
sum_to_n is a function that sums numbers from 1 to n.
[]
SingleLineInfilling/HumanEval/60/L0
code_infilling
return sum(range(n + 1))
[ [ "30", "465" ], [ "100", "5050" ], [ "5", "15" ], [ "10", "55" ], [ "1", "1" ] ]
def sum_to_n(n: int): """sum_to_n is a function that sums numbers from 1 to n. """
HumanEval_SingleLineInfillingLight
sum_to_n
python
python
[ [ "1", "1" ], [ "6", "21" ], [ "11", "66" ], [ "30", "465" ], [ "100", "5050" ] ]
[]
brackets is a string of "(" and ")". return True if every opening bracket has a corresponding closing bracket.
for b in brackets: if b == "(": depth += 1 else: depth -= 1 if depth < 0: return False return depth == 0
[]
SingleLineInfilling/HumanEval/61/L0
code_infilling
depth = 0
[ [ "\"(\"", "False" ], [ "\"()\"", "True" ], [ "\"(()())\"", "True" ], [ "\")(()\"", "False" ] ]
def correct_bracketing(brackets: str): """ brackets is a string of "(" and ")". return True if every opening bracket has a corresponding closing bracket. """
HumanEval_SingleLineInfillingLight
correct_bracketing
python
python
[]
[]
brackets is a string of "(" and ")". return True if every opening bracket has a corresponding closing bracket.
if b == "(": depth += 1 else: depth -= 1 if depth < 0: return False return depth == 0
[]
SingleLineInfilling/HumanEval/61/L1
code_infilling
for b in brackets:
[ [ "\"(\"", "False" ], [ "\"()\"", "True" ], [ "\"(()())\"", "True" ], [ "\")(()\"", "False" ] ]
def correct_bracketing(brackets: str): """ brackets is a string of "(" and ")". return True if every opening bracket has a corresponding closing bracket. """ depth = 0
HumanEval_SingleLineInfillingLight
correct_bracketing
python
python
[]
[]
brackets is a string of "(" and ")". return True if every opening bracket has a corresponding closing bracket.
depth += 1 else: depth -= 1 if depth < 0: return False return depth == 0
[]
SingleLineInfilling/HumanEval/61/L2
code_infilling
if b == "(":
[ [ "\"(\"", "False" ], [ "\"()\"", "True" ], [ "\"(()())\"", "True" ], [ "\")(()\"", "False" ] ]
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:
HumanEval_SingleLineInfillingLight
correct_bracketing
python
python
[]
[]
brackets is a string of "(" and ")". return True if every opening bracket has a corresponding closing bracket.
else: depth -= 1 if depth < 0: return False return depth == 0
[]
SingleLineInfilling/HumanEval/61/L3
code_infilling
depth += 1
[ [ "\"(\"", "False" ], [ "\"()\"", "True" ], [ "\"(()())\"", "True" ], [ "\")(()\"", "False" ] ]
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 == "(":
HumanEval_SingleLineInfillingLight
correct_bracketing
python
python
[]