prefix
stringlengths 65
1.8k
| suffix
stringclasses 839
values | solution
stringlengths 6
859
| test_cases
listlengths 0
100
| import_str
listlengths 0
1
| demos
listlengths 0
8
| entry_func
stringclasses 158
values | data_id
stringlengths 36
40
| doc_string
stringclasses 164
values | dataset_name
stringclasses 1
value | task_name
stringclasses 1
value | compare_func
listlengths 0
0
| src_lang
stringclasses 1
value | tgt_lang
stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
from typing import List
def 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.
"""
|
else:
depth -= 1
return max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
def parse_paren_group(s):
depth = 0
max_depth = 0
for c in s:
if c == '(':
depth += 1
max_depth = max(depth, max_depth)
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L0_L6
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.
"""
|
depth -= 1
return max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
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:
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L0_L7
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.
"""
|
return max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
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
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L0_L8
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.
"""
|
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
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
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L0_L10
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L0_L12
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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):
|
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]
|
depth = 0
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L1_L1
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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):
|
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]
|
depth = 0
max_depth = 0
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L1_L2
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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):
|
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]
|
depth = 0
max_depth = 0
for c in s:
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L1_L3
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 += 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]
|
depth = 0
max_depth = 0
for c in s:
if c == '(':
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L1_L4
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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):
|
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]
|
depth = 0
max_depth = 0
for c in s:
if c == '(':
depth += 1
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L1_L5
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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):
|
else:
depth -= 1
return max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
depth = 0
max_depth = 0
for c in s:
if c == '(':
depth += 1
max_depth = max(depth, max_depth)
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L1_L6
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 -= 1
return max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
depth = 0
max_depth = 0
for c in s:
if c == '(':
depth += 1
max_depth = max(depth, max_depth)
else:
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L1_L7
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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):
|
return max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
depth = 0
max_depth = 0
for c in s:
if c == '(':
depth += 1
max_depth = max(depth, max_depth)
else:
depth -= 1
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L1_L8
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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):
|
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
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
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L1_L10
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L1_L12
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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
|
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]
|
max_depth = 0
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L2_L2
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
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]
|
max_depth = 0
for c in s:
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L2_L3
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
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]
|
max_depth = 0
for c in s:
if c == '(':
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L2_L4
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = max(depth, max_depth)
else:
depth -= 1
return max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
max_depth = 0
for c in s:
if c == '(':
depth += 1
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L2_L5
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
else:
depth -= 1
return max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
max_depth = 0
for c in s:
if c == '(':
depth += 1
max_depth = max(depth, max_depth)
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L2_L6
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
depth -= 1
return max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
max_depth = 0
for c in s:
if c == '(':
depth += 1
max_depth = max(depth, max_depth)
else:
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L2_L7
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
return max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
max_depth = 0
for c in s:
if c == '(':
depth += 1
max_depth = max(depth, max_depth)
else:
depth -= 1
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L2_L8
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
max_depth = 0
for c in s:
if c == '(':
depth += 1
max_depth = max(depth, max_depth)
else:
depth -= 1
return max_depth
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L2_L10
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L2_L12
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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
|
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]
|
for c in s:
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L3_L3
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
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]
|
for c in s:
if c == '(':
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L3_L4
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
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]
|
for c in s:
if c == '(':
depth += 1
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L3_L5
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
else:
depth -= 1
return max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
for c in s:
if c == '(':
depth += 1
max_depth = max(depth, max_depth)
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L3_L6
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
depth -= 1
return max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
for c in s:
if c == '(':
depth += 1
max_depth = max(depth, max_depth)
else:
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L3_L7
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
return max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
for c in s:
if c == '(':
depth += 1
max_depth = max(depth, max_depth)
else:
depth -= 1
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L3_L8
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
for c in s:
if c == '(':
depth += 1
max_depth = max(depth, max_depth)
else:
depth -= 1
return max_depth
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L3_L10
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L3_L12
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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:
|
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]
|
if c == '(':
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L4_L4
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
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]
|
if c == '(':
depth += 1
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L4_L5
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
else:
depth -= 1
return max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
if c == '(':
depth += 1
max_depth = max(depth, max_depth)
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L4_L6
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
depth -= 1
return max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
if c == '(':
depth += 1
max_depth = max(depth, max_depth)
else:
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L4_L7
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
return max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
if c == '(':
depth += 1
max_depth = max(depth, max_depth)
else:
depth -= 1
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L4_L8
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
if c == '(':
depth += 1
max_depth = max(depth, max_depth)
else:
depth -= 1
return max_depth
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L4_L10
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L4_L12
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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 == '(':
|
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]
|
depth += 1
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L5_L5
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 == '(':
|
else:
depth -= 1
return max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
depth += 1
max_depth = max(depth, max_depth)
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L5_L6
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
return max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
depth += 1
max_depth = max(depth, max_depth)
else:
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L5_L7
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 == '(':
|
return max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
depth += 1
max_depth = max(depth, max_depth)
else:
depth -= 1
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L5_L8
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 == '(':
|
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
depth += 1
max_depth = max(depth, max_depth)
else:
depth -= 1
return max_depth
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L5_L10
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L5_L12
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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
|
else:
depth -= 1
return max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
max_depth = max(depth, max_depth)
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L6_L6
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
depth -= 1
return max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
max_depth = max(depth, max_depth)
else:
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L6_L7
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
return max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
max_depth = max(depth, max_depth)
else:
depth -= 1
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L6_L8
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
max_depth = max(depth, max_depth)
else:
depth -= 1
return max_depth
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L6_L10
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L6_L12
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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)
|
depth -= 1
return max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
else:
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L7_L7
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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)
|
return max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
else:
depth -= 1
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L7_L8
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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)
|
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
else:
depth -= 1
return max_depth
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L7_L10
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L7_L12
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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:
|
return max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
depth -= 1
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L8_L8
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
depth -= 1
return max_depth
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L8_L10
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L8_L12
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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 [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
return max_depth
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L10_L10
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 max_depth
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L10_L12
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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 max_depth
|
return [parse_paren_group(x) for x in paren_string.split(' ') if x]
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L12_L12
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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 substring in x]
|
[
[
"[], '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"
] |
[
[
"[], 'a'",
"[]"
],
[
"['abc', 'bacd', 'cde', 'array'], 'a'",
"['abc', 'bacd', 'array']"
]
] |
filter_by_substring
|
MultiLineInfilling/HumanEval/7/L0_L0
|
Filter an input list of strings only for ones that contain given substring
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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)
"""
|
prod_value = 1
for n in numbers:
sum_value += n
prod_value *= n
return sum_value, prod_value
|
sum_value = 0
|
[
[
"[]",
"(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"
] |
[
[
"[]",
"(0, 1)"
],
[
"[1, 2, 3, 4]",
"(10, 24)"
]
] |
sum_product
|
MultiLineInfilling/HumanEval/8/L0_L0
|
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)
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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)
"""
|
for n in numbers:
sum_value += n
prod_value *= n
return sum_value, prod_value
|
sum_value = 0
prod_value = 1
|
[
[
"[]",
"(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"
] |
[
[
"[]",
"(0, 1)"
],
[
"[1, 2, 3, 4]",
"(10, 24)"
]
] |
sum_product
|
MultiLineInfilling/HumanEval/8/L0_L1
|
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)
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 += n
prod_value *= n
return sum_value, prod_value
|
sum_value = 0
prod_value = 1
for n in numbers:
|
[
[
"[]",
"(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"
] |
[
[
"[]",
"(0, 1)"
],
[
"[1, 2, 3, 4]",
"(10, 24)"
]
] |
sum_product
|
MultiLineInfilling/HumanEval/8/L0_L3
|
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)
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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)
"""
|
prod_value *= n
return sum_value, prod_value
|
sum_value = 0
prod_value = 1
for n in numbers:
sum_value += n
|
[
[
"[]",
"(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"
] |
[
[
"[]",
"(0, 1)"
],
[
"[1, 2, 3, 4]",
"(10, 24)"
]
] |
sum_product
|
MultiLineInfilling/HumanEval/8/L0_L4
|
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)
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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)
"""
|
return sum_value, prod_value
|
sum_value = 0
prod_value = 1
for n in numbers:
sum_value += n
prod_value *= n
|
[
[
"[]",
"(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"
] |
[
[
"[]",
"(0, 1)"
],
[
"[1, 2, 3, 4]",
"(10, 24)"
]
] |
sum_product
|
MultiLineInfilling/HumanEval/8/L0_L5
|
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)
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
return sum_value, prod_value
|
[
[
"[]",
"(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"
] |
[
[
"[]",
"(0, 1)"
],
[
"[1, 2, 3, 4]",
"(10, 24)"
]
] |
sum_product
|
MultiLineInfilling/HumanEval/8/L0_L6
|
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)
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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
|
for n in numbers:
sum_value += n
prod_value *= n
return sum_value, prod_value
|
prod_value = 1
|
[
[
"[]",
"(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"
] |
[
[
"[]",
"(0, 1)"
],
[
"[1, 2, 3, 4]",
"(10, 24)"
]
] |
sum_product
|
MultiLineInfilling/HumanEval/8/L1_L1
|
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)
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
sum_value += n
prod_value *= n
return sum_value, prod_value
|
prod_value = 1
for n in numbers:
|
[
[
"[]",
"(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"
] |
[
[
"[]",
"(0, 1)"
],
[
"[1, 2, 3, 4]",
"(10, 24)"
]
] |
sum_product
|
MultiLineInfilling/HumanEval/8/L1_L3
|
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)
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 *= n
return sum_value, prod_value
|
prod_value = 1
for n in numbers:
sum_value += n
|
[
[
"[]",
"(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"
] |
[
[
"[]",
"(0, 1)"
],
[
"[1, 2, 3, 4]",
"(10, 24)"
]
] |
sum_product
|
MultiLineInfilling/HumanEval/8/L1_L4
|
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)
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
return sum_value, prod_value
|
prod_value = 1
for n in numbers:
sum_value += n
prod_value *= n
|
[
[
"[]",
"(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"
] |
[
[
"[]",
"(0, 1)"
],
[
"[1, 2, 3, 4]",
"(10, 24)"
]
] |
sum_product
|
MultiLineInfilling/HumanEval/8/L1_L5
|
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)
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
return sum_value, prod_value
|
[
[
"[]",
"(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"
] |
[
[
"[]",
"(0, 1)"
],
[
"[1, 2, 3, 4]",
"(10, 24)"
]
] |
sum_product
|
MultiLineInfilling/HumanEval/8/L1_L6
|
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)
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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
|
sum_value += n
prod_value *= n
return sum_value, prod_value
|
for n in numbers:
|
[
[
"[]",
"(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"
] |
[
[
"[]",
"(0, 1)"
],
[
"[1, 2, 3, 4]",
"(10, 24)"
]
] |
sum_product
|
MultiLineInfilling/HumanEval/8/L3_L3
|
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)
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
prod_value *= n
return sum_value, prod_value
|
for n in numbers:
sum_value += n
|
[
[
"[]",
"(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"
] |
[
[
"[]",
"(0, 1)"
],
[
"[1, 2, 3, 4]",
"(10, 24)"
]
] |
sum_product
|
MultiLineInfilling/HumanEval/8/L3_L4
|
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)
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
return sum_value, prod_value
|
for n in numbers:
sum_value += n
prod_value *= n
|
[
[
"[]",
"(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"
] |
[
[
"[]",
"(0, 1)"
],
[
"[1, 2, 3, 4]",
"(10, 24)"
]
] |
sum_product
|
MultiLineInfilling/HumanEval/8/L3_L5
|
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)
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
return sum_value, prod_value
|
[
[
"[]",
"(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"
] |
[
[
"[]",
"(0, 1)"
],
[
"[1, 2, 3, 4]",
"(10, 24)"
]
] |
sum_product
|
MultiLineInfilling/HumanEval/8/L3_L6
|
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)
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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:
|
prod_value *= n
return sum_value, prod_value
|
sum_value += n
|
[
[
"[]",
"(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"
] |
[
[
"[]",
"(0, 1)"
],
[
"[1, 2, 3, 4]",
"(10, 24)"
]
] |
sum_product
|
MultiLineInfilling/HumanEval/8/L4_L4
|
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)
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
return sum_value, prod_value
|
sum_value += n
prod_value *= n
|
[
[
"[]",
"(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"
] |
[
[
"[]",
"(0, 1)"
],
[
"[1, 2, 3, 4]",
"(10, 24)"
]
] |
sum_product
|
MultiLineInfilling/HumanEval/8/L4_L5
|
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)
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
return sum_value, prod_value
|
[
[
"[]",
"(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"
] |
[
[
"[]",
"(0, 1)"
],
[
"[1, 2, 3, 4]",
"(10, 24)"
]
] |
sum_product
|
MultiLineInfilling/HumanEval/8/L4_L6
|
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)
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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
|
return sum_value, prod_value
|
prod_value *= n
|
[
[
"[]",
"(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"
] |
[
[
"[]",
"(0, 1)"
],
[
"[1, 2, 3, 4]",
"(10, 24)"
]
] |
sum_product
|
MultiLineInfilling/HumanEval/8/L5_L5
|
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)
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
return sum_value, prod_value
|
[
[
"[]",
"(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"
] |
[
[
"[]",
"(0, 1)"
],
[
"[1, 2, 3, 4]",
"(10, 24)"
]
] |
sum_product
|
MultiLineInfilling/HumanEval/8/L5_L6
|
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)
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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
|
return sum_value, prod_value
|
[
[
"[]",
"(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"
] |
[
[
"[]",
"(0, 1)"
],
[
"[1, 2, 3, 4]",
"(10, 24)"
]
] |
sum_product
|
MultiLineInfilling/HumanEval/8/L6_L6
|
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)
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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.
"""
|
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
|
running_max = None
|
[
[
"[]",
"[]"
],
[
"[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"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L0_L0
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.
"""
|
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
|
running_max = None
result = []
|
[
[
"[]",
"[]"
],
[
"[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"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L0_L1
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.
"""
|
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
return result
|
running_max = None
result = []
for n in numbers:
|
[
[
"[]",
"[]"
],
[
"[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"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L0_L3
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = n
else:
running_max = max(running_max, n)
result.append(running_max)
return result
|
running_max = None
result = []
for n in numbers:
if running_max is None:
|
[
[
"[]",
"[]"
],
[
"[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"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L0_L4
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.
"""
|
else:
running_max = max(running_max, n)
result.append(running_max)
return result
|
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
|
[
[
"[]",
"[]"
],
[
"[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"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L0_L5
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = max(running_max, n)
result.append(running_max)
return result
|
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
|
[
[
"[]",
"[]"
],
[
"[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"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L0_L6
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.
"""
|
result.append(running_max)
return result
|
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
|
[
[
"[]",
"[]"
],
[
"[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"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L0_L7
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.
"""
|
return result
|
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)
|
[
[
"[]",
"[]"
],
[
"[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"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L0_L9
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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_max)
return result
|
[
[
"[]",
"[]"
],
[
"[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"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L0_L11
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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
|
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
|
result = []
|
[
[
"[]",
"[]"
],
[
"[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"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L1_L1
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
return result
|
result = []
for n in numbers:
|
[
[
"[]",
"[]"
],
[
"[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"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L1_L3
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
return result
|
result = []
for n in numbers:
if running_max is None:
|
[
[
"[]",
"[]"
],
[
"[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"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L1_L4
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
else:
running_max = max(running_max, n)
result.append(running_max)
return result
|
result = []
for n in numbers:
if running_max is None:
running_max = n
|
[
[
"[]",
"[]"
],
[
"[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"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L1_L5
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
running_max = max(running_max, n)
result.append(running_max)
return result
|
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
|
[
[
"[]",
"[]"
],
[
"[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"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L1_L6
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.append(running_max)
return result
|
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
|
[
[
"[]",
"[]"
],
[
"[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"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L1_L7
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
return result
|
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
result.append(running_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"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L1_L9
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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_max)
return result
|
[
[
"[]",
"[]"
],
[
"[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"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L1_L11
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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 = []
|
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
return result
|
for n in numbers:
|
[
[
"[]",
"[]"
],
[
"[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"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L3_L3
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.