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.0, 2.0, 3.9, 4.0, 5.0, 2.2]", "(3.9, 4.0)" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0]", "(5.0, 5.9)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.2]", "(2.0, 2.2)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0]", "(2.0, 2.0)" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1]", "(2.2, 3.1)" ] ]
[ "from typing import List, Tuple" ]
idx, elem in enumerate(numbers): for idx2, elem2 in enumerate(numbers): if idx != idx2: if distance is None: distance = abs(elem - elem2) closest_pair = tuple(sorted([elem, elem2])) else: new_distance = abs(elem - elem2) if new_distance < distance: distance = new_distance closest_pair = tuple(sorted([elem, elem2])) return closest_p
air
python
From a supplied list of numbers (of length at least two) select and return two that are the closest to each other and return them in order (smaller number, larger number).
[]
from typing import List, Tuple def find_closest_elements(numbers: List[float]) -> Tuple[float, float]: """ From a supplied list of numbers (of length at least two) select and return two that are the closest to each other and return them in order (smaller number, larger number). """ closest_pair = None distance = None for
[ [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.2]", "(2.0, 2.2)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0]", "(2.0, 2.0)" ] ]
RandomSpanInfilling/HumanEval/20/1
python
code_infilling
HumanEval_RandomSpanInfilling
find_closest_elements
[ [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2]", "(3.9, 4.0)" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0]", "(5.0, 5.9)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.2]", "(2.0, 2.2)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0]", "(2.0, 2.0)" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1]", "(2.2, 3.1)" ] ]
[ "from typing import List, Tuple" ]
closest_pair = None distance = None for idx, elem in enumerate(numbers): for idx2
, elem2 in enumerate(numbers): if idx != idx2: if distance is None: distance = abs(elem - elem2) closest_pair = tuple(sorted([elem, elem2])) else: new_distance = abs(elem - elem2) if new_distance < distance: distance = new_distance closest_pair = tuple(sorted([elem, elem2])) return closest_pair
python
From a supplied list of numbers (of length at least two) select and return two that are the closest to each other and return them in order (smaller number, larger number).
[]
from typing import List, Tuple def find_closest_elements(numbers: List[float]) -> Tuple[float, float]: """ From a supplied list of numbers (of length at least two) select and return two that are the closest to each other and return them in order (smaller number, larger number). """
[ [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.2]", "(2.0, 2.2)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0]", "(2.0, 2.0)" ] ]
RandomSpanInfilling/HumanEval/20/2
python
code_infilling
HumanEval_RandomSpanInfilling
find_closest_elements
[ [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2]", "(3.9, 4.0)" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0]", "(5.0, 5.9)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.2]", "(2.0, 2.2)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0]", "(2.0, 2.0)" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1]", "(2.2, 3.1)" ] ]
[ "from typing import List, Tuple" ]
e: distance = abs(elem - elem2) closest_pair = tuple(sorted([elem, elem2])) else:
new_distance = abs(elem - elem2) if new_distance < distance: distance = new_distance closest_pair = tuple(sorted([elem, elem2])) return closest_pair
python
From a supplied list of numbers (of length at least two) select and return two that are the closest to each other and return them in order (smaller number, larger number).
[]
from typing import List, Tuple def find_closest_elements(numbers: List[float]) -> Tuple[float, float]: """ From a supplied list of numbers (of length at least two) select and return two that are the closest to each other and return them in order (smaller number, larger number). """ closest_pair = None distance = None for idx, elem in enumerate(numbers): for idx2, elem2 in enumerate(numbers): if idx != idx2: if distance is Non
[ [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.2]", "(2.0, 2.2)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0]", "(2.0, 2.0)" ] ]
RandomSpanInfilling/HumanEval/20/3
python
code_infilling
HumanEval_RandomSpanInfilling
find_closest_elements
[ [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2]", "(3.9, 4.0)" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0]", "(5.0, 5.9)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.2]", "(2.0, 2.2)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0]", "(2.0, 2.0)" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1]", "(2.2, 3.1)" ] ]
[ "from typing import List, Tuple" ]
for idx, elem in enumerate(numbers): for idx2, elem2 in enumerate(numbers): if idx != idx2: if distance is None: distance = abs(elem - elem2) c
losest_pair = tuple(sorted([elem, elem2])) else: new_distance = abs(elem - elem2) if new_distance < distance: distance = new_distance closest_pair = tuple(sorted([elem, elem2])) return closest_pair
python
From a supplied list of numbers (of length at least two) select and return two that are the closest to each other and return them in order (smaller number, larger number).
[]
from typing import List, Tuple def find_closest_elements(numbers: List[float]) -> Tuple[float, float]: """ From a supplied list of numbers (of length at least two) select and return two that are the closest to each other and return them in order (smaller number, larger number). """ closest_pair = None distance = None
[ [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.2]", "(2.0, 2.2)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0]", "(2.0, 2.0)" ] ]
RandomSpanInfilling/HumanEval/20/4
python
code_infilling
HumanEval_RandomSpanInfilling
find_closest_elements
[ [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2]", "(3.9, 4.0)" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0]", "(5.0, 5.9)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.2]", "(2.0, 2.2)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0]", "(2.0, 2.0)" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1]", "(2.2, 3.1)" ] ]
[ "from typing import List, Tuple" ]
lem2 in enumerate(numbers): if idx != idx2: if distance is None: distance = abs(elem - elem2) closest_pair = tuple(sorted([elem, elem2])) else: new_distance = a
bs(elem - elem2) if new_distance < distance: distance = new_distance closest_pair = tuple(sorted([elem, elem2])) return closest_pair
python
From a supplied list of numbers (of length at least two) select and return two that are the closest to each other and return them in order (smaller number, larger number).
[]
from typing import List, Tuple def find_closest_elements(numbers: List[float]) -> Tuple[float, float]: """ From a supplied list of numbers (of length at least two) select and return two that are the closest to each other and return them in order (smaller number, larger number). """ closest_pair = None distance = None for idx, elem in enumerate(numbers): for idx2, e
[ [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.2]", "(2.0, 2.2)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0]", "(2.0, 2.0)" ] ]
RandomSpanInfilling/HumanEval/20/5
python
code_infilling
HumanEval_RandomSpanInfilling
find_closest_elements
[ [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2]", "(3.9, 4.0)" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0]", "(5.0, 5.9)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.2]", "(2.0, 2.2)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0]", "(2.0, 2.0)" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1]", "(2.2, 3.1)" ] ]
[ "from typing import List, Tuple" ]
elem in enumerate(numbers): for idx2, elem2 in enumer
ate(numbers): if idx != idx2: if distance is None: distance = abs(elem - elem2) closest_pair = tuple(sorted([elem, elem2])) else: new_distance = abs(elem - elem2) if new_distance < distance: distance = new_distance closest_pair = tuple(sorted([elem, elem2])) return closest_pair
python
From a supplied list of numbers (of length at least two) select and return two that are the closest to each other and return them in order (smaller number, larger number).
[]
from typing import List, Tuple def find_closest_elements(numbers: List[float]) -> Tuple[float, float]: """ From a supplied list of numbers (of length at least two) select and return two that are the closest to each other and return them in order (smaller number, larger number). """ closest_pair = None distance = None for idx,
[ [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.2]", "(2.0, 2.2)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0]", "(2.0, 2.0)" ] ]
RandomSpanInfilling/HumanEval/20/6
python
code_infilling
HumanEval_RandomSpanInfilling
find_closest_elements
[ [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2]", "(3.9, 4.0)" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0]", "(5.0, 5.9)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.2]", "(2.0, 2.2)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0]", "(2.0, 2.0)" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1]", "(2.2, 3.1)" ] ]
[ "from typing import List, Tuple" ]
new_distance = abs(elem - elem2) if new_distance < distance: distance = new_
distance closest_pair = tuple(sorted([elem, elem2])) return closest_pair
python
From a supplied list of numbers (of length at least two) select and return two that are the closest to each other and return them in order (smaller number, larger number).
[]
from typing import List, Tuple def find_closest_elements(numbers: List[float]) -> Tuple[float, float]: """ From a supplied list of numbers (of length at least two) select and return two that are the closest to each other and return them in order (smaller number, larger number). """ closest_pair = None distance = None for idx, elem in enumerate(numbers): for idx2, elem2 in enumerate(numbers): if idx != idx2: if distance is None: distance = abs(elem - elem2) closest_pair = tuple(sorted([elem, elem2])) else:
[ [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.2]", "(2.0, 2.2)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0]", "(2.0, 2.0)" ] ]
RandomSpanInfilling/HumanEval/20/7
python
code_infilling
HumanEval_RandomSpanInfilling
find_closest_elements
[ [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2]", "(3.9, 4.0)" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0]", "(5.0, 5.9)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.2]", "(2.0, 2.2)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0]", "(2.0, 2.0)" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1]", "(2.2, 3.1)" ] ]
[ "from typing import List, Tuple" ]
merate(num
bers): if idx != idx2: if distance is None: distance = abs(elem - elem2) closest_pair = tuple(sorted([elem, elem2])) else: new_distance = abs(elem - elem2) if new_distance < distance: distance = new_distance closest_pair = tuple(sorted([elem, elem2])) return closest_pair
python
From a supplied list of numbers (of length at least two) select and return two that are the closest to each other and return them in order (smaller number, larger number).
[]
from typing import List, Tuple def find_closest_elements(numbers: List[float]) -> Tuple[float, float]: """ From a supplied list of numbers (of length at least two) select and return two that are the closest to each other and return them in order (smaller number, larger number). """ closest_pair = None distance = None for idx, elem in enumerate(numbers): for idx2, elem2 in enu
[ [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.2]", "(2.0, 2.2)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0]", "(2.0, 2.0)" ] ]
RandomSpanInfilling/HumanEval/20/8
python
code_infilling
HumanEval_RandomSpanInfilling
find_closest_elements
[ [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2]", "(3.9, 4.0)" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0]", "(5.0, 5.9)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.2]", "(2.0, 2.2)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0]", "(2.0, 2.0)" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1]", "(2.2, 3.1)" ] ]
[ "from typing import List, Tuple" ]
elem in enumerate(numbers): for idx2, elem2 in enumerate(numbers): if idx != idx2: if distance is None: distance = abs(elem - elem2) closest_pair = tuple(sorted([elem, elem2])) else: new_distance = abs(elem - elem2)
if new_distance < distance: distance = new_distance closest_pair = tuple(sorted([elem, elem2])) return closest_pair
python
From a supplied list of numbers (of length at least two) select and return two that are the closest to each other and return them in order (smaller number, larger number).
[]
from typing import List, Tuple def find_closest_elements(numbers: List[float]) -> Tuple[float, float]: """ From a supplied list of numbers (of length at least two) select and return two that are the closest to each other and return them in order (smaller number, larger number). """ closest_pair = None distance = None for idx,
[ [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.2]", "(2.0, 2.2)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0]", "(2.0, 2.0)" ] ]
RandomSpanInfilling/HumanEval/20/9
python
code_infilling
HumanEval_RandomSpanInfilling
find_closest_elements
[ [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2]", "(3.9, 4.0)" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0]", "(5.0, 5.9)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.2]", "(2.0, 2.2)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0]", "(2.0, 2.0)" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1]", "(2.2, 3.1)" ] ]
[ "from typing import List, Tuple" ]
or idx2, elem2 in enumerate(numbers): if idx != idx2: if distance is None: distance = abs(elem - elem2) closest_pair = tuple(sorted([elem, elem2])) else: new_distance = abs(elem - elem2) if new_distance < distance: distance = new_distance closes
t_pair = tuple(sorted([elem, elem2])) return closest_pair
python
From a supplied list of numbers (of length at least two) select and return two that are the closest to each other and return them in order (smaller number, larger number).
[]
from typing import List, Tuple def find_closest_elements(numbers: List[float]) -> Tuple[float, float]: """ From a supplied list of numbers (of length at least two) select and return two that are the closest to each other and return them in order (smaller number, larger number). """ closest_pair = None distance = None for idx, elem in enumerate(numbers): f
[ [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.2]", "(2.0, 2.2)" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0]", "(2.0, 2.0)" ] ]
RandomSpanInfilling/HumanEval/20/10
python
code_infilling
HumanEval_RandomSpanInfilling
find_closest_elements
[ [ "[2.0, 49.9]", "[0.0, 1.0]" ], [ "[100.0, 49.9]", "[1.0, 0.0]" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "[0.0, 0.25, 0.5, 0.75, 1.0]" ], [ "[2.0, 1.0, 5.0, 3.0, 4.0]", "[0.25, 0.0, 1.0, 0.5, 0.75]" ], [ "[12.0, 11.0, 15.0, 13.0, 14.0]", "[0.25, 0.0, 1.0, 0.5, 0.75]" ] ]
[ "from typing import List" ]
for x in
numbers]
python
Given list of numbers (of at least two elements), apply a linear transform to that list, such that the smallest number will become 0 and the largest will become 1
[]
from typing import List def rescale_to_unit(numbers: List[float]) -> List[float]: """ Given list of numbers (of at least two elements), apply a linear transform to that list, such that the smallest number will become 0 and the largest will become 1 """ min_number = min(numbers) max_number = max(numbers) return [(x - min_number) / (max_number - min_number)
[ [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "[0.0, 0.25, 0.5, 0.75, 1.0]" ] ]
RandomSpanInfilling/HumanEval/21/1
python
code_infilling
HumanEval_RandomSpanInfilling
rescale_to_unit
[ [ "[2.0, 49.9]", "[0.0, 1.0]" ], [ "[100.0, 49.9]", "[1.0, 0.0]" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "[0.0, 0.25, 0.5, 0.75, 1.0]" ], [ "[2.0, 1.0, 5.0, 3.0, 4.0]", "[0.25, 0.0, 1.0, 0.5, 0.75]" ], [ "[12.0, 11.0, 15.0, 13.0, 14.0]", "[0.25, 0.0, 1.0, 0.5, 0.75]" ] ]
[ "from typing import List" ]
max(numbers) return [(x - min_number)
/ (max_number - min_number) for x in numbers]
python
Given list of numbers (of at least two elements), apply a linear transform to that list, such that the smallest number will become 0 and the largest will become 1
[]
from typing import List def rescale_to_unit(numbers: List[float]) -> List[float]: """ Given list of numbers (of at least two elements), apply a linear transform to that list, such that the smallest number will become 0 and the largest will become 1 """ min_number = min(numbers) max_number =
[ [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "[0.0, 0.25, 0.5, 0.75, 1.0]" ] ]
RandomSpanInfilling/HumanEval/21/2
python
code_infilling
HumanEval_RandomSpanInfilling
rescale_to_unit
[ [ "[2.0, 49.9]", "[0.0, 1.0]" ], [ "[100.0, 49.9]", "[1.0, 0.0]" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "[0.0, 0.25, 0.5, 0.75, 1.0]" ], [ "[2.0, 1.0, 5.0, 3.0, 4.0]", "[0.25, 0.0, 1.0, 0.5, 0.75]" ], [ "[12.0, 11.0, 15.0, 13.0, 14.0]", "[0.25, 0.0, 1.0, 0.5, 0.75]" ] ]
[ "from typing import List" ]
for x in nu
mbers]
python
Given list of numbers (of at least two elements), apply a linear transform to that list, such that the smallest number will become 0 and the largest will become 1
[]
from typing import List def rescale_to_unit(numbers: List[float]) -> List[float]: """ Given list of numbers (of at least two elements), apply a linear transform to that list, such that the smallest number will become 0 and the largest will become 1 """ min_number = min(numbers) max_number = max(numbers) return [(x - min_number) / (max_number - min_number)
[ [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "[0.0, 0.25, 0.5, 0.75, 1.0]" ] ]
RandomSpanInfilling/HumanEval/21/3
python
code_infilling
HumanEval_RandomSpanInfilling
rescale_to_unit
[ [ "[2.0, 49.9]", "[0.0, 1.0]" ], [ "[100.0, 49.9]", "[1.0, 0.0]" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "[0.0, 0.25, 0.5, 0.75, 1.0]" ], [ "[2.0, 1.0, 5.0, 3.0, 4.0]", "[0.25, 0.0, 1.0, 0.5, 0.75]" ], [ "[12.0, 11.0, 15.0, 13.0, 14.0]", "[0.25, 0.0, 1.0, 0.5, 0.75]" ] ]
[ "from typing import List" ]
= min(numbers) max_number = max(numbers) retu
rn [(x - min_number) / (max_number - min_number) for x in numbers]
python
Given list of numbers (of at least two elements), apply a linear transform to that list, such that the smallest number will become 0 and the largest will become 1
[]
from typing import List def rescale_to_unit(numbers: List[float]) -> List[float]: """ Given list of numbers (of at least two elements), apply a linear transform to that list, such that the smallest number will become 0 and the largest will become 1 """ min_number
[ [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "[0.0, 0.25, 0.5, 0.75, 1.0]" ] ]
RandomSpanInfilling/HumanEval/21/4
python
code_infilling
HumanEval_RandomSpanInfilling
rescale_to_unit
[ [ "[2.0, 49.9]", "[0.0, 1.0]" ], [ "[100.0, 49.9]", "[1.0, 0.0]" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "[0.0, 0.25, 0.5, 0.75, 1.0]" ], [ "[2.0, 1.0, 5.0, 3.0, 4.0]", "[0.25, 0.0, 1.0, 0.5, 0.75]" ], [ "[12.0, 11.0, 15.0, 13.0, 14.0]", "[0.25, 0.0, 1.0, 0.5, 0.75]" ] ]
[ "from typing import List" ]
numbers) max_number = max(numbers) return [(x - min_number) / (
max_number - min_number) for x in numbers]
python
Given list of numbers (of at least two elements), apply a linear transform to that list, such that the smallest number will become 0 and the largest will become 1
[]
from typing import List def rescale_to_unit(numbers: List[float]) -> List[float]: """ Given list of numbers (of at least two elements), apply a linear transform to that list, such that the smallest number will become 0 and the largest will become 1 """ min_number = min(
[ [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "[0.0, 0.25, 0.5, 0.75, 1.0]" ] ]
RandomSpanInfilling/HumanEval/21/5
python
code_infilling
HumanEval_RandomSpanInfilling
rescale_to_unit
[ [ "[2.0, 49.9]", "[0.0, 1.0]" ], [ "[100.0, 49.9]", "[1.0, 0.0]" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "[0.0, 0.25, 0.5, 0.75, 1.0]" ], [ "[2.0, 1.0, 5.0, 3.0, 4.0]", "[0.25, 0.0, 1.0, 0.5, 0.75]" ], [ "[12.0, 11.0, 15.0, 13.0, 14.0]", "[0.25, 0.0, 1.0, 0.5, 0.75]" ] ]
[ "from typing import List" ]
- min_numb
er) / (max_number - min_number) for x in numbers]
python
Given list of numbers (of at least two elements), apply a linear transform to that list, such that the smallest number will become 0 and the largest will become 1
[]
from typing import List def rescale_to_unit(numbers: List[float]) -> List[float]: """ Given list of numbers (of at least two elements), apply a linear transform to that list, such that the smallest number will become 0 and the largest will become 1 """ min_number = min(numbers) max_number = max(numbers) return [(x
[ [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "[0.0, 0.25, 0.5, 0.75, 1.0]" ] ]
RandomSpanInfilling/HumanEval/21/6
python
code_infilling
HumanEval_RandomSpanInfilling
rescale_to_unit
[ [ "[2.0, 49.9]", "[0.0, 1.0]" ], [ "[100.0, 49.9]", "[1.0, 0.0]" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "[0.0, 0.25, 0.5, 0.75, 1.0]" ], [ "[2.0, 1.0, 5.0, 3.0, 4.0]", "[0.25, 0.0, 1.0, 0.5, 0.75]" ], [ "[12.0, 11.0, 15.0, 13.0, 14.0]", "[0.25, 0.0, 1.0, 0.5, 0.75]" ] ]
[ "from typing import List" ]
) max_number = max(numbers) retu
rn [(x - min_number) / (max_number - min_number) for x in numbers]
python
Given list of numbers (of at least two elements), apply a linear transform to that list, such that the smallest number will become 0 and the largest will become 1
[]
from typing import List def rescale_to_unit(numbers: List[float]) -> List[float]: """ Given list of numbers (of at least two elements), apply a linear transform to that list, such that the smallest number will become 0 and the largest will become 1 """ min_number = min(numbers
[ [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "[0.0, 0.25, 0.5, 0.75, 1.0]" ] ]
RandomSpanInfilling/HumanEval/21/7
python
code_infilling
HumanEval_RandomSpanInfilling
rescale_to_unit
[ [ "[2.0, 49.9]", "[0.0, 1.0]" ], [ "[100.0, 49.9]", "[1.0, 0.0]" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "[0.0, 0.25, 0.5, 0.75, 1.0]" ], [ "[2.0, 1.0, 5.0, 3.0, 4.0]", "[0.25, 0.0, 1.0, 0.5, 0.75]" ], [ "[12.0, 11.0, 15.0, 13.0, 14.0]", "[0.25, 0.0, 1.0, 0.5, 0.75]" ] ]
[ "from typing import List" ]
max(numbers) return [(x - min_number) / (m
ax_number - min_number) for x in numbers]
python
Given list of numbers (of at least two elements), apply a linear transform to that list, such that the smallest number will become 0 and the largest will become 1
[]
from typing import List def rescale_to_unit(numbers: List[float]) -> List[float]: """ Given list of numbers (of at least two elements), apply a linear transform to that list, such that the smallest number will become 0 and the largest will become 1 """ min_number = min(numbers) max_number =
[ [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "[0.0, 0.25, 0.5, 0.75, 1.0]" ] ]
RandomSpanInfilling/HumanEval/21/8
python
code_infilling
HumanEval_RandomSpanInfilling
rescale_to_unit
[ [ "[2.0, 49.9]", "[0.0, 1.0]" ], [ "[100.0, 49.9]", "[1.0, 0.0]" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "[0.0, 0.25, 0.5, 0.75, 1.0]" ], [ "[2.0, 1.0, 5.0, 3.0, 4.0]", "[0.25, 0.0, 1.0, 0.5, 0.75]" ], [ "[12.0, 11.0, 15.0, 13.0, 14.0]", "[0.25, 0.0, 1.0, 0.5, 0.75]" ] ]
[ "from typing import List" ]
number = max(numbers) return [(x - min_num
ber) / (max_number - min_number) for x in numbers]
python
Given list of numbers (of at least two elements), apply a linear transform to that list, such that the smallest number will become 0 and the largest will become 1
[]
from typing import List def rescale_to_unit(numbers: List[float]) -> List[float]: """ Given list of numbers (of at least two elements), apply a linear transform to that list, such that the smallest number will become 0 and the largest will become 1 """ min_number = min(numbers) max_
[ [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "[0.0, 0.25, 0.5, 0.75, 1.0]" ] ]
RandomSpanInfilling/HumanEval/21/9
python
code_infilling
HumanEval_RandomSpanInfilling
rescale_to_unit
[ [ "[2.0, 49.9]", "[0.0, 1.0]" ], [ "[100.0, 49.9]", "[1.0, 0.0]" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "[0.0, 0.25, 0.5, 0.75, 1.0]" ], [ "[2.0, 1.0, 5.0, 3.0, 4.0]", "[0.25, 0.0, 1.0, 0.5, 0.75]" ], [ "[12.0, 11.0, 15.0, 13.0, 14.0]", "[0.25, 0.0, 1.0, 0.5, 0.75]" ] ]
[ "from typing import List" ]
max_number = max(numbers) return [(x - min_number) / (max_num
ber - min_number) for x in numbers]
python
Given list of numbers (of at least two elements), apply a linear transform to that list, such that the smallest number will become 0 and the largest will become 1
[]
from typing import List def rescale_to_unit(numbers: List[float]) -> List[float]: """ Given list of numbers (of at least two elements), apply a linear transform to that list, such that the smallest number will become 0 and the largest will become 1 """ min_number = min(numbers)
[ [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "[0.0, 0.25, 0.5, 0.75, 1.0]" ] ]
RandomSpanInfilling/HumanEval/21/10
python
code_infilling
HumanEval_RandomSpanInfilling
rescale_to_unit
[ [ "[]", "[]" ], [ "[4, {}, [], 23.2, 9, 'adasd']", "[4, 9]" ], [ "[3, 'c', 3, 3, 'a', 'b']", "[3, 3, 3]" ] ]
[ "from typing import List, Any" ]
if isi
nstance(x, int)]
python
Filter given list of any python values only for integers
[]
from typing import List, Any def filter_integers(values: List[Any]) -> List[int]: """ Filter given list of any python values only for integers """ return [x for x in values
[ [ "['a', 3.14, 5]", "[5]" ], [ "[1, 2, 3, 'abc', {}, []]", "[1, 2, 3]" ] ]
RandomSpanInfilling/HumanEval/22/1
python
code_infilling
HumanEval_RandomSpanInfilling
filter_integers
[ [ "[]", "[]" ], [ "[4, {}, [], 23.2, 9, 'adasd']", "[4, 9]" ], [ "[3, 'c', 3, 3, 'a', 'b']", "[3, 3, 3]" ] ]
[ "from typing import List, Any" ]
n [x for x in
values if isinstance(x, int)]
python
Filter given list of any python values only for integers
[]
from typing import List, Any def filter_integers(values: List[Any]) -> List[int]: """ Filter given list of any python values only for integers """ retur
[ [ "['a', 3.14, 5]", "[5]" ], [ "[1, 2, 3, 'abc', {}, []]", "[1, 2, 3]" ] ]
RandomSpanInfilling/HumanEval/22/2
python
code_infilling
HumanEval_RandomSpanInfilling
filter_integers
[ [ "[]", "[]" ], [ "[4, {}, [], 23.2, 9, 'adasd']", "[4, 9]" ], [ "[3, 'c', 3, 3, 'a', 'b']", "[3, 3, 3]" ] ]
[ "from typing import List, Any" ]
return [x for x in values if isinstance(x, int)]
python
Filter given list of any python values only for integers
[]
from typing import List, Any def filter_integers(values: List[Any]) -> List[int]: """ Filter given list of any python values only for integers """
[ [ "['a', 3.14, 5]", "[5]" ], [ "[1, 2, 3, 'abc', {}, []]", "[1, 2, 3]" ] ]
RandomSpanInfilling/HumanEval/22/3
python
code_infilling
HumanEval_RandomSpanInfilling
filter_integers
[ [ "[]", "[]" ], [ "[4, {}, [], 23.2, 9, 'adasd']", "[4, 9]" ], [ "[3, 'c', 3, 3, 'a', 'b']", "[3, 3, 3]" ] ]
[ "from typing import List, Any" ]
is
instance(x, int)]
python
Filter given list of any python values only for integers
[]
from typing import List, Any def filter_integers(values: List[Any]) -> List[int]: """ Filter given list of any python values only for integers """ return [x for x in values if
[ [ "['a', 3.14, 5]", "[5]" ], [ "[1, 2, 3, 'abc', {}, []]", "[1, 2, 3]" ] ]
RandomSpanInfilling/HumanEval/22/4
python
code_infilling
HumanEval_RandomSpanInfilling
filter_integers
[ [ "[]", "[]" ], [ "[4, {}, [], 23.2, 9, 'adasd']", "[4, 9]" ], [ "[3, 'c', 3, 3, 'a', 'b']", "[3, 3, 3]" ] ]
[ "from typing import List, Any" ]
if isinstance(x, int)
]
python
Filter given list of any python values only for integers
[]
from typing import List, Any def filter_integers(values: List[Any]) -> List[int]: """ Filter given list of any python values only for integers """ return [x for x in values
[ [ "['a', 3.14, 5]", "[5]" ], [ "[1, 2, 3, 'abc', {}, []]", "[1, 2, 3]" ] ]
RandomSpanInfilling/HumanEval/22/5
python
code_infilling
HumanEval_RandomSpanInfilling
filter_integers
[ [ "[]", "[]" ], [ "[4, {}, [], 23.2, 9, 'adasd']", "[4, 9]" ], [ "[3, 'c', 3, 3, 'a', 'b']", "[3, 3, 3]" ] ]
[ "from typing import List, Any" ]
n [x for
x in values if isinstance(x, int)]
python
Filter given list of any python values only for integers
[]
from typing import List, Any def filter_integers(values: List[Any]) -> List[int]: """ Filter given list of any python values only for integers """ retur
[ [ "['a', 3.14, 5]", "[5]" ], [ "[1, 2, 3, 'abc', {}, []]", "[1, 2, 3]" ] ]
RandomSpanInfilling/HumanEval/22/6
python
code_infilling
HumanEval_RandomSpanInfilling
filter_integers
[ [ "[]", "[]" ], [ "[4, {}, [], 23.2, 9, 'adasd']", "[4, 9]" ], [ "[3, 'c', 3, 3, 'a', 'b']", "[3, 3, 3]" ] ]
[ "from typing import List, Any" ]
return [x for x in values i
f isinstance(x, int)]
python
Filter given list of any python values only for integers
[]
from typing import List, Any def filter_integers(values: List[Any]) -> List[int]: """ Filter given list of any python values only for integers """
[ [ "['a', 3.14, 5]", "[5]" ], [ "[1, 2, 3, 'abc', {}, []]", "[1, 2, 3]" ] ]
RandomSpanInfilling/HumanEval/22/7
python
code_infilling
HumanEval_RandomSpanInfilling
filter_integers
[ [ "[]", "[]" ], [ "[4, {}, [], 23.2, 9, 'adasd']", "[4, 9]" ], [ "[3, 'c', 3, 3, 'a', 'b']", "[3, 3, 3]" ] ]
[ "from typing import List, Any" ]
return [x for x in values if isinstance(
x, int)]
python
Filter given list of any python values only for integers
[]
from typing import List, Any def filter_integers(values: List[Any]) -> List[int]: """ Filter given list of any python values only for integers """
[ [ "['a', 3.14, 5]", "[5]" ], [ "[1, 2, 3, 'abc', {}, []]", "[1, 2, 3]" ] ]
RandomSpanInfilling/HumanEval/22/8
python
code_infilling
HumanEval_RandomSpanInfilling
filter_integers
[ [ "[]", "[]" ], [ "[4, {}, [], 23.2, 9, 'adasd']", "[4, 9]" ], [ "[3, 'c', 3, 3, 'a', 'b']", "[3, 3, 3]" ] ]
[ "from typing import List, Any" ]
return [x f
or x in values if isinstance(x, int)]
python
Filter given list of any python values only for integers
[]
from typing import List, Any def filter_integers(values: List[Any]) -> List[int]: """ Filter given list of any python values only for integers """
[ [ "['a', 3.14, 5]", "[5]" ], [ "[1, 2, 3, 'abc', {}, []]", "[1, 2, 3]" ] ]
RandomSpanInfilling/HumanEval/22/9
python
code_infilling
HumanEval_RandomSpanInfilling
filter_integers
[ [ "[]", "[]" ], [ "[4, {}, [], 23.2, 9, 'adasd']", "[4, 9]" ], [ "[3, 'c', 3, 3, 'a', 'b']", "[3, 3, 3]" ] ]
[ "from typing import List, Any" ]
or x in
values if isinstance(x, int)]
python
Filter given list of any python values only for integers
[]
from typing import List, Any def filter_integers(values: List[Any]) -> List[int]: """ Filter given list of any python values only for integers """ return [x f
[ [ "['a', 3.14, 5]", "[5]" ], [ "[1, 2, 3, 'abc', {}, []]", "[1, 2, 3]" ] ]
RandomSpanInfilling/HumanEval/22/10
python
code_infilling
HumanEval_RandomSpanInfilling
filter_integers
[ [ "''", "0" ], [ "'x'", "1" ], [ "'asdasnakj'", "9" ] ]
[]
return len(string)
python
Return length of given string
[]
def strlen(string: str) -> int: """ Return length of given string """
[ [ "''", "0" ], [ "'abc'", "3" ] ]
RandomSpanInfilling/HumanEval/23/1
python
code_infilling
HumanEval_RandomSpanInfilling
strlen
[ [ "''", "0" ], [ "'x'", "1" ], [ "'asdasnakj'", "9" ] ]
[]
tri
ng)
python
Return length of given string
[]
def strlen(string: str) -> int: """ Return length of given string """ return len(s
[ [ "''", "0" ], [ "'abc'", "3" ] ]
RandomSpanInfilling/HumanEval/23/2
python
code_infilling
HumanEval_RandomSpanInfilling
strlen
[ [ "''", "0" ], [ "'x'", "1" ], [ "'asdasnakj'", "9" ] ]
[]
len(string)
python
Return length of given string
[]
def strlen(string: str) -> int: """ Return length of given string """ return
[ [ "''", "0" ], [ "'abc'", "3" ] ]
RandomSpanInfilling/HumanEval/23/3
python
code_infilling
HumanEval_RandomSpanInfilling
strlen
[ [ "''", "0" ], [ "'x'", "1" ], [ "'asdasnakj'", "9" ] ]
[]
return len(st
ring)
python
Return length of given string
[]
def strlen(string: str) -> int: """ Return length of given string """
[ [ "''", "0" ], [ "'abc'", "3" ] ]
RandomSpanInfilling/HumanEval/23/4
python
code_infilling
HumanEval_RandomSpanInfilling
strlen
[ [ "''", "0" ], [ "'x'", "1" ], [ "'asdasnakj'", "9" ] ]
[]
return len(string)
python
Return length of given string
[]
def strlen(string: str) -> int: """ Return length of given string """
[ [ "''", "0" ], [ "'abc'", "3" ] ]
RandomSpanInfilling/HumanEval/23/5
python
code_infilling
HumanEval_RandomSpanInfilling
strlen
[ [ "''", "0" ], [ "'x'", "1" ], [ "'asdasnakj'", "9" ] ]
[]
len(str
ing)
python
Return length of given string
[]
def strlen(string: str) -> int: """ Return length of given string """ return
[ [ "''", "0" ], [ "'abc'", "3" ] ]
RandomSpanInfilling/HumanEval/23/6
python
code_infilling
HumanEval_RandomSpanInfilling
strlen
[ [ "''", "0" ], [ "'x'", "1" ], [ "'asdasnakj'", "9" ] ]
[]
return
len(string)
python
Return length of given string
[]
def strlen(string: str) -> int: """ Return length of given string """
[ [ "''", "0" ], [ "'abc'", "3" ] ]
RandomSpanInfilling/HumanEval/23/7
python
code_infilling
HumanEval_RandomSpanInfilling
strlen
[ [ "''", "0" ], [ "'x'", "1" ], [ "'asdasnakj'", "9" ] ]
[]
return len(string)
python
Return length of given string
[]
def strlen(string: str) -> int: """ Return length of given string """
[ [ "''", "0" ], [ "'abc'", "3" ] ]
RandomSpanInfilling/HumanEval/23/8
python
code_infilling
HumanEval_RandomSpanInfilling
strlen
[ [ "''", "0" ], [ "'x'", "1" ], [ "'asdasnakj'", "9" ] ]
[]
ret
urn len(string)
python
Return length of given string
[]
def strlen(string: str) -> int: """ Return length of given string """
[ [ "''", "0" ], [ "'abc'", "3" ] ]
RandomSpanInfilling/HumanEval/23/9
python
code_infilling
HumanEval_RandomSpanInfilling
strlen
[ [ "''", "0" ], [ "'x'", "1" ], [ "'asdasnakj'", "9" ] ]
[]
n
len(string)
python
Return length of given string
[]
def strlen(string: str) -> int: """ Return length of given string """ retur
[ [ "''", "0" ], [ "'abc'", "3" ] ]
RandomSpanInfilling/HumanEval/23/10
python
code_infilling
HumanEval_RandomSpanInfilling
strlen
[ [ "3", "1" ], [ "7", "1" ], [ "10", "5" ], [ "100", "50" ], [ "49", "7" ] ]
[]
n)): if
n % i == 0: return i
python
For a given number n, find the largest number that divides n evenly, smaller than n
[]
def largest_divisor(n: int) -> int: """ For a given number n, find the largest number that divides n evenly, smaller than n """ for i in reversed(range(
[ [ "15", "5" ] ]
RandomSpanInfilling/HumanEval/24/1
python
code_infilling
HumanEval_RandomSpanInfilling
largest_divisor
[ [ "3", "1" ], [ "7", "1" ], [ "10", "5" ], [ "100", "50" ], [ "49", "7" ] ]
[]
n
reversed(range(n)): if n % i == 0: return i
python
For a given number n, find the largest number that divides n evenly, smaller than n
[]
def largest_divisor(n: int) -> int: """ For a given number n, find the largest number that divides n evenly, smaller than n """ for i i
[ [ "15", "5" ] ]
RandomSpanInfilling/HumanEval/24/2
python
code_infilling
HumanEval_RandomSpanInfilling
largest_divisor
[ [ "3", "1" ], [ "7", "1" ], [ "10", "5" ], [ "100", "50" ], [ "49", "7" ] ]
[]
for i in reversed(range(n)): if n
% i == 0: return i
python
For a given number n, find the largest number that divides n evenly, smaller than n
[]
def largest_divisor(n: int) -> int: """ For a given number n, find the largest number that divides n evenly, smaller than n """
[ [ "15", "5" ] ]
RandomSpanInfilling/HumanEval/24/3
python
code_infilling
HumanEval_RandomSpanInfilling
largest_divisor
[ [ "3", "1" ], [ "7", "1" ], [ "10", "5" ], [ "100", "50" ], [ "49", "7" ] ]
[]
i in reversed(range(n)):
if n % i == 0: return i
python
For a given number n, find the largest number that divides n evenly, smaller than n
[]
def largest_divisor(n: int) -> int: """ For a given number n, find the largest number that divides n evenly, smaller than n """ for
[ [ "15", "5" ] ]
RandomSpanInfilling/HumanEval/24/4
python
code_infilling
HumanEval_RandomSpanInfilling
largest_divisor
[ [ "3", "1" ], [ "7", "1" ], [ "10", "5" ], [ "100", "50" ], [ "49", "7" ] ]
[]
ge(n)): if n % i == 0: retur
n i
python
For a given number n, find the largest number that divides n evenly, smaller than n
[]
def largest_divisor(n: int) -> int: """ For a given number n, find the largest number that divides n evenly, smaller than n """ for i in reversed(ran
[ [ "15", "5" ] ]
RandomSpanInfilling/HumanEval/24/5
python
code_infilling
HumanEval_RandomSpanInfilling
largest_divisor
[ [ "3", "1" ], [ "7", "1" ], [ "10", "5" ], [ "100", "50" ], [ "49", "7" ] ]
[]
r i in reversed(range(n)):
if n % i == 0: return i
python
For a given number n, find the largest number that divides n evenly, smaller than n
[]
def largest_divisor(n: int) -> int: """ For a given number n, find the largest number that divides n evenly, smaller than n """ fo
[ [ "15", "5" ] ]
RandomSpanInfilling/HumanEval/24/6
python
code_infilling
HumanEval_RandomSpanInfilling
largest_divisor
[ [ "3", "1" ], [ "7", "1" ], [ "10", "5" ], [ "100", "50" ], [ "49", "7" ] ]
[]
return i
python
For a given number n, find the largest number that divides n evenly, smaller than n
[]
def largest_divisor(n: int) -> int: """ For a given number n, find the largest number that divides n evenly, smaller than n """ for i in reversed(range(n)): if n % i == 0:
[ [ "15", "5" ] ]
RandomSpanInfilling/HumanEval/24/7
python
code_infilling
HumanEval_RandomSpanInfilling
largest_divisor
[ [ "3", "1" ], [ "7", "1" ], [ "10", "5" ], [ "100", "50" ], [ "49", "7" ] ]
[]
n)): if n % i == 0: return
i
python
For a given number n, find the largest number that divides n evenly, smaller than n
[]
def largest_divisor(n: int) -> int: """ For a given number n, find the largest number that divides n evenly, smaller than n """ for i in reversed(range(
[ [ "15", "5" ] ]
RandomSpanInfilling/HumanEval/24/8
python
code_infilling
HumanEval_RandomSpanInfilling
largest_divisor
[ [ "3", "1" ], [ "7", "1" ], [ "10", "5" ], [ "100", "50" ], [ "49", "7" ] ]
[]
d(range(n)):
if n % i == 0: return i
python
For a given number n, find the largest number that divides n evenly, smaller than n
[]
def largest_divisor(n: int) -> int: """ For a given number n, find the largest number that divides n evenly, smaller than n """ for i in reverse
[ [ "15", "5" ] ]
RandomSpanInfilling/HumanEval/24/9
python
code_infilling
HumanEval_RandomSpanInfilling
largest_divisor
[ [ "3", "1" ], [ "7", "1" ], [ "10", "5" ], [ "100", "50" ], [ "49", "7" ] ]
[]
in reversed(range(n)):
if n % i == 0: return i
python
For a given number n, find the largest number that divides n evenly, smaller than n
[]
def largest_divisor(n: int) -> int: """ For a given number n, find the largest number that divides n evenly, smaller than n """ for i
[ [ "15", "5" ] ]
RandomSpanInfilling/HumanEval/24/10
python
code_infilling
HumanEval_RandomSpanInfilling
largest_divisor
[ [ "2", "[2]" ], [ "4", "[2, 2]" ], [ "8", "[2, 2, 2]" ], [ "3 * 19", "[3, 19]" ], [ "3 * 19 * 3 * 19", "[3, 3, 19, 19]" ], [ "3 * 19 * 3 * 19 * 3 * 19", "[3, 3, 3, 19, 19, 19]" ], [ "3 * 19 * 19 * 19", "[3, 19, 19, 19]" ], [ "3 * 2 * 3", "[2, 3, 3]" ] ]
[ "from typing import List" ]
fact.append(i) n //= i else: i += 1 if n > 1:
fact.append(n) return fact
python
Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the product of all factors
[]
from typing import List def factorize(n: int) -> List[int]: """ Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the product of all factors """ import math fact = [] i = 2 while i <= int(math.sqrt(n) + 1): if n % i == 0:
[ [ "8", "[2, 2, 2]" ], [ "25", "[5, 5]" ], [ "70", "[2, 5, 7]" ] ]
RandomSpanInfilling/HumanEval/25/1
python
code_infilling
HumanEval_RandomSpanInfilling
factorize
[ [ "2", "[2]" ], [ "4", "[2, 2]" ], [ "8", "[2, 2, 2]" ], [ "3 * 19", "[3, 19]" ], [ "3 * 19 * 3 * 19", "[3, 3, 19, 19]" ], [ "3 * 19 * 3 * 19 * 3 * 19", "[3, 3, 3, 19, 19, 19]" ], [ "3 * 19 * 19 * 19", "[3, 19, 19, 19]" ], [ "3 * 2 * 3", "[2, 3, 3]" ] ]
[ "from typing import List" ]
else: i += 1 if n
> 1: fact.append(n) return fact
python
Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the product of all factors
[]
from typing import List def factorize(n: int) -> List[int]: """ Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the product of all factors """ import math fact = [] i = 2 while i <= int(math.sqrt(n) + 1): if n % i == 0: fact.append(i) n //= i
[ [ "8", "[2, 2, 2]" ], [ "25", "[5, 5]" ], [ "70", "[2, 5, 7]" ] ]
RandomSpanInfilling/HumanEval/25/2
python
code_infilling
HumanEval_RandomSpanInfilling
factorize
[ [ "2", "[2]" ], [ "4", "[2, 2]" ], [ "8", "[2, 2, 2]" ], [ "3 * 19", "[3, 19]" ], [ "3 * 19 * 3 * 19", "[3, 3, 19, 19]" ], [ "3 * 19 * 3 * 19 * 3 * 19", "[3, 3, 3, 19, 19, 19]" ], [ "3 * 19 * 19 * 19", "[3, 19, 19, 19]" ], [ "3 * 2 * 3", "[2, 3, 3]" ] ]
[ "from typing import List" ]
+= 1 if n > 1: fact.append(n) ret
urn fact
python
Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the product of all factors
[]
from typing import List def factorize(n: int) -> List[int]: """ Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the product of all factors """ import math fact = [] i = 2 while i <= int(math.sqrt(n) + 1): if n % i == 0: fact.append(i) n //= i else: i
[ [ "8", "[2, 2, 2]" ], [ "25", "[5, 5]" ], [ "70", "[2, 5, 7]" ] ]
RandomSpanInfilling/HumanEval/25/3
python
code_infilling
HumanEval_RandomSpanInfilling
factorize
[ [ "2", "[2]" ], [ "4", "[2, 2]" ], [ "8", "[2, 2, 2]" ], [ "3 * 19", "[3, 19]" ], [ "3 * 19 * 3 * 19", "[3, 3, 19, 19]" ], [ "3 * 19 * 3 * 19 * 3 * 19", "[3, 3, 3, 19, 19, 19]" ], [ "3 * 19 * 19 * 19", "[3, 19, 19, 19]" ], [ "3 * 2 * 3", "[2, 3, 3]" ] ]
[ "from typing import List" ]
= 2 while i <= int(math.sqrt(n) + 1): if n % i ==
0: fact.append(i) n //= i else: i += 1 if n > 1: fact.append(n) return fact
python
Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the product of all factors
[]
from typing import List def factorize(n: int) -> List[int]: """ Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the product of all factors """ import math fact = [] i
[ [ "8", "[2, 2, 2]" ], [ "25", "[5, 5]" ], [ "70", "[2, 5, 7]" ] ]
RandomSpanInfilling/HumanEval/25/4
python
code_infilling
HumanEval_RandomSpanInfilling
factorize
[ [ "2", "[2]" ], [ "4", "[2, 2]" ], [ "8", "[2, 2, 2]" ], [ "3 * 19", "[3, 19]" ], [ "3 * 19 * 3 * 19", "[3, 3, 19, 19]" ], [ "3 * 19 * 3 * 19 * 3 * 19", "[3, 3, 3, 19, 19, 19]" ], [ "3 * 19 * 19 * 19", "[3, 19, 19, 19]" ], [ "3 * 2 * 3", "[2, 3, 3]" ] ]
[ "from typing import List" ]
append(n) return
fact
python
Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the product of all factors
[]
from typing import List def factorize(n: int) -> List[int]: """ Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the product of all factors """ import math fact = [] i = 2 while i <= int(math.sqrt(n) + 1): if n % i == 0: fact.append(i) n //= i else: i += 1 if n > 1: fact.
[ [ "8", "[2, 2, 2]" ], [ "25", "[5, 5]" ], [ "70", "[2, 5, 7]" ] ]
RandomSpanInfilling/HumanEval/25/5
python
code_infilling
HumanEval_RandomSpanInfilling
factorize
[ [ "2", "[2]" ], [ "4", "[2, 2]" ], [ "8", "[2, 2, 2]" ], [ "3 * 19", "[3, 19]" ], [ "3 * 19 * 3 * 19", "[3, 3, 19, 19]" ], [ "3 * 19 * 3 * 19 * 3 * 19", "[3, 3, 3, 19, 19, 19]" ], [ "3 * 19 * 19 * 19", "[3, 19, 19, 19]" ], [ "3 * 2 * 3", "[2, 3, 3]" ] ]
[ "from typing import List" ]
== 0: fact.append(i) n //= i
else: i += 1 if n > 1: fact.append(n) return fact
python
Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the product of all factors
[]
from typing import List def factorize(n: int) -> List[int]: """ Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the product of all factors """ import math fact = [] i = 2 while i <= int(math.sqrt(n) + 1): if n % i
[ [ "8", "[2, 2, 2]" ], [ "25", "[5, 5]" ], [ "70", "[2, 5, 7]" ] ]
RandomSpanInfilling/HumanEval/25/6
python
code_infilling
HumanEval_RandomSpanInfilling
factorize
[ [ "2", "[2]" ], [ "4", "[2, 2]" ], [ "8", "[2, 2, 2]" ], [ "3 * 19", "[3, 19]" ], [ "3 * 19 * 3 * 19", "[3, 3, 19, 19]" ], [ "3 * 19 * 3 * 19 * 3 * 19", "[3, 3, 3, 19, 19, 19]" ], [ "3 * 19 * 19 * 19", "[3, 19, 19, 19]" ], [ "3 * 2 * 3", "[2, 3, 3]" ] ]
[ "from typing import List" ]
else: i += 1 if
n > 1: fact.append(n) return fact
python
Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the product of all factors
[]
from typing import List def factorize(n: int) -> List[int]: """ Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the product of all factors """ import math fact = [] i = 2 while i <= int(math.sqrt(n) + 1): if n % i == 0: fact.append(i) n //= i
[ [ "8", "[2, 2, 2]" ], [ "25", "[5, 5]" ], [ "70", "[2, 5, 7]" ] ]
RandomSpanInfilling/HumanEval/25/7
python
code_infilling
HumanEval_RandomSpanInfilling
factorize
[ [ "2", "[2]" ], [ "4", "[2, 2]" ], [ "8", "[2, 2, 2]" ], [ "3 * 19", "[3, 19]" ], [ "3 * 19 * 3 * 19", "[3, 3, 19, 19]" ], [ "3 * 19 * 3 * 19 * 3 * 19", "[3, 3, 3, 19, 19, 19]" ], [ "3 * 19 * 19 * 19", "[3, 19, 19, 19]" ], [ "3 * 2 * 3", "[2, 3, 3]" ] ]
[ "from typing import List" ]
= 2 while i <= int(math.sqrt(n) + 1): if n % i == 0: fact.append(i) n //= i else: i += 1 if n > 1: fact.append(n)
return fact
python
Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the product of all factors
[]
from typing import List def factorize(n: int) -> List[int]: """ Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the product of all factors """ import math fact = [] i
[ [ "8", "[2, 2, 2]" ], [ "25", "[5, 5]" ], [ "70", "[2, 5, 7]" ] ]
RandomSpanInfilling/HumanEval/25/8
python
code_infilling
HumanEval_RandomSpanInfilling
factorize
[ [ "2", "[2]" ], [ "4", "[2, 2]" ], [ "8", "[2, 2, 2]" ], [ "3 * 19", "[3, 19]" ], [ "3 * 19 * 3 * 19", "[3, 3, 19, 19]" ], [ "3 * 19 * 3 * 19 * 3 * 19", "[3, 3, 3, 19, 19, 19]" ], [ "3 * 19 * 19 * 19", "[3, 19, 19, 19]" ], [ "3 * 2 * 3", "[2, 3, 3]" ] ]
[ "from typing import List" ]
math fact = [] i = 2 while i <= int(math.sqrt(n) + 1): if n % i == 0:
fact.append(i) n //= i else: i += 1 if n > 1: fact.append(n) return fact
python
Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the product of all factors
[]
from typing import List def factorize(n: int) -> List[int]: """ Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the product of all factors """ import
[ [ "8", "[2, 2, 2]" ], [ "25", "[5, 5]" ], [ "70", "[2, 5, 7]" ] ]
RandomSpanInfilling/HumanEval/25/9
python
code_infilling
HumanEval_RandomSpanInfilling
factorize
[ [ "2", "[2]" ], [ "4", "[2, 2]" ], [ "8", "[2, 2, 2]" ], [ "3 * 19", "[3, 19]" ], [ "3 * 19 * 3 * 19", "[3, 3, 19, 19]" ], [ "3 * 19 * 3 * 19 * 3 * 19", "[3, 3, 3, 19, 19, 19]" ], [ "3 * 19 * 19 * 19", "[3, 19, 19, 19]" ], [ "3 * 2 * 3", "[2, 3, 3]" ] ]
[ "from typing import List" ]
ath fact = [] i = 2 while i <= int(math.sqrt(n) + 1): if n % i == 0: fact.append(i) n //= i else: i += 1
if n > 1: fact.append(n) return fact
python
Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the product of all factors
[]
from typing import List def factorize(n: int) -> List[int]: """ Return list of prime factors of given integer in the order from smallest to largest. Each of the factors should be listed number of times corresponding to how many times it appeares in factorization. Input number should be equal to the product of all factors """ import m
[ [ "8", "[2, 2, 2]" ], [ "25", "[5, 5]" ], [ "70", "[2, 5, 7]" ] ]
RandomSpanInfilling/HumanEval/25/10
python
code_infilling
HumanEval_RandomSpanInfilling
factorize
[ [ "[]", "[]" ], [ "[1, 2, 3, 4]", "[1, 2, 3, 4]" ], [ "[1, 2, 3, 2, 4, 3, 5]", "[1, 4, 5]" ] ]
[ "from typing import List" ]
c = collections.Counter(numbers) return [n for n in numbe
rs if c[n] <= 1]
python
From a list of integers, remove all elements that occur more than once. Keep order of elements left the same as in the input.
[]
from typing import List def remove_duplicates(numbers: List[int]) -> List[int]: """ From a list of integers, remove all elements that occur more than once. Keep order of elements left the same as in the input. """ import collections
[ [ "[1, 2, 3, 2, 4]", "[1, 3, 4]" ] ]
RandomSpanInfilling/HumanEval/26/1
python
code_infilling
HumanEval_RandomSpanInfilling
remove_duplicates
[ [ "[]", "[]" ], [ "[1, 2, 3, 4]", "[1, 2, 3, 4]" ], [ "[1, 2, 3, 2, 4, 3, 5]", "[1, 4, 5]" ] ]
[ "from typing import List" ]
<= 1]
python
From a list of integers, remove all elements that occur more than once. Keep order of elements left the same as in the input.
[]
from typing import List def remove_duplicates(numbers: List[int]) -> List[int]: """ From a list of integers, remove all elements that occur more than once. Keep order of elements left the same as in the input. """ import collections c = collections.Counter(numbers) return [n for n in numbers if c[n]
[ [ "[1, 2, 3, 2, 4]", "[1, 3, 4]" ] ]
RandomSpanInfilling/HumanEval/26/2
python
code_infilling
HumanEval_RandomSpanInfilling
remove_duplicates
[ [ "[]", "[]" ], [ "[1, 2, 3, 4]", "[1, 2, 3, 4]" ], [ "[1, 2, 3, 2, 4, 3, 5]", "[1, 4, 5]" ] ]
[ "from typing import List" ]
ctions c
= collections.Counter(numbers) return [n for n in numbers if c[n] <= 1]
python
From a list of integers, remove all elements that occur more than once. Keep order of elements left the same as in the input.
[]
from typing import List def remove_duplicates(numbers: List[int]) -> List[int]: """ From a list of integers, remove all elements that occur more than once. Keep order of elements left the same as in the input. """ import colle
[ [ "[1, 2, 3, 2, 4]", "[1, 3, 4]" ] ]
RandomSpanInfilling/HumanEval/26/3
python
code_infilling
HumanEval_RandomSpanInfilling
remove_duplicates
[ [ "[]", "[]" ], [ "[1, 2, 3, 4]", "[1, 2, 3, 4]" ], [ "[1, 2, 3, 2, 4, 3, 5]", "[1, 4, 5]" ] ]
[ "from typing import List" ]
return [n for n in
numbers if c[n] <= 1]
python
From a list of integers, remove all elements that occur more than once. Keep order of elements left the same as in the input.
[]
from typing import List def remove_duplicates(numbers: List[int]) -> List[int]: """ From a list of integers, remove all elements that occur more than once. Keep order of elements left the same as in the input. """ import collections c = collections.Counter(numbers)
[ [ "[1, 2, 3, 2, 4]", "[1, 3, 4]" ] ]
RandomSpanInfilling/HumanEval/26/4
python
code_infilling
HumanEval_RandomSpanInfilling
remove_duplicates
[ [ "[]", "[]" ], [ "[1, 2, 3, 4]", "[1, 2, 3, 4]" ], [ "[1, 2, 3, 2, 4, 3, 5]", "[1, 4, 5]" ] ]
[ "from typing import List" ]
mbe
rs if c[n] <= 1]
python
From a list of integers, remove all elements that occur more than once. Keep order of elements left the same as in the input.
[]
from typing import List def remove_duplicates(numbers: List[int]) -> List[int]: """ From a list of integers, remove all elements that occur more than once. Keep order of elements left the same as in the input. """ import collections c = collections.Counter(numbers) return [n for n in nu
[ [ "[1, 2, 3, 2, 4]", "[1, 3, 4]" ] ]
RandomSpanInfilling/HumanEval/26/5
python
code_infilling
HumanEval_RandomSpanInfilling
remove_duplicates
[ [ "[]", "[]" ], [ "[1, 2, 3, 4]", "[1, 2, 3, 4]" ], [ "[1, 2, 3, 2, 4, 3, 5]", "[1, 4, 5]" ] ]
[ "from typing import List" ]
ollections c = collections.Counter(numbers
) return [n for n in numbers if c[n] <= 1]
python
From a list of integers, remove all elements that occur more than once. Keep order of elements left the same as in the input.
[]
from typing import List def remove_duplicates(numbers: List[int]) -> List[int]: """ From a list of integers, remove all elements that occur more than once. Keep order of elements left the same as in the input. """ import c
[ [ "[1, 2, 3, 2, 4]", "[1, 3, 4]" ] ]
RandomSpanInfilling/HumanEval/26/6
python
code_infilling
HumanEval_RandomSpanInfilling
remove_duplicates
[ [ "[]", "[]" ], [ "[1, 2, 3, 4]", "[1, 2, 3, 4]" ], [ "[1, 2, 3, 2, 4, 3, 5]", "[1, 4, 5]" ] ]
[ "from typing import List" ]
ions c = collections.Count
er(numbers) return [n for n in numbers if c[n] <= 1]
python
From a list of integers, remove all elements that occur more than once. Keep order of elements left the same as in the input.
[]
from typing import List def remove_duplicates(numbers: List[int]) -> List[int]: """ From a list of integers, remove all elements that occur more than once. Keep order of elements left the same as in the input. """ import collect
[ [ "[1, 2, 3, 2, 4]", "[1, 3, 4]" ] ]
RandomSpanInfilling/HumanEval/26/7
python
code_infilling
HumanEval_RandomSpanInfilling
remove_duplicates
[ [ "[]", "[]" ], [ "[1, 2, 3, 4]", "[1, 2, 3, 4]" ], [ "[1, 2, 3, 2, 4, 3, 5]", "[1, 4, 5]" ] ]
[ "from typing import List" ]
collections c = collections.Counter(numbers) return [n for n in numbers if c[n]
<= 1]
python
From a list of integers, remove all elements that occur more than once. Keep order of elements left the same as in the input.
[]
from typing import List def remove_duplicates(numbers: List[int]) -> List[int]: """ From a list of integers, remove all elements that occur more than once. Keep order of elements left the same as in the input. """ import
[ [ "[1, 2, 3, 2, 4]", "[1, 3, 4]" ] ]
RandomSpanInfilling/HumanEval/26/8
python
code_infilling
HumanEval_RandomSpanInfilling
remove_duplicates
[ [ "[]", "[]" ], [ "[1, 2, 3, 4]", "[1, 2, 3, 4]" ], [ "[1, 2, 3, 2, 4, 3, 5]", "[1, 4, 5]" ] ]
[ "from typing import List" ]
return [n for n in numbers if c[n] <= 1]
python
From a list of integers, remove all elements that occur more than once. Keep order of elements left the same as in the input.
[]
from typing import List def remove_duplicates(numbers: List[int]) -> List[int]: """ From a list of integers, remove all elements that occur more than once. Keep order of elements left the same as in the input. """ import collections c = collections.Counter(numbers)
[ [ "[1, 2, 3, 2, 4]", "[1, 3, 4]" ] ]
RandomSpanInfilling/HumanEval/26/9
python
code_infilling
HumanEval_RandomSpanInfilling
remove_duplicates
[ [ "[]", "[]" ], [ "[1, 2, 3, 4]", "[1, 2, 3, 4]" ], [ "[1, 2, 3, 2, 4, 3, 5]", "[1, 4, 5]" ] ]
[ "from typing import List" ]
ions c = collections.Counter(numbers) return [n f
or n in numbers if c[n] <= 1]
python
From a list of integers, remove all elements that occur more than once. Keep order of elements left the same as in the input.
[]
from typing import List def remove_duplicates(numbers: List[int]) -> List[int]: """ From a list of integers, remove all elements that occur more than once. Keep order of elements left the same as in the input. """ import collect
[ [ "[1, 2, 3, 2, 4]", "[1, 3, 4]" ] ]
RandomSpanInfilling/HumanEval/26/10
python
code_infilling
HumanEval_RandomSpanInfilling
remove_duplicates
[ [ "''", "''" ], [ "'Hello!'", "'hELLO!'" ], [ "'These violent delights have violent ends'", "'tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS'" ] ]
[]
tu
rn string.swapcase()
python
For a given string, flip lowercase characters to uppercase and uppercase to lowercase.
[]
def flip_case(string: str) -> str: """ For a given string, flip lowercase characters to uppercase and uppercase to lowercase. """ re
[ [ "'Hello'", "'hELLO'" ] ]
RandomSpanInfilling/HumanEval/27/1
python
code_infilling
HumanEval_RandomSpanInfilling
flip_case
[ [ "''", "''" ], [ "'Hello!'", "'hELLO!'" ], [ "'These violent delights have violent ends'", "'tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS'" ] ]
[]
ring.swapcase(
)
python
For a given string, flip lowercase characters to uppercase and uppercase to lowercase.
[]
def flip_case(string: str) -> str: """ For a given string, flip lowercase characters to uppercase and uppercase to lowercase. """ return st
[ [ "'Hello'", "'hELLO'" ] ]
RandomSpanInfilling/HumanEval/27/2
python
code_infilling
HumanEval_RandomSpanInfilling
flip_case
[ [ "''", "''" ], [ "'Hello!'", "'hELLO!'" ], [ "'These violent delights have violent ends'", "'tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS'" ] ]
[]
s
wapcase()
python
For a given string, flip lowercase characters to uppercase and uppercase to lowercase.
[]
def flip_case(string: str) -> str: """ For a given string, flip lowercase characters to uppercase and uppercase to lowercase. """ return string.
[ [ "'Hello'", "'hELLO'" ] ]
RandomSpanInfilling/HumanEval/27/3
python
code_infilling
HumanEval_RandomSpanInfilling
flip_case
[ [ "''", "''" ], [ "'Hello!'", "'hELLO!'" ], [ "'These violent delights have violent ends'", "'tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS'" ] ]
[]
ing.swapcas
e()
python
For a given string, flip lowercase characters to uppercase and uppercase to lowercase.
[]
def flip_case(string: str) -> str: """ For a given string, flip lowercase characters to uppercase and uppercase to lowercase. """ return str
[ [ "'Hello'", "'hELLO'" ] ]
RandomSpanInfilling/HumanEval/27/4
python
code_infilling
HumanEval_RandomSpanInfilling
flip_case
[ [ "''", "''" ], [ "'Hello!'", "'hELLO!'" ], [ "'These violent delights have violent ends'", "'tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS'" ] ]
[]
ng.sw
apcase()
python
For a given string, flip lowercase characters to uppercase and uppercase to lowercase.
[]
def flip_case(string: str) -> str: """ For a given string, flip lowercase characters to uppercase and uppercase to lowercase. """ return stri
[ [ "'Hello'", "'hELLO'" ] ]
RandomSpanInfilling/HumanEval/27/5
python
code_infilling
HumanEval_RandomSpanInfilling
flip_case
[ [ "''", "''" ], [ "'Hello!'", "'hELLO!'" ], [ "'These violent delights have violent ends'", "'tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS'" ] ]
[]
return string.swapcase()
python
For a given string, flip lowercase characters to uppercase and uppercase to lowercase.
[]
def flip_case(string: str) -> str: """ For a given string, flip lowercase characters to uppercase and uppercase to lowercase. """
[ [ "'Hello'", "'hELLO'" ] ]
RandomSpanInfilling/HumanEval/27/6
python
code_infilling
HumanEval_RandomSpanInfilling
flip_case
[ [ "''", "''" ], [ "'Hello!'", "'hELLO!'" ], [ "'These violent delights have violent ends'", "'tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS'" ] ]
[]
string.swapca
se()
python
For a given string, flip lowercase characters to uppercase and uppercase to lowercase.
[]
def flip_case(string: str) -> str: """ For a given string, flip lowercase characters to uppercase and uppercase to lowercase. """ return
[ [ "'Hello'", "'hELLO'" ] ]
RandomSpanInfilling/HumanEval/27/7
python
code_infilling
HumanEval_RandomSpanInfilling
flip_case
[ [ "''", "''" ], [ "'Hello!'", "'hELLO!'" ], [ "'These violent delights have violent ends'", "'tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS'" ] ]
[]
wapcase
()
python
For a given string, flip lowercase characters to uppercase and uppercase to lowercase.
[]
def flip_case(string: str) -> str: """ For a given string, flip lowercase characters to uppercase and uppercase to lowercase. """ return string.s
[ [ "'Hello'", "'hELLO'" ] ]
RandomSpanInfilling/HumanEval/27/8
python
code_infilling
HumanEval_RandomSpanInfilling
flip_case
[ [ "''", "''" ], [ "'Hello!'", "'hELLO!'" ], [ "'These violent delights have violent ends'", "'tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS'" ] ]
[]
return string.sw
apcase()
python
For a given string, flip lowercase characters to uppercase and uppercase to lowercase.
[]
def flip_case(string: str) -> str: """ For a given string, flip lowercase characters to uppercase and uppercase to lowercase. """
[ [ "'Hello'", "'hELLO'" ] ]
RandomSpanInfilling/HumanEval/27/9
python
code_infilling
HumanEval_RandomSpanInfilling
flip_case
[ [ "''", "''" ], [ "'Hello!'", "'hELLO!'" ], [ "'These violent delights have violent ends'", "'tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS'" ] ]
[]
ap
case()
python
For a given string, flip lowercase characters to uppercase and uppercase to lowercase.
[]
def flip_case(string: str) -> str: """ For a given string, flip lowercase characters to uppercase and uppercase to lowercase. """ return string.sw
[ [ "'Hello'", "'hELLO'" ] ]
RandomSpanInfilling/HumanEval/27/10
python
code_infilling
HumanEval_RandomSpanInfilling
flip_case
[ [ "[]", "''" ], [ "['x', 'y', 'z']", "'xyz'" ], [ "['x', 'y', 'z', 'w', 'k']", "'xyzwk'" ] ]
[ "from typing import List" ]
oin(strin
gs)
python
Concatenate list of strings into a single string
[]
from typing import List def concatenate(strings: List[str]) -> str: """ Concatenate list of strings into a single string """ return ''.j
[ [ "[]", "''" ], [ "['a', 'b', 'c']", "'abc'" ] ]
RandomSpanInfilling/HumanEval/28/1
python
code_infilling
HumanEval_RandomSpanInfilling
concatenate
[ [ "[]", "''" ], [ "['x', 'y', 'z']", "'xyz'" ], [ "['x', 'y', 'z', 'w', 'k']", "'xyzwk'" ] ]
[ "from typing import List" ]
turn '
'.join(strings)
python
Concatenate list of strings into a single string
[]
from typing import List def concatenate(strings: List[str]) -> str: """ Concatenate list of strings into a single string """ re
[ [ "[]", "''" ], [ "['a', 'b', 'c']", "'abc'" ] ]
RandomSpanInfilling/HumanEval/28/2
python
code_infilling
HumanEval_RandomSpanInfilling
concatenate
[ [ "[]", "''" ], [ "['x', 'y', 'z']", "'xyz'" ], [ "['x', 'y', 'z', 'w', 'k']", "'xyzwk'" ] ]
[ "from typing import List" ]
n ''.join(s
trings)
python
Concatenate list of strings into a single string
[]
from typing import List def concatenate(strings: List[str]) -> str: """ Concatenate list of strings into a single string """ retur
[ [ "[]", "''" ], [ "['a', 'b', 'c']", "'abc'" ] ]
RandomSpanInfilling/HumanEval/28/3
python
code_infilling
HumanEval_RandomSpanInfilling
concatenate
[ [ "[]", "''" ], [ "['x', 'y', 'z']", "'xyz'" ], [ "['x', 'y', 'z', 'w', 'k']", "'xyzwk'" ] ]
[ "from typing import List" ]
turn ''.join(string
s)
python
Concatenate list of strings into a single string
[]
from typing import List def concatenate(strings: List[str]) -> str: """ Concatenate list of strings into a single string """ re
[ [ "[]", "''" ], [ "['a', 'b', 'c']", "'abc'" ] ]
RandomSpanInfilling/HumanEval/28/4
python
code_infilling
HumanEval_RandomSpanInfilling
concatenate
[ [ "[]", "''" ], [ "['x', 'y', 'z']", "'xyz'" ], [ "['x', 'y', 'z', 'w', 'k']", "'xyzwk'" ] ]
[ "from typing import List" ]
.join(string
s)
python
Concatenate list of strings into a single string
[]
from typing import List def concatenate(strings: List[str]) -> str: """ Concatenate list of strings into a single string """ return ''
[ [ "[]", "''" ], [ "['a', 'b', 'c']", "'abc'" ] ]
RandomSpanInfilling/HumanEval/28/5
python
code_infilling
HumanEval_RandomSpanInfilling
concatenate
[ [ "[]", "''" ], [ "['x', 'y', 'z']", "'xyz'" ], [ "['x', 'y', 'z', 'w', 'k']", "'xyzwk'" ] ]
[ "from typing import List" ]
return ''.join(strings)
python
Concatenate list of strings into a single string
[]
from typing import List def concatenate(strings: List[str]) -> str: """ Concatenate list of strings into a single string """
[ [ "[]", "''" ], [ "['a', 'b', 'c']", "'abc'" ] ]
RandomSpanInfilling/HumanEval/28/6
python
code_infilling
HumanEval_RandomSpanInfilling
concatenate
[ [ "[]", "''" ], [ "['x', 'y', 'z']", "'xyz'" ], [ "['x', 'y', 'z', 'w', 'k']", "'xyzwk'" ] ]
[ "from typing import List" ]
ings)
python
Concatenate list of strings into a single string
[]
from typing import List def concatenate(strings: List[str]) -> str: """ Concatenate list of strings into a single string """ return ''.join(str
[ [ "[]", "''" ], [ "['a', 'b', 'c']", "'abc'" ] ]
RandomSpanInfilling/HumanEval/28/7
python
code_infilling
HumanEval_RandomSpanInfilling
concatenate
[ [ "[]", "''" ], [ "['x', 'y', 'z']", "'xyz'" ], [ "['x', 'y', 'z', 'w', 'k']", "'xyzwk'" ] ]
[ "from typing import List" ]
''.join(strings)
python
Concatenate list of strings into a single string
[]
from typing import List def concatenate(strings: List[str]) -> str: """ Concatenate list of strings into a single string """ return
[ [ "[]", "''" ], [ "['a', 'b', 'c']", "'abc'" ] ]
RandomSpanInfilling/HumanEval/28/8
python
code_infilling
HumanEval_RandomSpanInfilling
concatenate
[ [ "[]", "''" ], [ "['x', 'y', 'z']", "'xyz'" ], [ "['x', 'y', 'z', 'w', 'k']", "'xyzwk'" ] ]
[ "from typing import List" ]
joi
n(strings)
python
Concatenate list of strings into a single string
[]
from typing import List def concatenate(strings: List[str]) -> str: """ Concatenate list of strings into a single string """ return ''.
[ [ "[]", "''" ], [ "['a', 'b', 'c']", "'abc'" ] ]
RandomSpanInfilling/HumanEval/28/9
python
code_infilling
HumanEval_RandomSpanInfilling
concatenate
[ [ "[]", "''" ], [ "['x', 'y', 'z']", "'xyz'" ], [ "['x', 'y', 'z', 'w', 'k']", "'xyzwk'" ] ]
[ "from typing import List" ]
rn
''.join(strings)
python
Concatenate list of strings into a single string
[]
from typing import List def concatenate(strings: List[str]) -> str: """ Concatenate list of strings into a single string """ retu
[ [ "[]", "''" ], [ "['a', 'b', 'c']", "'abc'" ] ]
RandomSpanInfilling/HumanEval/28/10
python
code_infilling
HumanEval_RandomSpanInfilling
concatenate
[ [ "[], 'john'", "[]" ], [ "['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx'", "['xxx', 'xxxAAA', 'xxx']" ] ]
[ "from typing import List" ]
n [x for x in strings if x.startsw
ith(prefix)]
python
Filter an input list of strings only for ones that start with a given prefix.
[]
from typing import List def filter_by_prefix(strings: List[str], prefix: str) -> List[str]: """ Filter an input list of strings only for ones that start with a given prefix. """ retur
[ [ "[], 'a'", "[]" ], [ "['abc', 'bcd', 'cde', 'array'], 'a'", "['abc', 'array']" ] ]
RandomSpanInfilling/HumanEval/29/1
python
code_infilling
HumanEval_RandomSpanInfilling
filter_by_prefix
[ [ "[], 'john'", "[]" ], [ "['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx'", "['xxx', 'xxxAAA', 'xxx']" ] ]
[ "from typing import List" ]
r x in strings if x.s
tartswith(prefix)]
python
Filter an input list of strings only for ones that start with a given prefix.
[]
from typing import List def filter_by_prefix(strings: List[str], prefix: str) -> List[str]: """ Filter an input list of strings only for ones that start with a given prefix. """ return [x fo
[ [ "[], 'a'", "[]" ], [ "['abc', 'bcd', 'cde', 'array'], 'a'", "['abc', 'array']" ] ]
RandomSpanInfilling/HumanEval/29/2
python
code_infilling
HumanEval_RandomSpanInfilling
filter_by_prefix
[ [ "[], 'john'", "[]" ], [ "['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx'", "['xxx', 'xxxAAA', 'xxx']" ] ]
[ "from typing import List" ]
turn [x for x in strings if x.startswit
h(prefix)]
python
Filter an input list of strings only for ones that start with a given prefix.
[]
from typing import List def filter_by_prefix(strings: List[str], prefix: str) -> List[str]: """ Filter an input list of strings only for ones that start with a given prefix. """ re
[ [ "[], 'a'", "[]" ], [ "['abc', 'bcd', 'cde', 'array'], 'a'", "['abc', 'array']" ] ]
RandomSpanInfilling/HumanEval/29/3
python
code_infilling
HumanEval_RandomSpanInfilling
filter_by_prefix
[ [ "[], 'john'", "[]" ], [ "['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx'", "['xxx', 'xxxAAA', 'xxx']" ] ]
[ "from typing import List" ]
x for x in strings if x.sta
rtswith(prefix)]
python
Filter an input list of strings only for ones that start with a given prefix.
[]
from typing import List def filter_by_prefix(strings: List[str], prefix: str) -> List[str]: """ Filter an input list of strings only for ones that start with a given prefix. """ return [
[ [ "[], 'a'", "[]" ], [ "['abc', 'bcd', 'cde', 'array'], 'a'", "['abc', 'array']" ] ]
RandomSpanInfilling/HumanEval/29/4
python
code_infilling
HumanEval_RandomSpanInfilling
filter_by_prefix
[ [ "[], 'john'", "[]" ], [ "['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx'", "['xxx', 'xxxAAA', 'xxx']" ] ]
[ "from typing import List" ]
rn [x for x in strings if x.start
swith(prefix)]
python
Filter an input list of strings only for ones that start with a given prefix.
[]
from typing import List def filter_by_prefix(strings: List[str], prefix: str) -> List[str]: """ Filter an input list of strings only for ones that start with a given prefix. """ retu
[ [ "[], 'a'", "[]" ], [ "['abc', 'bcd', 'cde', 'array'], 'a'", "['abc', 'array']" ] ]
RandomSpanInfilling/HumanEval/29/5
python
code_infilling
HumanEval_RandomSpanInfilling
filter_by_prefix
[ [ "[], 'john'", "[]" ], [ "['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx'", "['xxx', 'xxxAAA', 'xxx']" ] ]
[ "from typing import List" ]
ings if x.startswith(pr
efix)]
python
Filter an input list of strings only for ones that start with a given prefix.
[]
from typing import List def filter_by_prefix(strings: List[str], prefix: str) -> List[str]: """ Filter an input list of strings only for ones that start with a given prefix. """ return [x for x in str
[ [ "[], 'a'", "[]" ], [ "['abc', 'bcd', 'cde', 'array'], 'a'", "['abc', 'array']" ] ]
RandomSpanInfilling/HumanEval/29/6
python
code_infilling
HumanEval_RandomSpanInfilling
filter_by_prefix
[ [ "[], 'john'", "[]" ], [ "['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx'", "['xxx', 'xxxAAA', 'xxx']" ] ]
[ "from typing import List" ]
return [x for x in strings if x.startswith(prefix)]
python
Filter an input list of strings only for ones that start with a given prefix.
[]
from typing import List def filter_by_prefix(strings: List[str], prefix: str) -> List[str]: """ Filter an input list of strings only for ones that start with a given prefix. """
[ [ "[], 'a'", "[]" ], [ "['abc', 'bcd', 'cde', 'array'], 'a'", "['abc', 'array']" ] ]
RandomSpanInfilling/HumanEval/29/7
python
code_infilling
HumanEval_RandomSpanInfilling
filter_by_prefix
[ [ "[], 'john'", "[]" ], [ "['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx'", "['xxx', 'xxxAAA', 'xxx']" ] ]
[ "from typing import List" ]
gs if x.
startswith(prefix)]
python
Filter an input list of strings only for ones that start with a given prefix.
[]
from typing import List def filter_by_prefix(strings: List[str], prefix: str) -> List[str]: """ Filter an input list of strings only for ones that start with a given prefix. """ return [x for x in strin
[ [ "[], 'a'", "[]" ], [ "['abc', 'bcd', 'cde', 'array'], 'a'", "['abc', 'array']" ] ]
RandomSpanInfilling/HumanEval/29/8
python
code_infilling
HumanEval_RandomSpanInfilling
filter_by_prefix
[ [ "[], 'john'", "[]" ], [ "['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx'", "['xxx', 'xxxAAA', 'xxx']" ] ]
[ "from typing import List" ]
x in strings if x.s
tartswith(prefix)]
python
Filter an input list of strings only for ones that start with a given prefix.
[]
from typing import List def filter_by_prefix(strings: List[str], prefix: str) -> List[str]: """ Filter an input list of strings only for ones that start with a given prefix. """ return [x for
[ [ "[], 'a'", "[]" ], [ "['abc', 'bcd', 'cde', 'array'], 'a'", "['abc', 'array']" ] ]
RandomSpanInfilling/HumanEval/29/9
python
code_infilling
HumanEval_RandomSpanInfilling
filter_by_prefix
[ [ "[], 'john'", "[]" ], [ "['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx'", "['xxx', 'xxxAAA', 'xxx']" ] ]
[ "from typing import List" ]
urn [x for x in strings if x.startswith(
prefix)]
python
Filter an input list of strings only for ones that start with a given prefix.
[]
from typing import List def filter_by_prefix(strings: List[str], prefix: str) -> List[str]: """ Filter an input list of strings only for ones that start with a given prefix. """ ret
[ [ "[], 'a'", "[]" ], [ "['abc', 'bcd', 'cde', 'array'], 'a'", "['abc', 'array']" ] ]
RandomSpanInfilling/HumanEval/29/10
python
code_infilling
HumanEval_RandomSpanInfilling
filter_by_prefix