import_str
sequencelengths
0
1
doc_string
stringclasses
164 values
suffix
stringlengths
0
837
compare_func
sequencelengths
0
0
data_id
stringlengths
34
37
task_name
stringclasses
1 value
solution
stringlengths
6
141
demos
sequencelengths
0
8
prefix
stringlengths
65
1.8k
dataset_name
stringclasses
1 value
entry_func
stringclasses
158 values
tgt_lang
stringclasses
1 value
src_lang
stringclasses
1 value
test_cases
sequencelengths
0
100
[ "from typing import List" ]
Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest
'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5, 'six': 6, 'seven': 7, 'eight': 8, 'nine': 9 } return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
[]
SingleLineInfilling/HumanEval/19/L1
code_infilling
'zero': 0,
[ [ "'three one five'", "'one three five'" ] ]
from typing import List def sort_numbers(numbers: str) -> str: """ Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest """ value_map = {
HumanEval_SingleLineInfillingLight
sort_numbers
python
python
[ [ "''", "''" ], [ "'three'", "'three'" ], [ "'three five nine'", "'three five nine'" ], [ "'five zero four seven nine eight'", "'zero four five seven eight nine'" ], [ "'six five four three two one zero'", "'zero one two three four five six'" ] ]
[ "from typing import List" ]
Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest
'two': 2, 'three': 3, 'four': 4, 'five': 5, 'six': 6, 'seven': 7, 'eight': 8, 'nine': 9 } return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
[]
SingleLineInfilling/HumanEval/19/L2
code_infilling
'one': 1,
[ [ "'three one five'", "'one three five'" ] ]
from typing import List def sort_numbers(numbers: str) -> str: """ Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest """ value_map = { 'zero': 0,
HumanEval_SingleLineInfillingLight
sort_numbers
python
python
[ [ "''", "''" ], [ "'three'", "'three'" ], [ "'three five nine'", "'three five nine'" ], [ "'five zero four seven nine eight'", "'zero four five seven eight nine'" ], [ "'six five four three two one zero'", "'zero one two three four five six'" ] ]
[ "from typing import List" ]
Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest
'three': 3, 'four': 4, 'five': 5, 'six': 6, 'seven': 7, 'eight': 8, 'nine': 9 } return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
[]
SingleLineInfilling/HumanEval/19/L3
code_infilling
'two': 2,
[ [ "'three one five'", "'one three five'" ] ]
from typing import List def sort_numbers(numbers: str) -> str: """ Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest """ value_map = { 'zero': 0, 'one': 1,
HumanEval_SingleLineInfillingLight
sort_numbers
python
python
[ [ "''", "''" ], [ "'three'", "'three'" ], [ "'three five nine'", "'three five nine'" ], [ "'five zero four seven nine eight'", "'zero four five seven eight nine'" ], [ "'six five four three two one zero'", "'zero one two three four five six'" ] ]
[ "from typing import List" ]
Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest
'four': 4, 'five': 5, 'six': 6, 'seven': 7, 'eight': 8, 'nine': 9 } return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
[]
SingleLineInfilling/HumanEval/19/L4
code_infilling
'three': 3,
[ [ "'three one five'", "'one three five'" ] ]
from typing import List def sort_numbers(numbers: str) -> str: """ Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest """ value_map = { 'zero': 0, 'one': 1, 'two': 2,
HumanEval_SingleLineInfillingLight
sort_numbers
python
python
[ [ "''", "''" ], [ "'three'", "'three'" ], [ "'three five nine'", "'three five nine'" ], [ "'five zero four seven nine eight'", "'zero four five seven eight nine'" ], [ "'six five four three two one zero'", "'zero one two three four five six'" ] ]
[ "from typing import List" ]
Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest
'five': 5, 'six': 6, 'seven': 7, 'eight': 8, 'nine': 9 } return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
[]
SingleLineInfilling/HumanEval/19/L5
code_infilling
'four': 4,
[ [ "'three one five'", "'one three five'" ] ]
from typing import List def sort_numbers(numbers: str) -> str: """ Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest """ value_map = { 'zero': 0, 'one': 1, 'two': 2, 'three': 3,
HumanEval_SingleLineInfillingLight
sort_numbers
python
python
[ [ "''", "''" ], [ "'three'", "'three'" ], [ "'three five nine'", "'three five nine'" ], [ "'five zero four seven nine eight'", "'zero four five seven eight nine'" ], [ "'six five four three two one zero'", "'zero one two three four five six'" ] ]
[ "from typing import List" ]
Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest
'six': 6, 'seven': 7, 'eight': 8, 'nine': 9 } return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
[]
SingleLineInfilling/HumanEval/19/L6
code_infilling
'five': 5,
[ [ "'three one five'", "'one three five'" ] ]
from typing import List def sort_numbers(numbers: str) -> str: """ Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest """ value_map = { 'zero': 0, 'one': 1, 'two': 2, 'three': 3, 'four': 4,
HumanEval_SingleLineInfillingLight
sort_numbers
python
python
[ [ "''", "''" ], [ "'three'", "'three'" ], [ "'three five nine'", "'three five nine'" ], [ "'five zero four seven nine eight'", "'zero four five seven eight nine'" ], [ "'six five four three two one zero'", "'zero one two three four five six'" ] ]
[ "from typing import List" ]
Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest
'seven': 7, 'eight': 8, 'nine': 9 } return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
[]
SingleLineInfilling/HumanEval/19/L7
code_infilling
'six': 6,
[ [ "'three one five'", "'one three five'" ] ]
from typing import List def sort_numbers(numbers: str) -> str: """ Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest """ value_map = { 'zero': 0, 'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5,
HumanEval_SingleLineInfillingLight
sort_numbers
python
python
[ [ "''", "''" ], [ "'three'", "'three'" ], [ "'three five nine'", "'three five nine'" ], [ "'five zero four seven nine eight'", "'zero four five seven eight nine'" ], [ "'six five four three two one zero'", "'zero one two three four five six'" ] ]
[ "from typing import List" ]
Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest
'eight': 8, 'nine': 9 } return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
[]
SingleLineInfilling/HumanEval/19/L8
code_infilling
'seven': 7,
[ [ "'three one five'", "'one three five'" ] ]
from typing import List def sort_numbers(numbers: str) -> str: """ Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest """ value_map = { 'zero': 0, 'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5, 'six': 6,
HumanEval_SingleLineInfillingLight
sort_numbers
python
python
[ [ "''", "''" ], [ "'three'", "'three'" ], [ "'three five nine'", "'three five nine'" ], [ "'five zero four seven nine eight'", "'zero four five seven eight nine'" ], [ "'six five four three two one zero'", "'zero one two three four five six'" ] ]
[ "from typing import List" ]
Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest
'nine': 9 } return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
[]
SingleLineInfilling/HumanEval/19/L9
code_infilling
'eight': 8,
[ [ "'three one five'", "'one three five'" ] ]
from typing import List def sort_numbers(numbers: str) -> str: """ Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest """ value_map = { 'zero': 0, 'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5, 'six': 6, 'seven': 7,
HumanEval_SingleLineInfillingLight
sort_numbers
python
python
[ [ "''", "''" ], [ "'three'", "'three'" ], [ "'three five nine'", "'three five nine'" ], [ "'five zero four seven nine eight'", "'zero four five seven eight nine'" ], [ "'six five four three two one zero'", "'zero one two three four five six'" ] ]
[ "from typing import List" ]
Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest
} return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
[]
SingleLineInfilling/HumanEval/19/L10
code_infilling
'nine': 9
[ [ "'three one five'", "'one three five'" ] ]
from typing import List def sort_numbers(numbers: str) -> str: """ Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest """ value_map = { 'zero': 0, 'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5, 'six': 6, 'seven': 7, 'eight': 8,
HumanEval_SingleLineInfillingLight
sort_numbers
python
python
[ [ "''", "''" ], [ "'three'", "'three'" ], [ "'three five nine'", "'three five nine'" ], [ "'five zero four seven nine eight'", "'zero four five seven eight nine'" ], [ "'six five four three two one zero'", "'zero one two three four five six'" ] ]
[ "from typing import List" ]
Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest
return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
[]
SingleLineInfilling/HumanEval/19/L11
code_infilling
}
[ [ "'three one five'", "'one three five'" ] ]
from typing import List def sort_numbers(numbers: str) -> str: """ Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest """ value_map = { 'zero': 0, 'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5, 'six': 6, 'seven': 7, 'eight': 8, 'nine': 9
HumanEval_SingleLineInfillingLight
sort_numbers
python
python
[ [ "''", "''" ], [ "'three'", "'three'" ], [ "'three five nine'", "'three five nine'" ], [ "'five zero four seven nine eight'", "'zero four five seven eight nine'" ], [ "'six five four three two one zero'", "'zero one two three four five six'" ] ]
[ "from typing import List" ]
Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest
[]
SingleLineInfilling/HumanEval/19/L12
code_infilling
return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
[ [ "'three one five'", "'one three five'" ] ]
from typing import List def sort_numbers(numbers: str) -> str: """ Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest """ value_map = { 'zero': 0, 'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5, 'six': 6, 'seven': 7, 'eight': 8, 'nine': 9 }
HumanEval_SingleLineInfillingLight
sort_numbers
python
python
[ [ "''", "''" ], [ "'three'", "'three'" ], [ "'three five nine'", "'three five nine'" ], [ "'five zero four seven nine eight'", "'zero four five seven eight nine'" ], [ "'six five four three two one zero'", "'zero one two three four five six'" ] ]
[ "from typing import List, Tuple" ]
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).
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
[]
SingleLineInfilling/HumanEval/20/L0
code_infilling
closest_pair = 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)" ] ]
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). """
HumanEval_SingleLineInfillingLight
find_closest_elements
python
python
[ [ "[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" ]
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).
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
[]
SingleLineInfilling/HumanEval/20/L1
code_infilling
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)" ] ]
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
HumanEval_SingleLineInfillingLight
find_closest_elements
python
python
[ [ "[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" ]
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).
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
[]
SingleLineInfilling/HumanEval/20/L3
code_infilling
for idx, elem in enumerate(numbers):
[ [ "[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)" ] ]
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
HumanEval_SingleLineInfillingLight
find_closest_elements
python
python
[ [ "[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" ]
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).
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
[]
SingleLineInfilling/HumanEval/20/L4
code_infilling
for idx2, elem2 in enumerate(numbers):
[ [ "[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)" ] ]
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):
HumanEval_SingleLineInfillingLight
find_closest_elements
python
python
[ [ "[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" ]
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).
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
[]
SingleLineInfilling/HumanEval/20/L5
code_infilling
if idx != idx2:
[ [ "[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)" ] ]
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):
HumanEval_SingleLineInfillingLight
find_closest_elements
python
python
[ [ "[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" ]
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).
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
[]
SingleLineInfilling/HumanEval/20/L6
code_infilling
if distance is 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)" ] ]
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:
HumanEval_SingleLineInfillingLight
find_closest_elements
python
python
[ [ "[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" ]
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 = 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
[]
SingleLineInfilling/HumanEval/20/L7
code_infilling
distance = abs(elem - elem2)
[ [ "[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)" ] ]
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:
HumanEval_SingleLineInfillingLight
find_closest_elements
python
python
[ [ "[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" ]
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).
else: new_distance = abs(elem - elem2) if new_distance < distance: distance = new_distance closest_pair = tuple(sorted([elem, elem2])) return closest_pair
[]
SingleLineInfilling/HumanEval/20/L8
code_infilling
closest_pair = tuple(sorted([elem, elem2]))
[ [ "[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)" ] ]
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)
HumanEval_SingleLineInfillingLight
find_closest_elements
python
python
[ [ "[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" ]
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).
new_distance = abs(elem - elem2) if new_distance < distance: distance = new_distance closest_pair = tuple(sorted([elem, elem2])) return closest_pair
[]
SingleLineInfilling/HumanEval/20/L9
code_infilling
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)" ] ]
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]))
HumanEval_SingleLineInfillingLight
find_closest_elements
python
python
[ [ "[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" ]
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).
if new_distance < distance: distance = new_distance closest_pair = tuple(sorted([elem, elem2])) return closest_pair
[]
SingleLineInfilling/HumanEval/20/L10
code_infilling
new_distance = abs(elem - elem2)
[ [ "[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)" ] ]
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:
HumanEval_SingleLineInfillingLight
find_closest_elements
python
python
[ [ "[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" ]
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).
distance = new_distance closest_pair = tuple(sorted([elem, elem2])) return closest_pair
[]
SingleLineInfilling/HumanEval/20/L11
code_infilling
if new_distance < distance:
[ [ "[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)" ] ]
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: new_distance = abs(elem - elem2)
HumanEval_SingleLineInfillingLight
find_closest_elements
python
python
[ [ "[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" ]
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 = tuple(sorted([elem, elem2])) return closest_pair
[]
SingleLineInfilling/HumanEval/20/L12
code_infilling
distance = new_distance
[ [ "[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)" ] ]
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: new_distance = abs(elem - elem2) if new_distance < distance:
HumanEval_SingleLineInfillingLight
find_closest_elements
python
python
[ [ "[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" ]
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).
return closest_pair
[]
SingleLineInfilling/HumanEval/20/L13
code_infilling
closest_pair = tuple(sorted([elem, elem2]))
[ [ "[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)" ] ]
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: new_distance = abs(elem - elem2) if new_distance < distance: distance = new_distance
HumanEval_SingleLineInfillingLight
find_closest_elements
python
python
[ [ "[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" ]
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).
[]
SingleLineInfilling/HumanEval/20/L15
code_infilling
return closest_pair
[ [ "[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)" ] ]
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: new_distance = abs(elem - elem2) if new_distance < distance: distance = new_distance closest_pair = tuple(sorted([elem, elem2]))
HumanEval_SingleLineInfillingLight
find_closest_elements
python
python
[ [ "[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" ]
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
max_number = max(numbers) return [(x - min_number) / (max_number - min_number) for x in numbers]
[]
SingleLineInfilling/HumanEval/21/L0
code_infilling
min_number = min(numbers)
[ [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "[0.0, 0.25, 0.5, 0.75, 1.0]" ] ]
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 """
HumanEval_SingleLineInfillingLight
rescale_to_unit
python
python
[ [ "[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" ]
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
return [(x - min_number) / (max_number - min_number) for x in numbers]
[]
SingleLineInfilling/HumanEval/21/L1
code_infilling
max_number = max(numbers)
[ [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "[0.0, 0.25, 0.5, 0.75, 1.0]" ] ]
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)
HumanEval_SingleLineInfillingLight
rescale_to_unit
python
python
[ [ "[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" ]
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
[]
SingleLineInfilling/HumanEval/21/L2
code_infilling
return [(x - min_number) / (max_number - min_number) for x in numbers]
[ [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "[0.0, 0.25, 0.5, 0.75, 1.0]" ] ]
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)
HumanEval_SingleLineInfillingLight
rescale_to_unit
python
python
[ [ "[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, Any" ]
Filter given list of any python values only for integers
[]
SingleLineInfilling/HumanEval/22/L0
code_infilling
return [x for x in values if isinstance(x, int)]
[ [ "['a', 3.14, 5]", "[5]" ], [ "[1, 2, 3, 'abc', {}, []]", "[1, 2, 3]" ] ]
from typing import List, Any def filter_integers(values: List[Any]) -> List[int]: """ Filter given list of any python values only for integers """
HumanEval_SingleLineInfillingLight
filter_integers
python
python
[ [ "[]", "[]" ], [ "[4, {}, [], 23.2, 9, 'adasd']", "[4, 9]" ], [ "[3, 'c', 3, 3, 'a', 'b']", "[3, 3, 3]" ] ]
[]
Return length of given string
[]
SingleLineInfilling/HumanEval/23/L0
code_infilling
return len(string)
[ [ "''", "0" ], [ "'abc'", "3" ] ]
def strlen(string: str) -> int: """ Return length of given string """
HumanEval_SingleLineInfillingLight
strlen
python
python
[ [ "''", "0" ], [ "'x'", "1" ], [ "'asdasnakj'", "9" ] ]
[]
For a given number n, find the largest number that divides n evenly, smaller than n
if n % i == 0: return i
[]
SingleLineInfilling/HumanEval/24/L0
code_infilling
for i in reversed(range(n)):
[ [ "15", "5" ] ]
def largest_divisor(n: int) -> int: """ For a given number n, find the largest number that divides n evenly, smaller than n """
HumanEval_SingleLineInfillingLight
largest_divisor
python
python
[ [ "3", "1" ], [ "7", "1" ], [ "10", "5" ], [ "100", "50" ], [ "49", "7" ] ]
[]
For a given number n, find the largest number that divides n evenly, smaller than n
return i
[]
SingleLineInfilling/HumanEval/24/L1
code_infilling
if n % i == 0:
[ [ "15", "5" ] ]
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)):
HumanEval_SingleLineInfillingLight
largest_divisor
python
python
[ [ "3", "1" ], [ "7", "1" ], [ "10", "5" ], [ "100", "50" ], [ "49", "7" ] ]
[]
For a given number n, find the largest number that divides n evenly, smaller than n
[]
SingleLineInfilling/HumanEval/24/L2
code_infilling
return i
[ [ "15", "5" ] ]
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:
HumanEval_SingleLineInfillingLight
largest_divisor
python
python
[ [ "3", "1" ], [ "7", "1" ], [ "10", "5" ], [ "100", "50" ], [ "49", "7" ] ]
[ "from typing import List" ]
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
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
[]
SingleLineInfilling/HumanEval/25/L0
code_infilling
import math
[ [ "8", "[2, 2, 2]" ], [ "25", "[5, 5]" ], [ "70", "[2, 5, 7]" ] ]
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 """
HumanEval_SingleLineInfillingLight
factorize
python
python
[ [ "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" ]
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
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
[]
SingleLineInfilling/HumanEval/25/L1
code_infilling
fact = []
[ [ "8", "[2, 2, 2]" ], [ "25", "[5, 5]" ], [ "70", "[2, 5, 7]" ] ]
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
HumanEval_SingleLineInfillingLight
factorize
python
python
[ [ "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" ]
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
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
[]
SingleLineInfilling/HumanEval/25/L2
code_infilling
i = 2
[ [ "8", "[2, 2, 2]" ], [ "25", "[5, 5]" ], [ "70", "[2, 5, 7]" ] ]
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 = []
HumanEval_SingleLineInfillingLight
factorize
python
python
[ [ "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" ]
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
if n % i == 0: fact.append(i) n //= i else: i += 1 if n > 1: fact.append(n) return fact
[]
SingleLineInfilling/HumanEval/25/L3
code_infilling
while i <= int(math.sqrt(n) + 1):
[ [ "8", "[2, 2, 2]" ], [ "25", "[5, 5]" ], [ "70", "[2, 5, 7]" ] ]
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
HumanEval_SingleLineInfillingLight
factorize
python
python
[ [ "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" ]
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
fact.append(i) n //= i else: i += 1 if n > 1: fact.append(n) return fact
[]
SingleLineInfilling/HumanEval/25/L4
code_infilling
if n % i == 0:
[ [ "8", "[2, 2, 2]" ], [ "25", "[5, 5]" ], [ "70", "[2, 5, 7]" ] ]
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):
HumanEval_SingleLineInfillingLight
factorize
python
python
[ [ "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" ]
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
n //= i else: i += 1 if n > 1: fact.append(n) return fact
[]
SingleLineInfilling/HumanEval/25/L5
code_infilling
fact.append(i)
[ [ "8", "[2, 2, 2]" ], [ "25", "[5, 5]" ], [ "70", "[2, 5, 7]" ] ]
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:
HumanEval_SingleLineInfillingLight
factorize
python
python
[ [ "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" ]
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
else: i += 1 if n > 1: fact.append(n) return fact
[]
SingleLineInfilling/HumanEval/25/L6
code_infilling
n //= i
[ [ "8", "[2, 2, 2]" ], [ "25", "[5, 5]" ], [ "70", "[2, 5, 7]" ] ]
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)
HumanEval_SingleLineInfillingLight
factorize
python
python
[ [ "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" ]
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
i += 1 if n > 1: fact.append(n) return fact
[]
SingleLineInfilling/HumanEval/25/L7
code_infilling
else:
[ [ "8", "[2, 2, 2]" ], [ "25", "[5, 5]" ], [ "70", "[2, 5, 7]" ] ]
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
HumanEval_SingleLineInfillingLight
factorize
python
python
[ [ "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" ]
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
if n > 1: fact.append(n) return fact
[]
SingleLineInfilling/HumanEval/25/L8
code_infilling
i += 1
[ [ "8", "[2, 2, 2]" ], [ "25", "[5, 5]" ], [ "70", "[2, 5, 7]" ] ]
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:
HumanEval_SingleLineInfillingLight
factorize
python
python
[ [ "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" ]
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
fact.append(n) return fact
[]
SingleLineInfilling/HumanEval/25/L10
code_infilling
if n > 1:
[ [ "8", "[2, 2, 2]" ], [ "25", "[5, 5]" ], [ "70", "[2, 5, 7]" ] ]
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
HumanEval_SingleLineInfillingLight
factorize
python
python
[ [ "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" ]
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
return fact
[]
SingleLineInfilling/HumanEval/25/L11
code_infilling
fact.append(n)
[ [ "8", "[2, 2, 2]" ], [ "25", "[5, 5]" ], [ "70", "[2, 5, 7]" ] ]
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:
HumanEval_SingleLineInfillingLight
factorize
python
python
[ [ "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" ]
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
[]
SingleLineInfilling/HumanEval/25/L12
code_infilling
return fact
[ [ "8", "[2, 2, 2]" ], [ "25", "[5, 5]" ], [ "70", "[2, 5, 7]" ] ]
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.append(n)
HumanEval_SingleLineInfillingLight
factorize
python
python
[ [ "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" ]
From a list of integers, remove all elements that occur more than once. Keep order of elements left the same as in the input.
c = collections.Counter(numbers) return [n for n in numbers if c[n] <= 1]
[]
SingleLineInfilling/HumanEval/26/L0
code_infilling
import collections
[ [ "[1, 2, 3, 2, 4]", "[1, 3, 4]" ] ]
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. """
HumanEval_SingleLineInfillingLight
remove_duplicates
python
python
[ [ "[]", "[]" ], [ "[1, 2, 3, 4]", "[1, 2, 3, 4]" ], [ "[1, 2, 3, 2, 4, 3, 5]", "[1, 4, 5]" ] ]
[ "from typing import List" ]
From a list of integers, remove all elements that occur more than once. Keep order of elements left the same as in the input.
return [n for n in numbers if c[n] <= 1]
[]
SingleLineInfilling/HumanEval/26/L1
code_infilling
c = collections.Counter(numbers)
[ [ "[1, 2, 3, 2, 4]", "[1, 3, 4]" ] ]
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
HumanEval_SingleLineInfillingLight
remove_duplicates
python
python
[ [ "[]", "[]" ], [ "[1, 2, 3, 4]", "[1, 2, 3, 4]" ], [ "[1, 2, 3, 2, 4, 3, 5]", "[1, 4, 5]" ] ]
[ "from typing import List" ]
From a list of integers, remove all elements that occur more than once. Keep order of elements left the same as in the input.
[]
SingleLineInfilling/HumanEval/26/L2
code_infilling
return [n for n in numbers if c[n] <= 1]
[ [ "[1, 2, 3, 2, 4]", "[1, 3, 4]" ] ]
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)
HumanEval_SingleLineInfillingLight
remove_duplicates
python
python
[ [ "[]", "[]" ], [ "[1, 2, 3, 4]", "[1, 2, 3, 4]" ], [ "[1, 2, 3, 2, 4, 3, 5]", "[1, 4, 5]" ] ]
[]
For a given string, flip lowercase characters to uppercase and uppercase to lowercase.
[]
SingleLineInfilling/HumanEval/27/L0
code_infilling
return string.swapcase()
[ [ "'Hello'", "'hELLO'" ] ]
def flip_case(string: str) -> str: """ For a given string, flip lowercase characters to uppercase and uppercase to lowercase. """
HumanEval_SingleLineInfillingLight
flip_case
python
python
[ [ "''", "''" ], [ "'Hello!'", "'hELLO!'" ], [ "'These violent delights have violent ends'", "'tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS'" ] ]
[ "from typing import List" ]
Concatenate list of strings into a single string
[]
SingleLineInfilling/HumanEval/28/L0
code_infilling
return ''.join(strings)
[ [ "[]", "''" ], [ "['a', 'b', 'c']", "'abc'" ] ]
from typing import List def concatenate(strings: List[str]) -> str: """ Concatenate list of strings into a single string """
HumanEval_SingleLineInfillingLight
concatenate
python
python
[ [ "[]", "''" ], [ "['x', 'y', 'z']", "'xyz'" ], [ "['x', 'y', 'z', 'w', 'k']", "'xyzwk'" ] ]
[ "from typing import List" ]
Filter an input list of strings only for ones that start with a given prefix.
[]
SingleLineInfilling/HumanEval/29/L0
code_infilling
return [x for x in strings if x.startswith(prefix)]
[ [ "[], 'a'", "[]" ], [ "['abc', 'bcd', 'cde', 'array'], 'a'", "['abc', 'array']" ] ]
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. """
HumanEval_SingleLineInfillingLight
filter_by_prefix
python
python
[ [ "[], 'john'", "[]" ], [ "['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx'", "['xxx', 'xxxAAA', 'xxx']" ] ]
[]
Return only positive numbers in the list.
[]
SingleLineInfilling/HumanEval/30/L0
code_infilling
return [e for e in l if e > 0]
[ [ "[-1, 2, -4, 5, 6]", "[2, 5, 6]" ], [ "[5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]", "[5, 3, 2, 3, 9, 123, 1]" ] ]
def get_positive(l: list): """Return only positive numbers in the list. """
HumanEval_SingleLineInfillingLight
get_positive
python
python
[ [ "[-1, -2, 4, 5, 6]", "[4, 5, 6]" ], [ "[5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]", "[5, 3, 2, 3, 3, 9, 123, 1]" ], [ "[-1, -2]", "[]" ], [ "[]", "[]" ] ]
[]
Return true if a given number is prime, and false otherwise.
return False for k in range(2, n - 1): if n % k == 0: return False return True
[]
SingleLineInfilling/HumanEval/31/L0
code_infilling
if n < 2:
[ [ "6", "False" ], [ "101", "True" ], [ "11", "True" ], [ "13441", "True" ], [ "61", "True" ], [ "4", "False" ], [ "1", "False" ] ]
def is_prime(n): """Return true if a given number is prime, and false otherwise. """
HumanEval_SingleLineInfillingLight
is_prime
python
python
[ [ "6", "False" ], [ "101", "True" ], [ "11", "True" ], [ "13441", "True" ], [ "61", "True" ], [ "4", "False" ], [ "1", "False" ], [ "5", "True" ], [ "11", "True" ], [ "17", "True" ], [ "5 * 17", "False" ], [ "11 * 7", "False" ], [ "13441 * 19", "False" ] ]
[]
Return true if a given number is prime, and false otherwise.
for k in range(2, n - 1): if n % k == 0: return False return True
[]
SingleLineInfilling/HumanEval/31/L1
code_infilling
return False
[ [ "6", "False" ], [ "101", "True" ], [ "11", "True" ], [ "13441", "True" ], [ "61", "True" ], [ "4", "False" ], [ "1", "False" ] ]
def is_prime(n): """Return true if a given number is prime, and false otherwise. """ if n < 2:
HumanEval_SingleLineInfillingLight
is_prime
python
python
[ [ "6", "False" ], [ "101", "True" ], [ "11", "True" ], [ "13441", "True" ], [ "61", "True" ], [ "4", "False" ], [ "1", "False" ], [ "5", "True" ], [ "11", "True" ], [ "17", "True" ], [ "5 * 17", "False" ], [ "11 * 7", "False" ], [ "13441 * 19", "False" ] ]
[]
Return true if a given number is prime, and false otherwise.
if n % k == 0: return False return True
[]
SingleLineInfilling/HumanEval/31/L2
code_infilling
for k in range(2, n - 1):
[ [ "6", "False" ], [ "101", "True" ], [ "11", "True" ], [ "13441", "True" ], [ "61", "True" ], [ "4", "False" ], [ "1", "False" ] ]
def is_prime(n): """Return true if a given number is prime, and false otherwise. """ if n < 2: return False
HumanEval_SingleLineInfillingLight
is_prime
python
python
[ [ "6", "False" ], [ "101", "True" ], [ "11", "True" ], [ "13441", "True" ], [ "61", "True" ], [ "4", "False" ], [ "1", "False" ], [ "5", "True" ], [ "11", "True" ], [ "17", "True" ], [ "5 * 17", "False" ], [ "11 * 7", "False" ], [ "13441 * 19", "False" ] ]
[]
Return true if a given number is prime, and false otherwise.
return False return True
[]
SingleLineInfilling/HumanEval/31/L3
code_infilling
if n % k == 0:
[ [ "6", "False" ], [ "101", "True" ], [ "11", "True" ], [ "13441", "True" ], [ "61", "True" ], [ "4", "False" ], [ "1", "False" ] ]
def is_prime(n): """Return true if a given number is prime, and false otherwise. """ if n < 2: return False for k in range(2, n - 1):
HumanEval_SingleLineInfillingLight
is_prime
python
python
[ [ "6", "False" ], [ "101", "True" ], [ "11", "True" ], [ "13441", "True" ], [ "61", "True" ], [ "4", "False" ], [ "1", "False" ], [ "5", "True" ], [ "11", "True" ], [ "17", "True" ], [ "5 * 17", "False" ], [ "11 * 7", "False" ], [ "13441 * 19", "False" ] ]
[]
Return true if a given number is prime, and false otherwise.
return True
[]
SingleLineInfilling/HumanEval/31/L4
code_infilling
return False
[ [ "6", "False" ], [ "101", "True" ], [ "11", "True" ], [ "13441", "True" ], [ "61", "True" ], [ "4", "False" ], [ "1", "False" ] ]
def is_prime(n): """Return true if a given number is prime, and false otherwise. """ if n < 2: return False for k in range(2, n - 1): if n % k == 0:
HumanEval_SingleLineInfillingLight
is_prime
python
python
[ [ "6", "False" ], [ "101", "True" ], [ "11", "True" ], [ "13441", "True" ], [ "61", "True" ], [ "4", "False" ], [ "1", "False" ], [ "5", "True" ], [ "11", "True" ], [ "17", "True" ], [ "5 * 17", "False" ], [ "11 * 7", "False" ], [ "13441 * 19", "False" ] ]
[]
Return true if a given number is prime, and false otherwise.
[]
SingleLineInfilling/HumanEval/31/L5
code_infilling
return True
[ [ "6", "False" ], [ "101", "True" ], [ "11", "True" ], [ "13441", "True" ], [ "61", "True" ], [ "4", "False" ], [ "1", "False" ] ]
def is_prime(n): """Return true if a given number is prime, and false otherwise. """ if n < 2: return False for k in range(2, n - 1): if n % k == 0: return False
HumanEval_SingleLineInfillingLight
is_prime
python
python
[ [ "6", "False" ], [ "101", "True" ], [ "11", "True" ], [ "13441", "True" ], [ "61", "True" ], [ "4", "False" ], [ "1", "False" ], [ "5", "True" ], [ "11", "True" ], [ "17", "True" ], [ "5 * 17", "False" ], [ "11 * 7", "False" ], [ "13441 * 19", "False" ] ]
[ "import math" ]
Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n
while poly(xs, begin) * poly(xs, end) > 0: begin *= 2.0 end *= 2.0 while end - begin > 1e-10: center = (begin + end) / 2.0 if poly(xs, center) * poly(xs, begin) > 0: begin = center else: end = center return begin
[]
SingleLineInfilling/HumanEval/32/L0
code_infilling
begin, end = -1., 1.
[ [ "x", "0." ], [ "find_zero([1, 2]), 2) # f(x", "1 + 2x" ], [ "find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3", "-6 + 11x - 6x^2 + x^3" ] ]
import math def poly(xs: list, x: float): """ Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n """ return sum([coeff * math.pow(x, i) for i, coeff in enumerate(xs)]) def find_zero(xs: list): """ xs are coefficients of a polynomial. find_zero find x such that poly(x) = 0. find_zero returns only only zero point, even if there are many. Moreover, find_zero only takes list xs having even number of coefficients and largest non zero coefficient as it guarantees a solution. >>> round(find_zero([1, 2]), 2) # f(x) = 1 + 2x -0.5 >>> round(find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3) = -6 + 11x - 6x^2 + x^3 1.0 """
HumanEval_SingleLineInfillingLight
find_zero
python
python
[]
[ "import math" ]
Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n
begin *= 2.0 end *= 2.0 while end - begin > 1e-10: center = (begin + end) / 2.0 if poly(xs, center) * poly(xs, begin) > 0: begin = center else: end = center return begin
[]
SingleLineInfilling/HumanEval/32/L1
code_infilling
while poly(xs, begin) * poly(xs, end) > 0:
[ [ "x", "0." ], [ "find_zero([1, 2]), 2) # f(x", "1 + 2x" ], [ "find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3", "-6 + 11x - 6x^2 + x^3" ] ]
import math def poly(xs: list, x: float): """ Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n """ return sum([coeff * math.pow(x, i) for i, coeff in enumerate(xs)]) def find_zero(xs: list): """ xs are coefficients of a polynomial. find_zero find x such that poly(x) = 0. find_zero returns only only zero point, even if there are many. Moreover, find_zero only takes list xs having even number of coefficients and largest non zero coefficient as it guarantees a solution. >>> round(find_zero([1, 2]), 2) # f(x) = 1 + 2x -0.5 >>> round(find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3) = -6 + 11x - 6x^2 + x^3 1.0 """ begin, end = -1., 1.
HumanEval_SingleLineInfillingLight
find_zero
python
python
[]
[ "import math" ]
Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n
end *= 2.0 while end - begin > 1e-10: center = (begin + end) / 2.0 if poly(xs, center) * poly(xs, begin) > 0: begin = center else: end = center return begin
[]
SingleLineInfilling/HumanEval/32/L2
code_infilling
begin *= 2.0
[ [ "x", "0." ], [ "find_zero([1, 2]), 2) # f(x", "1 + 2x" ], [ "find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3", "-6 + 11x - 6x^2 + x^3" ] ]
import math def poly(xs: list, x: float): """ Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n """ return sum([coeff * math.pow(x, i) for i, coeff in enumerate(xs)]) def find_zero(xs: list): """ xs are coefficients of a polynomial. find_zero find x such that poly(x) = 0. find_zero returns only only zero point, even if there are many. Moreover, find_zero only takes list xs having even number of coefficients and largest non zero coefficient as it guarantees a solution. >>> round(find_zero([1, 2]), 2) # f(x) = 1 + 2x -0.5 >>> round(find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3) = -6 + 11x - 6x^2 + x^3 1.0 """ begin, end = -1., 1. while poly(xs, begin) * poly(xs, end) > 0:
HumanEval_SingleLineInfillingLight
find_zero
python
python
[]
[ "import math" ]
Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n
while end - begin > 1e-10: center = (begin + end) / 2.0 if poly(xs, center) * poly(xs, begin) > 0: begin = center else: end = center return begin
[]
SingleLineInfilling/HumanEval/32/L3
code_infilling
end *= 2.0
[ [ "x", "0." ], [ "find_zero([1, 2]), 2) # f(x", "1 + 2x" ], [ "find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3", "-6 + 11x - 6x^2 + x^3" ] ]
import math def poly(xs: list, x: float): """ Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n """ return sum([coeff * math.pow(x, i) for i, coeff in enumerate(xs)]) def find_zero(xs: list): """ xs are coefficients of a polynomial. find_zero find x such that poly(x) = 0. find_zero returns only only zero point, even if there are many. Moreover, find_zero only takes list xs having even number of coefficients and largest non zero coefficient as it guarantees a solution. >>> round(find_zero([1, 2]), 2) # f(x) = 1 + 2x -0.5 >>> round(find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3) = -6 + 11x - 6x^2 + x^3 1.0 """ begin, end = -1., 1. while poly(xs, begin) * poly(xs, end) > 0: begin *= 2.0
HumanEval_SingleLineInfillingLight
find_zero
python
python
[]
[ "import math" ]
Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n
center = (begin + end) / 2.0 if poly(xs, center) * poly(xs, begin) > 0: begin = center else: end = center return begin
[]
SingleLineInfilling/HumanEval/32/L4
code_infilling
while end - begin > 1e-10:
[ [ "x", "0." ], [ "find_zero([1, 2]), 2) # f(x", "1 + 2x" ], [ "find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3", "-6 + 11x - 6x^2 + x^3" ] ]
import math def poly(xs: list, x: float): """ Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n """ return sum([coeff * math.pow(x, i) for i, coeff in enumerate(xs)]) def find_zero(xs: list): """ xs are coefficients of a polynomial. find_zero find x such that poly(x) = 0. find_zero returns only only zero point, even if there are many. Moreover, find_zero only takes list xs having even number of coefficients and largest non zero coefficient as it guarantees a solution. >>> round(find_zero([1, 2]), 2) # f(x) = 1 + 2x -0.5 >>> round(find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3) = -6 + 11x - 6x^2 + x^3 1.0 """ begin, end = -1., 1. while poly(xs, begin) * poly(xs, end) > 0: begin *= 2.0 end *= 2.0
HumanEval_SingleLineInfillingLight
find_zero
python
python
[]
[ "import math" ]
Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n
if poly(xs, center) * poly(xs, begin) > 0: begin = center else: end = center return begin
[]
SingleLineInfilling/HumanEval/32/L5
code_infilling
center = (begin + end) / 2.0
[ [ "x", "0." ], [ "find_zero([1, 2]), 2) # f(x", "1 + 2x" ], [ "find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3", "-6 + 11x - 6x^2 + x^3" ] ]
import math def poly(xs: list, x: float): """ Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n """ return sum([coeff * math.pow(x, i) for i, coeff in enumerate(xs)]) def find_zero(xs: list): """ xs are coefficients of a polynomial. find_zero find x such that poly(x) = 0. find_zero returns only only zero point, even if there are many. Moreover, find_zero only takes list xs having even number of coefficients and largest non zero coefficient as it guarantees a solution. >>> round(find_zero([1, 2]), 2) # f(x) = 1 + 2x -0.5 >>> round(find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3) = -6 + 11x - 6x^2 + x^3 1.0 """ begin, end = -1., 1. while poly(xs, begin) * poly(xs, end) > 0: begin *= 2.0 end *= 2.0 while end - begin > 1e-10:
HumanEval_SingleLineInfillingLight
find_zero
python
python
[]
[ "import math" ]
Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n
begin = center else: end = center return begin
[]
SingleLineInfilling/HumanEval/32/L6
code_infilling
if poly(xs, center) * poly(xs, begin) > 0:
[ [ "x", "0." ], [ "find_zero([1, 2]), 2) # f(x", "1 + 2x" ], [ "find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3", "-6 + 11x - 6x^2 + x^3" ] ]
import math def poly(xs: list, x: float): """ Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n """ return sum([coeff * math.pow(x, i) for i, coeff in enumerate(xs)]) def find_zero(xs: list): """ xs are coefficients of a polynomial. find_zero find x such that poly(x) = 0. find_zero returns only only zero point, even if there are many. Moreover, find_zero only takes list xs having even number of coefficients and largest non zero coefficient as it guarantees a solution. >>> round(find_zero([1, 2]), 2) # f(x) = 1 + 2x -0.5 >>> round(find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3) = -6 + 11x - 6x^2 + x^3 1.0 """ begin, end = -1., 1. while poly(xs, begin) * poly(xs, end) > 0: begin *= 2.0 end *= 2.0 while end - begin > 1e-10: center = (begin + end) / 2.0
HumanEval_SingleLineInfillingLight
find_zero
python
python
[]
[ "import math" ]
Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n
else: end = center return begin
[]
SingleLineInfilling/HumanEval/32/L7
code_infilling
begin = center
[ [ "x", "0." ], [ "find_zero([1, 2]), 2) # f(x", "1 + 2x" ], [ "find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3", "-6 + 11x - 6x^2 + x^3" ] ]
import math def poly(xs: list, x: float): """ Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n """ return sum([coeff * math.pow(x, i) for i, coeff in enumerate(xs)]) def find_zero(xs: list): """ xs are coefficients of a polynomial. find_zero find x such that poly(x) = 0. find_zero returns only only zero point, even if there are many. Moreover, find_zero only takes list xs having even number of coefficients and largest non zero coefficient as it guarantees a solution. >>> round(find_zero([1, 2]), 2) # f(x) = 1 + 2x -0.5 >>> round(find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3) = -6 + 11x - 6x^2 + x^3 1.0 """ begin, end = -1., 1. while poly(xs, begin) * poly(xs, end) > 0: begin *= 2.0 end *= 2.0 while end - begin > 1e-10: center = (begin + end) / 2.0 if poly(xs, center) * poly(xs, begin) > 0:
HumanEval_SingleLineInfillingLight
find_zero
python
python
[]
[ "import math" ]
Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n
end = center return begin
[]
SingleLineInfilling/HumanEval/32/L8
code_infilling
else:
[ [ "x", "0." ], [ "find_zero([1, 2]), 2) # f(x", "1 + 2x" ], [ "find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3", "-6 + 11x - 6x^2 + x^3" ] ]
import math def poly(xs: list, x: float): """ Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n """ return sum([coeff * math.pow(x, i) for i, coeff in enumerate(xs)]) def find_zero(xs: list): """ xs are coefficients of a polynomial. find_zero find x such that poly(x) = 0. find_zero returns only only zero point, even if there are many. Moreover, find_zero only takes list xs having even number of coefficients and largest non zero coefficient as it guarantees a solution. >>> round(find_zero([1, 2]), 2) # f(x) = 1 + 2x -0.5 >>> round(find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3) = -6 + 11x - 6x^2 + x^3 1.0 """ begin, end = -1., 1. while poly(xs, begin) * poly(xs, end) > 0: begin *= 2.0 end *= 2.0 while end - begin > 1e-10: center = (begin + end) / 2.0 if poly(xs, center) * poly(xs, begin) > 0: begin = center
HumanEval_SingleLineInfillingLight
find_zero
python
python
[]
[ "import math" ]
Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n
return begin
[]
SingleLineInfilling/HumanEval/32/L9
code_infilling
end = center
[ [ "x", "0." ], [ "find_zero([1, 2]), 2) # f(x", "1 + 2x" ], [ "find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3", "-6 + 11x - 6x^2 + x^3" ] ]
import math def poly(xs: list, x: float): """ Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n """ return sum([coeff * math.pow(x, i) for i, coeff in enumerate(xs)]) def find_zero(xs: list): """ xs are coefficients of a polynomial. find_zero find x such that poly(x) = 0. find_zero returns only only zero point, even if there are many. Moreover, find_zero only takes list xs having even number of coefficients and largest non zero coefficient as it guarantees a solution. >>> round(find_zero([1, 2]), 2) # f(x) = 1 + 2x -0.5 >>> round(find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3) = -6 + 11x - 6x^2 + x^3 1.0 """ begin, end = -1., 1. while poly(xs, begin) * poly(xs, end) > 0: begin *= 2.0 end *= 2.0 while end - begin > 1e-10: center = (begin + end) / 2.0 if poly(xs, center) * poly(xs, begin) > 0: begin = center else:
HumanEval_SingleLineInfillingLight
find_zero
python
python
[]
[ "import math" ]
Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n
[]
SingleLineInfilling/HumanEval/32/L10
code_infilling
return begin
[ [ "x", "0." ], [ "find_zero([1, 2]), 2) # f(x", "1 + 2x" ], [ "find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3", "-6 + 11x - 6x^2 + x^3" ] ]
import math def poly(xs: list, x: float): """ Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n """ return sum([coeff * math.pow(x, i) for i, coeff in enumerate(xs)]) def find_zero(xs: list): """ xs are coefficients of a polynomial. find_zero find x such that poly(x) = 0. find_zero returns only only zero point, even if there are many. Moreover, find_zero only takes list xs having even number of coefficients and largest non zero coefficient as it guarantees a solution. >>> round(find_zero([1, 2]), 2) # f(x) = 1 + 2x -0.5 >>> round(find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3) = -6 + 11x - 6x^2 + x^3 1.0 """ begin, end = -1., 1. while poly(xs, begin) * poly(xs, end) > 0: begin *= 2.0 end *= 2.0 while end - begin > 1e-10: center = (begin + end) / 2.0 if poly(xs, center) * poly(xs, begin) > 0: begin = center else: end = center
HumanEval_SingleLineInfillingLight
find_zero
python
python
[]
[]
This function takes a list l and returns a list l' such that l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal to the values of the corresponding indicies of l, but sorted.
l[::3] = sorted(l[::3]) return l
[]
SingleLineInfilling/HumanEval/33/L0
code_infilling
l = list(l)
[ [ "[1, 2, 3]", "[1, 2, 3]" ], [ "[5, 6, 3, 4, 8, 9, 2]", "[2, 6, 3, 4, 8, 9, 5]" ] ]
def sort_third(l: list): """This function takes a list l and returns a list l' such that l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal to the values of the corresponding indicies of l, but sorted. """
HumanEval_SingleLineInfillingLight
sort_third
python
python
[]
[]
This function takes a list l and returns a list l' such that l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal to the values of the corresponding indicies of l, but sorted.
return l
[]
SingleLineInfilling/HumanEval/33/L1
code_infilling
l[::3] = sorted(l[::3])
[ [ "[1, 2, 3]", "[1, 2, 3]" ], [ "[5, 6, 3, 4, 8, 9, 2]", "[2, 6, 3, 4, 8, 9, 5]" ] ]
def sort_third(l: list): """This function takes a list l and returns a list l' such that l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal to the values of the corresponding indicies of l, but sorted. """ l = list(l)
HumanEval_SingleLineInfillingLight
sort_third
python
python
[]
[]
This function takes a list l and returns a list l' such that l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal to the values of the corresponding indicies of l, but sorted.
[]
SingleLineInfilling/HumanEval/33/L2
code_infilling
return l
[ [ "[1, 2, 3]", "[1, 2, 3]" ], [ "[5, 6, 3, 4, 8, 9, 2]", "[2, 6, 3, 4, 8, 9, 5]" ] ]
def sort_third(l: list): """This function takes a list l and returns a list l' such that l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal to the values of the corresponding indicies of l, but sorted. """ l = list(l) l[::3] = sorted(l[::3])
HumanEval_SingleLineInfillingLight
sort_third
python
python
[]
[]
Return sorted unique elements in a list
[]
SingleLineInfilling/HumanEval/34/L0
code_infilling
return sorted(list(set(l)))
[ [ "[5, 3, 5, 2, 3, 3, 9, 0, 123]", "[0, 2, 3, 5, 9, 123]" ] ]
def unique(l: list): """Return sorted unique elements in a list """
HumanEval_SingleLineInfillingLight
unique
python
python
[ [ "[5, 3, 5, 2, 3, 3, 9, 0, 123]", "[0, 2, 3, 5, 9, 123]" ] ]
[]
Return maximum element in the list.
for e in l: if e > m: m = e return m
[]
SingleLineInfilling/HumanEval/35/L0
code_infilling
m = l[0]
[ [ "[1, 2, 3]", "3" ], [ "[5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]", "123" ] ]
def max_element(l: list): """Return maximum element in the list. """
HumanEval_SingleLineInfillingLight
max_element
python
python
[ [ "[1, 2, 3]", "3" ], [ "[5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]", "124" ] ]
[]
Return maximum element in the list.
if e > m: m = e return m
[]
SingleLineInfilling/HumanEval/35/L1
code_infilling
for e in l:
[ [ "[1, 2, 3]", "3" ], [ "[5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]", "123" ] ]
def max_element(l: list): """Return maximum element in the list. """ m = l[0]
HumanEval_SingleLineInfillingLight
max_element
python
python
[ [ "[1, 2, 3]", "3" ], [ "[5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]", "124" ] ]
[]
Return maximum element in the list.
m = e return m
[]
SingleLineInfilling/HumanEval/35/L2
code_infilling
if e > m:
[ [ "[1, 2, 3]", "3" ], [ "[5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]", "123" ] ]
def max_element(l: list): """Return maximum element in the list. """ m = l[0] for e in l:
HumanEval_SingleLineInfillingLight
max_element
python
python
[ [ "[1, 2, 3]", "3" ], [ "[5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]", "124" ] ]
[]
Return maximum element in the list.
return m
[]
SingleLineInfilling/HumanEval/35/L3
code_infilling
m = e
[ [ "[1, 2, 3]", "3" ], [ "[5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]", "123" ] ]
def max_element(l: list): """Return maximum element in the list. """ m = l[0] for e in l: if e > m:
HumanEval_SingleLineInfillingLight
max_element
python
python
[ [ "[1, 2, 3]", "3" ], [ "[5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]", "124" ] ]
[]
Return maximum element in the list.
[]
SingleLineInfilling/HumanEval/35/L4
code_infilling
return m
[ [ "[1, 2, 3]", "3" ], [ "[5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]", "123" ] ]
def max_element(l: list): """Return maximum element in the list. """ m = l[0] for e in l: if e > m: m = e
HumanEval_SingleLineInfillingLight
max_element
python
python
[ [ "[1, 2, 3]", "3" ], [ "[5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10]", "124" ] ]
[]
Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.
for i in range(n): if i % 11 == 0 or i % 13 == 0: ns.append(i) s = ''.join(list(map(str, ns))) ans = 0 for c in s: ans += (c == '7') return ans
[]
SingleLineInfilling/HumanEval/36/L0
code_infilling
ns = []
[ [ "50", "0" ], [ "78", "2" ], [ "79", "3" ] ]
def fizz_buzz(n: int): """Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13. """
HumanEval_SingleLineInfillingLight
fizz_buzz
python
python
[ [ "50", "0" ], [ "78", "2" ], [ "79", "3" ], [ "100", "3" ], [ "200", "6" ], [ "4000", "192" ], [ "10000", "639" ], [ "100000", "8026" ] ]
[]
Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.
if i % 11 == 0 or i % 13 == 0: ns.append(i) s = ''.join(list(map(str, ns))) ans = 0 for c in s: ans += (c == '7') return ans
[]
SingleLineInfilling/HumanEval/36/L1
code_infilling
for i in range(n):
[ [ "50", "0" ], [ "78", "2" ], [ "79", "3" ] ]
def fizz_buzz(n: int): """Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13. """ ns = []
HumanEval_SingleLineInfillingLight
fizz_buzz
python
python
[ [ "50", "0" ], [ "78", "2" ], [ "79", "3" ], [ "100", "3" ], [ "200", "6" ], [ "4000", "192" ], [ "10000", "639" ], [ "100000", "8026" ] ]
[]
Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.
ns.append(i) s = ''.join(list(map(str, ns))) ans = 0 for c in s: ans += (c == '7') return ans
[]
SingleLineInfilling/HumanEval/36/L2
code_infilling
if i % 11 == 0 or i % 13 == 0:
[ [ "50", "0" ], [ "78", "2" ], [ "79", "3" ] ]
def fizz_buzz(n: int): """Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13. """ ns = [] for i in range(n):
HumanEval_SingleLineInfillingLight
fizz_buzz
python
python
[ [ "50", "0" ], [ "78", "2" ], [ "79", "3" ], [ "100", "3" ], [ "200", "6" ], [ "4000", "192" ], [ "10000", "639" ], [ "100000", "8026" ] ]
[]
Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.
s = ''.join(list(map(str, ns))) ans = 0 for c in s: ans += (c == '7') return ans
[]
SingleLineInfilling/HumanEval/36/L3
code_infilling
ns.append(i)
[ [ "50", "0" ], [ "78", "2" ], [ "79", "3" ] ]
def fizz_buzz(n: int): """Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13. """ ns = [] for i in range(n): if i % 11 == 0 or i % 13 == 0:
HumanEval_SingleLineInfillingLight
fizz_buzz
python
python
[ [ "50", "0" ], [ "78", "2" ], [ "79", "3" ], [ "100", "3" ], [ "200", "6" ], [ "4000", "192" ], [ "10000", "639" ], [ "100000", "8026" ] ]
[]
Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.
ans = 0 for c in s: ans += (c == '7') return ans
[]
SingleLineInfilling/HumanEval/36/L4
code_infilling
s = ''.join(list(map(str, ns)))
[ [ "50", "0" ], [ "78", "2" ], [ "79", "3" ] ]
def fizz_buzz(n: int): """Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13. """ ns = [] for i in range(n): if i % 11 == 0 or i % 13 == 0: ns.append(i)
HumanEval_SingleLineInfillingLight
fizz_buzz
python
python
[ [ "50", "0" ], [ "78", "2" ], [ "79", "3" ], [ "100", "3" ], [ "200", "6" ], [ "4000", "192" ], [ "10000", "639" ], [ "100000", "8026" ] ]
[]
Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.
for c in s: ans += (c == '7') return ans
[]
SingleLineInfilling/HumanEval/36/L5
code_infilling
ans = 0
[ [ "50", "0" ], [ "78", "2" ], [ "79", "3" ] ]
def fizz_buzz(n: int): """Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13. """ ns = [] for i in range(n): if i % 11 == 0 or i % 13 == 0: ns.append(i) s = ''.join(list(map(str, ns)))
HumanEval_SingleLineInfillingLight
fizz_buzz
python
python
[ [ "50", "0" ], [ "78", "2" ], [ "79", "3" ], [ "100", "3" ], [ "200", "6" ], [ "4000", "192" ], [ "10000", "639" ], [ "100000", "8026" ] ]
[]
Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.
ans += (c == '7') return ans
[]
SingleLineInfilling/HumanEval/36/L6
code_infilling
for c in s:
[ [ "50", "0" ], [ "78", "2" ], [ "79", "3" ] ]
def fizz_buzz(n: int): """Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13. """ ns = [] for i in range(n): if i % 11 == 0 or i % 13 == 0: ns.append(i) s = ''.join(list(map(str, ns))) ans = 0
HumanEval_SingleLineInfillingLight
fizz_buzz
python
python
[ [ "50", "0" ], [ "78", "2" ], [ "79", "3" ], [ "100", "3" ], [ "200", "6" ], [ "4000", "192" ], [ "10000", "639" ], [ "100000", "8026" ] ]
[]
Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.
return ans
[]
SingleLineInfilling/HumanEval/36/L7
code_infilling
ans += (c == '7')
[ [ "50", "0" ], [ "78", "2" ], [ "79", "3" ] ]
def fizz_buzz(n: int): """Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13. """ ns = [] for i in range(n): if i % 11 == 0 or i % 13 == 0: ns.append(i) s = ''.join(list(map(str, ns))) ans = 0 for c in s:
HumanEval_SingleLineInfillingLight
fizz_buzz
python
python
[ [ "50", "0" ], [ "78", "2" ], [ "79", "3" ], [ "100", "3" ], [ "200", "6" ], [ "4000", "192" ], [ "10000", "639" ], [ "100000", "8026" ] ]
[]
Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.
[]
SingleLineInfilling/HumanEval/36/L8
code_infilling
return ans
[ [ "50", "0" ], [ "78", "2" ], [ "79", "3" ] ]
def fizz_buzz(n: int): """Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13. """ ns = [] for i in range(n): if i % 11 == 0 or i % 13 == 0: ns.append(i) s = ''.join(list(map(str, ns))) ans = 0 for c in s: ans += (c == '7')
HumanEval_SingleLineInfillingLight
fizz_buzz
python
python
[ [ "50", "0" ], [ "78", "2" ], [ "79", "3" ], [ "100", "3" ], [ "200", "6" ], [ "4000", "192" ], [ "10000", "639" ], [ "100000", "8026" ] ]
[]
This function takes a list l and returns a list l' such that l' is identical to l in the odd indicies, while its values at the even indicies are equal to the values of the even indicies of l, but sorted.
odds = l[1::2] evens.sort() ans = [] for e, o in zip(evens, odds): ans.extend([e, o]) if len(evens) > len(odds): ans.append(evens[-1]) return ans
[]
SingleLineInfilling/HumanEval/37/L0
code_infilling
evens = l[::2]
[ [ "[1, 2, 3]", "[1, 2, 3]" ], [ "[5, 6, 3, 4]", "[3, 6, 5, 4]" ] ]
def sort_even(l: list): """This function takes a list l and returns a list l' such that l' is identical to l in the odd indicies, while its values at the even indicies are equal to the values of the even indicies of l, but sorted. """
HumanEval_SingleLineInfillingLight
sort_even
python
python
[]
[]
This function takes a list l and returns a list l' such that l' is identical to l in the odd indicies, while its values at the even indicies are equal to the values of the even indicies of l, but sorted.
evens.sort() ans = [] for e, o in zip(evens, odds): ans.extend([e, o]) if len(evens) > len(odds): ans.append(evens[-1]) return ans
[]
SingleLineInfilling/HumanEval/37/L1
code_infilling
odds = l[1::2]
[ [ "[1, 2, 3]", "[1, 2, 3]" ], [ "[5, 6, 3, 4]", "[3, 6, 5, 4]" ] ]
def sort_even(l: list): """This function takes a list l and returns a list l' such that l' is identical to l in the odd indicies, while its values at the even indicies are equal to the values of the even indicies of l, but sorted. """ evens = l[::2]
HumanEval_SingleLineInfillingLight
sort_even
python
python
[]
[]
This function takes a list l and returns a list l' such that l' is identical to l in the odd indicies, while its values at the even indicies are equal to the values of the even indicies of l, but sorted.
ans = [] for e, o in zip(evens, odds): ans.extend([e, o]) if len(evens) > len(odds): ans.append(evens[-1]) return ans
[]
SingleLineInfilling/HumanEval/37/L2
code_infilling
evens.sort()
[ [ "[1, 2, 3]", "[1, 2, 3]" ], [ "[5, 6, 3, 4]", "[3, 6, 5, 4]" ] ]
def sort_even(l: list): """This function takes a list l and returns a list l' such that l' is identical to l in the odd indicies, while its values at the even indicies are equal to the values of the even indicies of l, but sorted. """ evens = l[::2] odds = l[1::2]
HumanEval_SingleLineInfillingLight
sort_even
python
python
[]
[]
This function takes a list l and returns a list l' such that l' is identical to l in the odd indicies, while its values at the even indicies are equal to the values of the even indicies of l, but sorted.
for e, o in zip(evens, odds): ans.extend([e, o]) if len(evens) > len(odds): ans.append(evens[-1]) return ans
[]
SingleLineInfilling/HumanEval/37/L3
code_infilling
ans = []
[ [ "[1, 2, 3]", "[1, 2, 3]" ], [ "[5, 6, 3, 4]", "[3, 6, 5, 4]" ] ]
def sort_even(l: list): """This function takes a list l and returns a list l' such that l' is identical to l in the odd indicies, while its values at the even indicies are equal to the values of the even indicies of l, but sorted. """ evens = l[::2] odds = l[1::2] evens.sort()
HumanEval_SingleLineInfillingLight
sort_even
python
python
[]
[]
This function takes a list l and returns a list l' such that l' is identical to l in the odd indicies, while its values at the even indicies are equal to the values of the even indicies of l, but sorted.
ans.extend([e, o]) if len(evens) > len(odds): ans.append(evens[-1]) return ans
[]
SingleLineInfilling/HumanEval/37/L4
code_infilling
for e, o in zip(evens, odds):
[ [ "[1, 2, 3]", "[1, 2, 3]" ], [ "[5, 6, 3, 4]", "[3, 6, 5, 4]" ] ]
def sort_even(l: list): """This function takes a list l and returns a list l' such that l' is identical to l in the odd indicies, while its values at the even indicies are equal to the values of the even indicies of l, but sorted. """ evens = l[::2] odds = l[1::2] evens.sort() ans = []
HumanEval_SingleLineInfillingLight
sort_even
python
python
[]
[]
This function takes a list l and returns a list l' such that l' is identical to l in the odd indicies, while its values at the even indicies are equal to the values of the even indicies of l, but sorted.
if len(evens) > len(odds): ans.append(evens[-1]) return ans
[]
SingleLineInfilling/HumanEval/37/L5
code_infilling
ans.extend([e, o])
[ [ "[1, 2, 3]", "[1, 2, 3]" ], [ "[5, 6, 3, 4]", "[3, 6, 5, 4]" ] ]
def sort_even(l: list): """This function takes a list l and returns a list l' such that l' is identical to l in the odd indicies, while its values at the even indicies are equal to the values of the even indicies of l, but sorted. """ evens = l[::2] odds = l[1::2] evens.sort() ans = [] for e, o in zip(evens, odds):
HumanEval_SingleLineInfillingLight
sort_even
python
python
[]
[]
This function takes a list l and returns a list l' such that l' is identical to l in the odd indicies, while its values at the even indicies are equal to the values of the even indicies of l, but sorted.
ans.append(evens[-1]) return ans
[]
SingleLineInfilling/HumanEval/37/L6
code_infilling
if len(evens) > len(odds):
[ [ "[1, 2, 3]", "[1, 2, 3]" ], [ "[5, 6, 3, 4]", "[3, 6, 5, 4]" ] ]
def sort_even(l: list): """This function takes a list l and returns a list l' such that l' is identical to l in the odd indicies, while its values at the even indicies are equal to the values of the even indicies of l, but sorted. """ evens = l[::2] odds = l[1::2] evens.sort() ans = [] for e, o in zip(evens, odds): ans.extend([e, o])
HumanEval_SingleLineInfillingLight
sort_even
python
python
[]
[]
This function takes a list l and returns a list l' such that l' is identical to l in the odd indicies, while its values at the even indicies are equal to the values of the even indicies of l, but sorted.
return ans
[]
SingleLineInfilling/HumanEval/37/L7
code_infilling
ans.append(evens[-1])
[ [ "[1, 2, 3]", "[1, 2, 3]" ], [ "[5, 6, 3, 4]", "[3, 6, 5, 4]" ] ]
def sort_even(l: list): """This function takes a list l and returns a list l' such that l' is identical to l in the odd indicies, while its values at the even indicies are equal to the values of the even indicies of l, but sorted. """ evens = l[::2] odds = l[1::2] evens.sort() ans = [] for e, o in zip(evens, odds): ans.extend([e, o]) if len(evens) > len(odds):
HumanEval_SingleLineInfillingLight
sort_even
python
python
[]
[]
This function takes a list l and returns a list l' such that l' is identical to l in the odd indicies, while its values at the even indicies are equal to the values of the even indicies of l, but sorted.
[]
SingleLineInfilling/HumanEval/37/L8
code_infilling
return ans
[ [ "[1, 2, 3]", "[1, 2, 3]" ], [ "[5, 6, 3, 4]", "[3, 6, 5, 4]" ] ]
def sort_even(l: list): """This function takes a list l and returns a list l' such that l' is identical to l in the odd indicies, while its values at the even indicies are equal to the values of the even indicies of l, but sorted. """ evens = l[::2] odds = l[1::2] evens.sort() ans = [] for e, o in zip(evens, odds): ans.extend([e, o]) if len(evens) > len(odds): ans.append(evens[-1])
HumanEval_SingleLineInfillingLight
sort_even
python
python
[]
[]
returns encoded string by cycling groups of three characters.
[]
SingleLineInfilling/HumanEval/38/L0
code_infilling
return encode_cyclic(encode_cyclic(s))
[ [ "group", "3 else group for group in groups]" ] ]
def encode_cyclic(s: str): """ returns encoded string by cycling groups of three characters. """ # split string to groups. Each of length 3. groups = [s[(3 * i):min((3 * i + 3), len(s))] for i in range((len(s) + 2) // 3)] # cycle elements in each group. Unless group has fewer elements than 3. groups = [(group[1:] + group[0]) if len(group) == 3 else group for group in groups] return "".join(groups) def decode_cyclic(s: str): """ takes as input string encoded with encode_cyclic function. Returns decoded string. """
HumanEval_SingleLineInfillingLight
decode_cyclic
python
python
[ [ "'eaztdrcpoojjs'", "'zeartdocpjojs'" ], [ "'fcsasgmhiqc'", "'sfcgasimhqc'" ], [ "'avmirjdeqbylxuau'", "'mavjirqdelbyaxuu'" ], [ "'azhacmsfsnfsg'", "'hazmacssfsnfg'" ], [ "'zbvkvwoatdccvw'", "'vzbwkvtoacdcvw'" ], [ "'mqzfshjknuz'", "'zmqhfsnjkuz'" ], [ "'bgpjjqmghur'", "'pbgqjjhmgur'" ], [ "'skuuqfixmobqarshlnfv'", "'uskfuqmixqobsarnhlfv'" ], [ "'bwcoqbjzilceuidscgn'", "'cbwboqijzelcduigscn'" ], [ "'lpoyfvzavtysssduxn'", "'olpvyfvzastydssnux'" ], [ "'rguzukgsizsrmvrnt'", "'urgkzuigsrzsrmvnt'" ], [ "'orjrnmyozyhwc'", "'jormrnzyowyhc'" ], [ "'egkdzdeufufsupt'", "'kegddzfeusuftup'" ], [ "'kuqnvecsetyvdfero'", "'qkuenvecsvtyedfro'" ], [ "'rglvlgjtgesicfkcmkm'", "'lrggvlgjtieskcfkcmm'" ], [ "'jpdxznnaqylzmmh'", "'djpnxzqnazylhmm'" ], [ "'zwmgzcntpbawwlfbex'", "'mzwcgzpntwbafwlxbe'" ], [ "'unjdpwbxpxkpqdopaalb'", "'junwdppbxpxkoqdapalb'" ], [ "'zeukiguxndy'", "'uzegkinuxdy'" ], [ "'sjnaktdnbnokqjg'", "'nsjtakbdnknogqj'" ], [ "'vrmtirlygzhf'", "'mvrrtiglyfzh'" ], [ "'mhtgmpslldrhjl'", "'tmhpgmlslhdrjl'" ], [ "'mpvjpdatrmhtdx'", "'vmpdjprattmhdx'" ], [ "'jimzixallctnnsg'", "'mjixzilalnctgns'" ], [ "'gahjootuomivad'", "'hgaojootuvmiad'" ], [ "'ulilcmoplpsqqoyrppbh'", "'iulmlclopqpsyqoprpbh'" ], [ "'oznykgwonynglp'", "'nozgyknwogynlp'" ], [ "'fzvyarmdbmeogatu'", "'vfzryabmdometgau'" ], [ "'mfnngxdggewb'", "'nmfxnggdgbew'" ], [ "'qvacnekscjxe'", "'aqvecncksejx'" ], [ "'nmcapqndnkuh'", "'cnmqapnndhku'" ], [ "'nnennffezagabnfa'", "'ennfnnzfeaagfbna'" ], [ "'ifgknbekvs'", "'gifbknveks'" ], [ "'drtekkfffj'", "'tdrkekfffj'" ], [ "'tswtymazbcejja'", "'wtsmtybazjceja'" ], [ "'vlcyvzwvjbrc'", "'cvlzyvjwvcbr'" ], [ "'jvlybcuhdjhoixz'", "'ljvcybduhojhzix'" ], [ "'gtpwuynlrwoimpersbri'", "'pgtywurnliwoempbrsri'" ], [ "'gxkyyxeiltkdiuq'", "'kgxxyyleidtkqiu'" ], [ "'lsxrlnsbrxispzf'", "'xlsnrlrsbsxifpz'" ], [ "'hkwqbehapilpgesmj'", "'whkeqbphapilsgemj'" ], [ "'qgxkrqvsvsrwesnwot'", "'xqgqkrvvswsrnestwo'" ], [ "'tkjskkxoqalpnajqidr'", "'jtkkskqxopaljnadqir'" ], [ "'djekkirzcafg'", "'edjikkcrzgaf'" ], [ "'srfgcpgexwdbajohros'", "'fsrpgcxgebwdoajohrs'" ], [ "'sfckdzevjqezdxmcso'", "'csfzkdjevzqemdxocs'" ], [ "'aaikokcghtbyunigyq'", "'iaakkohcgytbiunqgy'" ], [ "'jaldcwbuxzqvlsff'", "'ljawdcxbuvzqflsf'" ], [ "'hyjfibztlplww'", "'jhybfilztwplw'" ], [ "'irsuppaksqoxgkyak'", "'sirpupsakxqoygkak'" ], [ "'rvhlirxndd'", "'hrvrlidxnd'" ], [ "'fwofairkckdyffng'", "'ofwifacrkykdnffg'" ], [ "'idmgovtowjfmf'", "'midvgowtomjff'" ], [ "'ovfdtilllkla'", "'fovidtlllakl'" ], [ "'kmmlbgisttsjhpgeo'", "'mkmglbtisjtsghpeo'" ], [ "'wvnqidnuhafydcdqqbzv'", "'nwvdqihnuyafddcbqqzv'" ], [ "'suhgzhdxuwp'", "'hsuhgzudxwp'" ], [ "'wovjwmvixtut'", "'vwomjwxvittu'" ], [ "'cghripgisjeihgsbkme'", "'hcgprisgiijeshgmbke'" ], [ "'vpnnwihekt'", "'nvpinwkhet'" ], [ "'oakdzvyxwcubs'", "'koavdzwyxbcus'" ], [ "'yiizrtxhhmazu'", "'iyitzrhxhzmau'" ], [ "'ykzsucdlyah'", "'zykcsuydlah'" ], [ "'wikxqjfoudburqasd'", "'kwijxqufoudbarqsd'" ], [ "'cssoeuoaspnhxaeipsc'", "'scsuoesoahpnexasipc'" ], [ "'yiztlakgbpfqpnvrwxl'", "'zyiatlbkgqpfvpnxrwl'" ], [ "'faljwqdqsyeghhccnrvz'", "'lfaqjwsdqgyechhrcnvz'" ], [ "'okdezkfuvnml'", "'dokkezvfulnm'" ], [ "'klkbfzkqofdmtcg'", "'kklzbfokqmfdgtc'" ], [ "'uqzurwhizdjvr'", "'zuqwurzhivdjr'" ], [ "'jrgrscrapvjpfqj'", "'gjrcrsprapvjjfq'" ], [ "'nwenxrwcrfaeb'", "'enwrnxrwcefab'" ], [ "'pldrrczxefqs'", "'dplcrrezxsfq'" ], [ "'ksvouegvkjyfecan'", "'vkseoukgvfjyaecn'" ], [ "'ijqaxfmbwjkevttzbxk'", "'qijfaxwmbejktvtxzbk'" ], [ "'irewkmbwkh'", "'eirmwkkbwh'" ], [ "'mhqhodamvtgiev'", "'qmhdhovamitgev'" ], [ "'ryjpgtgwucmyeulwhydh'", "'jrytpgugwycmleuywhdh'" ], [ "'ttkwvupppyakk'", "'kttuwvpppkyak'" ], [ "'dsgidvchdrln'", "'gdsviddchnrl'" ], [ "'nklhmphxejdcwx'", "'lnkphmehxcjdwx'" ], [ "'plwenneudaqxtwheh'", "'wplnendeuxaqhtweh'" ], [ "'pasolfzaalcs'", "'spafolazaslc'" ], [ "'mvohmjdjtvggijdbxbnh'", "'omvjhmtdjgvgdijbbxnh'" ], [ "'olbcwcvbnhh'", "'bolccwnvbhh'" ], [ "'nttkuqayrlcuxioymcl'", "'tntqkurayulcoxicyml'" ], [ "'jxhrreunodmezni'", "'hjxerrounedmizn'" ], [ "'wsrxjpqyzkxhbxc'", "'rwspxjzqyhkxcbx'" ], [ "'kxkqlaosighdfirrgd'", "'kkxaqliosdghrfidrg'" ], [ "'jwlphbvzsosmfdq'", "'ljwbphsvzmosqfd'" ], [ "'osdfiyiitm'", "'dosyfitiim'" ], [ "'yndqfrdeuthbcwhhvizq'", "'dynrqfudebthhcwihvzq'" ], [ "'cmqnxmwxnrv'", "'qcmmnxnwxrv'" ], [ "'qvfdfgsgqkwa'", "'fqvgdfqsgakw'" ], [ "'zzuimcybadfunvwd'", "'uzzcimaybudfwnvd'" ], [ "'bsrzyntvnvsppnz'", "'rbsnzyntvpvszpn'" ], [ "'mjrvpbrpqemkws'", "'rmjbvpqrpkemws'" ], [ "'ekwvxxlganvrot'", "'wekxvxalgrnvot'" ], [ "'onlzsrfkdqfuvl'", "'lonrzsdfkuqfvl'" ], [ "'rcwvivhovywyfnqsefv'", "'wrcvvivhoyywqfnfsev'" ] ]
[]
prime_fib returns n-th number that is a Fibonacci number and it's also prime.
def is_prime(p): if p < 2: return False for k in range(2, min(int(math.sqrt(p)) + 1, p - 1)): if p % k == 0: return False return True f = [0, 1] while True: f.append(f[-1] + f[-2]) if is_prime(f[-1]): n -= 1 if n == 0: return f[-1]
[]
SingleLineInfilling/HumanEval/39/L0
code_infilling
import math
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ] ]
def prime_fib(n: int): """ prime_fib returns n-th number that is a Fibonacci number and it's also prime. """
HumanEval_SingleLineInfillingLight
prime_fib
python
python
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ], [ "6", "233" ], [ "7", "1597" ], [ "8", "28657" ], [ "9", "514229" ], [ "10", "433494437" ] ]
[]
prime_fib returns n-th number that is a Fibonacci number and it's also prime.
if p < 2: return False for k in range(2, min(int(math.sqrt(p)) + 1, p - 1)): if p % k == 0: return False return True f = [0, 1] while True: f.append(f[-1] + f[-2]) if is_prime(f[-1]): n -= 1 if n == 0: return f[-1]
[]
SingleLineInfilling/HumanEval/39/L2
code_infilling
def is_prime(p):
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ] ]
def prime_fib(n: int): """ prime_fib returns n-th number that is a Fibonacci number and it's also prime. """ import math
HumanEval_SingleLineInfillingLight
prime_fib
python
python
[ [ "1", "2" ], [ "2", "3" ], [ "3", "5" ], [ "4", "13" ], [ "5", "89" ], [ "6", "233" ], [ "7", "1597" ], [ "8", "28657" ], [ "9", "514229" ], [ "10", "433494437" ] ]