prefix
stringlengths 65
1.8k
| suffix
stringclasses 839
values | solution
stringlengths 6
859
| test_cases
listlengths 0
100
| import_str
listlengths 0
1
| demos
listlengths 0
8
| entry_func
stringclasses 158
values | data_id
stringlengths 36
40
| doc_string
stringclasses 164
values | dataset_name
stringclasses 1
value | task_name
stringclasses 1
value | compare_func
listlengths 0
0
| src_lang
stringclasses 1
value | tgt_lang
stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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,
|
return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
|
'six': 6,
'seven': 7,
'eight': 8,
'nine': 9
}
|
[
[
"''",
"''"
],
[
"'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"
] |
[
[
"'three one five'",
"'one three five'"
]
] |
sort_numbers
|
MultiLineInfilling/HumanEval/19/L7_L11
|
Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
}
return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
|
[
[
"''",
"''"
],
[
"'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"
] |
[
[
"'three one five'",
"'one three five'"
]
] |
sort_numbers
|
MultiLineInfilling/HumanEval/19/L7_L12
|
Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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,
|
'eight': 8,
'nine': 9
}
return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
|
'seven': 7,
|
[
[
"''",
"''"
],
[
"'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"
] |
[
[
"'three one five'",
"'one three five'"
]
] |
sort_numbers
|
MultiLineInfilling/HumanEval/19/L8_L8
|
Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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,
|
'nine': 9
}
return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
|
'seven': 7,
'eight': 8,
|
[
[
"''",
"''"
],
[
"'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"
] |
[
[
"'three one five'",
"'one three five'"
]
] |
sort_numbers
|
MultiLineInfilling/HumanEval/19/L8_L9
|
Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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,
|
}
return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
|
'seven': 7,
'eight': 8,
'nine': 9
|
[
[
"''",
"''"
],
[
"'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"
] |
[
[
"'three one five'",
"'one three five'"
]
] |
sort_numbers
|
MultiLineInfilling/HumanEval/19/L8_L10
|
Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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,
|
return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
|
'seven': 7,
'eight': 8,
'nine': 9
}
|
[
[
"''",
"''"
],
[
"'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"
] |
[
[
"'three one five'",
"'one three five'"
]
] |
sort_numbers
|
MultiLineInfilling/HumanEval/19/L8_L11
|
Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
}
return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
|
[
[
"''",
"''"
],
[
"'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"
] |
[
[
"'three one five'",
"'one three five'"
]
] |
sort_numbers
|
MultiLineInfilling/HumanEval/19/L8_L12
|
Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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,
|
'nine': 9
}
return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
|
'eight': 8,
|
[
[
"''",
"''"
],
[
"'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"
] |
[
[
"'three one five'",
"'one three five'"
]
] |
sort_numbers
|
MultiLineInfilling/HumanEval/19/L9_L9
|
Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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,
|
}
return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
|
'eight': 8,
'nine': 9
|
[
[
"''",
"''"
],
[
"'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"
] |
[
[
"'three one five'",
"'one three five'"
]
] |
sort_numbers
|
MultiLineInfilling/HumanEval/19/L9_L10
|
Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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,
|
return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
|
'eight': 8,
'nine': 9
}
|
[
[
"''",
"''"
],
[
"'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"
] |
[
[
"'three one five'",
"'one three five'"
]
] |
sort_numbers
|
MultiLineInfilling/HumanEval/19/L9_L11
|
Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
}
return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
|
[
[
"''",
"''"
],
[
"'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"
] |
[
[
"'three one five'",
"'one three five'"
]
] |
sort_numbers
|
MultiLineInfilling/HumanEval/19/L9_L12
|
Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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,
|
}
return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
|
'nine': 9
|
[
[
"''",
"''"
],
[
"'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"
] |
[
[
"'three one five'",
"'one three five'"
]
] |
sort_numbers
|
MultiLineInfilling/HumanEval/19/L10_L10
|
Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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,
|
return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
|
'nine': 9
}
|
[
[
"''",
"''"
],
[
"'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"
] |
[
[
"'three one five'",
"'one three five'"
]
] |
sort_numbers
|
MultiLineInfilling/HumanEval/19/L10_L11
|
Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
}
return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
|
[
[
"''",
"''"
],
[
"'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"
] |
[
[
"'three one five'",
"'one three five'"
]
] |
sort_numbers
|
MultiLineInfilling/HumanEval/19/L10_L12
|
Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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
|
return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
|
}
|
[
[
"''",
"''"
],
[
"'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"
] |
[
[
"'three one five'",
"'one three five'"
]
] |
sort_numbers
|
MultiLineInfilling/HumanEval/19/L11_L11
|
Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
}
return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
|
[
[
"''",
"''"
],
[
"'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"
] |
[
[
"'three one five'",
"'one three five'"
]
] |
sort_numbers
|
MultiLineInfilling/HumanEval/19/L11_L12
|
Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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
}
|
return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
|
[
[
"''",
"''"
],
[
"'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"
] |
[
[
"'three one five'",
"'one three five'"
]
] |
sort_numbers
|
MultiLineInfilling/HumanEval/19/L12_L12
|
Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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).
"""
|
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
|
closest_pair = None
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L0_L0
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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).
"""
|
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
|
closest_pair = None
distance = None
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L0_L1
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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).
"""
|
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
|
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L0_L3
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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).
"""
|
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
|
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L0_L4
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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).
"""
|
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
|
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L0_L5
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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).
"""
|
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
|
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L0_L6
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = 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
|
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)
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L0_L7
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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).
"""
|
else:
new_distance = abs(elem - elem2)
if new_distance < distance:
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
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]))
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L0_L8
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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).
"""
|
new_distance = abs(elem - elem2)
if new_distance < distance:
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
distance = abs(elem - elem2)
closest_pair = tuple(sorted([elem, elem2]))
else:
|
[
[
"[1.0, 2.0, 3.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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L0_L9
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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).
"""
|
if new_distance < distance:
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
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)
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L0_L10
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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).
"""
|
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
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:
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L0_L11
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = tuple(sorted([elem, elem2]))
return closest_pair
|
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
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L0_L12
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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).
"""
|
return closest_pair
|
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]))
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L0_L13
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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]))
return closest_pair
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L0_L15
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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
|
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
|
distance = None
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L1_L1
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
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
|
distance = None
for idx, elem in enumerate(numbers):
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L1_L3
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
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
|
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L1_L4
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
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
|
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L1_L5
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = 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
|
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L1_L6
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
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
|
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)
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L1_L7
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
else:
new_distance = abs(elem - elem2)
if new_distance < distance:
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
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]))
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L1_L8
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
new_distance = abs(elem - elem2)
if new_distance < distance:
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
distance = abs(elem - elem2)
closest_pair = tuple(sorted([elem, elem2]))
else:
|
[
[
"[1.0, 2.0, 3.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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L1_L9
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
if new_distance < distance:
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
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)
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L1_L10
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
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:
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L1_L11
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
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
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L1_L12
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
return closest_pair
|
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]))
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L1_L13
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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]))
return closest_pair
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L1_L15
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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 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
|
for idx, elem in enumerate(numbers):
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L3_L3
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
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
|
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L3_L4
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
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
|
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L3_L5
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
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
|
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L3_L6
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
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
|
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
distance = abs(elem - elem2)
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L3_L7
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
else:
new_distance = abs(elem - elem2)
if new_distance < distance:
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
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]))
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L3_L8
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
new_distance = abs(elem - elem2)
if new_distance < distance:
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
distance = abs(elem - elem2)
closest_pair = tuple(sorted([elem, elem2]))
else:
|
[
[
"[1.0, 2.0, 3.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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L3_L9
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
if new_distance < distance:
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
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)
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L3_L10
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
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:
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L3_L11
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
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
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L3_L12
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
return closest_pair
|
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]))
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L3_L13
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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]))
return closest_pair
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L3_L15
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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):
|
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
|
for idx2, elem2 in enumerate(numbers):
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L4_L4
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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):
|
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
|
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L4_L5
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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):
|
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
|
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L4_L6
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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):
|
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
|
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
distance = abs(elem - elem2)
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L4_L7
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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):
|
else:
new_distance = abs(elem - elem2)
if new_distance < distance:
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
distance = abs(elem - elem2)
closest_pair = tuple(sorted([elem, elem2]))
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L4_L8
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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):
|
new_distance = abs(elem - elem2)
if new_distance < distance:
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
distance = abs(elem - elem2)
closest_pair = tuple(sorted([elem, elem2]))
else:
|
[
[
"[1.0, 2.0, 3.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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L4_L9
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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):
|
if new_distance < distance:
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
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)
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L4_L10
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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):
|
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
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:
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L4_L11
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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):
|
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
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
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L4_L12
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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):
|
return closest_pair
|
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]))
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L4_L13
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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]))
return closest_pair
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L4_L15
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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 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
|
if idx != idx2:
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L5_L5
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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):
|
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
|
if idx != idx2:
if distance is None:
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L5_L6
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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):
|
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
|
if idx != idx2:
if distance is None:
distance = abs(elem - elem2)
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L5_L7
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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):
|
else:
new_distance = abs(elem - elem2)
if new_distance < distance:
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
if idx != idx2:
if distance is None:
distance = abs(elem - elem2)
closest_pair = tuple(sorted([elem, elem2]))
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L5_L8
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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):
|
new_distance = abs(elem - elem2)
if new_distance < distance:
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
if idx != idx2:
if distance is None:
distance = abs(elem - elem2)
closest_pair = tuple(sorted([elem, elem2]))
else:
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L5_L9
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 new_distance < distance:
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
if idx != idx2:
if distance is None:
distance = abs(elem - elem2)
closest_pair = tuple(sorted([elem, elem2]))
else:
new_distance = abs(elem - elem2)
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L5_L10
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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):
|
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
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:
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L5_L11
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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):
|
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
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
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L5_L12
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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):
|
return closest_pair
|
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]))
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L5_L13
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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]))
return closest_pair
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L5_L15
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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:
|
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
|
if distance is None:
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L6_L6
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
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
|
if distance is None:
distance = abs(elem - elem2)
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L6_L7
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
else:
new_distance = abs(elem - elem2)
if new_distance < distance:
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
if distance is None:
distance = abs(elem - elem2)
closest_pair = tuple(sorted([elem, elem2]))
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L6_L8
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
new_distance = abs(elem - elem2)
if new_distance < distance:
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
if distance is None:
distance = abs(elem - elem2)
closest_pair = tuple(sorted([elem, elem2]))
else:
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L6_L9
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 new_distance < distance:
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
if distance is None:
distance = abs(elem - elem2)
closest_pair = tuple(sorted([elem, elem2]))
else:
new_distance = abs(elem - elem2)
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L6_L10
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
if distance is None:
distance = abs(elem - elem2)
closest_pair = tuple(sorted([elem, elem2]))
else:
new_distance = abs(elem - elem2)
if new_distance < distance:
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L6_L11
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
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
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L6_L12
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
return closest_pair
|
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]))
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L6_L13
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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]))
return closest_pair
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L6_L15
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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:
|
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
|
distance = abs(elem - elem2)
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L7_L7
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
else:
new_distance = abs(elem - elem2)
if new_distance < distance:
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
distance = abs(elem - elem2)
closest_pair = tuple(sorted([elem, elem2]))
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L7_L8
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
new_distance = abs(elem - elem2)
if new_distance < distance:
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
distance = abs(elem - elem2)
closest_pair = tuple(sorted([elem, elem2]))
else:
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L7_L9
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
if new_distance < distance:
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
distance = abs(elem - elem2)
closest_pair = tuple(sorted([elem, elem2]))
else:
new_distance = abs(elem - elem2)
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L7_L10
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
distance = abs(elem - elem2)
closest_pair = tuple(sorted([elem, elem2]))
else:
new_distance = abs(elem - elem2)
if new_distance < distance:
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L7_L11
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
distance = abs(elem - elem2)
closest_pair = tuple(sorted([elem, elem2]))
else:
new_distance = abs(elem - elem2)
if new_distance < distance:
distance = new_distance
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L7_L12
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
return closest_pair
|
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]))
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L7_L13
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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]))
return closest_pair
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L7_L15
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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)
|
else:
new_distance = abs(elem - elem2)
if new_distance < distance:
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
closest_pair = tuple(sorted([elem, elem2]))
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L8_L8
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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)
|
new_distance = abs(elem - elem2)
if new_distance < distance:
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
closest_pair = tuple(sorted([elem, elem2]))
else:
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L8_L9
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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)
|
if new_distance < distance:
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
closest_pair = tuple(sorted([elem, elem2]))
else:
new_distance = abs(elem - elem2)
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L8_L10
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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)
|
distance = new_distance
closest_pair = tuple(sorted([elem, elem2]))
return closest_pair
|
closest_pair = tuple(sorted([elem, elem2]))
else:
new_distance = abs(elem - elem2)
if new_distance < distance:
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L8_L11
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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]))
return closest_pair
|
closest_pair = tuple(sorted([elem, elem2]))
else:
new_distance = abs(elem - elem2)
if new_distance < distance:
distance = new_distance
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L8_L12
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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)
|
return closest_pair
|
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]))
|
[
[
"[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"
] |
[
[
"[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)"
]
] |
find_closest_elements
|
MultiLineInfilling/HumanEval/20/L8_L13
|
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_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.