Dataset Viewer
Auto-converted to Parquet
test_cases
sequencelengths
0
100
import_str
sequencelengths
0
1
solution
stringlengths
0
620
suffix
stringlengths
0
655
tgt_lang
stringclasses
1 value
doc_string
stringclasses
164 values
compare_func
sequencelengths
0
0
prefix
stringlengths
65
1.63k
demos
sequencelengths
0
8
data_id
stringlengths
33
36
src_lang
stringclasses
1 value
task_name
stringclasses
1 value
dataset_name
stringclasses
1 value
entry_func
stringclasses
158 values
[ [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3", "True" ], [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05", "False" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0], 0.95", "True" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0], 0.8", "False" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1", "True" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1], 1.0", "True" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1], 0.5", "False" ] ]
[ "from typing import List" ]
idx != idx2: distance = abs(elem - elem2) if
distance < threshold: return True return False
python
Check if in given list of numbers, are any two numbers closer to each other than given threshold.
[]
from typing import List def has_close_elements(numbers: List[float], threshold: float) -> bool: """ Check if in given list of numbers, are any two numbers closer to each other than given threshold. """ for idx, elem in enumerate(numbers): for idx2, elem2 in enumerate(numbers): if
[ [ "[1.0, 2.0, 3.0], 0.5", "False" ], [ "[1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3", "True" ] ]
RandomSpanInfilling/HumanEval/0/1
python
code_infilling
HumanEval_RandomSpanInfilling
has_close_elements
[ [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3", "True" ], [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05", "False" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0], 0.95", "True" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0], 0.8", "False" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1", "True" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1], 1.0", "True" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1], 0.5", "False" ] ]
[ "from typing import List" ]
lem in enumerate(numbers): for idx2, elem2 in enumerate(numbers):
if idx != idx2: distance = abs(elem - elem2) if distance < threshold: return True return False
python
Check if in given list of numbers, are any two numbers closer to each other than given threshold.
[]
from typing import List def has_close_elements(numbers: List[float], threshold: float) -> bool: """ Check if in given list of numbers, are any two numbers closer to each other than given threshold. """ for idx, e
[ [ "[1.0, 2.0, 3.0], 0.5", "False" ], [ "[1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3", "True" ] ]
RandomSpanInfilling/HumanEval/0/2
python
code_infilling
HumanEval_RandomSpanInfilling
has_close_elements
[ [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3", "True" ], [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05", "False" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0], 0.95", "True" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0], 0.8", "False" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1", "True" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1], 1.0", "True" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1], 0.5", "False" ] ]
[ "from typing import List" ]
merate(numbers): if idx
!= idx2: distance = abs(elem - elem2) if distance < threshold: return True return False
python
Check if in given list of numbers, are any two numbers closer to each other than given threshold.
[]
from typing import List def has_close_elements(numbers: List[float], threshold: float) -> bool: """ Check if in given list of numbers, are any two numbers closer to each other than given threshold. """ for idx, elem in enumerate(numbers): for idx2, elem2 in enu
[ [ "[1.0, 2.0, 3.0], 0.5", "False" ], [ "[1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3", "True" ] ]
RandomSpanInfilling/HumanEval/0/3
python
code_infilling
HumanEval_RandomSpanInfilling
has_close_elements
[ [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3", "True" ], [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05", "False" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0], 0.95", "True" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0], 0.8", "False" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1", "True" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1], 1.0", "True" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1], 0.5", "False" ] ]
[ "from typing import List" ]
enumerate(numbers): for idx2, elem2 in enumerate(numbers): if idx != idx2: distance = abs(elem - elem2) if distance
< threshold: return True return False
python
Check if in given list of numbers, are any two numbers closer to each other than given threshold.
[]
from typing import List def has_close_elements(numbers: List[float], threshold: float) -> bool: """ Check if in given list of numbers, are any two numbers closer to each other than given threshold. """ for idx, elem in
[ [ "[1.0, 2.0, 3.0], 0.5", "False" ], [ "[1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3", "True" ] ]
RandomSpanInfilling/HumanEval/0/4
python
code_infilling
HumanEval_RandomSpanInfilling
has_close_elements
[ [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3", "True" ], [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05", "False" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0], 0.95", "True" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0], 0.8", "False" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1", "True" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1], 1.0", "True" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1], 0.5", "False" ] ]
[ "from typing import List" ]
idx != idx2:
distance = abs(elem - elem2) if distance < threshold: return True return False
python
Check if in given list of numbers, are any two numbers closer to each other than given threshold.
[]
from typing import List def has_close_elements(numbers: List[float], threshold: float) -> bool: """ Check if in given list of numbers, are any two numbers closer to each other than given threshold. """ for idx, elem in enumerate(numbers): for idx2, elem2 in enumerate(numbers): if
[ [ "[1.0, 2.0, 3.0], 0.5", "False" ], [ "[1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3", "True" ] ]
RandomSpanInfilling/HumanEval/0/5
python
code_infilling
HumanEval_RandomSpanInfilling
has_close_elements
[ [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3", "True" ], [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05", "False" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0], 0.95", "True" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0], 0.8", "False" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1", "True" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1], 1.0", "True" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1], 0.5", "False" ] ]
[ "from typing import List" ]
return True return False
python
Check if in given list of numbers, are any two numbers closer to each other than given threshold.
[]
from typing import List def has_close_elements(numbers: List[float], threshold: float) -> bool: """ Check if in given list of numbers, are any two numbers closer to each other than given threshold. """ for idx, elem in enumerate(numbers): for idx2, elem2 in enumerate(numbers): if idx != idx2: distance = abs(elem - elem2) if distance < threshold:
[ [ "[1.0, 2.0, 3.0], 0.5", "False" ], [ "[1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3", "True" ] ]
RandomSpanInfilling/HumanEval/0/6
python
code_infilling
HumanEval_RandomSpanInfilling
has_close_elements
[ [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3", "True" ], [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05", "False" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0], 0.95", "True" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0], 0.8", "False" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1", "True" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1], 1.0", "True" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1], 0.5", "False" ] ]
[ "from typing import List" ]
ate(numbers): if idx != idx2: distance = abs(elem - elem2) if distance < threshold:
return True return False
python
Check if in given list of numbers, are any two numbers closer to each other than given threshold.
[]
from typing import List def has_close_elements(numbers: List[float], threshold: float) -> bool: """ Check if in given list of numbers, are any two numbers closer to each other than given threshold. """ for idx, elem in enumerate(numbers): for idx2, elem2 in enumer
[ [ "[1.0, 2.0, 3.0], 0.5", "False" ], [ "[1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3", "True" ] ]
RandomSpanInfilling/HumanEval/0/7
python
code_infilling
HumanEval_RandomSpanInfilling
has_close_elements
[ [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3", "True" ], [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05", "False" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0], 0.95", "True" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0], 0.8", "False" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1", "True" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1], 1.0", "True" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1], 0.5", "False" ] ]
[ "from typing import List" ]
if idx != idx2:
distance = abs(elem - elem2) if distance < threshold: return True return False
python
Check if in given list of numbers, are any two numbers closer to each other than given threshold.
[]
from typing import List def has_close_elements(numbers: List[float], threshold: float) -> bool: """ Check if in given list of numbers, are any two numbers closer to each other than given threshold. """ for idx, elem in enumerate(numbers): for idx2, elem2 in enumerate(numbers):
[ [ "[1.0, 2.0, 3.0], 0.5", "False" ], [ "[1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3", "True" ] ]
RandomSpanInfilling/HumanEval/0/8
python
code_infilling
HumanEval_RandomSpanInfilling
has_close_elements
[ [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3", "True" ], [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05", "False" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0], 0.95", "True" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0], 0.8", "False" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1", "True" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1], 1.0", "True" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1], 0.5", "False" ] ]
[ "from typing import List" ]
if
idx != idx2: distance = abs(elem - elem2) if distance < threshold: return True return False
python
Check if in given list of numbers, are any two numbers closer to each other than given threshold.
[]
from typing import List def has_close_elements(numbers: List[float], threshold: float) -> bool: """ Check if in given list of numbers, are any two numbers closer to each other than given threshold. """ for idx, elem in enumerate(numbers): for idx2, elem2 in enumerate(numbers):
[ [ "[1.0, 2.0, 3.0], 0.5", "False" ], [ "[1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3", "True" ] ]
RandomSpanInfilling/HumanEval/0/9
python
code_infilling
HumanEval_RandomSpanInfilling
has_close_elements
[ [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3", "True" ], [ "[1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05", "False" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0], 0.95", "True" ], [ "[1.0, 2.0, 5.9, 4.0, 5.0], 0.8", "False" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1", "True" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1], 1.0", "True" ], [ "[1.1, 2.2, 3.1, 4.1, 5.1], 0.5", "False" ] ]
[ "from typing import List" ]
distance = abs(elem
- elem2) if distance < threshold: return True return False
python
Check if in given list of numbers, are any two numbers closer to each other than given threshold.
[]
from typing import List def has_close_elements(numbers: List[float], threshold: float) -> bool: """ Check if in given list of numbers, are any two numbers closer to each other than given threshold. """ for idx, elem in enumerate(numbers): for idx2, elem2 in enumerate(numbers): if idx != idx2:
[ [ "[1.0, 2.0, 3.0], 0.5", "False" ], [ "[1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3", "True" ] ]
RandomSpanInfilling/HumanEval/0/10
python
code_infilling
HumanEval_RandomSpanInfilling
has_close_elements
[ [ "'(()()) ((())) () ((())()())'", "[\n '(()())', '((()))', '()', '((())()())'\n ]" ], [ "'() (()) ((())) (((())))'", "[\n '()', '(())', '((()))', '(((())))'\n ]" ], [ "'(()(())((())))'", "[\n '(()(())((())))'\n ]" ], [ "'( ) (( )) (( )( ))'", "['()', '(())', '(()())']" ] ]
[ "from typing import List" ]
current_string.append(c) elif c == ')': current_depth -= 1 current_string.append(c) if current_depth == 0:
result.append(''.join(current_string)) current_string.clear() return result
python
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace is properly closed) and not nested within each other Ignore any spaces in the input string.
[]
from typing import List def separate_paren_groups(paren_string: str) -> List[str]: """ Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace is properly closed) and not nested within each other Ignore any spaces in the input string. """ result = [] current_string = [] current_depth = 0 for c in paren_string: if c == '(': current_depth += 1
[ [ "'( ) (( )) (( )( ))'", "['()', '(())', '(()())']" ] ]
RandomSpanInfilling/HumanEval/1/1
python
code_infilling
HumanEval_RandomSpanInfilling
separate_paren_groups
[ [ "'(()()) ((())) () ((())()())'", "[\n '(()())', '((()))', '()', '((())()())'\n ]" ], [ "'() (()) ((())) (((())))'", "[\n '()', '(())', '((()))', '(((())))'\n ]" ], [ "'(()(())((())))'", "[\n '(()(())((())))'\n ]" ], [ "'( ) (( )) (( )( ))'", "['()', '(())', '(()())']" ] ]
[ "from typing import List" ]
ng.append(c) if current_depth == 0: result.append(''.join
(current_string)) current_string.clear() return result
python
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace is properly closed) and not nested within each other Ignore any spaces in the input string.
[]
from typing import List def separate_paren_groups(paren_string: str) -> List[str]: """ Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace is properly closed) and not nested within each other Ignore any spaces in the input string. """ result = [] current_string = [] current_depth = 0 for c in paren_string: if c == '(': current_depth += 1 current_string.append(c) elif c == ')': current_depth -= 1 current_stri
[ [ "'( ) (( )) (( )( ))'", "['()', '(())', '(()())']" ] ]
RandomSpanInfilling/HumanEval/1/2
python
code_infilling
HumanEval_RandomSpanInfilling
separate_paren_groups
[ [ "'(()()) ((())) () ((())()())'", "[\n '(()())', '((()))', '()', '((())()())'\n ]" ], [ "'() (()) ((())) (((())))'", "[\n '()', '(())', '((()))', '(((())))'\n ]" ], [ "'(()(())((())))'", "[\n '(()(())((())))'\n ]" ], [ "'( ) (( )) (( )( ))'", "['()', '(())', '(()())']" ] ]
[ "from typing import List" ]
_depth == 0: result.append(''.join(current_string)) current_string.clear() return r
esult
python
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace is properly closed) and not nested within each other Ignore any spaces in the input string.
[]
from typing import List def separate_paren_groups(paren_string: str) -> List[str]: """ Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace is properly closed) and not nested within each other Ignore any spaces in the input string. """ result = [] current_string = [] current_depth = 0 for c in paren_string: if c == '(': current_depth += 1 current_string.append(c) elif c == ')': current_depth -= 1 current_string.append(c) if current
[ [ "'( ) (( )) (( )( ))'", "['()', '(())', '(()())']" ] ]
RandomSpanInfilling/HumanEval/1/3
python
code_infilling
HumanEval_RandomSpanInfilling
separate_paren_groups
[ [ "'(()()) ((())) () ((())()())'", "[\n '(()())', '((()))', '()', '((())()())'\n ]" ], [ "'() (()) ((())) (((())))'", "[\n '()', '(())', '((()))', '(((())))'\n ]" ], [ "'(()(())((())))'", "[\n '(()(())((())))'\n ]" ], [ "'( ) (( )) (( )( ))'", "['()', '(())', '(()())']" ] ]
[ "from typing import List" ]
c == ')': current_depth -= 1 current_string.append(c) if current_depth == 0: result.append(''.join(current_string)) current_
string.clear() return result
python
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace is properly closed) and not nested within each other Ignore any spaces in the input string.
[]
from typing import List def separate_paren_groups(paren_string: str) -> List[str]: """ Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace is properly closed) and not nested within each other Ignore any spaces in the input string. """ result = [] current_string = [] current_depth = 0 for c in paren_string: if c == '(': current_depth += 1 current_string.append(c) elif
[ [ "'( ) (( )) (( )( ))'", "['()', '(())', '(()())']" ] ]
RandomSpanInfilling/HumanEval/1/4
python
code_infilling
HumanEval_RandomSpanInfilling
separate_paren_groups
[ [ "'(()()) ((())) () ((())()())'", "[\n '(()())', '((()))', '()', '((())()())'\n ]" ], [ "'() (()) ((())) (((())))'", "[\n '()', '(())', '((()))', '(((())))'\n ]" ], [ "'(()(())((())))'", "[\n '(()(())((())))'\n ]" ], [ "'( ) (( )) (( )( ))'", "['()', '(())', '(()())']" ] ]
[ "from typing import List" ]
t_string.append(c) elif c == ')': current_depth -= 1 current_string.append(c)
if current_depth == 0: result.append(''.join(current_string)) current_string.clear() return result
python
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace is properly closed) and not nested within each other Ignore any spaces in the input string.
[]
from typing import List def separate_paren_groups(paren_string: str) -> List[str]: """ Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace is properly closed) and not nested within each other Ignore any spaces in the input string. """ result = [] current_string = [] current_depth = 0 for c in paren_string: if c == '(': current_depth += 1 curren
[ [ "'( ) (( )) (( )( ))'", "['()', '(())', '(()())']" ] ]
RandomSpanInfilling/HumanEval/1/5
python
code_infilling
HumanEval_RandomSpanInfilling
separate_paren_groups
[ [ "'(()()) ((())) () ((())()())'", "[\n '(()())', '((()))', '()', '((())()())'\n ]" ], [ "'() (()) ((())) (((())))'", "[\n '()', '(())', '((()))', '(((())))'\n ]" ], [ "'(()(())((())))'", "[\n '(()(())((())))'\n ]" ], [ "'( ) (( )) (( )( ))'", "['()', '(())', '(()())']" ] ]
[ "from typing import List" ]
urrent_string = [] current_depth = 0 for c in paren_string: if c == '(': current_depth += 1 current_string.append(c) elif c == ')': current_depth -= 1 current_string.append(c) if current_depth == 0:
result.append(''.join(current_string)) current_string.clear() return result
python
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace is properly closed) and not nested within each other Ignore any spaces in the input string.
[]
from typing import List def separate_paren_groups(paren_string: str) -> List[str]: """ Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace is properly closed) and not nested within each other Ignore any spaces in the input string. """ result = [] c
[ [ "'( ) (( )) (( )( ))'", "['()', '(())', '(()())']" ] ]
RandomSpanInfilling/HumanEval/1/6
python
code_infilling
HumanEval_RandomSpanInfilling
separate_paren_groups
[ [ "'(()()) ((())) () ((())()())'", "[\n '(()())', '((()))', '()', '((())()())'\n ]" ], [ "'() (()) ((())) (((())))'", "[\n '()', '(())', '((()))', '(((())))'\n ]" ], [ "'(()(())((())))'", "[\n '(()(())((())))'\n ]" ], [ "'( ) (( )) (( )( ))'", "['()', '(())', '(()())']" ] ]
[ "from typing import List" ]
current
_string.append(c) if current_depth == 0: result.append(''.join(current_string)) current_string.clear() return result
python
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace is properly closed) and not nested within each other Ignore any spaces in the input string.
[]
from typing import List def separate_paren_groups(paren_string: str) -> List[str]: """ Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace is properly closed) and not nested within each other Ignore any spaces in the input string. """ result = [] current_string = [] current_depth = 0 for c in paren_string: if c == '(': current_depth += 1 current_string.append(c) elif c == ')': current_depth -= 1
[ [ "'( ) (( )) (( )( ))'", "['()', '(())', '(()())']" ] ]
RandomSpanInfilling/HumanEval/1/7
python
code_infilling
HumanEval_RandomSpanInfilling
separate_paren_groups
[ [ "'(()()) ((())) () ((())()())'", "[\n '(()())', '((()))', '()', '((())()())'\n ]" ], [ "'() (()) ((())) (((())))'", "[\n '()', '(())', '((()))', '(((())))'\n ]" ], [ "'(()(())((())))'", "[\n '(()(())((())))'\n ]" ], [ "'( ) (( )) (( )( ))'", "['()', '(())', '(()())']" ] ]
[ "from typing import List" ]
ent_depth = 0 for c in paren_string: if c == '(': current_depth += 1 current_string.append(c) elif c == ')': current_depth -= 1 current_string.append(c) if current_depth == 0: result.append(''.join(
current_string)) current_string.clear() return result
python
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace is properly closed) and not nested within each other Ignore any spaces in the input string.
[]
from typing import List def separate_paren_groups(paren_string: str) -> List[str]: """ Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace is properly closed) and not nested within each other Ignore any spaces in the input string. """ result = [] current_string = [] curr
[ [ "'( ) (( )) (( )( ))'", "['()', '(())', '(()())']" ] ]
RandomSpanInfilling/HumanEval/1/8
python
code_infilling
HumanEval_RandomSpanInfilling
separate_paren_groups
[ [ "'(()()) ((())) () ((())()())'", "[\n '(()())', '((()))', '()', '((())()())'\n ]" ], [ "'() (()) ((())) (((())))'", "[\n '()', '(())', '((()))', '(((())))'\n ]" ], [ "'(()(())((())))'", "[\n '(()(())((())))'\n ]" ], [ "'( ) (( )) (( )( ))'", "['()', '(())', '(()())']" ] ]
[ "from typing import List" ]
= 0 for c in paren_string: if c == '(': current_depth += 1 current_string.
append(c) elif c == ')': current_depth -= 1 current_string.append(c) if current_depth == 0: result.append(''.join(current_string)) current_string.clear() return result
python
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace is properly closed) and not nested within each other Ignore any spaces in the input string.
[]
from typing import List def separate_paren_groups(paren_string: str) -> List[str]: """ Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace is properly closed) and not nested within each other Ignore any spaces in the input string. """ result = [] current_string = [] current_depth
[ [ "'( ) (( )) (( )( ))'", "['()', '(())', '(()())']" ] ]
RandomSpanInfilling/HumanEval/1/9
python
code_infilling
HumanEval_RandomSpanInfilling
separate_paren_groups
[ [ "'(()()) ((())) () ((())()())'", "[\n '(()())', '((()))', '()', '((())()())'\n ]" ], [ "'() (()) ((())) (((())))'", "[\n '()', '(())', '((()))', '(((())))'\n ]" ], [ "'(()(())((())))'", "[\n '(()(())((())))'\n ]" ], [ "'( ) (( )) (( )( ))'", "['()', '(())', '(()())']" ] ]
[ "from typing import List" ]
elif c == ')': current_depth -= 1 current_string.append(c)
if current_depth == 0: result.append(''.join(current_string)) current_string.clear() return result
python
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace is properly closed) and not nested within each other Ignore any spaces in the input string.
[]
from typing import List def separate_paren_groups(paren_string: str) -> List[str]: """ Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace is properly closed) and not nested within each other Ignore any spaces in the input string. """ result = [] current_string = [] current_depth = 0 for c in paren_string: if c == '(': current_depth += 1 current_string.append(c)
[ [ "'( ) (( )) (( )( ))'", "['()', '(())', '(()())']" ] ]
RandomSpanInfilling/HumanEval/1/10
python
code_infilling
HumanEval_RandomSpanInfilling
separate_paren_groups
[ [ "3.5", "0.5" ] ]
[]
ber
% 1.0
python
Given a positive floating point number, it can be decomposed into and integer part (largest integer smaller than given number) and decimals (leftover part always smaller than 1). Return the decimal part of the number.
[]
def truncate_number(number: float) -> float: """ Given a positive floating point number, it can be decomposed into and integer part (largest integer smaller than given number) and decimals (leftover part always smaller than 1). Return the decimal part of the number. """ return num
[ [ "3.5", "0.5" ], [ "1.33", "0.33" ], [ "123.456", "0.456" ] ]
RandomSpanInfilling/HumanEval/2/1
python
code_infilling
HumanEval_RandomSpanInfilling
truncate_number
[ [ "3.5", "0.5" ] ]
[]
number % 1.
0
python
Given a positive floating point number, it can be decomposed into and integer part (largest integer smaller than given number) and decimals (leftover part always smaller than 1). Return the decimal part of the number.
[]
def truncate_number(number: float) -> float: """ Given a positive floating point number, it can be decomposed into and integer part (largest integer smaller than given number) and decimals (leftover part always smaller than 1). Return the decimal part of the number. """ return
[ [ "3.5", "0.5" ], [ "1.33", "0.33" ], [ "123.456", "0.456" ] ]
RandomSpanInfilling/HumanEval/2/2
python
code_infilling
HumanEval_RandomSpanInfilling
truncate_number
[ [ "3.5", "0.5" ] ]
[]
1.0
python
Given a positive floating point number, it can be decomposed into and integer part (largest integer smaller than given number) and decimals (leftover part always smaller than 1). Return the decimal part of the number.
[]
def truncate_number(number: float) -> float: """ Given a positive floating point number, it can be decomposed into and integer part (largest integer smaller than given number) and decimals (leftover part always smaller than 1). Return the decimal part of the number. """ return number %
[ [ "3.5", "0.5" ], [ "1.33", "0.33" ], [ "123.456", "0.456" ] ]
RandomSpanInfilling/HumanEval/2/3
python
code_infilling
HumanEval_RandomSpanInfilling
truncate_number
[ [ "3.5", "0.5" ] ]
[]
return number % 1.0
python
Given a positive floating point number, it can be decomposed into and integer part (largest integer smaller than given number) and decimals (leftover part always smaller than 1). Return the decimal part of the number.
[]
def truncate_number(number: float) -> float: """ Given a positive floating point number, it can be decomposed into and integer part (largest integer smaller than given number) and decimals (leftover part always smaller than 1). Return the decimal part of the number. """
[ [ "3.5", "0.5" ], [ "1.33", "0.33" ], [ "123.456", "0.456" ] ]
RandomSpanInfilling/HumanEval/2/4
python
code_infilling
HumanEval_RandomSpanInfilling
truncate_number
[ [ "3.5", "0.5" ] ]
[]
turn number
% 1.0
python
Given a positive floating point number, it can be decomposed into and integer part (largest integer smaller than given number) and decimals (leftover part always smaller than 1). Return the decimal part of the number.
[]
def truncate_number(number: float) -> float: """ Given a positive floating point number, it can be decomposed into and integer part (largest integer smaller than given number) and decimals (leftover part always smaller than 1). Return the decimal part of the number. """ re
[ [ "3.5", "0.5" ], [ "1.33", "0.33" ], [ "123.456", "0.456" ] ]
RandomSpanInfilling/HumanEval/2/5
python
code_infilling
HumanEval_RandomSpanInfilling
truncate_number
[ [ "3.5", "0.5" ] ]
[]
rn number %
1.0
python
Given a positive floating point number, it can be decomposed into and integer part (largest integer smaller than given number) and decimals (leftover part always smaller than 1). Return the decimal part of the number.
[]
def truncate_number(number: float) -> float: """ Given a positive floating point number, it can be decomposed into and integer part (largest integer smaller than given number) and decimals (leftover part always smaller than 1). Return the decimal part of the number. """ retu
[ [ "3.5", "0.5" ], [ "1.33", "0.33" ], [ "123.456", "0.456" ] ]
RandomSpanInfilling/HumanEval/2/6
python
code_infilling
HumanEval_RandomSpanInfilling
truncate_number
[ [ "3.5", "0.5" ] ]
[]
turn number
% 1.0
python
Given a positive floating point number, it can be decomposed into and integer part (largest integer smaller than given number) and decimals (leftover part always smaller than 1). Return the decimal part of the number.
[]
def truncate_number(number: float) -> float: """ Given a positive floating point number, it can be decomposed into and integer part (largest integer smaller than given number) and decimals (leftover part always smaller than 1). Return the decimal part of the number. """ re
[ [ "3.5", "0.5" ], [ "1.33", "0.33" ], [ "123.456", "0.456" ] ]
RandomSpanInfilling/HumanEval/2/7
python
code_infilling
HumanEval_RandomSpanInfilling
truncate_number
[ [ "3.5", "0.5" ] ]
[]
return number % 1.0
python
Given a positive floating point number, it can be decomposed into and integer part (largest integer smaller than given number) and decimals (leftover part always smaller than 1). Return the decimal part of the number.
[]
def truncate_number(number: float) -> float: """ Given a positive floating point number, it can be decomposed into and integer part (largest integer smaller than given number) and decimals (leftover part always smaller than 1). Return the decimal part of the number. """
[ [ "3.5", "0.5" ], [ "1.33", "0.33" ], [ "123.456", "0.456" ] ]
RandomSpanInfilling/HumanEval/2/8
python
code_infilling
HumanEval_RandomSpanInfilling
truncate_number
[ [ "3.5", "0.5" ] ]
[]
mber
% 1.0
python
Given a positive floating point number, it can be decomposed into and integer part (largest integer smaller than given number) and decimals (leftover part always smaller than 1). Return the decimal part of the number.
[]
def truncate_number(number: float) -> float: """ Given a positive floating point number, it can be decomposed into and integer part (largest integer smaller than given number) and decimals (leftover part always smaller than 1). Return the decimal part of the number. """ return nu
[ [ "3.5", "0.5" ], [ "1.33", "0.33" ], [ "123.456", "0.456" ] ]
RandomSpanInfilling/HumanEval/2/9
python
code_infilling
HumanEval_RandomSpanInfilling
truncate_number
[ [ "3.5", "0.5" ] ]
[]
return number %
1.0
python
Given a positive floating point number, it can be decomposed into and integer part (largest integer smaller than given number) and decimals (leftover part always smaller than 1). Return the decimal part of the number.
[]
def truncate_number(number: float) -> float: """ Given a positive floating point number, it can be decomposed into and integer part (largest integer smaller than given number) and decimals (leftover part always smaller than 1). Return the decimal part of the number. """
[ [ "3.5", "0.5" ], [ "1.33", "0.33" ], [ "123.456", "0.456" ] ]
RandomSpanInfilling/HumanEval/2/10
python
code_infilling
HumanEval_RandomSpanInfilling
truncate_number
[ [ "[]", "False" ], [ "[1, 2, -3, 1, 2, -3]", "False" ], [ "[1, 2, -4, 5, 6]", "True" ], [ "[1, -1, 2, -2, 5, -5, 4, -4]", "False" ], [ "[1, -1, 2, -2, 5, -5, 4, -5]", "True" ], [ "[1, -2, 2, -2, 5, -5, 4, -4]", "True" ] ]
[ "from typing import List" ]
return Tr
ue return False
python
You're given a list of deposit and withdrawal operations on a bank account that starts with zero balance. Your task is to detect if at any point the balance of account fallls below zero, and at that point function should return True. Otherwise it should return False.
[]
from typing import List def below_zero(operations: List[int]) -> bool: """ You're given a list of deposit and withdrawal operations on a bank account that starts with zero balance. Your task is to detect if at any point the balance of account fallls below zero, and at that point function should return True. Otherwise it should return False. """ balance = 0 for op in operations: balance += op if balance < 0:
[ [ "[1, 2, 3]", "False" ], [ "[1, 2, -4, 5]", "True" ] ]
RandomSpanInfilling/HumanEval/3/1
python
code_infilling
HumanEval_RandomSpanInfilling
below_zero
[ [ "[]", "False" ], [ "[1, 2, -3, 1, 2, -3]", "False" ], [ "[1, 2, -4, 5, 6]", "True" ], [ "[1, -1, 2, -2, 5, -5, 4, -4]", "False" ], [ "[1, -1, 2, -2, 5, -5, 4, -5]", "True" ], [ "[1, -2, 2, -2, 5, -5, 4, -4]", "True" ] ]
[ "from typing import List" ]
ance = 0 for op in ope
rations: balance += op if balance < 0: return True return False
python
You're given a list of deposit and withdrawal operations on a bank account that starts with zero balance. Your task is to detect if at any point the balance of account fallls below zero, and at that point function should return True. Otherwise it should return False.
[]
from typing import List def below_zero(operations: List[int]) -> bool: """ You're given a list of deposit and withdrawal operations on a bank account that starts with zero balance. Your task is to detect if at any point the balance of account fallls below zero, and at that point function should return True. Otherwise it should return False. """ bal
[ [ "[1, 2, 3]", "False" ], [ "[1, 2, -4, 5]", "True" ] ]
RandomSpanInfilling/HumanEval/3/2
python
code_infilling
HumanEval_RandomSpanInfilling
below_zero
[ [ "[]", "False" ], [ "[1, 2, -3, 1, 2, -3]", "False" ], [ "[1, 2, -4, 5, 6]", "True" ], [ "[1, -1, 2, -2, 5, -5, 4, -4]", "False" ], [ "[1, -1, 2, -2, 5, -5, 4, -5]", "True" ], [ "[1, -2, 2, -2, 5, -5, 4, -4]", "True" ] ]
[ "from typing import List" ]
balance += op if bala
nce < 0: return True return False
python
You're given a list of deposit and withdrawal operations on a bank account that starts with zero balance. Your task is to detect if at any point the balance of account fallls below zero, and at that point function should return True. Otherwise it should return False.
[]
from typing import List def below_zero(operations: List[int]) -> bool: """ You're given a list of deposit and withdrawal operations on a bank account that starts with zero balance. Your task is to detect if at any point the balance of account fallls below zero, and at that point function should return True. Otherwise it should return False. """ balance = 0 for op in operations:
[ [ "[1, 2, 3]", "False" ], [ "[1, 2, -4, 5]", "True" ] ]
RandomSpanInfilling/HumanEval/3/3
python
code_infilling
HumanEval_RandomSpanInfilling
below_zero
[ [ "[]", "False" ], [ "[1, 2, -3, 1, 2, -3]", "False" ], [ "[1, 2, -4, 5, 6]", "True" ], [ "[1, -1, 2, -2, 5, -5, 4, -4]", "False" ], [ "[1, -1, 2, -2, 5, -5, 4, -5]", "True" ], [ "[1, -2, 2, -2, 5, -5, 4, -4]", "True" ] ]
[ "from typing import List" ]
turn True return False
python
You're given a list of deposit and withdrawal operations on a bank account that starts with zero balance. Your task is to detect if at any point the balance of account fallls below zero, and at that point function should return True. Otherwise it should return False.
[]
from typing import List def below_zero(operations: List[int]) -> bool: """ You're given a list of deposit and withdrawal operations on a bank account that starts with zero balance. Your task is to detect if at any point the balance of account fallls below zero, and at that point function should return True. Otherwise it should return False. """ balance = 0 for op in operations: balance += op if balance < 0: re
[ [ "[1, 2, 3]", "False" ], [ "[1, 2, -4, 5]", "True" ] ]
RandomSpanInfilling/HumanEval/3/4
python
code_infilling
HumanEval_RandomSpanInfilling
below_zero
[ [ "[]", "False" ], [ "[1, 2, -3, 1, 2, -3]", "False" ], [ "[1, 2, -4, 5, 6]", "True" ], [ "[1, -1, 2, -2, 5, -5, 4, -4]", "False" ], [ "[1, -1, 2, -2, 5, -5, 4, -5]", "True" ], [ "[1, -2, 2, -2, 5, -5, 4, -4]", "True" ] ]
[ "from typing import List" ]
balance = 0 for op in operations: ba
lance += op if balance < 0: return True return False
python
You're given a list of deposit and withdrawal operations on a bank account that starts with zero balance. Your task is to detect if at any point the balance of account fallls below zero, and at that point function should return True. Otherwise it should return False.
[]
from typing import List def below_zero(operations: List[int]) -> bool: """ You're given a list of deposit and withdrawal operations on a bank account that starts with zero balance. Your task is to detect if at any point the balance of account fallls below zero, and at that point function should return True. Otherwise it should return False. """
[ [ "[1, 2, 3]", "False" ], [ "[1, 2, -4, 5]", "True" ] ]
RandomSpanInfilling/HumanEval/3/5
python
code_infilling
HumanEval_RandomSpanInfilling
below_zero
[ [ "[]", "False" ], [ "[1, 2, -3, 1, 2, -3]", "False" ], [ "[1, 2, -4, 5, 6]", "True" ], [ "[1, -1, 2, -2, 5, -5, 4, -4]", "False" ], [ "[1, -1, 2, -2, 5, -5, 4, -5]", "True" ], [ "[1, -2, 2, -2, 5, -5, 4, -4]", "True" ] ]
[ "from typing import List" ]
balance = 0 for op in operations: balance += op if balance < 0: retu
rn True return False
python
You're given a list of deposit and withdrawal operations on a bank account that starts with zero balance. Your task is to detect if at any point the balance of account fallls below zero, and at that point function should return True. Otherwise it should return False.
[]
from typing import List def below_zero(operations: List[int]) -> bool: """ You're given a list of deposit and withdrawal operations on a bank account that starts with zero balance. Your task is to detect if at any point the balance of account fallls below zero, and at that point function should return True. Otherwise it should return False. """
[ [ "[1, 2, 3]", "False" ], [ "[1, 2, -4, 5]", "True" ] ]
RandomSpanInfilling/HumanEval/3/6
python
code_infilling
HumanEval_RandomSpanInfilling
below_zero
[ [ "[]", "False" ], [ "[1, 2, -3, 1, 2, -3]", "False" ], [ "[1, 2, -4, 5, 6]", "True" ], [ "[1, -1, 2, -2, 5, -5, 4, -4]", "False" ], [ "[1, -1, 2, -2, 5, -5, 4, -5]", "True" ], [ "[1, -2, 2, -2, 5, -5, 4, -4]", "True" ] ]
[ "from typing import List" ]
ba
lance += op if balance < 0: return True return False
python
You're given a list of deposit and withdrawal operations on a bank account that starts with zero balance. Your task is to detect if at any point the balance of account fallls below zero, and at that point function should return True. Otherwise it should return False.
[]
from typing import List def below_zero(operations: List[int]) -> bool: """ You're given a list of deposit and withdrawal operations on a bank account that starts with zero balance. Your task is to detect if at any point the balance of account fallls below zero, and at that point function should return True. Otherwise it should return False. """ balance = 0 for op in operations:
[ [ "[1, 2, 3]", "False" ], [ "[1, 2, -4, 5]", "True" ] ]
RandomSpanInfilling/HumanEval/3/7
python
code_infilling
HumanEval_RandomSpanInfilling
below_zero
[ [ "[]", "False" ], [ "[1, 2, -3, 1, 2, -3]", "False" ], [ "[1, 2, -4, 5, 6]", "True" ], [ "[1, -1, 2, -2, 5, -5, 4, -4]", "False" ], [ "[1, -1, 2, -2, 5, -5, 4, -5]", "True" ], [ "[1, -2, 2, -2, 5, -5, 4, -4]", "True" ] ]
[ "from typing import List" ]
0 for op in operations: balance += op if balance < 0:
return True return False
python
You're given a list of deposit and withdrawal operations on a bank account that starts with zero balance. Your task is to detect if at any point the balance of account fallls below zero, and at that point function should return True. Otherwise it should return False.
[]
from typing import List def below_zero(operations: List[int]) -> bool: """ You're given a list of deposit and withdrawal operations on a bank account that starts with zero balance. Your task is to detect if at any point the balance of account fallls below zero, and at that point function should return True. Otherwise it should return False. """ balance =
[ [ "[1, 2, 3]", "False" ], [ "[1, 2, -4, 5]", "True" ] ]
RandomSpanInfilling/HumanEval/3/8
python
code_infilling
HumanEval_RandomSpanInfilling
below_zero
[ [ "[]", "False" ], [ "[1, 2, -3, 1, 2, -3]", "False" ], [ "[1, 2, -4, 5, 6]", "True" ], [ "[1, -1, 2, -2, 5, -5, 4, -4]", "False" ], [ "[1, -1, 2, -2, 5, -5, 4, -5]", "True" ], [ "[1, -2, 2, -2, 5, -5, 4, -4]", "True" ] ]
[ "from typing import List" ]
0 for op in operations:
balance += op if balance < 0: return True return False
python
You're given a list of deposit and withdrawal operations on a bank account that starts with zero balance. Your task is to detect if at any point the balance of account fallls below zero, and at that point function should return True. Otherwise it should return False.
[]
from typing import List def below_zero(operations: List[int]) -> bool: """ You're given a list of deposit and withdrawal operations on a bank account that starts with zero balance. Your task is to detect if at any point the balance of account fallls below zero, and at that point function should return True. Otherwise it should return False. """ balance =
[ [ "[1, 2, 3]", "False" ], [ "[1, 2, -4, 5]", "True" ] ]
RandomSpanInfilling/HumanEval/3/9
python
code_infilling
HumanEval_RandomSpanInfilling
below_zero
[ [ "[]", "False" ], [ "[1, 2, -3, 1, 2, -3]", "False" ], [ "[1, 2, -4, 5, 6]", "True" ], [ "[1, -1, 2, -2, 5, -5, 4, -4]", "False" ], [ "[1, -1, 2, -2, 5, -5, 4, -5]", "True" ], [ "[1, -2, 2, -2, 5, -5, 4, -4]", "True" ] ]
[ "from typing import List" ]
ns: balance += op if balan
ce < 0: return True return False
python
You're given a list of deposit and withdrawal operations on a bank account that starts with zero balance. Your task is to detect if at any point the balance of account fallls below zero, and at that point function should return True. Otherwise it should return False.
[]
from typing import List def below_zero(operations: List[int]) -> bool: """ You're given a list of deposit and withdrawal operations on a bank account that starts with zero balance. Your task is to detect if at any point the balance of account fallls below zero, and at that point function should return True. Otherwise it should return False. """ balance = 0 for op in operatio
[ [ "[1, 2, 3]", "False" ], [ "[1, 2, -4, 5]", "True" ] ]
RandomSpanInfilling/HumanEval/3/10
python
code_infilling
HumanEval_RandomSpanInfilling
below_zero
[ [ "[1.0, 2.0, 3.0]", "2.0/3.0" ], [ "[1.0, 2.0, 3.0, 4.0]", "1.0" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "6.0/5.0" ] ]
[ "from typing import List" ]
/ len(numbers) return su
m(abs(x - mean) for x in numbers) / len(numbers)
python
For a given list of input numbers, calculate Mean Absolute Deviation around the mean of this dataset. Mean Absolute Deviation is the average absolute difference between each element and a centerpoint (mean in this case): MAD = average | x - x_mean |
[]
from typing import List def mean_absolute_deviation(numbers: List[float]) -> float: """ For a given list of input numbers, calculate Mean Absolute Deviation around the mean of this dataset. Mean Absolute Deviation is the average absolute difference between each element and a centerpoint (mean in this case): MAD = average | x - x_mean | """ mean = sum(numbers)
[ [ "[1.0, 2.0, 3.0, 4.0]", "1.0" ] ]
RandomSpanInfilling/HumanEval/4/1
python
code_infilling
HumanEval_RandomSpanInfilling
mean_absolute_deviation
[ [ "[1.0, 2.0, 3.0]", "2.0/3.0" ], [ "[1.0, 2.0, 3.0, 4.0]", "1.0" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "6.0/5.0" ] ]
[ "from typing import List" ]
len(numbers) return sum(abs(x - mean) for x in numbers) /
len(numbers)
python
For a given list of input numbers, calculate Mean Absolute Deviation around the mean of this dataset. Mean Absolute Deviation is the average absolute difference between each element and a centerpoint (mean in this case): MAD = average | x - x_mean |
[]
from typing import List def mean_absolute_deviation(numbers: List[float]) -> float: """ For a given list of input numbers, calculate Mean Absolute Deviation around the mean of this dataset. Mean Absolute Deviation is the average absolute difference between each element and a centerpoint (mean in this case): MAD = average | x - x_mean | """ mean = sum(numbers) /
[ [ "[1.0, 2.0, 3.0, 4.0]", "1.0" ] ]
RandomSpanInfilling/HumanEval/4/2
python
code_infilling
HumanEval_RandomSpanInfilling
mean_absolute_deviation
[ [ "[1.0, 2.0, 3.0]", "2.0/3.0" ], [ "[1.0, 2.0, 3.0, 4.0]", "1.0" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "6.0/5.0" ] ]
[ "from typing import List" ]
return sum(abs(x
- mean) for x in numbers) / len(numbers)
python
For a given list of input numbers, calculate Mean Absolute Deviation around the mean of this dataset. Mean Absolute Deviation is the average absolute difference between each element and a centerpoint (mean in this case): MAD = average | x - x_mean |
[]
from typing import List def mean_absolute_deviation(numbers: List[float]) -> float: """ For a given list of input numbers, calculate Mean Absolute Deviation around the mean of this dataset. Mean Absolute Deviation is the average absolute difference between each element and a centerpoint (mean in this case): MAD = average | x - x_mean | """ mean = sum(numbers) / len(numbers)
[ [ "[1.0, 2.0, 3.0, 4.0]", "1.0" ] ]
RandomSpanInfilling/HumanEval/4/3
python
code_infilling
HumanEval_RandomSpanInfilling
mean_absolute_deviation
[ [ "[1.0, 2.0, 3.0]", "2.0/3.0" ], [ "[1.0, 2.0, 3.0, 4.0]", "1.0" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "6.0/5.0" ] ]
[ "from typing import List" ]
(numbers) / le
n(numbers) return sum(abs(x - mean) for x in numbers) / len(numbers)
python
For a given list of input numbers, calculate Mean Absolute Deviation around the mean of this dataset. Mean Absolute Deviation is the average absolute difference between each element and a centerpoint (mean in this case): MAD = average | x - x_mean |
[]
from typing import List def mean_absolute_deviation(numbers: List[float]) -> float: """ For a given list of input numbers, calculate Mean Absolute Deviation around the mean of this dataset. Mean Absolute Deviation is the average absolute difference between each element and a centerpoint (mean in this case): MAD = average | x - x_mean | """ mean = sum
[ [ "[1.0, 2.0, 3.0, 4.0]", "1.0" ] ]
RandomSpanInfilling/HumanEval/4/4
python
code_infilling
HumanEval_RandomSpanInfilling
mean_absolute_deviation
[ [ "[1.0, 2.0, 3.0]", "2.0/3.0" ], [ "[1.0, 2.0, 3.0, 4.0]", "1.0" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "6.0/5.0" ] ]
[ "from typing import List" ]
eturn sum(abs(x - me
an) for x in numbers) / len(numbers)
python
For a given list of input numbers, calculate Mean Absolute Deviation around the mean of this dataset. Mean Absolute Deviation is the average absolute difference between each element and a centerpoint (mean in this case): MAD = average | x - x_mean |
[]
from typing import List def mean_absolute_deviation(numbers: List[float]) -> float: """ For a given list of input numbers, calculate Mean Absolute Deviation around the mean of this dataset. Mean Absolute Deviation is the average absolute difference between each element and a centerpoint (mean in this case): MAD = average | x - x_mean | """ mean = sum(numbers) / len(numbers) r
[ [ "[1.0, 2.0, 3.0, 4.0]", "1.0" ] ]
RandomSpanInfilling/HumanEval/4/5
python
code_infilling
HumanEval_RandomSpanInfilling
mean_absolute_deviation
[ [ "[1.0, 2.0, 3.0]", "2.0/3.0" ], [ "[1.0, 2.0, 3.0, 4.0]", "1.0" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "6.0/5.0" ] ]
[ "from typing import List" ]
r x in numbers) /
len(numbers)
python
For a given list of input numbers, calculate Mean Absolute Deviation around the mean of this dataset. Mean Absolute Deviation is the average absolute difference between each element and a centerpoint (mean in this case): MAD = average | x - x_mean |
[]
from typing import List def mean_absolute_deviation(numbers: List[float]) -> float: """ For a given list of input numbers, calculate Mean Absolute Deviation around the mean of this dataset. Mean Absolute Deviation is the average absolute difference between each element and a centerpoint (mean in this case): MAD = average | x - x_mean | """ mean = sum(numbers) / len(numbers) return sum(abs(x - mean) fo
[ [ "[1.0, 2.0, 3.0, 4.0]", "1.0" ] ]
RandomSpanInfilling/HumanEval/4/6
python
code_infilling
HumanEval_RandomSpanInfilling
mean_absolute_deviation
[ [ "[1.0, 2.0, 3.0]", "2.0/3.0" ], [ "[1.0, 2.0, 3.0, 4.0]", "1.0" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "6.0/5.0" ] ]
[ "from typing import List" ]
= sum(numbers) / len(numbers) return sum(abs(x - mean) for x in numbers) /
len(numbers)
python
For a given list of input numbers, calculate Mean Absolute Deviation around the mean of this dataset. Mean Absolute Deviation is the average absolute difference between each element and a centerpoint (mean in this case): MAD = average | x - x_mean |
[]
from typing import List def mean_absolute_deviation(numbers: List[float]) -> float: """ For a given list of input numbers, calculate Mean Absolute Deviation around the mean of this dataset. Mean Absolute Deviation is the average absolute difference between each element and a centerpoint (mean in this case): MAD = average | x - x_mean | """ mean
[ [ "[1.0, 2.0, 3.0, 4.0]", "1.0" ] ]
RandomSpanInfilling/HumanEval/4/7
python
code_infilling
HumanEval_RandomSpanInfilling
mean_absolute_deviation
[ [ "[1.0, 2.0, 3.0]", "2.0/3.0" ], [ "[1.0, 2.0, 3.0, 4.0]", "1.0" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "6.0/5.0" ] ]
[ "from typing import List" ]
mea
n = sum(numbers) / len(numbers) return sum(abs(x - mean) for x in numbers) / len(numbers)
python
For a given list of input numbers, calculate Mean Absolute Deviation around the mean of this dataset. Mean Absolute Deviation is the average absolute difference between each element and a centerpoint (mean in this case): MAD = average | x - x_mean |
[]
from typing import List def mean_absolute_deviation(numbers: List[float]) -> float: """ For a given list of input numbers, calculate Mean Absolute Deviation around the mean of this dataset. Mean Absolute Deviation is the average absolute difference between each element and a centerpoint (mean in this case): MAD = average | x - x_mean | """
[ [ "[1.0, 2.0, 3.0, 4.0]", "1.0" ] ]
RandomSpanInfilling/HumanEval/4/8
python
code_infilling
HumanEval_RandomSpanInfilling
mean_absolute_deviation
[ [ "[1.0, 2.0, 3.0]", "2.0/3.0" ], [ "[1.0, 2.0, 3.0, 4.0]", "1.0" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "6.0/5.0" ] ]
[ "from typing import List" ]
mean) for x in numbers) /
len(numbers)
python
For a given list of input numbers, calculate Mean Absolute Deviation around the mean of this dataset. Mean Absolute Deviation is the average absolute difference between each element and a centerpoint (mean in this case): MAD = average | x - x_mean |
[]
from typing import List def mean_absolute_deviation(numbers: List[float]) -> float: """ For a given list of input numbers, calculate Mean Absolute Deviation around the mean of this dataset. Mean Absolute Deviation is the average absolute difference between each element and a centerpoint (mean in this case): MAD = average | x - x_mean | """ mean = sum(numbers) / len(numbers) return sum(abs(x -
[ [ "[1.0, 2.0, 3.0, 4.0]", "1.0" ] ]
RandomSpanInfilling/HumanEval/4/9
python
code_infilling
HumanEval_RandomSpanInfilling
mean_absolute_deviation
[ [ "[1.0, 2.0, 3.0]", "2.0/3.0" ], [ "[1.0, 2.0, 3.0, 4.0]", "1.0" ], [ "[1.0, 2.0, 3.0, 4.0, 5.0]", "6.0/5.0" ] ]
[ "from typing import List" ]
sum(numbers) / len(numbers) return sum(abs(x - mean) for x in num
bers) / len(numbers)
python
For a given list of input numbers, calculate Mean Absolute Deviation around the mean of this dataset. Mean Absolute Deviation is the average absolute difference between each element and a centerpoint (mean in this case): MAD = average | x - x_mean |
[]
from typing import List def mean_absolute_deviation(numbers: List[float]) -> float: """ For a given list of input numbers, calculate Mean Absolute Deviation around the mean of this dataset. Mean Absolute Deviation is the average absolute difference between each element and a centerpoint (mean in this case): MAD = average | x - x_mean | """ mean =
[ [ "[1.0, 2.0, 3.0, 4.0]", "1.0" ] ]
RandomSpanInfilling/HumanEval/4/10
python
code_infilling
HumanEval_RandomSpanInfilling
mean_absolute_deviation
[ [ "[], 7", "[]" ], [ "[5, 6, 3, 2], 8", "[5, 8, 6, 8, 3, 8, 2]" ], [ "[2, 2, 2], 2", "[2, 2, 2, 2, 2]" ] ]
[ "from typing import List" ]
eter) result.append(nu
mbers[-1]) return result
python
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
[]
from typing import List def intersperse(numbers: List[int], delimeter: int) -> List[int]: """ Insert a number 'delimeter' between every two consecutive elements of input list `numbers' """ if not numbers: return [] result = [] for n in numbers[:-1]: result.append(n) result.append(delim
[ [ "[], 4", "[]" ], [ "[1, 2, 3], 4", "[1, 4, 2, 4, 3]" ] ]
RandomSpanInfilling/HumanEval/5/1
python
code_infilling
HumanEval_RandomSpanInfilling
intersperse
[ [ "[], 7", "[]" ], [ "[5, 6, 3, 2], 8", "[5, 8, 6, 8, 3, 8, 2]" ], [ "[2, 2, 2], 2", "[2, 2, 2, 2, 2]" ] ]
[ "from typing import List" ]
rn [] result = [] for n in numbers[:-1]: result.append(n) result.append(delimeter) result.append(nu
mbers[-1]) return result
python
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
[]
from typing import List def intersperse(numbers: List[int], delimeter: int) -> List[int]: """ Insert a number 'delimeter' between every two consecutive elements of input list `numbers' """ if not numbers: retu
[ [ "[], 4", "[]" ], [ "[1, 2, 3], 4", "[1, 4, 2, 4, 3]" ] ]
RandomSpanInfilling/HumanEval/5/2
python
code_infilling
HumanEval_RandomSpanInfilling
intersperse
[ [ "[], 7", "[]" ], [ "[5, 6, 3, 2], 8", "[5, 8, 6, 8, 3, 8, 2]" ], [ "[2, 2, 2], 2", "[2, 2, 2, 2, 2]" ] ]
[ "from typing import List" ]
if not numbers: return [] result = [] for n in numbers[:-1]: result.append(n) result
.append(delimeter) result.append(numbers[-1]) return result
python
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
[]
from typing import List def intersperse(numbers: List[int], delimeter: int) -> List[int]: """ Insert a number 'delimeter' between every two consecutive elements of input list `numbers' """
[ [ "[], 4", "[]" ], [ "[1, 2, 3], 4", "[1, 4, 2, 4, 3]" ] ]
RandomSpanInfilling/HumanEval/5/3
python
code_infilling
HumanEval_RandomSpanInfilling
intersperse
[ [ "[], 7", "[]" ], [ "[5, 6, 3, 2], 8", "[5, 8, 6, 8, 3, 8, 2]" ], [ "[2, 2, 2], 2", "[2, 2, 2, 2, 2]" ] ]
[ "from typing import List" ]
return []
result = [] for n in numbers[:-1]: result.append(n) result.append(delimeter) result.append(numbers[-1]) return result
python
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
[]
from typing import List def intersperse(numbers: List[int], delimeter: int) -> List[int]: """ Insert a number 'delimeter' between every two consecutive elements of input list `numbers' """ if not numbers:
[ [ "[], 4", "[]" ], [ "[1, 2, 3], 4", "[1, 4, 2, 4, 3]" ] ]
RandomSpanInfilling/HumanEval/5/4
python
code_infilling
HumanEval_RandomSpanInfilling
intersperse
[ [ "[], 7", "[]" ], [ "[5, 6, 3, 2], 8", "[5, 8, 6, 8, 3, 8, 2]" ], [ "[2, 2, 2], 2", "[2, 2, 2, 2, 2]" ] ]
[ "from typing import List" ]
mbers[:-1]: result.append(n) result.append(deli
meter) result.append(numbers[-1]) return result
python
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
[]
from typing import List def intersperse(numbers: List[int], delimeter: int) -> List[int]: """ Insert a number 'delimeter' between every two consecutive elements of input list `numbers' """ if not numbers: return [] result = [] for n in nu
[ [ "[], 4", "[]" ], [ "[1, 2, 3], 4", "[1, 4, 2, 4, 3]" ] ]
RandomSpanInfilling/HumanEval/5/5
python
code_infilling
HumanEval_RandomSpanInfilling
intersperse
[ [ "[], 7", "[]" ], [ "[5, 6, 3, 2], 8", "[5, 8, 6, 8, 3, 8, 2]" ], [ "[2, 2, 2], 2", "[2, 2, 2, 2, 2]" ] ]
[ "from typing import List" ]
numbers: return [] result = [] for n in numbers[:-1]: result.append(n) result.append(delimeter) result.append(n
umbers[-1]) return result
python
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
[]
from typing import List def intersperse(numbers: List[int], delimeter: int) -> List[int]: """ Insert a number 'delimeter' between every two consecutive elements of input list `numbers' """ if not
[ [ "[], 4", "[]" ], [ "[1, 2, 3], 4", "[1, 4, 2, 4, 3]" ] ]
RandomSpanInfilling/HumanEval/5/6
python
code_infilling
HumanEval_RandomSpanInfilling
intersperse
[ [ "[], 7", "[]" ], [ "[5, 6, 3, 2], 8", "[5, 8, 6, 8, 3, 8, 2]" ], [ "[2, 2, 2], 2", "[2, 2, 2, 2, 2]" ] ]
[ "from typing import List" ]
rn [] resu
lt = [] for n in numbers[:-1]: result.append(n) result.append(delimeter) result.append(numbers[-1]) return result
python
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
[]
from typing import List def intersperse(numbers: List[int], delimeter: int) -> List[int]: """ Insert a number 'delimeter' between every two consecutive elements of input list `numbers' """ if not numbers: retu
[ [ "[], 4", "[]" ], [ "[1, 2, 3], 4", "[1, 4, 2, 4, 3]" ] ]
RandomSpanInfilling/HumanEval/5/7
python
code_infilling
HumanEval_RandomSpanInfilling
intersperse
[ [ "[], 7", "[]" ], [ "[5, 6, 3, 2], 8", "[5, 8, 6, 8, 3, 8, 2]" ], [ "[2, 2, 2], 2", "[2, 2, 2, 2, 2]" ] ]
[ "from typing import List" ]
or n in numbers[:-1]: result.append(n) result.append(delimeter) resu
lt.append(numbers[-1]) return result
python
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
[]
from typing import List def intersperse(numbers: List[int], delimeter: int) -> List[int]: """ Insert a number 'delimeter' between every two consecutive elements of input list `numbers' """ if not numbers: return [] result = [] f
[ [ "[], 4", "[]" ], [ "[1, 2, 3], 4", "[1, 4, 2, 4, 3]" ] ]
RandomSpanInfilling/HumanEval/5/8
python
code_infilling
HumanEval_RandomSpanInfilling
intersperse
[ [ "[], 7", "[]" ], [ "[5, 6, 3, 2], 8", "[5, 8, 6, 8, 3, 8, 2]" ], [ "[2, 2, 2], 2", "[2, 2, 2, 2, 2]" ] ]
[ "from typing import List" ]
] result = [] for n in numbers[:-1]: result.
append(n) result.append(delimeter) result.append(numbers[-1]) return result
python
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
[]
from typing import List def intersperse(numbers: List[int], delimeter: int) -> List[int]: """ Insert a number 'delimeter' between every two consecutive elements of input list `numbers' """ if not numbers: return [
[ [ "[], 4", "[]" ], [ "[1, 2, 3], 4", "[1, 4, 2, 4, 3]" ] ]
RandomSpanInfilling/HumanEval/5/9
python
code_infilling
HumanEval_RandomSpanInfilling
intersperse
[ [ "[], 7", "[]" ], [ "[5, 6, 3, 2], 8", "[5, 8, 6, 8, 3, 8, 2]" ], [ "[2, 2, 2], 2", "[2, 2, 2, 2, 2]" ] ]
[ "from typing import List" ]
d(n) result.append(delimeter) result.append(numbers[-1]
) return result
python
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
[]
from typing import List def intersperse(numbers: List[int], delimeter: int) -> List[int]: """ Insert a number 'delimeter' between every two consecutive elements of input list `numbers' """ if not numbers: return [] result = [] for n in numbers[:-1]: result.appen
[ [ "[], 4", "[]" ], [ "[1, 2, 3], 4", "[1, 4, 2, 4, 3]" ] ]
RandomSpanInfilling/HumanEval/5/10
python
code_infilling
HumanEval_RandomSpanInfilling
intersperse
[ [ "'(()()) ((())) () ((())()())'", "[2, 3, 1, 3]" ], [ "'() (()) ((())) (((())))'", "[1, 2, 3, 4]" ], [ "'(()(())((())))'", "[4]" ] ]
[ "from typing import List" ]
depth = 0 max_depth = 0 for c in s: if c == '(': depth += 1 max_depth = max(depth, max_depth) else:
depth -= 1 return max_depth return [parse_paren_group(x) for x in paren_string.split(' ') if x]
python
Input to this function is a string represented multiple groups for nested parentheses separated by spaces. For each of the group, output the deepest level of nesting of parentheses. E.g. (()()) has maximum two levels of nesting while ((())) has three.
[]
from typing import List def parse_nested_parens(paren_string: str) -> List[int]: """ Input to this function is a string represented multiple groups for nested parentheses separated by spaces. For each of the group, output the deepest level of nesting of parentheses. E.g. (()()) has maximum two levels of nesting while ((())) has three. """ def parse_paren_group(s):
[ [ "'(()()) ((())) () ((())()())'", "[2, 3, 1, 3]" ] ]
RandomSpanInfilling/HumanEval/6/1
python
code_infilling
HumanEval_RandomSpanInfilling
parse_nested_parens
[ [ "'(()()) ((())) () ((())()())'", "[2, 3, 1, 3]" ], [ "'() (()) ((())) (((())))'", "[1, 2, 3, 4]" ], [ "'(()(())((())))'", "[4]" ] ]
[ "from typing import List" ]
if c == '(': depth += 1 max_depth = max(depth, max_depth) else:
depth -= 1 return max_depth return [parse_paren_group(x) for x in paren_string.split(' ') if x]
python
Input to this function is a string represented multiple groups for nested parentheses separated by spaces. For each of the group, output the deepest level of nesting of parentheses. E.g. (()()) has maximum two levels of nesting while ((())) has three.
[]
from typing import List def parse_nested_parens(paren_string: str) -> List[int]: """ Input to this function is a string represented multiple groups for nested parentheses separated by spaces. For each of the group, output the deepest level of nesting of parentheses. E.g. (()()) has maximum two levels of nesting while ((())) has three. """ def parse_paren_group(s): depth = 0 max_depth = 0 for c in s:
[ [ "'(()()) ((())) () ((())()())'", "[2, 3, 1, 3]" ] ]
RandomSpanInfilling/HumanEval/6/2
python
code_infilling
HumanEval_RandomSpanInfilling
parse_nested_parens
[ [ "'(()()) ((())) () ((())()())'", "[2, 3, 1, 3]" ], [ "'() (()) ((())) (((())))'", "[1, 2, 3, 4]" ], [ "'(()(())((())))'", "[4]" ] ]
[ "from typing import List" ]
depth += 1 max_depth = max(depth, max_depth) else: depth -= 1 return max
_depth return [parse_paren_group(x) for x in paren_string.split(' ') if x]
python
Input to this function is a string represented multiple groups for nested parentheses separated by spaces. For each of the group, output the deepest level of nesting of parentheses. E.g. (()()) has maximum two levels of nesting while ((())) has three.
[]
from typing import List def parse_nested_parens(paren_string: str) -> List[int]: """ Input to this function is a string represented multiple groups for nested parentheses separated by spaces. For each of the group, output the deepest level of nesting of parentheses. E.g. (()()) has maximum two levels of nesting while ((())) has three. """ def parse_paren_group(s): depth = 0 max_depth = 0 for c in s: if c == '(':
[ [ "'(()()) ((())) () ((())()())'", "[2, 3, 1, 3]" ] ]
RandomSpanInfilling/HumanEval/6/3
python
code_infilling
HumanEval_RandomSpanInfilling
parse_nested_parens
[ [ "'(()()) ((())) () ((())()())'", "[2, 3, 1, 3]" ], [ "'() (()) ((())) (((())))'", "[1, 2, 3, 4]" ], [ "'(()(())((())))'", "[4]" ] ]
[ "from typing import List" ]
def parse_paren_group(s): depth = 0 max_depth = 0 for c in s: if c == '(': depth += 1 max_depth = max(depth, max_depth) else:
depth -= 1 return max_depth return [parse_paren_group(x) for x in paren_string.split(' ') if x]
python
Input to this function is a string represented multiple groups for nested parentheses separated by spaces. For each of the group, output the deepest level of nesting of parentheses. E.g. (()()) has maximum two levels of nesting while ((())) has three.
[]
from typing import List def parse_nested_parens(paren_string: str) -> List[int]: """ Input to this function is a string represented multiple groups for nested parentheses separated by spaces. For each of the group, output the deepest level of nesting of parentheses. E.g. (()()) has maximum two levels of nesting while ((())) has three. """
[ [ "'(()()) ((())) () ((())()())'", "[2, 3, 1, 3]" ] ]
RandomSpanInfilling/HumanEval/6/4
python
code_infilling
HumanEval_RandomSpanInfilling
parse_nested_parens
[ [ "'(()()) ((())) () ((())()())'", "[2, 3, 1, 3]" ], [ "'() (()) ((())) (((())))'", "[1, 2, 3, 4]" ], [ "'(()(())((())))'", "[4]" ] ]
[ "from typing import List" ]
ax_depth return [parse_
paren_group(x) for x in paren_string.split(' ') if x]
python
Input to this function is a string represented multiple groups for nested parentheses separated by spaces. For each of the group, output the deepest level of nesting of parentheses. E.g. (()()) has maximum two levels of nesting while ((())) has three.
[]
from typing import List def parse_nested_parens(paren_string: str) -> List[int]: """ Input to this function is a string represented multiple groups for nested parentheses separated by spaces. For each of the group, output the deepest level of nesting of parentheses. E.g. (()()) has maximum two levels of nesting while ((())) has three. """ def parse_paren_group(s): depth = 0 max_depth = 0 for c in s: if c == '(': depth += 1 max_depth = max(depth, max_depth) else: depth -= 1 return m
[ [ "'(()()) ((())) () ((())()())'", "[2, 3, 1, 3]" ] ]
RandomSpanInfilling/HumanEval/6/5
python
code_infilling
HumanEval_RandomSpanInfilling
parse_nested_parens
[ [ "'(()()) ((())) () ((())()())'", "[2, 3, 1, 3]" ], [ "'() (()) ((())) (((())))'", "[1, 2, 3, 4]" ], [ "'(()(())((())))'", "[4]" ] ]
[ "from typing import List" ]
paren_group(s): depth = 0 max_depth = 0 for c in s: if c == '(': depth += 1 max_depth = max(depth, max_depth) el
se: depth -= 1 return max_depth return [parse_paren_group(x) for x in paren_string.split(' ') if x]
python
Input to this function is a string represented multiple groups for nested parentheses separated by spaces. For each of the group, output the deepest level of nesting of parentheses. E.g. (()()) has maximum two levels of nesting while ((())) has three.
[]
from typing import List def parse_nested_parens(paren_string: str) -> List[int]: """ Input to this function is a string represented multiple groups for nested parentheses separated by spaces. For each of the group, output the deepest level of nesting of parentheses. E.g. (()()) has maximum two levels of nesting while ((())) has three. """ def parse_
[ [ "'(()()) ((())) () ((())()())'", "[2, 3, 1, 3]" ] ]
RandomSpanInfilling/HumanEval/6/6
python
code_infilling
HumanEval_RandomSpanInfilling
parse_nested_parens
[ [ "'(()()) ((())) () ((())()())'", "[2, 3, 1, 3]" ], [ "'() (()) ((())) (((())))'", "[1, 2, 3, 4]" ], [ "'(()(())((())))'", "[4]" ] ]
[ "from typing import List" ]
th = 0 max_depth = 0 for c in s: if c == '(': depth += 1 max_depth = max(dept
h, max_depth) else: depth -= 1 return max_depth return [parse_paren_group(x) for x in paren_string.split(' ') if x]
python
Input to this function is a string represented multiple groups for nested parentheses separated by spaces. For each of the group, output the deepest level of nesting of parentheses. E.g. (()()) has maximum two levels of nesting while ((())) has three.
[]
from typing import List def parse_nested_parens(paren_string: str) -> List[int]: """ Input to this function is a string represented multiple groups for nested parentheses separated by spaces. For each of the group, output the deepest level of nesting of parentheses. E.g. (()()) has maximum two levels of nesting while ((())) has three. """ def parse_paren_group(s): dep
[ [ "'(()()) ((())) () ((())()())'", "[2, 3, 1, 3]" ] ]
RandomSpanInfilling/HumanEval/6/7
python
code_infilling
HumanEval_RandomSpanInfilling
parse_nested_parens
[ [ "'(()()) ((())) () ((())()())'", "[2, 3, 1, 3]" ], [ "'() (()) ((())) (((())))'", "[1, 2, 3, 4]" ], [ "'(()(())((())))'", "[4]" ] ]
[ "from typing import List" ]
pth = 0 for c in s: if c == '(': depth += 1 max_depth = max(depth, max_depth) else: dept
h -= 1 return max_depth return [parse_paren_group(x) for x in paren_string.split(' ') if x]
python
Input to this function is a string represented multiple groups for nested parentheses separated by spaces. For each of the group, output the deepest level of nesting of parentheses. E.g. (()()) has maximum two levels of nesting while ((())) has three.
[]
from typing import List def parse_nested_parens(paren_string: str) -> List[int]: """ Input to this function is a string represented multiple groups for nested parentheses separated by spaces. For each of the group, output the deepest level of nesting of parentheses. E.g. (()()) has maximum two levels of nesting while ((())) has three. """ def parse_paren_group(s): depth = 0 max_de
[ [ "'(()()) ((())) () ((())()())'", "[2, 3, 1, 3]" ] ]
RandomSpanInfilling/HumanEval/6/8
python
code_infilling
HumanEval_RandomSpanInfilling
parse_nested_parens
[ [ "'(()()) ((())) () ((())()())'", "[2, 3, 1, 3]" ], [ "'() (()) ((())) (((())))'", "[1, 2, 3, 4]" ], [ "'(()(())((())))'", "[4]" ] ]
[ "from typing import List" ]
max_depth = 0 for c in s: if c == '(': depth += 1 max_depth = max(depth, max_depth) else: depth -= 1
return max_depth return [parse_paren_group(x) for x in paren_string.split(' ') if x]
python
Input to this function is a string represented multiple groups for nested parentheses separated by spaces. For each of the group, output the deepest level of nesting of parentheses. E.g. (()()) has maximum two levels of nesting while ((())) has three.
[]
from typing import List def parse_nested_parens(paren_string: str) -> List[int]: """ Input to this function is a string represented multiple groups for nested parentheses separated by spaces. For each of the group, output the deepest level of nesting of parentheses. E.g. (()()) has maximum two levels of nesting while ((())) has three. """ def parse_paren_group(s): depth = 0
[ [ "'(()()) ((())) () ((())()())'", "[2, 3, 1, 3]" ] ]
RandomSpanInfilling/HumanEval/6/9
python
code_infilling
HumanEval_RandomSpanInfilling
parse_nested_parens
[ [ "'(()()) ((())) () ((())()())'", "[2, 3, 1, 3]" ], [ "'() (()) ((())) (((())))'", "[1, 2, 3, 4]" ], [ "'(()(())((())))'", "[4]" ] ]
[ "from typing import List" ]
if c == '(': depth += 1 max_depth = max(depth, max_depth) else:
depth -= 1 return max_depth return [parse_paren_group(x) for x in paren_string.split(' ') if x]
python
Input to this function is a string represented multiple groups for nested parentheses separated by spaces. For each of the group, output the deepest level of nesting of parentheses. E.g. (()()) has maximum two levels of nesting while ((())) has three.
[]
from typing import List def parse_nested_parens(paren_string: str) -> List[int]: """ Input to this function is a string represented multiple groups for nested parentheses separated by spaces. For each of the group, output the deepest level of nesting of parentheses. E.g. (()()) has maximum two levels of nesting while ((())) has three. """ def parse_paren_group(s): depth = 0 max_depth = 0 for c in s:
[ [ "'(()()) ((())) () ((())()())'", "[2, 3, 1, 3]" ] ]
RandomSpanInfilling/HumanEval/6/10
python
code_infilling
HumanEval_RandomSpanInfilling
parse_nested_parens
[ [ "[], 'john'", "[]" ], [ "['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx'", "['xxx', 'xxxAAA', 'xxx']" ], [ "['xxx', 'asd', 'aaaxxy', 'john doe', 'xxxAAA', 'xxx'], 'xx'", "['xxx', 'aaaxxy', 'xxxAAA', 'xxx']" ], [ "['grunt', 'trumpet', 'prune', 'gruesome'], 'run'", "['grunt', 'prune']" ] ]
[ "from typing import List" ]
strings if su
bstring in x]
python
Filter an input list of strings only for ones that contain given substring
[]
from typing import List def filter_by_substring(strings: List[str], substring: str) -> List[str]: """ Filter an input list of strings only for ones that contain given substring """ return [x for x in
[ [ "[], 'a'", "[]" ], [ "['abc', 'bacd', 'cde', 'array'], 'a'", "['abc', 'bacd', 'array']" ] ]
RandomSpanInfilling/HumanEval/7/1
python
code_infilling
HumanEval_RandomSpanInfilling
filter_by_substring
[ [ "[], 'john'", "[]" ], [ "['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx'", "['xxx', 'xxxAAA', 'xxx']" ], [ "['xxx', 'asd', 'aaaxxy', 'john doe', 'xxxAAA', 'xxx'], 'xx'", "['xxx', 'aaaxxy', 'xxxAAA', 'xxx']" ], [ "['grunt', 'trumpet', 'prune', 'gruesome'], 'run'", "['grunt', 'prune']" ] ]
[ "from typing import List" ]
tring
in x]
python
Filter an input list of strings only for ones that contain given substring
[]
from typing import List def filter_by_substring(strings: List[str], substring: str) -> List[str]: """ Filter an input list of strings only for ones that contain given substring """ return [x for x in strings if subs
[ [ "[], 'a'", "[]" ], [ "['abc', 'bacd', 'cde', 'array'], 'a'", "['abc', 'bacd', 'array']" ] ]
RandomSpanInfilling/HumanEval/7/2
python
code_infilling
HumanEval_RandomSpanInfilling
filter_by_substring
[ [ "[], 'john'", "[]" ], [ "['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx'", "['xxx', 'xxxAAA', 'xxx']" ], [ "['xxx', 'asd', 'aaaxxy', 'john doe', 'xxxAAA', 'xxx'], 'xx'", "['xxx', 'aaaxxy', 'xxxAAA', 'xxx']" ], [ "['grunt', 'trumpet', 'prune', 'gruesome'], 'run'", "['grunt', 'prune']" ] ]
[ "from typing import List" ]
for x in strings if substrin
g in x]
python
Filter an input list of strings only for ones that contain given substring
[]
from typing import List def filter_by_substring(strings: List[str], substring: str) -> List[str]: """ Filter an input list of strings only for ones that contain given substring """ return [x
[ [ "[], 'a'", "[]" ], [ "['abc', 'bacd', 'cde', 'array'], 'a'", "['abc', 'bacd', 'array']" ] ]
RandomSpanInfilling/HumanEval/7/3
python
code_infilling
HumanEval_RandomSpanInfilling
filter_by_substring
[ [ "[], 'john'", "[]" ], [ "['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx'", "['xxx', 'xxxAAA', 'xxx']" ], [ "['xxx', 'asd', 'aaaxxy', 'john doe', 'xxxAAA', 'xxx'], 'xx'", "['xxx', 'aaaxxy', 'xxxAAA', 'xxx']" ], [ "['grunt', 'trumpet', 'prune', 'gruesome'], 'run'", "['grunt', 'prune']" ] ]
[ "from typing import List" ]
gs if s
ubstring in x]
python
Filter an input list of strings only for ones that contain given substring
[]
from typing import List def filter_by_substring(strings: List[str], substring: str) -> List[str]: """ Filter an input list of strings only for ones that contain given substring """ return [x for x in strin
[ [ "[], 'a'", "[]" ], [ "['abc', 'bacd', 'cde', 'array'], 'a'", "['abc', 'bacd', 'array']" ] ]
RandomSpanInfilling/HumanEval/7/4
python
code_infilling
HumanEval_RandomSpanInfilling
filter_by_substring
[ [ "[], 'john'", "[]" ], [ "['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx'", "['xxx', 'xxxAAA', 'xxx']" ], [ "['xxx', 'asd', 'aaaxxy', 'john doe', 'xxxAAA', 'xxx'], 'xx'", "['xxx', 'aaaxxy', 'xxxAAA', 'xxx']" ], [ "['grunt', 'trumpet', 'prune', 'gruesome'], 'run'", "['grunt', 'prune']" ] ]
[ "from typing import List" ]
x for x in strings
if substring in x]
python
Filter an input list of strings only for ones that contain given substring
[]
from typing import List def filter_by_substring(strings: List[str], substring: str) -> List[str]: """ Filter an input list of strings only for ones that contain given substring """ return [
[ [ "[], 'a'", "[]" ], [ "['abc', 'bacd', 'cde', 'array'], 'a'", "['abc', 'bacd', 'array']" ] ]
RandomSpanInfilling/HumanEval/7/5
python
code_infilling
HumanEval_RandomSpanInfilling
filter_by_substring
[ [ "[], 'john'", "[]" ], [ "['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx'", "['xxx', 'xxxAAA', 'xxx']" ], [ "['xxx', 'asd', 'aaaxxy', 'john doe', 'xxxAAA', 'xxx'], 'xx'", "['xxx', 'aaaxxy', 'xxxAAA', 'xxx']" ], [ "['grunt', 'trumpet', 'prune', 'gruesome'], 'run'", "['grunt', 'prune']" ] ]
[ "from typing import List" ]
turn [x for x in strings if substring in x]
python
Filter an input list of strings only for ones that contain given substring
[]
from typing import List def filter_by_substring(strings: List[str], substring: str) -> List[str]: """ Filter an input list of strings only for ones that contain given substring """ re
[ [ "[], 'a'", "[]" ], [ "['abc', 'bacd', 'cde', 'array'], 'a'", "['abc', 'bacd', 'array']" ] ]
RandomSpanInfilling/HumanEval/7/6
python
code_infilling
HumanEval_RandomSpanInfilling
filter_by_substring
[ [ "[], 'john'", "[]" ], [ "['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx'", "['xxx', 'xxxAAA', 'xxx']" ], [ "['xxx', 'asd', 'aaaxxy', 'john doe', 'xxxAAA', 'xxx'], 'xx'", "['xxx', 'aaaxxy', 'xxxAAA', 'xxx']" ], [ "['grunt', 'trumpet', 'prune', 'gruesome'], 'run'", "['grunt', 'prune']" ] ]
[ "from typing import List" ]
n stri
ngs if substring in x]
python
Filter an input list of strings only for ones that contain given substring
[]
from typing import List def filter_by_substring(strings: List[str], substring: str) -> List[str]: """ Filter an input list of strings only for ones that contain given substring """ return [x for x i
[ [ "[], 'a'", "[]" ], [ "['abc', 'bacd', 'cde', 'array'], 'a'", "['abc', 'bacd', 'array']" ] ]
RandomSpanInfilling/HumanEval/7/7
python
code_infilling
HumanEval_RandomSpanInfilling
filter_by_substring
[ [ "[], 'john'", "[]" ], [ "['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx'", "['xxx', 'xxxAAA', 'xxx']" ], [ "['xxx', 'asd', 'aaaxxy', 'john doe', 'xxxAAA', 'xxx'], 'xx'", "['xxx', 'aaaxxy', 'xxxAAA', 'xxx']" ], [ "['grunt', 'trumpet', 'prune', 'gruesome'], 'run'", "['grunt', 'prune']" ] ]
[ "from typing import List" ]
return [x for x in strings if substri
ng in x]
python
Filter an input list of strings only for ones that contain given substring
[]
from typing import List def filter_by_substring(strings: List[str], substring: str) -> List[str]: """ Filter an input list of strings only for ones that contain given substring """
[ [ "[], 'a'", "[]" ], [ "['abc', 'bacd', 'cde', 'array'], 'a'", "['abc', 'bacd', 'array']" ] ]
RandomSpanInfilling/HumanEval/7/8
python
code_infilling
HumanEval_RandomSpanInfilling
filter_by_substring
[ [ "[], 'john'", "[]" ], [ "['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx'", "['xxx', 'xxxAAA', 'xxx']" ], [ "['xxx', 'asd', 'aaaxxy', 'john doe', 'xxxAAA', 'xxx'], 'xx'", "['xxx', 'aaaxxy', 'xxxAAA', 'xxx']" ], [ "['grunt', 'trumpet', 'prune', 'gruesome'], 'run'", "['grunt', 'prune']" ] ]
[ "from typing import List" ]
eturn [x for x in strings if substring
in x]
python
Filter an input list of strings only for ones that contain given substring
[]
from typing import List def filter_by_substring(strings: List[str], substring: str) -> List[str]: """ Filter an input list of strings only for ones that contain given substring """ r
[ [ "[], 'a'", "[]" ], [ "['abc', 'bacd', 'cde', 'array'], 'a'", "['abc', 'bacd', 'array']" ] ]
RandomSpanInfilling/HumanEval/7/9
python
code_infilling
HumanEval_RandomSpanInfilling
filter_by_substring
[ [ "[], 'john'", "[]" ], [ "['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx'", "['xxx', 'xxxAAA', 'xxx']" ], [ "['xxx', 'asd', 'aaaxxy', 'john doe', 'xxxAAA', 'xxx'], 'xx'", "['xxx', 'aaaxxy', 'xxxAAA', 'xxx']" ], [ "['grunt', 'trumpet', 'prune', 'gruesome'], 'run'", "['grunt', 'prune']" ] ]
[ "from typing import List" ]
ngs if substring in x]
python
Filter an input list of strings only for ones that contain given substring
[]
from typing import List def filter_by_substring(strings: List[str], substring: str) -> List[str]: """ Filter an input list of strings only for ones that contain given substring """ return [x for x in stri
[ [ "[], 'a'", "[]" ], [ "['abc', 'bacd', 'cde', 'array'], 'a'", "['abc', 'bacd', 'array']" ] ]
RandomSpanInfilling/HumanEval/7/10
python
code_infilling
HumanEval_RandomSpanInfilling
filter_by_substring
[ [ "[]", "(0, 1)" ], [ "[1, 1, 1]", "(3, 1)" ], [ "[100, 0]", "(100, 0)" ], [ "[3, 5, 7]", "(3 + 5 + 7, 3 * 5 * 7)" ], [ "[10]", "(10, 10)" ] ]
[ "from typing import List, Tuple" ]
or n in numbers: sum_value += n prod_value *= n
return sum_value, prod_value
python
For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. >>> sum_product([]) (0, 1)
[]
from typing import List, Tuple def sum_product(numbers: List[int]) -> Tuple[int, int]: """ For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. >>> sum_product([]) (0, 1) """ sum_value = 0 prod_value = 1 f
[ [ "[]", "(0, 1)" ], [ "[1, 2, 3, 4]", "(10, 24)" ] ]
RandomSpanInfilling/HumanEval/8/1
python
code_infilling
HumanEval_RandomSpanInfilling
sum_product
[ [ "[]", "(0, 1)" ], [ "[1, 1, 1]", "(3, 1)" ], [ "[100, 0]", "(100, 0)" ], [ "[3, 5, 7]", "(3 + 5 + 7, 3 * 5 * 7)" ], [ "[10]", "(10, 10)" ] ]
[ "from typing import List, Tuple" ]
lue = 1 for n in numbers: sum_value += n
prod_value *= n return sum_value, prod_value
python
For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. >>> sum_product([]) (0, 1)
[]
from typing import List, Tuple def sum_product(numbers: List[int]) -> Tuple[int, int]: """ For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. >>> sum_product([]) (0, 1) """ sum_value = 0 prod_va
[ [ "[]", "(0, 1)" ], [ "[1, 2, 3, 4]", "(10, 24)" ] ]
RandomSpanInfilling/HumanEval/8/2
python
code_infilling
HumanEval_RandomSpanInfilling
sum_product
[ [ "[]", "(0, 1)" ], [ "[1, 1, 1]", "(3, 1)" ], [ "[100, 0]", "(100, 0)" ], [ "[3, 5, 7]", "(3 + 5 + 7, 3 * 5 * 7)" ], [ "[10]", "(10, 10)" ] ]
[ "from typing import List, Tuple" ]
lue += n prod_value *= n return sum_value
, prod_value
python
For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. >>> sum_product([]) (0, 1)
[]
from typing import List, Tuple def sum_product(numbers: List[int]) -> Tuple[int, int]: """ For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. >>> sum_product([]) (0, 1) """ sum_value = 0 prod_value = 1 for n in numbers: sum_va
[ [ "[]", "(0, 1)" ], [ "[1, 2, 3, 4]", "(10, 24)" ] ]
RandomSpanInfilling/HumanEval/8/3
python
code_infilling
HumanEval_RandomSpanInfilling
sum_product
[ [ "[]", "(0, 1)" ], [ "[1, 1, 1]", "(3, 1)" ], [ "[100, 0]", "(100, 0)" ], [ "[3, 5, 7]", "(3 + 5 + 7, 3 * 5 * 7)" ], [ "[10]", "(10, 10)" ] ]
[ "from typing import List, Tuple" ]
prod_value *= n return sum_value,
prod_value
python
For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. >>> sum_product([]) (0, 1)
[]
from typing import List, Tuple def sum_product(numbers: List[int]) -> Tuple[int, int]: """ For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. >>> sum_product([]) (0, 1) """ sum_value = 0 prod_value = 1 for n in numbers: sum_value += n
[ [ "[]", "(0, 1)" ], [ "[1, 2, 3, 4]", "(10, 24)" ] ]
RandomSpanInfilling/HumanEval/8/4
python
code_infilling
HumanEval_RandomSpanInfilling
sum_product
[ [ "[]", "(0, 1)" ], [ "[1, 1, 1]", "(3, 1)" ], [ "[100, 0]", "(100, 0)" ], [ "[3, 5, 7]", "(3 + 5 + 7, 3 * 5 * 7)" ], [ "[10]", "(10, 10)" ] ]
[ "from typing import List, Tuple" ]
_value = 1 for n in numbers: sum_value += n prod_value *= n return su
m_value, prod_value
python
For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. >>> sum_product([]) (0, 1)
[]
from typing import List, Tuple def sum_product(numbers: List[int]) -> Tuple[int, int]: """ For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. >>> sum_product([]) (0, 1) """ sum_value = 0 prod
[ [ "[]", "(0, 1)" ], [ "[1, 2, 3, 4]", "(10, 24)" ] ]
RandomSpanInfilling/HumanEval/8/5
python
code_infilling
HumanEval_RandomSpanInfilling
sum_product
[ [ "[]", "(0, 1)" ], [ "[1, 1, 1]", "(3, 1)" ], [ "[100, 0]", "(100, 0)" ], [ "[3, 5, 7]", "(3 + 5 + 7, 3 * 5 * 7)" ], [ "[10]", "(10, 10)" ] ]
[ "from typing import List, Tuple" ]
rn su
m_value, prod_value
python
For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. >>> sum_product([]) (0, 1)
[]
from typing import List, Tuple def sum_product(numbers: List[int]) -> Tuple[int, int]: """ For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. >>> sum_product([]) (0, 1) """ sum_value = 0 prod_value = 1 for n in numbers: sum_value += n prod_value *= n retu
[ [ "[]", "(0, 1)" ], [ "[1, 2, 3, 4]", "(10, 24)" ] ]
RandomSpanInfilling/HumanEval/8/6
python
code_infilling
HumanEval_RandomSpanInfilling
sum_product
[ [ "[]", "(0, 1)" ], [ "[1, 1, 1]", "(3, 1)" ], [ "[100, 0]", "(100, 0)" ], [ "[3, 5, 7]", "(3 + 5 + 7, 3 * 5 * 7)" ], [ "[10]", "(10, 10)" ] ]
[ "from typing import List, Tuple" ]
sum_value = 0 prod_value = 1 for n in numbers: sum_value += n prod_value
*= n return sum_value, prod_value
python
For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. >>> sum_product([]) (0, 1)
[]
from typing import List, Tuple def sum_product(numbers: List[int]) -> Tuple[int, int]: """ For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. >>> sum_product([]) (0, 1) """
[ [ "[]", "(0, 1)" ], [ "[1, 2, 3, 4]", "(10, 24)" ] ]
RandomSpanInfilling/HumanEval/8/7
python
code_infilling
HumanEval_RandomSpanInfilling
sum_product
[ [ "[]", "(0, 1)" ], [ "[1, 1, 1]", "(3, 1)" ], [ "[100, 0]", "(100, 0)" ], [ "[3, 5, 7]", "(3 + 5 + 7, 3 * 5 * 7)" ], [ "[10]", "(10, 10)" ] ]
[ "from typing import List, Tuple" ]
sum_value += n prod_value *= n return sum_value, prod_va
lue
python
For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. >>> sum_product([]) (0, 1)
[]
from typing import List, Tuple def sum_product(numbers: List[int]) -> Tuple[int, int]: """ For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. >>> sum_product([]) (0, 1) """ sum_value = 0 prod_value = 1 for n in numbers:
[ [ "[]", "(0, 1)" ], [ "[1, 2, 3, 4]", "(10, 24)" ] ]
RandomSpanInfilling/HumanEval/8/8
python
code_infilling
HumanEval_RandomSpanInfilling
sum_product
[ [ "[]", "(0, 1)" ], [ "[1, 1, 1]", "(3, 1)" ], [ "[100, 0]", "(100, 0)" ], [ "[3, 5, 7]", "(3 + 5 + 7, 3 * 5 * 7)" ], [ "[10]", "(10, 10)" ] ]
[ "from typing import List, Tuple" ]
numbers
: sum_value += n prod_value *= n return sum_value, prod_value
python
For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. >>> sum_product([]) (0, 1)
[]
from typing import List, Tuple def sum_product(numbers: List[int]) -> Tuple[int, int]: """ For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. >>> sum_product([]) (0, 1) """ sum_value = 0 prod_value = 1 for n in
[ [ "[]", "(0, 1)" ], [ "[1, 2, 3, 4]", "(10, 24)" ] ]
RandomSpanInfilling/HumanEval/8/9
python
code_infilling
HumanEval_RandomSpanInfilling
sum_product
[ [ "[]", "(0, 1)" ], [ "[1, 1, 1]", "(3, 1)" ], [ "[100, 0]", "(100, 0)" ], [ "[3, 5, 7]", "(3 + 5 + 7, 3 * 5 * 7)" ], [ "[10]", "(10, 10)" ] ]
[ "from typing import List, Tuple" ]
_value *= n return
sum_value, prod_value
python
For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. >>> sum_product([]) (0, 1)
[]
from typing import List, Tuple def sum_product(numbers: List[int]) -> Tuple[int, int]: """ For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. >>> sum_product([]) (0, 1) """ sum_value = 0 prod_value = 1 for n in numbers: sum_value += n prod
[ [ "[]", "(0, 1)" ], [ "[1, 2, 3, 4]", "(10, 24)" ] ]
RandomSpanInfilling/HumanEval/8/10
python
code_infilling
HumanEval_RandomSpanInfilling
sum_product
[ [ "[]", "[]" ], [ "[1, 2, 3, 4]", "[1, 2, 3, 4]" ], [ "[4, 3, 2, 1]", "[4, 4, 4, 4]" ], [ "[3, 2, 3, 100, 3]", "[3, 3, 3, 100, 100]" ] ]
[ "from typing import List, Tuple" ]
x) return re
sult
python
From a given list of integers, generate a list of rolling maximum element found until given moment in the sequence.
[]
from typing import List, Tuple def rolling_max(numbers: List[int]) -> List[int]: """ From a given list of integers, generate a list of rolling maximum element found until given moment in the sequence. """ running_max = None result = [] for n in numbers: if running_max is None: running_max = n else: running_max = max(running_max, n) result.append(running_ma
[ [ "[1, 2, 3, 2, 3, 4, 2]", "[1, 2, 3, 3, 3, 4, 4]" ] ]
RandomSpanInfilling/HumanEval/9/1
python
code_infilling
HumanEval_RandomSpanInfilling
rolling_max
[ [ "[]", "[]" ], [ "[1, 2, 3, 4]", "[1, 2, 3, 4]" ], [ "[4, 3, 2, 1]", "[4, 4, 4, 4]" ], [ "[3, 2, 3, 100, 3]", "[3, 3, 3, 100, 100]" ] ]
[ "from typing import List, Tuple" ]
g_max = n else: running_max = max(running_max,
n) result.append(running_max) return result
python
From a given list of integers, generate a list of rolling maximum element found until given moment in the sequence.
[]
from typing import List, Tuple def rolling_max(numbers: List[int]) -> List[int]: """ From a given list of integers, generate a list of rolling maximum element found until given moment in the sequence. """ running_max = None result = [] for n in numbers: if running_max is None: runnin
[ [ "[1, 2, 3, 2, 3, 4, 2]", "[1, 2, 3, 3, 3, 4, 4]" ] ]
RandomSpanInfilling/HumanEval/9/2
python
code_infilling
HumanEval_RandomSpanInfilling
rolling_max
[ [ "[]", "[]" ], [ "[1, 2, 3, 4]", "[1, 2, 3, 4]" ], [ "[4, 3, 2, 1]", "[4, 4, 4, 4]" ], [ "[3, 2, 3, 100, 3]", "[3, 3, 3, 100, 100]" ] ]
[ "from typing import List, Tuple" ]
if running_max is None: running_max = n else: running_max = max(running_max, n)
result.append(running_max) return result
python
From a given list of integers, generate a list of rolling maximum element found until given moment in the sequence.
[]
from typing import List, Tuple def rolling_max(numbers: List[int]) -> List[int]: """ From a given list of integers, generate a list of rolling maximum element found until given moment in the sequence. """ running_max = None result = [] for n in numbers:
[ [ "[1, 2, 3, 2, 3, 4, 2]", "[1, 2, 3, 3, 3, 4, 4]" ] ]
RandomSpanInfilling/HumanEval/9/3
python
code_infilling
HumanEval_RandomSpanInfilling
rolling_max
[ [ "[]", "[]" ], [ "[1, 2, 3, 4]", "[1, 2, 3, 4]" ], [ "[4, 3, 2, 1]", "[4, 4, 4, 4]" ], [ "[3, 2, 3, 100, 3]", "[3, 3, 3, 100, 100]" ] ]
[ "from typing import List, Tuple" ]
_max = None result = [] for n i
n numbers: if running_max is None: running_max = n else: running_max = max(running_max, n) result.append(running_max) return result
python
From a given list of integers, generate a list of rolling maximum element found until given moment in the sequence.
[]
from typing import List, Tuple def rolling_max(numbers: List[int]) -> List[int]: """ From a given list of integers, generate a list of rolling maximum element found until given moment in the sequence. """ running
[ [ "[1, 2, 3, 2, 3, 4, 2]", "[1, 2, 3, 3, 3, 4, 4]" ] ]
RandomSpanInfilling/HumanEval/9/4
python
code_infilling
HumanEval_RandomSpanInfilling
rolling_max
[ [ "[]", "[]" ], [ "[1, 2, 3, 4]", "[1, 2, 3, 4]" ], [ "[4, 3, 2, 1]", "[4, 4, 4, 4]" ], [ "[3, 2, 3, 100, 3]", "[3, 3, 3, 100, 100]" ] ]
[ "from typing import List, Tuple" ]
for n in numbers: if running_max is None: running_max = n
else: running_max = max(running_max, n) result.append(running_max) return result
python
From a given list of integers, generate a list of rolling maximum element found until given moment in the sequence.
[]
from typing import List, Tuple def rolling_max(numbers: List[int]) -> List[int]: """ From a given list of integers, generate a list of rolling maximum element found until given moment in the sequence. """ running_max = None result = []
[ [ "[1, 2, 3, 2, 3, 4, 2]", "[1, 2, 3, 3, 3, 4, 4]" ] ]
RandomSpanInfilling/HumanEval/9/5
python
code_infilling
HumanEval_RandomSpanInfilling
rolling_max
[ [ "[]", "[]" ], [ "[1, 2, 3, 4]", "[1, 2, 3, 4]" ], [ "[4, 3, 2, 1]", "[4, 4, 4, 4]" ], [ "[3, 2, 3, 100, 3]", "[3, 3, 3, 100, 100]" ] ]
[ "from typing import List, Tuple" ]
g_max = n
else: running_max = max(running_max, n) result.append(running_max) return result
python
From a given list of integers, generate a list of rolling maximum element found until given moment in the sequence.
[]
from typing import List, Tuple def rolling_max(numbers: List[int]) -> List[int]: """ From a given list of integers, generate a list of rolling maximum element found until given moment in the sequence. """ running_max = None result = [] for n in numbers: if running_max is None: runnin
[ [ "[1, 2, 3, 2, 3, 4, 2]", "[1, 2, 3, 3, 3, 4, 4]" ] ]
RandomSpanInfilling/HumanEval/9/6
python
code_infilling
HumanEval_RandomSpanInfilling
rolling_max
[ [ "[]", "[]" ], [ "[1, 2, 3, 4]", "[1, 2, 3, 4]" ], [ "[4, 3, 2, 1]", "[4, 4, 4, 4]" ], [ "[3, 2, 3, 100, 3]", "[3, 3, 3, 100, 100]" ] ]
[ "from typing import List, Tuple" ]
runnin
g_max = n else: running_max = max(running_max, n) result.append(running_max) return result
python
From a given list of integers, generate a list of rolling maximum element found until given moment in the sequence.
[]
from typing import List, Tuple def rolling_max(numbers: List[int]) -> List[int]: """ From a given list of integers, generate a list of rolling maximum element found until given moment in the sequence. """ running_max = None result = [] for n in numbers: if running_max is None:
[ [ "[1, 2, 3, 2, 3, 4, 2]", "[1, 2, 3, 3, 3, 4, 4]" ] ]
RandomSpanInfilling/HumanEval/9/7
python
code_infilling
HumanEval_RandomSpanInfilling
rolling_max
[ [ "[]", "[]" ], [ "[1, 2, 3, 4]", "[1, 2, 3, 4]" ], [ "[4, 3, 2, 1]", "[4, 4, 4, 4]" ], [ "[3, 2, 3, 100, 3]", "[3, 3, 3, 100, 100]" ] ]
[ "from typing import List, Tuple" ]
_max is None: running_max = n else: running_max = max(running_max, n)
result.append(running_max) return result
python
From a given list of integers, generate a list of rolling maximum element found until given moment in the sequence.
[]
from typing import List, Tuple def rolling_max(numbers: List[int]) -> List[int]: """ From a given list of integers, generate a list of rolling maximum element found until given moment in the sequence. """ running_max = None result = [] for n in numbers: if running
[ [ "[1, 2, 3, 2, 3, 4, 2]", "[1, 2, 3, 3, 3, 4, 4]" ] ]
RandomSpanInfilling/HumanEval/9/8
python
code_infilling
HumanEval_RandomSpanInfilling
rolling_max
[ [ "[]", "[]" ], [ "[1, 2, 3, 4]", "[1, 2, 3, 4]" ], [ "[4, 3, 2, 1]", "[4, 4, 4, 4]" ], [ "[3, 2, 3, 100, 3]", "[3, 3, 3, 100, 100]" ] ]
[ "from typing import List, Tuple" ]
g_max = n else: running_max = max(running_max, n)
result.append(running_max) return result
python
From a given list of integers, generate a list of rolling maximum element found until given moment in the sequence.
[]
from typing import List, Tuple def rolling_max(numbers: List[int]) -> List[int]: """ From a given list of integers, generate a list of rolling maximum element found until given moment in the sequence. """ running_max = None result = [] for n in numbers: if running_max is None: runnin
[ [ "[1, 2, 3, 2, 3, 4, 2]", "[1, 2, 3, 3, 3, 4, 4]" ] ]
RandomSpanInfilling/HumanEval/9/9
python
code_infilling
HumanEval_RandomSpanInfilling
rolling_max
[ [ "[]", "[]" ], [ "[1, 2, 3, 4]", "[1, 2, 3, 4]" ], [ "[4, 3, 2, 1]", "[4, 4, 4, 4]" ], [ "[3, 2, 3, 100, 3]", "[3, 3, 3, 100, 100]" ] ]
[ "from typing import List, Tuple" ]
running_max = None result = [] for n in numbers: if running_max is None: running_max = n
else: running_max = max(running_max, n) result.append(running_max) return result
python
From a given list of integers, generate a list of rolling maximum element found until given moment in the sequence.
[]
from typing import List, Tuple def rolling_max(numbers: List[int]) -> List[int]: """ From a given list of integers, generate a list of rolling maximum element found until given moment in the sequence. """
[ [ "[1, 2, 3, 2, 3, 4, 2]", "[1, 2, 3, 3, 3, 4, 4]" ] ]
RandomSpanInfilling/HumanEval/9/10
python
code_infilling
HumanEval_RandomSpanInfilling
rolling_max
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
35