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 separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
|
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
return result
|
current_string.append(c)
elif c == ')':
current_depth -= 1
current_string.append(c)
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L7_L10
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
|
result.append(''.join(current_string))
current_string.clear()
return result
|
current_string.append(c)
elif c == ')':
current_depth -= 1
current_string.append(c)
if current_depth == 0:
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L7_L12
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
|
current_string.clear()
return result
|
current_string.append(c)
elif c == ')':
current_depth -= 1
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L7_L13
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
|
return result
|
current_string.append(c)
elif c == ')':
current_depth -= 1
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L7_L14
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
|
current_string.append(c)
elif c == ')':
current_depth -= 1
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
return result
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L7_L16
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
|
current_depth -= 1
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
return result
|
elif c == ')':
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L8_L8
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
|
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
return result
|
elif c == ')':
current_depth -= 1
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L8_L9
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
|
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
return result
|
elif c == ')':
current_depth -= 1
current_string.append(c)
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L8_L10
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
|
result.append(''.join(current_string))
current_string.clear()
return result
|
elif c == ')':
current_depth -= 1
current_string.append(c)
if current_depth == 0:
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L8_L12
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
|
current_string.clear()
return result
|
elif c == ')':
current_depth -= 1
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L8_L13
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
|
return result
|
elif c == ')':
current_depth -= 1
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L8_L14
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
|
elif c == ')':
current_depth -= 1
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
return result
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L8_L16
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
|
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
return result
|
current_depth -= 1
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L9_L9
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
|
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
return result
|
current_depth -= 1
current_string.append(c)
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L9_L10
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
|
result.append(''.join(current_string))
current_string.clear()
return result
|
current_depth -= 1
current_string.append(c)
if current_depth == 0:
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L9_L12
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
|
current_string.clear()
return result
|
current_depth -= 1
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L9_L13
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
|
return result
|
current_depth -= 1
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L9_L14
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
|
current_depth -= 1
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
return result
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L9_L16
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
current_depth -= 1
|
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
return result
|
current_string.append(c)
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L10_L10
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
current_depth -= 1
|
result.append(''.join(current_string))
current_string.clear()
return result
|
current_string.append(c)
if current_depth == 0:
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L10_L12
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
current_depth -= 1
|
current_string.clear()
return result
|
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L10_L13
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
current_depth -= 1
|
return result
|
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L10_L14
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
current_depth -= 1
|
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
return result
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L10_L16
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
current_depth -= 1
current_string.append(c)
|
result.append(''.join(current_string))
current_string.clear()
return result
|
if current_depth == 0:
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L12_L12
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
current_depth -= 1
current_string.append(c)
|
current_string.clear()
return result
|
if current_depth == 0:
result.append(''.join(current_string))
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L12_L13
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
current_depth -= 1
current_string.append(c)
|
return result
|
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L12_L14
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
current_depth -= 1
current_string.append(c)
|
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
return result
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L12_L16
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
current_depth -= 1
current_string.append(c)
if current_depth == 0:
|
current_string.clear()
return result
|
result.append(''.join(current_string))
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L13_L13
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
current_depth -= 1
current_string.append(c)
if current_depth == 0:
|
return result
|
result.append(''.join(current_string))
current_string.clear()
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L13_L14
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
current_depth -= 1
current_string.append(c)
if current_depth == 0:
|
result.append(''.join(current_string))
current_string.clear()
return result
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L13_L16
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
current_depth -= 1
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
|
return result
|
current_string.clear()
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L14_L14
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
current_depth -= 1
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
|
current_string.clear()
return result
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L14_L16
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
"""
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
current_depth -= 1
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
|
return result
|
[
[
"'(()()) ((())) () ((())()())'",
"[\n '(()())', '((()))', '()', '((())()())'\n ]"
],
[
"'() (()) ((())) (((())))'",
"[\n '()', '(())', '((()))', '(((())))'\n ]"
],
[
"'(()(())((())))'",
"[\n '(()(())((())))'\n ]"
],
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
[
"from typing import List"
] |
[
[
"'( ) (( )) (( )( ))'",
"['()', '(())', '(()())']"
]
] |
separate_paren_groups
|
MultiLineInfilling/HumanEval/1/L16_L16
|
Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
separate those group into separate strings and return the list of those.
Separate groups are balanced (each open brace is properly closed) and not nested within each other
Ignore any spaces in the input string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
def truncate_number(number: float) -> float:
""" Given a positive floating point number, it can be decomposed into
and integer part (largest integer smaller than given number) and decimals
(leftover part always smaller than 1).
Return the decimal part of the number.
"""
|
return number % 1.0
|
[
[
"3.5",
"0.5"
]
] |
[] |
[
[
"3.5",
"0.5"
],
[
"1.33",
"0.33"
],
[
"123.456",
"0.456"
]
] |
truncate_number
|
MultiLineInfilling/HumanEval/2/L0_L0
|
Given a positive floating point number, it can be decomposed into
and integer part (largest integer smaller than given number) and decimals
(leftover part always smaller than 1).
Return the decimal part of the number.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def below_zero(operations: List[int]) -> bool:
""" You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
"""
|
for op in operations:
balance += op
if balance < 0:
return True
return False
|
balance = 0
|
[
[
"[]",
"False"
],
[
"[1, 2, -3, 1, 2, -3]",
"False"
],
[
"[1, 2, -4, 5, 6]",
"True"
],
[
"[1, -1, 2, -2, 5, -5, 4, -4]",
"False"
],
[
"[1, -1, 2, -2, 5, -5, 4, -5]",
"True"
],
[
"[1, -2, 2, -2, 5, -5, 4, -4]",
"True"
]
] |
[
"from typing import List"
] |
[
[
"[1, 2, 3]",
"False"
],
[
"[1, 2, -4, 5]",
"True"
]
] |
below_zero
|
MultiLineInfilling/HumanEval/3/L0_L0
|
You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def below_zero(operations: List[int]) -> bool:
""" You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
"""
|
balance += op
if balance < 0:
return True
return False
|
balance = 0
for op in operations:
|
[
[
"[]",
"False"
],
[
"[1, 2, -3, 1, 2, -3]",
"False"
],
[
"[1, 2, -4, 5, 6]",
"True"
],
[
"[1, -1, 2, -2, 5, -5, 4, -4]",
"False"
],
[
"[1, -1, 2, -2, 5, -5, 4, -5]",
"True"
],
[
"[1, -2, 2, -2, 5, -5, 4, -4]",
"True"
]
] |
[
"from typing import List"
] |
[
[
"[1, 2, 3]",
"False"
],
[
"[1, 2, -4, 5]",
"True"
]
] |
below_zero
|
MultiLineInfilling/HumanEval/3/L0_L2
|
You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def below_zero(operations: List[int]) -> bool:
""" You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
"""
|
if balance < 0:
return True
return False
|
balance = 0
for op in operations:
balance += op
|
[
[
"[]",
"False"
],
[
"[1, 2, -3, 1, 2, -3]",
"False"
],
[
"[1, 2, -4, 5, 6]",
"True"
],
[
"[1, -1, 2, -2, 5, -5, 4, -4]",
"False"
],
[
"[1, -1, 2, -2, 5, -5, 4, -5]",
"True"
],
[
"[1, -2, 2, -2, 5, -5, 4, -4]",
"True"
]
] |
[
"from typing import List"
] |
[
[
"[1, 2, 3]",
"False"
],
[
"[1, 2, -4, 5]",
"True"
]
] |
below_zero
|
MultiLineInfilling/HumanEval/3/L0_L3
|
You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def below_zero(operations: List[int]) -> bool:
""" You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
"""
|
return True
return False
|
balance = 0
for op in operations:
balance += op
if balance < 0:
|
[
[
"[]",
"False"
],
[
"[1, 2, -3, 1, 2, -3]",
"False"
],
[
"[1, 2, -4, 5, 6]",
"True"
],
[
"[1, -1, 2, -2, 5, -5, 4, -4]",
"False"
],
[
"[1, -1, 2, -2, 5, -5, 4, -5]",
"True"
],
[
"[1, -2, 2, -2, 5, -5, 4, -4]",
"True"
]
] |
[
"from typing import List"
] |
[
[
"[1, 2, 3]",
"False"
],
[
"[1, 2, -4, 5]",
"True"
]
] |
below_zero
|
MultiLineInfilling/HumanEval/3/L0_L4
|
You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def below_zero(operations: List[int]) -> bool:
""" You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
"""
|
return False
|
balance = 0
for op in operations:
balance += op
if balance < 0:
return True
|
[
[
"[]",
"False"
],
[
"[1, 2, -3, 1, 2, -3]",
"False"
],
[
"[1, 2, -4, 5, 6]",
"True"
],
[
"[1, -1, 2, -2, 5, -5, 4, -4]",
"False"
],
[
"[1, -1, 2, -2, 5, -5, 4, -5]",
"True"
],
[
"[1, -2, 2, -2, 5, -5, 4, -4]",
"True"
]
] |
[
"from typing import List"
] |
[
[
"[1, 2, 3]",
"False"
],
[
"[1, 2, -4, 5]",
"True"
]
] |
below_zero
|
MultiLineInfilling/HumanEval/3/L0_L5
|
You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def below_zero(operations: List[int]) -> bool:
""" You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
"""
|
balance = 0
for op in operations:
balance += op
if balance < 0:
return True
return False
|
[
[
"[]",
"False"
],
[
"[1, 2, -3, 1, 2, -3]",
"False"
],
[
"[1, 2, -4, 5, 6]",
"True"
],
[
"[1, -1, 2, -2, 5, -5, 4, -4]",
"False"
],
[
"[1, -1, 2, -2, 5, -5, 4, -5]",
"True"
],
[
"[1, -2, 2, -2, 5, -5, 4, -4]",
"True"
]
] |
[
"from typing import List"
] |
[
[
"[1, 2, 3]",
"False"
],
[
"[1, 2, -4, 5]",
"True"
]
] |
below_zero
|
MultiLineInfilling/HumanEval/3/L0_L7
|
You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def below_zero(operations: List[int]) -> bool:
""" You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
"""
balance = 0
|
balance += op
if balance < 0:
return True
return False
|
for op in operations:
|
[
[
"[]",
"False"
],
[
"[1, 2, -3, 1, 2, -3]",
"False"
],
[
"[1, 2, -4, 5, 6]",
"True"
],
[
"[1, -1, 2, -2, 5, -5, 4, -4]",
"False"
],
[
"[1, -1, 2, -2, 5, -5, 4, -5]",
"True"
],
[
"[1, -2, 2, -2, 5, -5, 4, -4]",
"True"
]
] |
[
"from typing import List"
] |
[
[
"[1, 2, 3]",
"False"
],
[
"[1, 2, -4, 5]",
"True"
]
] |
below_zero
|
MultiLineInfilling/HumanEval/3/L2_L2
|
You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def below_zero(operations: List[int]) -> bool:
""" You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
"""
balance = 0
|
if balance < 0:
return True
return False
|
for op in operations:
balance += op
|
[
[
"[]",
"False"
],
[
"[1, 2, -3, 1, 2, -3]",
"False"
],
[
"[1, 2, -4, 5, 6]",
"True"
],
[
"[1, -1, 2, -2, 5, -5, 4, -4]",
"False"
],
[
"[1, -1, 2, -2, 5, -5, 4, -5]",
"True"
],
[
"[1, -2, 2, -2, 5, -5, 4, -4]",
"True"
]
] |
[
"from typing import List"
] |
[
[
"[1, 2, 3]",
"False"
],
[
"[1, 2, -4, 5]",
"True"
]
] |
below_zero
|
MultiLineInfilling/HumanEval/3/L2_L3
|
You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def below_zero(operations: List[int]) -> bool:
""" You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
"""
balance = 0
|
return True
return False
|
for op in operations:
balance += op
if balance < 0:
|
[
[
"[]",
"False"
],
[
"[1, 2, -3, 1, 2, -3]",
"False"
],
[
"[1, 2, -4, 5, 6]",
"True"
],
[
"[1, -1, 2, -2, 5, -5, 4, -4]",
"False"
],
[
"[1, -1, 2, -2, 5, -5, 4, -5]",
"True"
],
[
"[1, -2, 2, -2, 5, -5, 4, -4]",
"True"
]
] |
[
"from typing import List"
] |
[
[
"[1, 2, 3]",
"False"
],
[
"[1, 2, -4, 5]",
"True"
]
] |
below_zero
|
MultiLineInfilling/HumanEval/3/L2_L4
|
You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def below_zero(operations: List[int]) -> bool:
""" You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
"""
balance = 0
|
return False
|
for op in operations:
balance += op
if balance < 0:
return True
|
[
[
"[]",
"False"
],
[
"[1, 2, -3, 1, 2, -3]",
"False"
],
[
"[1, 2, -4, 5, 6]",
"True"
],
[
"[1, -1, 2, -2, 5, -5, 4, -4]",
"False"
],
[
"[1, -1, 2, -2, 5, -5, 4, -5]",
"True"
],
[
"[1, -2, 2, -2, 5, -5, 4, -4]",
"True"
]
] |
[
"from typing import List"
] |
[
[
"[1, 2, 3]",
"False"
],
[
"[1, 2, -4, 5]",
"True"
]
] |
below_zero
|
MultiLineInfilling/HumanEval/3/L2_L5
|
You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def below_zero(operations: List[int]) -> bool:
""" You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
"""
balance = 0
|
for op in operations:
balance += op
if balance < 0:
return True
return False
|
[
[
"[]",
"False"
],
[
"[1, 2, -3, 1, 2, -3]",
"False"
],
[
"[1, 2, -4, 5, 6]",
"True"
],
[
"[1, -1, 2, -2, 5, -5, 4, -4]",
"False"
],
[
"[1, -1, 2, -2, 5, -5, 4, -5]",
"True"
],
[
"[1, -2, 2, -2, 5, -5, 4, -4]",
"True"
]
] |
[
"from typing import List"
] |
[
[
"[1, 2, 3]",
"False"
],
[
"[1, 2, -4, 5]",
"True"
]
] |
below_zero
|
MultiLineInfilling/HumanEval/3/L2_L7
|
You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def below_zero(operations: List[int]) -> bool:
""" You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
"""
balance = 0
for op in operations:
|
if balance < 0:
return True
return False
|
balance += op
|
[
[
"[]",
"False"
],
[
"[1, 2, -3, 1, 2, -3]",
"False"
],
[
"[1, 2, -4, 5, 6]",
"True"
],
[
"[1, -1, 2, -2, 5, -5, 4, -4]",
"False"
],
[
"[1, -1, 2, -2, 5, -5, 4, -5]",
"True"
],
[
"[1, -2, 2, -2, 5, -5, 4, -4]",
"True"
]
] |
[
"from typing import List"
] |
[
[
"[1, 2, 3]",
"False"
],
[
"[1, 2, -4, 5]",
"True"
]
] |
below_zero
|
MultiLineInfilling/HumanEval/3/L3_L3
|
You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def below_zero(operations: List[int]) -> bool:
""" You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
"""
balance = 0
for op in operations:
|
return True
return False
|
balance += op
if balance < 0:
|
[
[
"[]",
"False"
],
[
"[1, 2, -3, 1, 2, -3]",
"False"
],
[
"[1, 2, -4, 5, 6]",
"True"
],
[
"[1, -1, 2, -2, 5, -5, 4, -4]",
"False"
],
[
"[1, -1, 2, -2, 5, -5, 4, -5]",
"True"
],
[
"[1, -2, 2, -2, 5, -5, 4, -4]",
"True"
]
] |
[
"from typing import List"
] |
[
[
"[1, 2, 3]",
"False"
],
[
"[1, 2, -4, 5]",
"True"
]
] |
below_zero
|
MultiLineInfilling/HumanEval/3/L3_L4
|
You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def below_zero(operations: List[int]) -> bool:
""" You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
"""
balance = 0
for op in operations:
|
return False
|
balance += op
if balance < 0:
return True
|
[
[
"[]",
"False"
],
[
"[1, 2, -3, 1, 2, -3]",
"False"
],
[
"[1, 2, -4, 5, 6]",
"True"
],
[
"[1, -1, 2, -2, 5, -5, 4, -4]",
"False"
],
[
"[1, -1, 2, -2, 5, -5, 4, -5]",
"True"
],
[
"[1, -2, 2, -2, 5, -5, 4, -4]",
"True"
]
] |
[
"from typing import List"
] |
[
[
"[1, 2, 3]",
"False"
],
[
"[1, 2, -4, 5]",
"True"
]
] |
below_zero
|
MultiLineInfilling/HumanEval/3/L3_L5
|
You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def below_zero(operations: List[int]) -> bool:
""" You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
"""
balance = 0
for op in operations:
|
balance += op
if balance < 0:
return True
return False
|
[
[
"[]",
"False"
],
[
"[1, 2, -3, 1, 2, -3]",
"False"
],
[
"[1, 2, -4, 5, 6]",
"True"
],
[
"[1, -1, 2, -2, 5, -5, 4, -4]",
"False"
],
[
"[1, -1, 2, -2, 5, -5, 4, -5]",
"True"
],
[
"[1, -2, 2, -2, 5, -5, 4, -4]",
"True"
]
] |
[
"from typing import List"
] |
[
[
"[1, 2, 3]",
"False"
],
[
"[1, 2, -4, 5]",
"True"
]
] |
below_zero
|
MultiLineInfilling/HumanEval/3/L3_L7
|
You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def below_zero(operations: List[int]) -> bool:
""" You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
"""
balance = 0
for op in operations:
balance += op
|
return True
return False
|
if balance < 0:
|
[
[
"[]",
"False"
],
[
"[1, 2, -3, 1, 2, -3]",
"False"
],
[
"[1, 2, -4, 5, 6]",
"True"
],
[
"[1, -1, 2, -2, 5, -5, 4, -4]",
"False"
],
[
"[1, -1, 2, -2, 5, -5, 4, -5]",
"True"
],
[
"[1, -2, 2, -2, 5, -5, 4, -4]",
"True"
]
] |
[
"from typing import List"
] |
[
[
"[1, 2, 3]",
"False"
],
[
"[1, 2, -4, 5]",
"True"
]
] |
below_zero
|
MultiLineInfilling/HumanEval/3/L4_L4
|
You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def below_zero(operations: List[int]) -> bool:
""" You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
"""
balance = 0
for op in operations:
balance += op
|
return False
|
if balance < 0:
return True
|
[
[
"[]",
"False"
],
[
"[1, 2, -3, 1, 2, -3]",
"False"
],
[
"[1, 2, -4, 5, 6]",
"True"
],
[
"[1, -1, 2, -2, 5, -5, 4, -4]",
"False"
],
[
"[1, -1, 2, -2, 5, -5, 4, -5]",
"True"
],
[
"[1, -2, 2, -2, 5, -5, 4, -4]",
"True"
]
] |
[
"from typing import List"
] |
[
[
"[1, 2, 3]",
"False"
],
[
"[1, 2, -4, 5]",
"True"
]
] |
below_zero
|
MultiLineInfilling/HumanEval/3/L4_L5
|
You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def below_zero(operations: List[int]) -> bool:
""" You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
"""
balance = 0
for op in operations:
balance += op
|
if balance < 0:
return True
return False
|
[
[
"[]",
"False"
],
[
"[1, 2, -3, 1, 2, -3]",
"False"
],
[
"[1, 2, -4, 5, 6]",
"True"
],
[
"[1, -1, 2, -2, 5, -5, 4, -4]",
"False"
],
[
"[1, -1, 2, -2, 5, -5, 4, -5]",
"True"
],
[
"[1, -2, 2, -2, 5, -5, 4, -4]",
"True"
]
] |
[
"from typing import List"
] |
[
[
"[1, 2, 3]",
"False"
],
[
"[1, 2, -4, 5]",
"True"
]
] |
below_zero
|
MultiLineInfilling/HumanEval/3/L4_L7
|
You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def below_zero(operations: List[int]) -> bool:
""" You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
"""
balance = 0
for op in operations:
balance += op
if balance < 0:
|
return False
|
return True
|
[
[
"[]",
"False"
],
[
"[1, 2, -3, 1, 2, -3]",
"False"
],
[
"[1, 2, -4, 5, 6]",
"True"
],
[
"[1, -1, 2, -2, 5, -5, 4, -4]",
"False"
],
[
"[1, -1, 2, -2, 5, -5, 4, -5]",
"True"
],
[
"[1, -2, 2, -2, 5, -5, 4, -4]",
"True"
]
] |
[
"from typing import List"
] |
[
[
"[1, 2, 3]",
"False"
],
[
"[1, 2, -4, 5]",
"True"
]
] |
below_zero
|
MultiLineInfilling/HumanEval/3/L5_L5
|
You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def below_zero(operations: List[int]) -> bool:
""" You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
"""
balance = 0
for op in operations:
balance += op
if balance < 0:
|
return True
return False
|
[
[
"[]",
"False"
],
[
"[1, 2, -3, 1, 2, -3]",
"False"
],
[
"[1, 2, -4, 5, 6]",
"True"
],
[
"[1, -1, 2, -2, 5, -5, 4, -4]",
"False"
],
[
"[1, -1, 2, -2, 5, -5, 4, -5]",
"True"
],
[
"[1, -2, 2, -2, 5, -5, 4, -4]",
"True"
]
] |
[
"from typing import List"
] |
[
[
"[1, 2, 3]",
"False"
],
[
"[1, 2, -4, 5]",
"True"
]
] |
below_zero
|
MultiLineInfilling/HumanEval/3/L5_L7
|
You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def below_zero(operations: List[int]) -> bool:
""" You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
"""
balance = 0
for op in operations:
balance += op
if balance < 0:
return True
|
return False
|
[
[
"[]",
"False"
],
[
"[1, 2, -3, 1, 2, -3]",
"False"
],
[
"[1, 2, -4, 5, 6]",
"True"
],
[
"[1, -1, 2, -2, 5, -5, 4, -4]",
"False"
],
[
"[1, -1, 2, -2, 5, -5, 4, -5]",
"True"
],
[
"[1, -2, 2, -2, 5, -5, 4, -4]",
"True"
]
] |
[
"from typing import List"
] |
[
[
"[1, 2, 3]",
"False"
],
[
"[1, 2, -4, 5]",
"True"
]
] |
below_zero
|
MultiLineInfilling/HumanEval/3/L7_L7
|
You're given a list of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
at that point function should return True. Otherwise it should return False.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def mean_absolute_deviation(numbers: List[float]) -> float:
""" For a given list of input numbers, calculate Mean Absolute Deviation
around the mean of this dataset.
Mean Absolute Deviation is the average absolute difference between each
element and a centerpoint (mean in this case):
MAD = average | x - x_mean |
"""
|
return sum(abs(x - mean) for x in numbers) / len(numbers)
|
mean = sum(numbers) / len(numbers)
|
[
[
"[1.0, 2.0, 3.0]",
"2.0/3.0"
],
[
"[1.0, 2.0, 3.0, 4.0]",
"1.0"
],
[
"[1.0, 2.0, 3.0, 4.0, 5.0]",
"6.0/5.0"
]
] |
[
"from typing import List"
] |
[
[
"[1.0, 2.0, 3.0, 4.0]",
"1.0"
]
] |
mean_absolute_deviation
|
MultiLineInfilling/HumanEval/4/L0_L0
|
For a given list of input numbers, calculate Mean Absolute Deviation
around the mean of this dataset.
Mean Absolute Deviation is the average absolute difference between each
element and a centerpoint (mean in this case):
MAD = average | x - x_mean |
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def mean_absolute_deviation(numbers: List[float]) -> float:
""" For a given list of input numbers, calculate Mean Absolute Deviation
around the mean of this dataset.
Mean Absolute Deviation is the average absolute difference between each
element and a centerpoint (mean in this case):
MAD = average | x - x_mean |
"""
|
mean = sum(numbers) / len(numbers)
return sum(abs(x - mean) for x in numbers) / len(numbers)
|
[
[
"[1.0, 2.0, 3.0]",
"2.0/3.0"
],
[
"[1.0, 2.0, 3.0, 4.0]",
"1.0"
],
[
"[1.0, 2.0, 3.0, 4.0, 5.0]",
"6.0/5.0"
]
] |
[
"from typing import List"
] |
[
[
"[1.0, 2.0, 3.0, 4.0]",
"1.0"
]
] |
mean_absolute_deviation
|
MultiLineInfilling/HumanEval/4/L0_L1
|
For a given list of input numbers, calculate Mean Absolute Deviation
around the mean of this dataset.
Mean Absolute Deviation is the average absolute difference between each
element and a centerpoint (mean in this case):
MAD = average | x - x_mean |
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def mean_absolute_deviation(numbers: List[float]) -> float:
""" For a given list of input numbers, calculate Mean Absolute Deviation
around the mean of this dataset.
Mean Absolute Deviation is the average absolute difference between each
element and a centerpoint (mean in this case):
MAD = average | x - x_mean |
"""
mean = sum(numbers) / len(numbers)
|
return sum(abs(x - mean) for x in numbers) / len(numbers)
|
[
[
"[1.0, 2.0, 3.0]",
"2.0/3.0"
],
[
"[1.0, 2.0, 3.0, 4.0]",
"1.0"
],
[
"[1.0, 2.0, 3.0, 4.0, 5.0]",
"6.0/5.0"
]
] |
[
"from typing import List"
] |
[
[
"[1.0, 2.0, 3.0, 4.0]",
"1.0"
]
] |
mean_absolute_deviation
|
MultiLineInfilling/HumanEval/4/L1_L1
|
For a given list of input numbers, calculate Mean Absolute Deviation
around the mean of this dataset.
Mean Absolute Deviation is the average absolute difference between each
element and a centerpoint (mean in this case):
MAD = average | x - x_mean |
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
|
return []
result = []
for n in numbers[:-1]:
result.append(n)
result.append(delimeter)
result.append(numbers[-1])
return result
|
if not numbers:
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L0_L0
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
|
result = []
for n in numbers[:-1]:
result.append(n)
result.append(delimeter)
result.append(numbers[-1])
return result
|
if not numbers:
return []
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L0_L1
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
|
for n in numbers[:-1]:
result.append(n)
result.append(delimeter)
result.append(numbers[-1])
return result
|
if not numbers:
return []
result = []
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L0_L3
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
|
result.append(n)
result.append(delimeter)
result.append(numbers[-1])
return result
|
if not numbers:
return []
result = []
for n in numbers[:-1]:
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L0_L5
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
|
result.append(delimeter)
result.append(numbers[-1])
return result
|
if not numbers:
return []
result = []
for n in numbers[:-1]:
result.append(n)
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L0_L6
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
|
result.append(numbers[-1])
return result
|
if not numbers:
return []
result = []
for n in numbers[:-1]:
result.append(n)
result.append(delimeter)
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L0_L7
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
|
return result
|
if not numbers:
return []
result = []
for n in numbers[:-1]:
result.append(n)
result.append(delimeter)
result.append(numbers[-1])
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L0_L9
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
|
if not numbers:
return []
result = []
for n in numbers[:-1]:
result.append(n)
result.append(delimeter)
result.append(numbers[-1])
return result
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L0_L11
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
|
result = []
for n in numbers[:-1]:
result.append(n)
result.append(delimeter)
result.append(numbers[-1])
return result
|
return []
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L1_L1
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
|
for n in numbers[:-1]:
result.append(n)
result.append(delimeter)
result.append(numbers[-1])
return result
|
return []
result = []
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L1_L3
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
|
result.append(n)
result.append(delimeter)
result.append(numbers[-1])
return result
|
return []
result = []
for n in numbers[:-1]:
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L1_L5
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
|
result.append(delimeter)
result.append(numbers[-1])
return result
|
return []
result = []
for n in numbers[:-1]:
result.append(n)
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L1_L6
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
|
result.append(numbers[-1])
return result
|
return []
result = []
for n in numbers[:-1]:
result.append(n)
result.append(delimeter)
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L1_L7
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
|
return result
|
return []
result = []
for n in numbers[:-1]:
result.append(n)
result.append(delimeter)
result.append(numbers[-1])
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L1_L9
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
|
return []
result = []
for n in numbers[:-1]:
result.append(n)
result.append(delimeter)
result.append(numbers[-1])
return result
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L1_L11
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
return []
|
for n in numbers[:-1]:
result.append(n)
result.append(delimeter)
result.append(numbers[-1])
return result
|
result = []
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L3_L3
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
return []
|
result.append(n)
result.append(delimeter)
result.append(numbers[-1])
return result
|
result = []
for n in numbers[:-1]:
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L3_L5
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
return []
|
result.append(delimeter)
result.append(numbers[-1])
return result
|
result = []
for n in numbers[:-1]:
result.append(n)
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L3_L6
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
return []
|
result.append(numbers[-1])
return result
|
result = []
for n in numbers[:-1]:
result.append(n)
result.append(delimeter)
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L3_L7
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
return []
|
return result
|
result = []
for n in numbers[:-1]:
result.append(n)
result.append(delimeter)
result.append(numbers[-1])
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L3_L9
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
return []
|
result = []
for n in numbers[:-1]:
result.append(n)
result.append(delimeter)
result.append(numbers[-1])
return result
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L3_L11
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
return []
result = []
|
result.append(n)
result.append(delimeter)
result.append(numbers[-1])
return result
|
for n in numbers[:-1]:
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L5_L5
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
return []
result = []
|
result.append(delimeter)
result.append(numbers[-1])
return result
|
for n in numbers[:-1]:
result.append(n)
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L5_L6
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
return []
result = []
|
result.append(numbers[-1])
return result
|
for n in numbers[:-1]:
result.append(n)
result.append(delimeter)
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L5_L7
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
return []
result = []
|
return result
|
for n in numbers[:-1]:
result.append(n)
result.append(delimeter)
result.append(numbers[-1])
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L5_L9
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
return []
result = []
|
for n in numbers[:-1]:
result.append(n)
result.append(delimeter)
result.append(numbers[-1])
return result
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L5_L11
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
return []
result = []
for n in numbers[:-1]:
|
result.append(delimeter)
result.append(numbers[-1])
return result
|
result.append(n)
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L6_L6
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
return []
result = []
for n in numbers[:-1]:
|
result.append(numbers[-1])
return result
|
result.append(n)
result.append(delimeter)
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L6_L7
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
return []
result = []
for n in numbers[:-1]:
|
return result
|
result.append(n)
result.append(delimeter)
result.append(numbers[-1])
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L6_L9
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
return []
result = []
for n in numbers[:-1]:
|
result.append(n)
result.append(delimeter)
result.append(numbers[-1])
return result
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L6_L11
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
return []
result = []
for n in numbers[:-1]:
result.append(n)
|
result.append(numbers[-1])
return result
|
result.append(delimeter)
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L7_L7
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
return []
result = []
for n in numbers[:-1]:
result.append(n)
|
return result
|
result.append(delimeter)
result.append(numbers[-1])
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L7_L9
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
return []
result = []
for n in numbers[:-1]:
result.append(n)
|
result.append(delimeter)
result.append(numbers[-1])
return result
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L7_L11
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
return []
result = []
for n in numbers[:-1]:
result.append(n)
result.append(delimeter)
|
return result
|
result.append(numbers[-1])
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L9_L9
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
return []
result = []
for n in numbers[:-1]:
result.append(n)
result.append(delimeter)
|
result.append(numbers[-1])
return result
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L9_L11
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
"""
if not numbers:
return []
result = []
for n in numbers[:-1]:
result.append(n)
result.append(delimeter)
result.append(numbers[-1])
|
return result
|
[
[
"[], 7",
"[]"
],
[
"[5, 6, 3, 2], 8",
"[5, 8, 6, 8, 3, 8, 2]"
],
[
"[2, 2, 2], 2",
"[2, 2, 2, 2, 2]"
]
] |
[
"from typing import List"
] |
[
[
"[], 4",
"[]"
],
[
"[1, 2, 3], 4",
"[1, 4, 2, 4, 3]"
]
] |
intersperse
|
MultiLineInfilling/HumanEval/5/L11_L11
|
Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
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 = 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]
|
def parse_paren_group(s):
|
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
],
[
"'() (()) ((())) (((())))'",
"[1, 2, 3, 4]"
],
[
"'(()(())((())))'",
"[4]"
]
] |
[
"from typing import List"
] |
[
[
"'(()()) ((())) () ((())()())'",
"[2, 3, 1, 3]"
]
] |
parse_nested_parens
|
MultiLineInfilling/HumanEval/6/L0_L0
|
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.
"""
|
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]
|
def parse_paren_group(s):
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/L0_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.
"""
|
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]
|
def parse_paren_group(s):
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/L0_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.
"""
|
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]
|
def parse_paren_group(s):
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/L0_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.
"""
|
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]
|
def parse_paren_group(s):
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/L0_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.
"""
|
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]
|
def parse_paren_group(s):
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/L0_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
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.