test_cases listlengths 0 100 | import_str listlengths 0 1 | solution stringlengths 0 620 | suffix stringlengths 0 655 | tgt_lang stringclasses 1
value | doc_string stringclasses 164
values | compare_func listlengths 0 0 | prefix stringlengths 65 1.63k | demos listlengths 0 8 | data_id stringlengths 33 36 | src_lang stringclasses 1
value | task_name stringclasses 1
value | dataset_name stringclasses 1
value | entry_func stringclasses 158
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
[
[
"[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]",
"F... | [] | n(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
return False
| python | 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. | [] |
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(le | [
[
"[1, 3, 5, 0]",
"False"
],
[
"[1, 3, -2, 1]",
"True"
],
[
"[1, 2, 3, 7]",
"False"
],
[
"[2, 4, -5, 3, 9, 7]",
"True"
],
[
"[1]",
"False"
]
] | RandomSpanInfilling/HumanEval/40/1 | python | code_infilling | HumanEval_RandomSpanInfilling | triples_sum_to_zero |
[
[
"[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]",
"F... | [] | 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
return False
| python | 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. | [] |
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.
"""
| [
[
"[1, 3, 5, 0]",
"False"
],
[
"[1, 3, -2, 1]",
"True"
],
[
"[1, 2, 3, 7]",
"False"
],
[
"[2, 4, -5, 3, 9, 7]",
"True"
],
[
"[1]",
"False"
]
] | RandomSpanInfilling/HumanEval/40/2 | python | code_infilling | HumanEval_RandomSpanInfilling | triples_sum_to_zero |
[
[
"[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]",
"F... | [] | n 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
return False
| python | 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. | [] |
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 i | [
[
"[1, 3, 5, 0]",
"False"
],
[
"[1, 3, -2, 1]",
"True"
],
[
"[1, 2, 3, 7]",
"False"
],
[
"[2, 4, -5, 3, 9, 7]",
"True"
],
[
"[1]",
"False"
]
] | RandomSpanInfilling/HumanEval/40/3 | python | code_infilling | HumanEval_RandomSpanInfilling | triples_sum_to_zero |
[
[
"[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]",
"F... | [] | range(i + 1, len(l)):
for k in r | ange(j + 1, len(l)):
if l[i] + l[j] + l[k] == 0:
return True
return False
| python | 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. | [] |
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 | [
[
"[1, 3, 5, 0]",
"False"
],
[
"[1, 3, -2, 1]",
"True"
],
[
"[1, 2, 3, 7]",
"False"
],
[
"[2, 4, -5, 3, 9, 7]",
"True"
],
[
"[1]",
"False"
]
] | RandomSpanInfilling/HumanEval/40/4 | python | code_infilling | HumanEval_RandomSpanInfilling | triples_sum_to_zero |
[
[
"[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]",
"F... | [] | for j in range(i + 1, len(l)):
for k in range(j + 1, len(l)):
if l[i] + l[j] + l[k] == 0:
re | turn True
return False
| python | 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. | [] |
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)):
| [
[
"[1, 3, 5, 0]",
"False"
],
[
"[1, 3, -2, 1]",
"True"
],
[
"[1, 2, 3, 7]",
"False"
],
[
"[2, 4, -5, 3, 9, 7]",
"True"
],
[
"[1]",
"False"
]
] | RandomSpanInfilling/HumanEval/40/5 | python | code_infilling | HumanEval_RandomSpanInfilling | triples_sum_to_zero |
[
[
"[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]",
"F... | [] | 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
| python | 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. | [] |
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 | [
[
"[1, 3, 5, 0]",
"False"
],
[
"[1, 3, -2, 1]",
"True"
],
[
"[1, 2, 3, 7]",
"False"
],
[
"[2, 4, -5, 3, 9, 7]",
"True"
],
[
"[1]",
"False"
]
] | RandomSpanInfilling/HumanEval/40/6 | python | code_infilling | HumanEval_RandomSpanInfilling | triples_sum_to_zero |
[
[
"[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]",
"F... | [] | for k in range(j + 1, len(l)):
if l[i] + l[j] + l[k] == 0:
| return True
return False
| python | 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. | [] |
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)):
| [
[
"[1, 3, 5, 0]",
"False"
],
[
"[1, 3, -2, 1]",
"True"
],
[
"[1, 2, 3, 7]",
"False"
],
[
"[2, 4, -5, 3, 9, 7]",
"True"
],
[
"[1]",
"False"
]
] | RandomSpanInfilling/HumanEval/40/7 | python | code_infilling | HumanEval_RandomSpanInfilling | triples_sum_to_zero |
[
[
"[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]",
"F... | [] | ):
for j in r | ange(i + 1, len(l)):
for k in range(j + 1, len(l)):
if l[i] + l[j] + l[k] == 0:
return True
return False
| python | 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. | [] |
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) | [
[
"[1, 3, 5, 0]",
"False"
],
[
"[1, 3, -2, 1]",
"True"
],
[
"[1, 2, 3, 7]",
"False"
],
[
"[2, 4, -5, 3, 9, 7]",
"True"
],
[
"[1]",
"False"
]
] | RandomSpanInfilling/HumanEval/40/8 | python | code_infilling | HumanEval_RandomSpanInfilling | triples_sum_to_zero |
[
[
"[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]",
"F... | [] | 1, len(l)):
for k in range(j + 1, len(l)):
| if l[i] + l[j] + l[k] == 0:
return True
return False
| python | 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. | [] |
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, 3, 5, 0]",
"False"
],
[
"[1, 3, -2, 1]",
"True"
],
[
"[1, 2, 3, 7]",
"False"
],
[
"[2, 4, -5, 3, 9, 7]",
"True"
],
[
"[1]",
"False"
]
] | RandomSpanInfilling/HumanEval/40/9 | python | code_infilling | HumanEval_RandomSpanInfilling | triples_sum_to_zero |
[
[
"[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]",
"F... | [] | (j + 1, len(l | )):
if l[i] + l[j] + l[k] == 0:
return True
return False
| python | 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. | [] |
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, 3, 5, 0]",
"False"
],
[
"[1, 3, -2, 1]",
"True"
],
[
"[1, 2, 3, 7]",
"False"
],
[
"[2, 4, -5, 3, 9, 7]",
"True"
],
[
"[1]",
"False"
]
] | RandomSpanInfilling/HumanEval/40/10 | python | code_infilling | HumanEval_RandomSpanInfilling | triples_sum_to_zero |
[
[
"2",
"4"
],
[
"3",
"9"
],
[
"4",
"16"
],
[
"8",
"64"
],
[
"10",
"100"
]
] | [] | python | 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... | [] |
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 s... | [] | RandomSpanInfilling/HumanEval/41/1 | python | code_infilling | HumanEval_RandomSpanInfilling | car_race_collision | ||
[
[
"2",
"4"
],
[
"3",
"9"
],
[
"4",
"16"
],
[
"8",
"64"
],
[
"10",
"100"
]
] | [] | return n**2
| python | 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... | [] |
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 s... | [] | RandomSpanInfilling/HumanEval/41/2 | python | code_infilling | HumanEval_RandomSpanInfilling | car_race_collision | |
[
[
"2",
"4"
],
[
"3",
"9"
],
[
"4",
"16"
],
[
"8",
"64"
],
[
"10",
"100"
]
] | [] | urn n**2
| python | 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... | [] |
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 s... | [] | RandomSpanInfilling/HumanEval/41/3 | python | code_infilling | HumanEval_RandomSpanInfilling | car_race_collision | |
[
[
"2",
"4"
],
[
"3",
"9"
],
[
"4",
"16"
],
[
"8",
"64"
],
[
"10",
"100"
]
] | [] | return n** | 2
| python | 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... | [] |
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 s... | [] | RandomSpanInfilling/HumanEval/41/4 | python | code_infilling | HumanEval_RandomSpanInfilling | car_race_collision |
[
[
"2",
"4"
],
[
"3",
"9"
],
[
"4",
"16"
],
[
"8",
"64"
],
[
"10",
"100"
]
] | [] | * | 2
| python | 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... | [] |
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 s... | [] | RandomSpanInfilling/HumanEval/41/5 | python | code_infilling | HumanEval_RandomSpanInfilling | car_race_collision |
[
[
"2",
"4"
],
[
"3",
"9"
],
[
"4",
"16"
],
[
"8",
"64"
],
[
"10",
"100"
]
] | [] | return n* | *2
| python | 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... | [] |
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 s... | [] | RandomSpanInfilling/HumanEval/41/6 | python | code_infilling | HumanEval_RandomSpanInfilling | car_race_collision |
[
[
"2",
"4"
],
[
"3",
"9"
],
[
"4",
"16"
],
[
"8",
"64"
],
[
"10",
"100"
]
] | [] | * | *2
| python | 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... | [] |
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 s... | [] | RandomSpanInfilling/HumanEval/41/7 | python | code_infilling | HumanEval_RandomSpanInfilling | car_race_collision |
[
[
"2",
"4"
],
[
"3",
"9"
],
[
"4",
"16"
],
[
"8",
"64"
],
[
"10",
"100"
]
] | [] | re | turn n**2
| python | 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... | [] |
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 s... | [] | RandomSpanInfilling/HumanEval/41/8 | python | code_infilling | HumanEval_RandomSpanInfilling | car_race_collision |
[
[
"2",
"4"
],
[
"3",
"9"
],
[
"4",
"16"
],
[
"8",
"64"
],
[
"10",
"100"
]
] | [] | n** | 2
| python | 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... | [] |
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 s... | [] | RandomSpanInfilling/HumanEval/41/9 | python | code_infilling | HumanEval_RandomSpanInfilling | car_race_collision |
[
[
"2",
"4"
],
[
"3",
"9"
],
[
"4",
"16"
],
[
"8",
"64"
],
[
"10",
"100"
]
] | [] | eturn n | **2
| python | 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... | [] |
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 s... | [] | RandomSpanInfilling/HumanEval/41/10 | python | code_infilling | HumanEval_RandomSpanInfilling | car_race_collision |
[
[
"[]",
"[]"
],
[
"[3, 2, 1]",
"[4, 3, 2]"
],
[
"[5, 2, 5, 2, 3, 3, 9, 0, 123]",
"[6, 3, 6, 3, 4, 4, 10, 1, 124]"
]
] | [] | + 1) for | e in l]
| python | Return list with elements incremented by 1. | [] |
def incr_list(l: list):
"""Return list with elements incremented by 1.
"""
return [(e | [
[
"[1, 2, 3]",
"[2, 3, 4]"
],
[
"[5, 3, 5, 2, 3, 3, 9, 0, 123]",
"[6, 4, 6, 3, 4, 4, 10, 1, 124]"
]
] | RandomSpanInfilling/HumanEval/42/1 | python | code_infilling | HumanEval_RandomSpanInfilling | incr_list |
[
[
"[]",
"[]"
],
[
"[3, 2, 1]",
"[4, 3, 2]"
],
[
"[5, 2, 5, 2, 3, 3, 9, 0, 123]",
"[6, 3, 6, 3, 4, 4, 10, 1, 124]"
]
] | [] | n [(e + 1) for e i | n l]
| python | Return list with elements incremented by 1. | [] |
def incr_list(l: list):
"""Return list with elements incremented by 1.
"""
retur | [
[
"[1, 2, 3]",
"[2, 3, 4]"
],
[
"[5, 3, 5, 2, 3, 3, 9, 0, 123]",
"[6, 4, 6, 3, 4, 4, 10, 1, 124]"
]
] | RandomSpanInfilling/HumanEval/42/2 | python | code_infilling | HumanEval_RandomSpanInfilling | incr_list |
[
[
"[]",
"[]"
],
[
"[3, 2, 1]",
"[4, 3, 2]"
],
[
"[5, 2, 5, 2, 3, 3, 9, 0, 123]",
"[6, 3, 6, 3, 4, 4, 10, 1, 124]"
]
] | [] | 1) f | or e in l]
| python | Return list with elements incremented by 1. | [] |
def incr_list(l: list):
"""Return list with elements incremented by 1.
"""
return [(e + | [
[
"[1, 2, 3]",
"[2, 3, 4]"
],
[
"[5, 3, 5, 2, 3, 3, 9, 0, 123]",
"[6, 4, 6, 3, 4, 4, 10, 1, 124]"
]
] | RandomSpanInfilling/HumanEval/42/3 | python | code_infilling | HumanEval_RandomSpanInfilling | incr_list |
[
[
"[]",
"[]"
],
[
"[3, 2, 1]",
"[4, 3, 2]"
],
[
"[5, 2, 5, 2, 3, 3, 9, 0, 123]",
"[6, 3, 6, 3, 4, 4, 10, 1, 124]"
]
] | [] | e | in l]
| python | Return list with elements incremented by 1. | [] |
def incr_list(l: list):
"""Return list with elements incremented by 1.
"""
return [(e + 1) for | [
[
"[1, 2, 3]",
"[2, 3, 4]"
],
[
"[5, 3, 5, 2, 3, 3, 9, 0, 123]",
"[6, 4, 6, 3, 4, 4, 10, 1, 124]"
]
] | RandomSpanInfilling/HumanEval/42/4 | python | code_infilling | HumanEval_RandomSpanInfilling | incr_list |
[
[
"[]",
"[]"
],
[
"[3, 2, 1]",
"[4, 3, 2]"
],
[
"[5, 2, 5, 2, 3, 3, 9, 0, 123]",
"[6, 3, 6, 3, 4, 4, 10, 1, 124]"
]
] | [] | (e + | 1) for e in l]
| python | Return list with elements incremented by 1. | [] |
def incr_list(l: list):
"""Return list with elements incremented by 1.
"""
return [ | [
[
"[1, 2, 3]",
"[2, 3, 4]"
],
[
"[5, 3, 5, 2, 3, 3, 9, 0, 123]",
"[6, 4, 6, 3, 4, 4, 10, 1, 124]"
]
] | RandomSpanInfilling/HumanEval/42/5 | python | code_infilling | HumanEval_RandomSpanInfilling | incr_list |
[
[
"[]",
"[]"
],
[
"[3, 2, 1]",
"[4, 3, 2]"
],
[
"[5, 2, 5, 2, 3, 3, 9, 0, 123]",
"[6, 3, 6, 3, 4, 4, 10, 1, 124]"
]
] | [] | for | e in l]
| python | Return list with elements incremented by 1. | [] |
def incr_list(l: list):
"""Return list with elements incremented by 1.
"""
return [(e + 1) | [
[
"[1, 2, 3]",
"[2, 3, 4]"
],
[
"[5, 3, 5, 2, 3, 3, 9, 0, 123]",
"[6, 4, 6, 3, 4, 4, 10, 1, 124]"
]
] | RandomSpanInfilling/HumanEval/42/6 | python | code_infilling | HumanEval_RandomSpanInfilling | incr_list |
[
[
"[]",
"[]"
],
[
"[3, 2, 1]",
"[4, 3, 2]"
],
[
"[5, 2, 5, 2, 3, 3, 9, 0, 123]",
"[6, 3, 6, 3, 4, 4, 10, 1, 124]"
]
] | [] | retur | n [(e + 1) for e in l]
| python | Return list with elements incremented by 1. | [] |
def incr_list(l: list):
"""Return list with elements incremented by 1.
"""
| [
[
"[1, 2, 3]",
"[2, 3, 4]"
],
[
"[5, 3, 5, 2, 3, 3, 9, 0, 123]",
"[6, 4, 6, 3, 4, 4, 10, 1, 124]"
]
] | RandomSpanInfilling/HumanEval/42/7 | python | code_infilling | HumanEval_RandomSpanInfilling | incr_list |
[
[
"[]",
"[]"
],
[
"[3, 2, 1]",
"[4, 3, 2]"
],
[
"[5, 2, 5, 2, 3, 3, 9, 0, 123]",
"[6, 3, 6, 3, 4, 4, 10, 1, 124]"
]
] | [] | return [(e + | 1) for e in l]
| python | Return list with elements incremented by 1. | [] |
def incr_list(l: list):
"""Return list with elements incremented by 1.
"""
| [
[
"[1, 2, 3]",
"[2, 3, 4]"
],
[
"[5, 3, 5, 2, 3, 3, 9, 0, 123]",
"[6, 4, 6, 3, 4, 4, 10, 1, 124]"
]
] | RandomSpanInfilling/HumanEval/42/8 | python | code_infilling | HumanEval_RandomSpanInfilling | incr_list |
[
[
"[]",
"[]"
],
[
"[3, 2, 1]",
"[4, 3, 2]"
],
[
"[5, 2, 5, 2, 3, 3, 9, 0, 123]",
"[6, 3, 6, 3, 4, 4, 10, 1, 124]"
]
] | [] | urn [(e + 1) f | or e in l]
| python | Return list with elements incremented by 1. | [] |
def incr_list(l: list):
"""Return list with elements incremented by 1.
"""
ret | [
[
"[1, 2, 3]",
"[2, 3, 4]"
],
[
"[5, 3, 5, 2, 3, 3, 9, 0, 123]",
"[6, 4, 6, 3, 4, 4, 10, 1, 124]"
]
] | RandomSpanInfilling/HumanEval/42/9 | python | code_infilling | HumanEval_RandomSpanInfilling | incr_list |
[
[
"[]",
"[]"
],
[
"[3, 2, 1]",
"[4, 3, 2]"
],
[
"[5, 2, 5, 2, 3, 3, 9, 0, 123]",
"[6, 3, 6, 3, 4, 4, 10, 1, 124]"
]
] | [] | eturn [(e + 1 | ) for e in l]
| python | Return list with elements incremented by 1. | [] |
def incr_list(l: list):
"""Return list with elements incremented by 1.
"""
r | [
[
"[1, 2, 3]",
"[2, 3, 4]"
],
[
"[5, 3, 5, 2, 3, 3, 9, 0, 123]",
"[6, 4, 6, 3, 4, 4, 10, 1, 124]"
]
] | RandomSpanInfilling/HumanEval/42/10 | python | code_infilling | HumanEval_RandomSpanInfilling | incr_list |
[
[
"[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, ... | [] | e(l):
for j in range(i + 1, le | n(l)):
if l1 + l[j] == 0:
return True
return False
| python | 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. | [] |
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 enumerat | [
[
"[1, 3, 5, 0]",
"False"
],
[
"[1, 3, -2, 1]",
"False"
],
[
"[1, 2, 3, 7]",
"False"
],
[
"[2, 4, -5, 3, 5, 7]",
"True"
],
[
"[1]",
"False"
]
] | RandomSpanInfilling/HumanEval/43/1 | python | code_infilling | HumanEval_RandomSpanInfilling | pairs_sum_to_zero |
[
[
"[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, len(l)):
if l1 + l[j] == 0:
| return True
return False
| python | 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. | [] |
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, 3, 5, 0]",
"False"
],
[
"[1, 3, -2, 1]",
"False"
],
[
"[1, 2, 3, 7]",
"False"
],
[
"[2, 4, -5, 3, 5, 7]",
"True"
],
[
"[1]",
"False"
]
] | RandomSpanInfilling/HumanEval/43/2 | python | code_infilling | HumanEval_RandomSpanInfilling | pairs_sum_to_zero |
[
[
"[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, ... | [] | for j in range(i + 1, len(l)):
if l1 + l[j] == 0:
ret | urn True
return False
| python | 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. | [] |
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):
| [
[
"[1, 3, 5, 0]",
"False"
],
[
"[1, 3, -2, 1]",
"False"
],
[
"[1, 2, 3, 7]",
"False"
],
[
"[2, 4, -5, 3, 5, 7]",
"True"
],
[
"[1]",
"False"
]
] | RandomSpanInfilling/HumanEval/43/3 | python | code_infilling | HumanEval_RandomSpanInfilling | pairs_sum_to_zero |
[
[
"[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, ... | [] | merate(l):
for j in range(i + 1, len(l)): |
if l1 + l[j] == 0:
return True
return False
| python | 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. | [] |
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 enu | [
[
"[1, 3, 5, 0]",
"False"
],
[
"[1, 3, -2, 1]",
"False"
],
[
"[1, 2, 3, 7]",
"False"
],
[
"[2, 4, -5, 3, 5, 7]",
"True"
],
[
"[1]",
"False"
]
] | RandomSpanInfilling/HumanEval/43/4 | python | code_infilling | HumanEval_RandomSpanInfilling | pairs_sum_to_zero |
[
[
"[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, ... | [] | for i, l1 in enumerate(l):
for j in range(i + 1, len(l)):
if l1 + l[j] == 0:
| return True
return False
| python | 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. | [] |
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.
"""
| [
[
"[1, 3, 5, 0]",
"False"
],
[
"[1, 3, -2, 1]",
"False"
],
[
"[1, 2, 3, 7]",
"False"
],
[
"[2, 4, -5, 3, 5, 7]",
"True"
],
[
"[1]",
"False"
]
] | RandomSpanInfilling/HumanEval/43/5 | python | code_infilling | HumanEval_RandomSpanInfilling | pairs_sum_to_zero |
[
[
"[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, ... | [] | if l1 + l[j | ] == 0:
return True
return False
| python | 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. | [] |
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)):
| [
[
"[1, 3, 5, 0]",
"False"
],
[
"[1, 3, -2, 1]",
"False"
],
[
"[1, 2, 3, 7]",
"False"
],
[
"[2, 4, -5, 3, 5, 7]",
"True"
],
[
"[1]",
"False"
]
] | RandomSpanInfilling/HumanEval/43/6 | python | code_infilling | HumanEval_RandomSpanInfilling | pairs_sum_to_zero |
[
[
"[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, ... | [] | len(l)):
if l1 + l[j | ] == 0:
return True
return False
| python | 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. | [] |
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, | [
[
"[1, 3, 5, 0]",
"False"
],
[
"[1, 3, -2, 1]",
"False"
],
[
"[1, 2, 3, 7]",
"False"
],
[
"[2, 4, -5, 3, 5, 7]",
"True"
],
[
"[1]",
"False"
]
] | RandomSpanInfilling/HumanEval/43/7 | python | code_infilling | HumanEval_RandomSpanInfilling | pairs_sum_to_zero |
[
[
"[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, ... | [] | i + 1, len(l)):
if l1 + l[j] | == 0:
return True
return False
| python | 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. | [] |
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( | [
[
"[1, 3, 5, 0]",
"False"
],
[
"[1, 3, -2, 1]",
"False"
],
[
"[1, 2, 3, 7]",
"False"
],
[
"[2, 4, -5, 3, 5, 7]",
"True"
],
[
"[1]",
"False"
]
] | RandomSpanInfilling/HumanEval/43/8 | python | code_infilling | HumanEval_RandomSpanInfilling | pairs_sum_to_zero |
[
[
"[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, ... | [] | ret | urn False
| python | 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. | [] |
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:
... | [
[
"[1, 3, 5, 0]",
"False"
],
[
"[1, 3, -2, 1]",
"False"
],
[
"[1, 2, 3, 7]",
"False"
],
[
"[2, 4, -5, 3, 5, 7]",
"True"
],
[
"[1]",
"False"
]
] | RandomSpanInfilling/HumanEval/43/9 | python | code_infilling | HumanEval_RandomSpanInfilling | pairs_sum_to_zero |
[
[
"[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, ... | [] | for j in range(i + 1, len(l)):
if l1 + l[j] == 0:
return True
return False
| python | 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. | [] |
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): | [
[
"[1, 3, 5, 0]",
"False"
],
[
"[1, 3, -2, 1]",
"False"
],
[
"[1, 2, 3, 7]",
"False"
],
[
"[2, 4, -5, 3, 5, 7]",
"True"
],
[
"[1]",
"False"
]
] | RandomSpanInfilling/HumanEval/43/10 | python | code_infilling | HumanEval_RandomSpanInfilling | pairs_sum_to_zero | |
[
[
"8, 3",
"\"22\""
],
[
"9, 3",
"\"100\""
],
[
"234, 2",
"\"11101010\""
],
[
"16, 2",
"\"10000\""
],
[
"8, 2",
"\"1000\""
],
[
"7, 2",
"\"111\""
]
] | [] | x > 0:
| ret = str(x % base) + ret
x //= base
return ret
| python | Change numerical base of input number x to base.
return string representation after the conversion.
base numbers are less than 10. | [] |
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 | [
[
"8, 3",
"'22'"
],
[
"8, 2",
"'1000'"
],
[
"7, 2",
"'111'"
]
] | RandomSpanInfilling/HumanEval/44/1 | python | code_infilling | HumanEval_RandomSpanInfilling | change_base |
[
[
"8, 3",
"\"22\""
],
[
"9, 3",
"\"100\""
],
[
"234, 2",
"\"11101010\""
],
[
"16, 2",
"\"10000\""
],
[
"8, 2",
"\"1000\""
],
[
"7, 2",
"\"111\""
]
] | [] | et = ""
while x > 0:
ret = str(x % base) + ret
x //= base
return | ret
| python | Change numerical base of input number x to base.
return string representation after the conversion.
base numbers are less than 10. | [] |
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.
"""
r | [
[
"8, 3",
"'22'"
],
[
"8, 2",
"'1000'"
],
[
"7, 2",
"'111'"
]
] | RandomSpanInfilling/HumanEval/44/2 | python | code_infilling | HumanEval_RandomSpanInfilling | change_base |
[
[
"8, 3",
"\"22\""
],
[
"9, 3",
"\"100\""
],
[
"234, 2",
"\"11101010\""
],
[
"16, 2",
"\"10000\""
],
[
"8, 2",
"\"1000\""
],
[
"7, 2",
"\"111\""
]
] | [] | x //= base
| return ret
| python | Change numerical base of input number x to base.
return string representation after the conversion.
base numbers are less than 10. | [] |
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
| [
[
"8, 3",
"'22'"
],
[
"8, 2",
"'1000'"
],
[
"7, 2",
"'111'"
]
] | RandomSpanInfilling/HumanEval/44/3 | python | code_infilling | HumanEval_RandomSpanInfilling | change_base |
[
[
"8, 3",
"\"22\""
],
[
"9, 3",
"\"100\""
],
[
"234, 2",
"\"11101010\""
],
[
"16, 2",
"\"10000\""
],
[
"8, 2",
"\"1000\""
],
[
"7, 2",
"\"111\""
]
] | [] | //= base
retu | rn ret
| python | Change numerical base of input number x to base.
return string representation after the conversion.
base numbers are less than 10. | [] |
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 | [
[
"8, 3",
"'22'"
],
[
"8, 2",
"'1000'"
],
[
"7, 2",
"'111'"
]
] | RandomSpanInfilling/HumanEval/44/4 | python | code_infilling | HumanEval_RandomSpanInfilling | change_base |
[
[
"8, 3",
"\"22\""
],
[
"9, 3",
"\"100\""
],
[
"234, 2",
"\"11101010\""
],
[
"16, 2",
"\"10000\""
],
[
"8, 2",
"\"1000\""
],
[
"7, 2",
"\"111\""
]
] | [] | ret = ""
while x > 0:
ret = str(x % base) + ret
x //= | base
return ret
| python | Change numerical base of input number x to base.
return string representation after the conversion.
base numbers are less than 10. | [] |
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.
"""
| [
[
"8, 3",
"'22'"
],
[
"8, 2",
"'1000'"
],
[
"7, 2",
"'111'"
]
] | RandomSpanInfilling/HumanEval/44/5 | python | code_infilling | HumanEval_RandomSpanInfilling | change_base |
[
[
"8, 3",
"\"22\""
],
[
"9, 3",
"\"100\""
],
[
"234, 2",
"\"11101010\""
],
[
"16, 2",
"\"10000\""
],
[
"8, 2",
"\"1000\""
],
[
"7, 2",
"\"111\""
]
] | [] | et = ""
while x > 0:
ret = str(x % base) + ret
x //= base
return | ret
| python | Change numerical base of input number x to base.
return string representation after the conversion.
base numbers are less than 10. | [] |
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.
"""
r | [
[
"8, 3",
"'22'"
],
[
"8, 2",
"'1000'"
],
[
"7, 2",
"'111'"
]
] | RandomSpanInfilling/HumanEval/44/6 | python | code_infilling | HumanEval_RandomSpanInfilling | change_base |
[
[
"8, 3",
"\"22\""
],
[
"9, 3",
"\"100\""
],
[
"234, 2",
"\"11101010\""
],
[
"16, 2",
"\"10000\""
],
[
"8, 2",
"\"1000\""
],
[
"7, 2",
"\"111\""
]
] | [] | % base) + r | et
x //= base
return ret
| python | Change numerical base of input number x to base.
return string representation after the conversion.
base numbers are less than 10. | [] |
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 | [
[
"8, 3",
"'22'"
],
[
"8, 2",
"'1000'"
],
[
"7, 2",
"'111'"
]
] | RandomSpanInfilling/HumanEval/44/7 | python | code_infilling | HumanEval_RandomSpanInfilling | change_base |
[
[
"8, 3",
"\"22\""
],
[
"9, 3",
"\"100\""
],
[
"234, 2",
"\"11101010\""
],
[
"16, 2",
"\"10000\""
],
[
"8, 2",
"\"1000\""
],
[
"7, 2",
"\"111\""
]
] | [] | ) + ret
| x //= base
return ret
| python | Change numerical base of input number x to base.
return string representation after the conversion.
base numbers are less than 10. | [] |
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 | [
[
"8, 3",
"'22'"
],
[
"8, 2",
"'1000'"
],
[
"7, 2",
"'111'"
]
] | RandomSpanInfilling/HumanEval/44/8 | python | code_infilling | HumanEval_RandomSpanInfilling | change_base |
[
[
"8, 3",
"\"22\""
],
[
"9, 3",
"\"100\""
],
[
"234, 2",
"\"11101010\""
],
[
"16, 2",
"\"10000\""
],
[
"8, 2",
"\"1000\""
],
[
"7, 2",
"\"111\""
]
] | [] | //= | base
return ret
| python | Change numerical base of input number x to base.
return string representation after the conversion.
base numbers are less than 10. | [] |
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 | [
[
"8, 3",
"'22'"
],
[
"8, 2",
"'1000'"
],
[
"7, 2",
"'111'"
]
] | RandomSpanInfilling/HumanEval/44/9 | python | code_infilling | HumanEval_RandomSpanInfilling | change_base |
[
[
"8, 3",
"\"22\""
],
[
"9, 3",
"\"100\""
],
[
"234, 2",
"\"11101010\""
],
[
"16, 2",
"\"10000\""
],
[
"8, 2",
"\"1000\""
],
[
"7, 2",
"\"111\""
]
] | [] | = ""
while x | > 0:
ret = str(x % base) + ret
x //= base
return ret
| python | Change numerical base of input number x to base.
return string representation after the conversion.
base numbers are less than 10. | [] |
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 | [
[
"8, 3",
"'22'"
],
[
"8, 2",
"'1000'"
],
[
"7, 2",
"'111'"
]
] | RandomSpanInfilling/HumanEval/44/10 | python | code_infilling | HumanEval_RandomSpanInfilling | change_base |
[
[
"5, 3",
"7.5"
],
[
"2, 2",
"2.0"
],
[
"10, 8",
"40.0"
]
] | [] | * h / | 2.0
| python | Given length of a side and high return area for a triangle. | [] |
def triangle_area(a, h):
"""Given length of a side and high return area for a triangle.
"""
return a | [
[
"5, 3",
"7.5"
]
] | RandomSpanInfilling/HumanEval/45/1 | python | code_infilling | HumanEval_RandomSpanInfilling | triangle_area |
[
[
"5, 3",
"7.5"
],
[
"2, 2",
"2.0"
],
[
"10, 8",
"40.0"
]
] | [] | return | a * h / 2.0
| python | Given length of a side and high return area for a triangle. | [] |
def triangle_area(a, h):
"""Given length of a side and high return area for a triangle.
"""
| [
[
"5, 3",
"7.5"
]
] | RandomSpanInfilling/HumanEval/45/2 | python | code_infilling | HumanEval_RandomSpanInfilling | triangle_area |
[
[
"5, 3",
"7.5"
],
[
"2, 2",
"2.0"
],
[
"10, 8",
"40.0"
]
] | [] | eturn a * h / 2. | 0
| python | Given length of a side and high return area for a triangle. | [] |
def triangle_area(a, h):
"""Given length of a side and high return area for a triangle.
"""
r | [
[
"5, 3",
"7.5"
]
] | RandomSpanInfilling/HumanEval/45/3 | python | code_infilling | HumanEval_RandomSpanInfilling | triangle_area |
[
[
"5, 3",
"7.5"
],
[
"2, 2",
"2.0"
],
[
"10, 8",
"40.0"
]
] | [] | return a * h / | 2.0
| python | Given length of a side and high return area for a triangle. | [] |
def triangle_area(a, h):
"""Given length of a side and high return area for a triangle.
"""
| [
[
"5, 3",
"7.5"
]
] | RandomSpanInfilling/HumanEval/45/4 | python | code_infilling | HumanEval_RandomSpanInfilling | triangle_area |
[
[
"5, 3",
"7.5"
],
[
"2, 2",
"2.0"
],
[
"10, 8",
"40.0"
]
] | [] | return a * h / | 2.0
| python | Given length of a side and high return area for a triangle. | [] |
def triangle_area(a, h):
"""Given length of a side and high return area for a triangle.
"""
| [
[
"5, 3",
"7.5"
]
] | RandomSpanInfilling/HumanEval/45/5 | python | code_infilling | HumanEval_RandomSpanInfilling | triangle_area |
[
[
"5, 3",
"7.5"
],
[
"2, 2",
"2.0"
],
[
"10, 8",
"40.0"
]
] | [] | / | 2.0
| python | Given length of a side and high return area for a triangle. | [] |
def triangle_area(a, h):
"""Given length of a side and high return area for a triangle.
"""
return a * h | [
[
"5, 3",
"7.5"
]
] | RandomSpanInfilling/HumanEval/45/6 | python | code_infilling | HumanEval_RandomSpanInfilling | triangle_area |
[
[
"5, 3",
"7.5"
],
[
"2, 2",
"2.0"
],
[
"10, 8",
"40.0"
]
] | [] | a * | h / 2.0
| python | Given length of a side and high return area for a triangle. | [] |
def triangle_area(a, h):
"""Given length of a side and high return area for a triangle.
"""
return | [
[
"5, 3",
"7.5"
]
] | RandomSpanInfilling/HumanEval/45/7 | python | code_infilling | HumanEval_RandomSpanInfilling | triangle_area |
[
[
"5, 3",
"7.5"
],
[
"2, 2",
"2.0"
],
[
"10, 8",
"40.0"
]
] | [] | return a | * h / 2.0
| python | Given length of a side and high return area for a triangle. | [] |
def triangle_area(a, h):
"""Given length of a side and high return area for a triangle.
"""
| [
[
"5, 3",
"7.5"
]
] | RandomSpanInfilling/HumanEval/45/8 | python | code_infilling | HumanEval_RandomSpanInfilling | triangle_area |
[
[
"5, 3",
"7.5"
],
[
"2, 2",
"2.0"
],
[
"10, 8",
"40.0"
]
] | [] | r | eturn a * h / 2.0
| python | Given length of a side and high return area for a triangle. | [] |
def triangle_area(a, h):
"""Given length of a side and high return area for a triangle.
"""
| [
[
"5, 3",
"7.5"
]
] | RandomSpanInfilling/HumanEval/45/9 | python | code_infilling | HumanEval_RandomSpanInfilling | triangle_area |
[
[
"5, 3",
"7.5"
],
[
"2, 2",
"2.0"
],
[
"10, 8",
"40.0"
]
] | [] | return | a * h / 2.0
| python | Given length of a side and high return area for a triangle. | [] |
def triangle_area(a, h):
"""Given length of a side and high return area for a triangle.
"""
| [
[
"5, 3",
"7.5"
]
] | RandomSpanInfilling/HumanEval/45/10 | python | code_infilling | HumanEval_RandomSpanInfilling | triangle_area |
[
[
"5",
"4"
],
[
"8",
"28"
],
[
"10",
"104"
],
[
"12",
"386"
]
] | [] | 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)
return results[-1]
| python | 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 se... | [] |
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... | [
[
"5",
"4"
],
[
"6",
"8"
],
[
"7",
"14"
]
] | RandomSpanInfilling/HumanEval/46/1 | python | code_infilling | HumanEval_RandomSpanInfilling | fib4 |
[
[
"5",
"4"
],
[
"8",
"28"
],
[
"10",
"104"
],
[
"12",
"386"
]
] | [] | + results[-2] + results[-3] | + results[-4])
results.pop(0)
return results[-1]
| python | 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 se... | [] |
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... | [
[
"5",
"4"
],
[
"6",
"8"
],
[
"7",
"14"
]
] | RandomSpanInfilling/HumanEval/46/2 | python | code_infilling | HumanEval_RandomSpanInfilling | fib4 |
[
[
"5",
"4"
],
[
"8",
"28"
],
[
"10",
"104"
],
[
"12",
"386"
]
] | [] | ts = [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)
return results[-1]
| python | 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 se... | [] |
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... | [
[
"5",
"4"
],
[
"6",
"8"
],
[
"7",
"14"
]
] | RandomSpanInfilling/HumanEval/46/3 | python | code_infilling | HumanEval_RandomSpanInfilling | fib4 |
[
[
"5",
"4"
],
[
"8",
"28"
],
[
"10",
"104"
],
[
"12",
"386"
]
] | [] | results = [0, 0, 2, 0]
if n < 4:
return results[n]
for _ in range(4, n + 1):
results.append(results[-1] + results[-2] + r | esults[-3] + results[-4])
results.pop(0)
return results[-1]
| python | 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 se... | [] |
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... | [
[
"5",
"4"
],
[
"6",
"8"
],
[
"7",
"14"
]
] | RandomSpanInfilling/HumanEval/46/4 | python | code_infilling | HumanEval_RandomSpanInfilling | fib4 |
[
[
"5",
"4"
],
[
"8",
"28"
],
[
"10",
"104"
],
[
"12",
"386"
]
] | [] | sults[-2] + results[-3] + results[ | -4])
results.pop(0)
return results[-1]
| python | 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 se... | [] |
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... | [
[
"5",
"4"
],
[
"6",
"8"
],
[
"7",
"14"
]
] | RandomSpanInfilling/HumanEval/46/5 | python | code_infilling | HumanEval_RandomSpanInfilling | fib4 |
[
[
"5",
"4"
],
[
"8",
"28"
],
[
"10",
"104"
],
[
"12",
"386"
]
] | [] | = [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)
return results[-1]
| python | 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 se... | [] |
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... | [
[
"5",
"4"
],
[
"6",
"8"
],
[
"7",
"14"
]
] | RandomSpanInfilling/HumanEval/46/6 | python | code_infilling | HumanEval_RandomSpanInfilling | fib4 |
[
[
"5",
"4"
],
[
"8",
"28"
],
[
"10",
"104"
],
[
"12",
"386"
]
] | [] | -1] + results[-2] + results[-3] + resu | lts[-4])
results.pop(0)
return results[-1]
| python | 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 se... | [] |
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... | [
[
"5",
"4"
],
[
"6",
"8"
],
[
"7",
"14"
]
] | RandomSpanInfilling/HumanEval/46/7 | python | code_infilling | HumanEval_RandomSpanInfilling | fib4 |
[
[
"5",
"4"
],
[
"8",
"28"
],
[
"10",
"104"
],
[
"12",
"386"
]
] | [] | n]
for _ in ra | nge(4, n + 1):
results.append(results[-1] + results[-2] + results[-3] + results[-4])
results.pop(0)
return results[-1]
| python | 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 se... | [] |
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... | [
[
"5",
"4"
],
[
"6",
"8"
],
[
"7",
"14"
]
] | RandomSpanInfilling/HumanEval/46/8 | python | code_infilling | HumanEval_RandomSpanInfilling | fib4 |
[
[
"5",
"4"
],
[
"8",
"28"
],
[
"10",
"104"
],
[
"12",
"386"
]
] | [] | s[n]
for _ in range(4, n + 1):
| results.append(results[-1] + results[-2] + results[-3] + results[-4])
results.pop(0)
return results[-1]
| python | 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 se... | [] |
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... | [
[
"5",
"4"
],
[
"6",
"8"
],
[
"7",
"14"
]
] | RandomSpanInfilling/HumanEval/46/9 | python | code_infilling | HumanEval_RandomSpanInfilling | fib4 |
[
[
"5",
"4"
],
[
"8",
"28"
],
[
"10",
"104"
],
[
"12",
"386"
]
] | [] | , 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)
return results[-1]
| python | 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 se... | [] |
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... | [
[
"5",
"4"
],
[
"6",
"8"
],
[
"7",
"14"
]
] | RandomSpanInfilling/HumanEval/46/10 | python | code_infilling | HumanEval_RandomSpanInfilling | fib4 |
[
[
"[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"
]
] | [] | sorted(l)
if len(l) % 2 = | = 1:
return l[len(l) // 2]
else:
return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
| python | Return median of elements in the list l. | [] |
def median(l: list):
"""Return median of elements in the list l.
"""
l = | [
[
"[3, 1, 2, 4, 5]",
"3"
],
[
"[-10, 4, 6, 1000, 10, 20]",
"15.0"
]
] | RandomSpanInfilling/HumanEval/47/1 | python | code_infilling | HumanEval_RandomSpanInfilling | median |
[
[
"[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"
]
] | [] | u | rn (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
| python | Return median of elements in the list l. | [] |
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:
ret | [
[
"[3, 1, 2, 4, 5]",
"3"
],
[
"[-10, 4, 6, 1000, 10, 20]",
"15.0"
]
] | RandomSpanInfilling/HumanEval/47/2 | python | code_infilling | HumanEval_RandomSpanInfilling | median |
[
[
"[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 l[len(l) // | 2]
else:
return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
| python | Return median of elements in the list l. | [] |
def median(l: list):
"""Return median of elements in the list l.
"""
l = sorted(l)
if len(l) % 2 == 1:
| [
[
"[3, 1, 2, 4, 5]",
"3"
],
[
"[-10, 4, 6, 1000, 10, 20]",
"15.0"
]
] | RandomSpanInfilling/HumanEval/47/3 | python | code_infilling | HumanEval_RandomSpanInfilling | median |
[
[
"[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"
]
] | [] | n(l) // 2]
e | lse:
return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
| python | Return median of elements in the list l. | [] |
def median(l: list):
"""Return median of elements in the list l.
"""
l = sorted(l)
if len(l) % 2 == 1:
return l[le | [
[
"[3, 1, 2, 4, 5]",
"3"
],
[
"[-10, 4, 6, 1000, 10, 20]",
"15.0"
]
] | RandomSpanInfilling/HumanEval/47/4 | python | code_infilling | HumanEval_RandomSpanInfilling | median |
[
[
"[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"
]
] | [] | + | l[len(l) // 2]) / 2.0
| python | Return median of elements in the list l. | [] |
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) // 2 - 1] | [
[
"[3, 1, 2, 4, 5]",
"3"
],
[
"[-10, 4, 6, 1000, 10, 20]",
"15.0"
]
] | RandomSpanInfilling/HumanEval/47/5 | python | code_infilling | HumanEval_RandomSpanInfilling | median |
[
[
"[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"
]
] | [] | else:
return (l[len(l) // 2 - 1] + l[len(l) // 2]) / | 2.0
| python | Return median of elements in the list l. | [] |
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]
| [
[
"[3, 1, 2, 4, 5]",
"3"
],
[
"[-10, 4, 6, 1000, 10, 20]",
"15.0"
]
] | RandomSpanInfilling/HumanEval/47/6 | python | code_infilling | HumanEval_RandomSpanInfilling | median |
[
[
"[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"
]
] | [] | l = sorted(l)
if len(l) % | 2 == 1:
return l[len(l) // 2]
else:
return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
| python | Return median of elements in the list l. | [] |
def median(l: list):
"""Return median of elements in the list l.
"""
| [
[
"[3, 1, 2, 4, 5]",
"3"
],
[
"[-10, 4, 6, 1000, 10, 20]",
"15.0"
]
] | RandomSpanInfilling/HumanEval/47/7 | python | code_infilling | HumanEval_RandomSpanInfilling | median |
[
[
"[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"
]
] | [] | 1:
return l[len( | l) // 2]
else:
return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
| python | Return median of elements in the list l. | [] |
def median(l: list):
"""Return median of elements in the list l.
"""
l = sorted(l)
if len(l) % 2 == | [
[
"[3, 1, 2, 4, 5]",
"3"
],
[
"[-10, 4, 6, 1000, 10, 20]",
"15.0"
]
] | RandomSpanInfilling/HumanEval/47/8 | python | code_infilling | HumanEval_RandomSpanInfilling | median |
[
[
"[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"
]
] | [] | len( | l) // 2]
else:
return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
| python | Return median of elements in the list l. | [] |
def median(l: list):
"""Return median of elements in the list l.
"""
l = sorted(l)
if len(l) % 2 == 1:
return l[ | [
[
"[3, 1, 2, 4, 5]",
"3"
],
[
"[-10, 4, 6, 1000, 10, 20]",
"15.0"
]
] | RandomSpanInfilling/HumanEval/47/9 | python | code_infilling | HumanEval_RandomSpanInfilling | median |
[
[
"[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"
]
] | [] |
else:
re | turn (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
| python | Return median of elements in the list l. | [] |
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] | [
[
"[3, 1, 2, 4, 5]",
"3"
],
[
"[-10, 4, 6, 1000, 10, 20]",
"15.0"
]
] | RandomSpanInfilling/HumanEval/47/10 | python | code_infilling | HumanEval_RandomSpanInfilling | median |
[
[
"''",
"True"
],
[
"'aba'",
"True"
],
[
"'aaaaa'",
"True"
],
[
"'zbcd'",
"False"
],
[
"'xywyx'",
"True"
],
[
"'xywyz'",
"False"
],
[
"'xywzx'",
"False"
]
] | [] | in range(len(text)):
if text[i] != text[len(text) - 1 - i]:
return False
| return True
| python | Checks if given string is a palindrome | [] |
def is_palindrome(text: str):
"""
Checks if given string is a palindrome
"""
for i | [
[
"''",
"True"
],
[
"'aba'",
"True"
],
[
"'aaaaa'",
"True"
],
[
"'zbcd'",
"False"
]
] | RandomSpanInfilling/HumanEval/48/1 | python | code_infilling | HumanEval_RandomSpanInfilling | is_palindrome |
[
[
"''",
"True"
],
[
"'aba'",
"True"
],
[
"'aaaaa'",
"True"
],
[
"'zbcd'",
"False"
],
[
"'xywyx'",
"True"
],
[
"'xywyz'",
"False"
],
[
"'xywzx'",
"False"
]
] | [] | range(len(text)):
if text[i] != text[len(text) - 1 - i]:
return Fal | se
return True
| python | Checks if given string is a palindrome | [] |
def is_palindrome(text: str):
"""
Checks if given string is a palindrome
"""
for i in | [
[
"''",
"True"
],
[
"'aba'",
"True"
],
[
"'aaaaa'",
"True"
],
[
"'zbcd'",
"False"
]
] | RandomSpanInfilling/HumanEval/48/2 | python | code_infilling | HumanEval_RandomSpanInfilling | is_palindrome |
[
[
"''",
"True"
],
[
"'aba'",
"True"
],
[
"'aaaaa'",
"True"
],
[
"'zbcd'",
"False"
],
[
"'xywyx'",
"True"
],
[
"'xywyz'",
"False"
],
[
"'xywzx'",
"False"
]
] | [] | :
if text[i] != text[l | en(text) - 1 - i]:
return False
return True
| python | Checks if given string is a palindrome | [] |
def is_palindrome(text: str):
"""
Checks if given string is a palindrome
"""
for i in range(len(text)) | [
[
"''",
"True"
],
[
"'aba'",
"True"
],
[
"'aaaaa'",
"True"
],
[
"'zbcd'",
"False"
]
] | RandomSpanInfilling/HumanEval/48/3 | python | code_infilling | HumanEval_RandomSpanInfilling | is_palindrome |
[
[
"''",
"True"
],
[
"'aba'",
"True"
],
[
"'aaaaa'",
"True"
],
[
"'zbcd'",
"False"
],
[
"'xywyx'",
"True"
],
[
"'xywyz'",
"False"
],
[
"'xywzx'",
"False"
]
] | [] | if text[i] != text[len(text) - 1 - i]:
| return False
return True
| python | Checks if given string is a palindrome | [] |
def is_palindrome(text: str):
"""
Checks if given string is a palindrome
"""
for i in range(len(text)):
| [
[
"''",
"True"
],
[
"'aba'",
"True"
],
[
"'aaaaa'",
"True"
],
[
"'zbcd'",
"False"
]
] | RandomSpanInfilling/HumanEval/48/4 | python | code_infilling | HumanEval_RandomSpanInfilling | is_palindrome |
[
[
"''",
"True"
],
[
"'aba'",
"True"
],
[
"'aaaaa'",
"True"
],
[
"'zbcd'",
"False"
],
[
"'xywyx'",
"True"
],
[
"'xywyz'",
"False"
],
[
"'xywzx'",
"False"
]
] | [] | for i in range(len(text)):
| if text[i] != text[len(text) - 1 - i]:
return False
return True
| python | Checks if given string is a palindrome | [] |
def is_palindrome(text: str):
"""
Checks if given string is a palindrome
"""
| [
[
"''",
"True"
],
[
"'aba'",
"True"
],
[
"'aaaaa'",
"True"
],
[
"'zbcd'",
"False"
]
] | RandomSpanInfilling/HumanEval/48/5 | python | code_infilling | HumanEval_RandomSpanInfilling | is_palindrome |
[
[
"''",
"True"
],
[
"'aba'",
"True"
],
[
"'aaaaa'",
"True"
],
[
"'zbcd'",
"False"
],
[
"'xywyx'",
"True"
],
[
"'xywyz'",
"False"
],
[
"'xywzx'",
"False"
]
] | [] | return False
return True
| python | Checks if given string is a palindrome | [] |
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]: | [
[
"''",
"True"
],
[
"'aba'",
"True"
],
[
"'aaaaa'",
"True"
],
[
"'zbcd'",
"False"
]
] | RandomSpanInfilling/HumanEval/48/6 | python | code_infilling | HumanEval_RandomSpanInfilling | is_palindrome | |
[
[
"''",
"True"
],
[
"'aba'",
"True"
],
[
"'aaaaa'",
"True"
],
[
"'zbcd'",
"False"
],
[
"'xywyx'",
"True"
],
[
"'xywyz'",
"False"
],
[
"'xywzx'",
"False"
]
] | [] | xt)):
if text[i] != text[len | (text) - 1 - i]:
return False
return True
| python | Checks if given string is a palindrome | [] |
def is_palindrome(text: str):
"""
Checks if given string is a palindrome
"""
for i in range(len(te | [
[
"''",
"True"
],
[
"'aba'",
"True"
],
[
"'aaaaa'",
"True"
],
[
"'zbcd'",
"False"
]
] | RandomSpanInfilling/HumanEval/48/7 | python | code_infilling | HumanEval_RandomSpanInfilling | is_palindrome |
[
[
"''",
"True"
],
[
"'aba'",
"True"
],
[
"'aaaaa'",
"True"
],
[
"'zbcd'",
"False"
],
[
"'xywyx'",
"True"
],
[
"'xywyz'",
"False"
],
[
"'xywzx'",
"False"
]
] | [] | for i in range(len(text)):
if text[i] != text[len(text) - 1 - i]:
| return False
return True
| python | Checks if given string is a palindrome | [] |
def is_palindrome(text: str):
"""
Checks if given string is a palindrome
"""
| [
[
"''",
"True"
],
[
"'aba'",
"True"
],
[
"'aaaaa'",
"True"
],
[
"'zbcd'",
"False"
]
] | RandomSpanInfilling/HumanEval/48/8 | python | code_infilling | HumanEval_RandomSpanInfilling | is_palindrome |
[
[
"''",
"True"
],
[
"'aba'",
"True"
],
[
"'aaaaa'",
"True"
],
[
"'zbcd'",
"False"
],
[
"'xywyx'",
"True"
],
[
"'xywyz'",
"False"
],
[
"'xywzx'",
"False"
]
] | [] | text[i] != text[len(text) - 1 - i]:
return False
r | eturn True
| python | Checks if given string is a palindrome | [] |
def is_palindrome(text: str):
"""
Checks if given string is a palindrome
"""
for i in range(len(text)):
if | [
[
"''",
"True"
],
[
"'aba'",
"True"
],
[
"'aaaaa'",
"True"
],
[
"'zbcd'",
"False"
]
] | RandomSpanInfilling/HumanEval/48/9 | python | code_infilling | HumanEval_RandomSpanInfilling | is_palindrome |
[
[
"''",
"True"
],
[
"'aba'",
"True"
],
[
"'aaaaa'",
"True"
],
[
"'zbcd'",
"False"
],
[
"'xywyx'",
"True"
],
[
"'xywyz'",
"False"
],
[
"'xywzx'",
"False"
]
] | [] | e(len(text)):
if text[i] != text[len(text) - 1 - i]:
| return False
return True
| python | Checks if given string is a palindrome | [] |
def is_palindrome(text: str):
"""
Checks if given string is a palindrome
"""
for i in rang | [
[
"''",
"True"
],
[
"'aba'",
"True"
],
[
"'aaaaa'",
"True"
],
[
"'zbcd'",
"False"
]
] | RandomSpanInfilling/HumanEval/48/10 | python | code_infilling | HumanEval_RandomSpanInfilling | is_palindrome |
[
[
"3, 5",
"3"
],
[
"1101, 101",
"2"
],
[
"0, 101",
"1"
],
[
"3, 11",
"8"
],
[
"100, 101",
"1"
],
[
"30, 5",
"4"
],
[
"31, 5",
"3"
]
] | [] | ret = (2 * ret) % p
retu | rn ret
| python | Return 2^n modulo p (be aware of numerics). | [] |
def modp(n: int, p: int):
"""Return 2^n modulo p (be aware of numerics).
"""
ret = 1
for i in range(n):
| [
[
"3, 5",
"3"
],
[
"1101, 101",
"2"
],
[
"0, 101",
"1"
],
[
"3, 11",
"8"
],
[
"100, 101",
"1"
]
] | RandomSpanInfilling/HumanEval/49/1 | python | code_infilling | HumanEval_RandomSpanInfilling | modp |
[
[
"3, 5",
"3"
],
[
"1101, 101",
"2"
],
[
"0, 101",
"1"
],
[
"3, 11",
"8"
],
[
"100, 101",
"1"
],
[
"30, 5",
"4"
],
[
"31, 5",
"3"
]
] | [] | for i in range(n):
| ret = (2 * ret) % p
return ret
| python | Return 2^n modulo p (be aware of numerics). | [] |
def modp(n: int, p: int):
"""Return 2^n modulo p (be aware of numerics).
"""
ret = 1
| [
[
"3, 5",
"3"
],
[
"1101, 101",
"2"
],
[
"0, 101",
"1"
],
[
"3, 11",
"8"
],
[
"100, 101",
"1"
]
] | RandomSpanInfilling/HumanEval/49/2 | python | code_infilling | HumanEval_RandomSpanInfilling | modp |
[
[
"3, 5",
"3"
],
[
"1101, 101",
"2"
],
[
"0, 101",
"1"
],
[
"3, 11",
"8"
],
[
"100, 101",
"1"
],
[
"30, 5",
"4"
],
[
"31, 5",
"3"
]
] | [] | n):
ret = ( | 2 * ret) % p
return ret
| python | Return 2^n modulo p (be aware of numerics). | [] |
def modp(n: int, p: int):
"""Return 2^n modulo p (be aware of numerics).
"""
ret = 1
for i in range( | [
[
"3, 5",
"3"
],
[
"1101, 101",
"2"
],
[
"0, 101",
"1"
],
[
"3, 11",
"8"
],
[
"100, 101",
"1"
]
] | RandomSpanInfilling/HumanEval/49/3 | python | code_infilling | HumanEval_RandomSpanInfilling | modp |
[
[
"3, 5",
"3"
],
[
"1101, 101",
"2"
],
[
"0, 101",
"1"
],
[
"3, 11",
"8"
],
[
"100, 101",
"1"
],
[
"30, 5",
"4"
],
[
"31, 5",
"3"
]
] | [] | in range(n):
| ret = (2 * ret) % p
return ret
| python | Return 2^n modulo p (be aware of numerics). | [] |
def modp(n: int, p: int):
"""Return 2^n modulo p (be aware of numerics).
"""
ret = 1
for i | [
[
"3, 5",
"3"
],
[
"1101, 101",
"2"
],
[
"0, 101",
"1"
],
[
"3, 11",
"8"
],
[
"100, 101",
"1"
]
] | RandomSpanInfilling/HumanEval/49/4 | python | code_infilling | HumanEval_RandomSpanInfilling | modp |
[
[
"3, 5",
"3"
],
[
"1101, 101",
"2"
],
[
"0, 101",
"1"
],
[
"3, 11",
"8"
],
[
"100, 101",
"1"
],
[
"30, 5",
"4"
],
[
"31, 5",
"3"
]
] | [] | for i in range(n):
ret = (2 * ret) % p |
return ret
| python | Return 2^n modulo p (be aware of numerics). | [] |
def modp(n: int, p: int):
"""Return 2^n modulo p (be aware of numerics).
"""
ret = 1
| [
[
"3, 5",
"3"
],
[
"1101, 101",
"2"
],
[
"0, 101",
"1"
],
[
"3, 11",
"8"
],
[
"100, 101",
"1"
]
] | RandomSpanInfilling/HumanEval/49/5 | python | code_infilling | HumanEval_RandomSpanInfilling | modp |
[
[
"3, 5",
"3"
],
[
"1101, 101",
"2"
],
[
"0, 101",
"1"
],
[
"3, 11",
"8"
],
[
"100, 101",
"1"
],
[
"30, 5",
"4"
],
[
"31, 5",
"3"
]
] | [] | for i in | range(n):
ret = (2 * ret) % p
return ret
| python | Return 2^n modulo p (be aware of numerics). | [] |
def modp(n: int, p: int):
"""Return 2^n modulo p (be aware of numerics).
"""
ret = 1
| [
[
"3, 5",
"3"
],
[
"1101, 101",
"2"
],
[
"0, 101",
"1"
],
[
"3, 11",
"8"
],
[
"100, 101",
"1"
]
] | RandomSpanInfilling/HumanEval/49/6 | python | code_infilling | HumanEval_RandomSpanInfilling | modp |
[
[
"3, 5",
"3"
],
[
"1101, 101",
"2"
],
[
"0, 101",
"1"
],
[
"3, 11",
"8"
],
[
"100, 101",
"1"
],
[
"30, 5",
"4"
],
[
"31, 5",
"3"
]
] | [] | return ret | python | Return 2^n modulo p (be aware of numerics). | [] |
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
| [
[
"3, 5",
"3"
],
[
"1101, 101",
"2"
],
[
"0, 101",
"1"
],
[
"3, 11",
"8"
],
[
"100, 101",
"1"
]
] | RandomSpanInfilling/HumanEval/49/7 | python | code_infilling | HumanEval_RandomSpanInfilling | modp | |
[
[
"3, 5",
"3"
],
[
"1101, 101",
"2"
],
[
"0, 101",
"1"
],
[
"3, 11",
"8"
],
[
"100, 101",
"1"
],
[
"30, 5",
"4"
],
[
"31, 5",
"3"
]
] | [] | 2 | * ret) % p
return ret
| python | Return 2^n modulo p (be aware of numerics). | [] |
def modp(n: int, p: int):
"""Return 2^n modulo p (be aware of numerics).
"""
ret = 1
for i in range(n):
ret = ( | [
[
"3, 5",
"3"
],
[
"1101, 101",
"2"
],
[
"0, 101",
"1"
],
[
"3, 11",
"8"
],
[
"100, 101",
"1"
]
] | RandomSpanInfilling/HumanEval/49/8 | python | code_infilling | HumanEval_RandomSpanInfilling | modp |
[
[
"3, 5",
"3"
],
[
"1101, 101",
"2"
],
[
"0, 101",
"1"
],
[
"3, 11",
"8"
],
[
"100, 101",
"1"
],
[
"30, 5",
"4"
],
[
"31, 5",
"3"
]
] | [] | ret = ( | 2 * ret) % p
return ret
| python | Return 2^n modulo p (be aware of numerics). | [] |
def modp(n: int, p: int):
"""Return 2^n modulo p (be aware of numerics).
"""
ret = 1
for i in range(n):
| [
[
"3, 5",
"3"
],
[
"1101, 101",
"2"
],
[
"0, 101",
"1"
],
[
"3, 11",
"8"
],
[
"100, 101",
"1"
]
] | RandomSpanInfilling/HumanEval/49/9 | python | code_infilling | HumanEval_RandomSpanInfilling | modp |
[
[
"3, 5",
"3"
],
[
"1101, 101",
"2"
],
[
"0, 101",
"1"
],
[
"3, 11",
"8"
],
[
"100, 101",
"1"
],
[
"30, 5",
"4"
],
[
"31, 5",
"3"
]
] | [] | et = 1
for i in range(n):
ret = (2 * ret) % p
re | turn ret
| python | Return 2^n modulo p (be aware of numerics). | [] |
def modp(n: int, p: int):
"""Return 2^n modulo p (be aware of numerics).
"""
r | [
[
"3, 5",
"3"
],
[
"1101, 101",
"2"
],
[
"0, 101",
"1"
],
[
"3, 11",
"8"
],
[
"100, 101",
"1"
]
] | RandomSpanInfilling/HumanEval/49/10 | python | code_infilling | HumanEval_RandomSpanInfilling | modp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.