test_cases listlengths 0 100 | import_str listlengths 0 1 | solution stringlengths 0 620 | suffix stringlengths 0 655 | tgt_lang stringclasses 1 value | doc_string stringclasses 164 values | compare_func listlengths 0 0 | prefix stringlengths 65 1.63k | demos listlengths 0 8 | data_id stringlengths 33 36 | src_lang stringclasses 1 value | task_name stringclasses 1 value | dataset_name stringclasses 1 value | entry_func stringclasses 158 values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] | [] | f_suffix = 0
while not is_pa | lindrome(string[beginning_of_suffix:]):
beginning_of_suffix += 1
return string + string[:beginning_of_suffix][::-1]
| python | Test if given string is a palindrome | [] |
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
if not string:
return ''
beginning_o | [
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] | RandomSpanInfilling/HumanEval/10/1 | python | code_infilling | HumanEval_RandomSpanInfilling | make_palindrome |
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] | [] | beginning_of | _suffix += 1
return string + string[:beginning_of_suffix][::-1]
| python | Test if given string is a palindrome | [] |
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
if not string:
return ''
beginning_of_suffix = 0
while not is_palindrome(string[beginning_of_suffix:]):
| [
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] | RandomSpanInfilling/HumanEval/10/2 | python | code_infilling | HumanEval_RandomSpanInfilling | make_palindrome |
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] | [] | beginning_of_suffix += 1
return string + string[:beginning_of_suffix][::-1]
| python | Test if given string is a palindrome | [] |
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
if not string:
return ''
beginning_of_suffix = 0
while not is_palindrome(string[beginning_of_suffix:]): | [
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] | RandomSpanInfilling/HumanEval/10/3 | python | code_infilling | HumanEval_RandomSpanInfilling | make_palindrome | |
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] | [] | of_suffix = 0
while not is_palindrome(string[beginning_of_suffix:]):
beginning_of_suffix += 1
return | string + string[:beginning_of_suffix][::-1]
| python | Test if given string is a palindrome | [] |
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
if not string:
return ''
beginning_ | [
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] | RandomSpanInfilling/HumanEval/10/4 | python | code_infilling | HumanEval_RandomSpanInfilling | make_palindrome |
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] | [] |
return string + string[:beginning | _of_suffix][::-1]
| python | Test if given string is a palindrome | [] |
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
if not string:
return ''
beginning_of_suffix = 0
while not is_palindrome(string[beginning_of_suffix:]):
beginning_of_suffix += 1
| [
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] | RandomSpanInfilling/HumanEval/10/5 | python | code_infilling | HumanEval_RandomSpanInfilling | make_palindrome |
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] | [] | while not is_palindrome(string[beginning_of_suffix:]):
beginning_of_suffix += 1
|
return string + string[:beginning_of_suffix][::-1]
| python | Test if given string is a palindrome | [] |
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
if not string:
return ''
beginning_of_suffix = 0
| [
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] | RandomSpanInfilling/HumanEval/10/6 | python | code_infilling | HumanEval_RandomSpanInfilling | make_palindrome |
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] | [] | ring[:beginning_of_s | uffix][::-1]
| python | Test if given string is a palindrome | [] |
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
if not string:
return ''
beginning_of_suffix = 0
while not is_palindrome(string[beginning_of_suffix:]):
beginning_of_suffix += 1
return string + st | [
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] | RandomSpanInfilling/HumanEval/10/7 | python | code_infilling | HumanEval_RandomSpanInfilling | make_palindrome |
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] | [] | ]):
beginning_of_suffix += 1
return string + str | ing[:beginning_of_suffix][::-1]
| python | Test if given string is a palindrome | [] |
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
if not string:
return ''
beginning_of_suffix = 0
while not is_palindrome(string[beginning_of_suffix: | [
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] | RandomSpanInfilling/HumanEval/10/8 | python | code_infilling | HumanEval_RandomSpanInfilling | make_palindrome |
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] | [] |
beginning_of_suffix = 0
while not is_palindrome(string[beginning_of_suffix:]):
beginning_ | of_suffix += 1
return string + string[:beginning_of_suffix][::-1]
| python | Test if given string is a palindrome | [] |
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
if not string:
return ''
| [
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] | RandomSpanInfilling/HumanEval/10/9 | python | code_infilling | HumanEval_RandomSpanInfilling | make_palindrome |
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] | [] | return ''
beginning_of_suffix = 0
| while not is_palindrome(string[beginning_of_suffix:]):
beginning_of_suffix += 1
return string + string[:beginning_of_suffix][::-1]
| python | Test if given string is a palindrome | [] |
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
if not string:
| [
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] | RandomSpanInfilling/HumanEval/10/10 | python | code_infilling | HumanEval_RandomSpanInfilling | make_palindrome |
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] | [
"from typing import List"
] |
return ''.jo | in(xor(x, y) for x, y in zip(a, b))
| python | Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string. | [] | from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
def xor(i, j):
if i == j:
return '0'
else:
return '1' | [
[
"'010', '110'",
"'100'"
]
] | RandomSpanInfilling/HumanEval/11/1 | python | code_infilling | HumanEval_RandomSpanInfilling | string_xor |
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] | [
"from typing import List"
] | n zip | (a, b))
| python | Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string. | [] | from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
def xor(i, j):
if i == j:
return '0'
else:
return '1'
return ''.join(xor(x, y) for x, y i | [
[
"'010', '110'",
"'100'"
]
] | RandomSpanInfilling/HumanEval/11/2 | python | code_infilling | HumanEval_RandomSpanInfilling | string_xor |
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] | [
"from typing import List"
] | '
return ''.join(xor(x | , y) for x, y in zip(a, b))
| python | Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string. | [] | from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
def xor(i, j):
if i == j:
return '0'
else:
return '1 | [
[
"'010', '110'",
"'100'"
]
] | RandomSpanInfilling/HumanEval/11/3 | python | code_infilling | HumanEval_RandomSpanInfilling | string_xor |
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] | [
"from typing import List"
] | else:
retur | n '1'
return ''.join(xor(x, y) for x, y in zip(a, b))
| python | Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string. | [] | from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
def xor(i, j):
if i == j:
return '0'
| [
[
"'010', '110'",
"'100'"
]
] | RandomSpanInfilling/HumanEval/11/4 | python | code_infilling | HumanEval_RandomSpanInfilling | string_xor |
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] | [
"from typing import List"
] | def xor(i, j):
if i == j:
return '0'
else:
return '1'
return ''.join(xor(x, y) for x, y in zip(a, | b))
| python | Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string. | [] | from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
| [
[
"'010', '110'",
"'100'"
]
] | RandomSpanInfilling/HumanEval/11/5 | python | code_infilling | HumanEval_RandomSpanInfilling | string_xor |
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] | [
"from typing import List"
] | turn '1'
return ''.join(xor(x, y) for x, y in zip(a, | b))
| python | Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string. | [] | from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
def xor(i, j):
if i == j:
return '0'
else:
re | [
[
"'010', '110'",
"'100'"
]
] | RandomSpanInfilling/HumanEval/11/6 | python | code_infilling | HumanEval_RandomSpanInfilling | string_xor |
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] | [
"from typing import List"
] | b))
| python | Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string. | [] | from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
def xor(i, j):
if i == j:
return '0'
else:
return '1'
return ''.join(xor(x, y) for x, y in zip(a, | [
[
"'010', '110'",
"'100'"
]
] | RandomSpanInfilling/HumanEval/11/7 | python | code_infilling | HumanEval_RandomSpanInfilling | string_xor | |
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] | [
"from typing import List"
] | eturn '0'
else:
return ' | 1'
return ''.join(xor(x, y) for x, y in zip(a, b))
| python | Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string. | [] | from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
def xor(i, j):
if i == j:
r | [
[
"'010', '110'",
"'100'"
]
] | RandomSpanInfilling/HumanEval/11/8 | python | code_infilling | HumanEval_RandomSpanInfilling | string_xor |
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] | [
"from typing import List"
] | return '0'
else:
return '1'
return ''.join(xor(x, y) | for x, y in zip(a, b))
| python | Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string. | [] | from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
def xor(i, j):
if i == j:
| [
[
"'010', '110'",
"'100'"
]
] | RandomSpanInfilling/HumanEval/11/9 | python | code_infilling | HumanEval_RandomSpanInfilling | string_xor |
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] | [
"from typing import List"
] | return '1'
| return ''.join(xor(x, y) for x, y in zip(a, b))
| python | Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string. | [] | from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
def xor(i, j):
if i == j:
return '0'
else:
| [
[
"'010', '110'",
"'100'"
]
] | RandomSpanInfilling/HumanEval/11/10 | python | code_infilling | HumanEval_RandomSpanInfilling | string_xor |
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] | [
"from typing import List, Optional"
] | strings:
return None
maxlen = max(len(x) for x in strings)
for s in strings:
if len(s) == ma | xlen:
return s
| python | Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty. | [] | from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
if not | [
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] | RandomSpanInfilling/HumanEval/12/1 | python | code_infilling | HumanEval_RandomSpanInfilling | longest |
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] | [
"from typing import List, Optional"
] | maxlen = max(len(x) for x in strings)
for s in strings:
if len(s) == maxlen:
retu | rn s
| python | Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty. | [] | from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
if not strings:
return None
| [
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] | RandomSpanInfilling/HumanEval/12/2 | python | code_infilling | HumanEval_RandomSpanInfilling | longest |
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] | [
"from typing import List, Optional"
] | not strings:
return None
maxlen = max(len(x) for x in strings)
for s in st | rings:
if len(s) == maxlen:
return s
| python | Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty. | [] | from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
if | [
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] | RandomSpanInfilling/HumanEval/12/3 | python | code_infilling | HumanEval_RandomSpanInfilling | longest |
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] | [
"from typing import List, Optional"
] | r s in strings:
if len(s) == maxlen:
| return s
| python | Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty. | [] | from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
if not strings:
return None
maxlen = max(len(x) for x in strings)
fo | [
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] | RandomSpanInfilling/HumanEval/12/4 | python | code_infilling | HumanEval_RandomSpanInfilling | longest |
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] | [
"from typing import List, Optional"
] | en(x) for x in strings)
for s in strings:
| if len(s) == maxlen:
return s
| python | Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty. | [] | from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
if not strings:
return None
maxlen = max(l | [
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] | RandomSpanInfilling/HumanEval/12/5 | python | code_infilling | HumanEval_RandomSpanInfilling | longest |
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] | [
"from typing import List, Optional"
] | if not strings:
return None
maxlen = max(len(x) for x in strings)
for s in strings:
| if len(s) == maxlen:
return s
| python | Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty. | [] | from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
| [
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] | RandomSpanInfilling/HumanEval/12/6 | python | code_infilling | HumanEval_RandomSpanInfilling | longest |
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] | [
"from typing import List, Optional"
] | xlen = max(len(x) for x in strings)
for s in strings:
if len(s) == ma | xlen:
return s
| python | Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty. | [] | from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
if not strings:
return None
ma | [
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] | RandomSpanInfilling/HumanEval/12/7 | python | code_infilling | HumanEval_RandomSpanInfilling | longest |
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] | [
"from typing import List, Optional"
] | one
maxlen = max(len(x) for x in strings)
for s in strings:
if len(s) == maxlen:
| return s
| python | Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty. | [] | from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
if not strings:
return N | [
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] | RandomSpanInfilling/HumanEval/12/8 | python | code_infilling | HumanEval_RandomSpanInfilling | longest |
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] | [
"from typing import List, Optional"
] | ot strings:
return None
maxlen = max(len(x) for x in strings)
for s in st | rings:
if len(s) == maxlen:
return s
| python | Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty. | [] | from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
if n | [
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] | RandomSpanInfilling/HumanEval/12/9 | python | code_infilling | HumanEval_RandomSpanInfilling | longest |
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] | [
"from typing import List, Optional"
] | xlen = max(len(x) for x in strings)
for s in strings:
if len(s) == maxlen:
| return s
| python | Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty. | [] | from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
if not strings:
return None
ma | [
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] | RandomSpanInfilling/HumanEval/12/10 | python | code_infilling | HumanEval_RandomSpanInfilling | longest |
[
[
"3, 7",
"1"
],
[
"10, 15",
"5"
],
[
"49, 14",
"7"
],
[
"144, 60",
"12"
]
] | [] | while b:
| a, b = b, a % b
return a
| python | Return a greatest common divisor of two integers a and b | [] |
def greatest_common_divisor(a: int, b: int) -> int:
""" Return a greatest common divisor of two integers a and b
"""
| [
[
"3, 5",
"1"
],
[
"25, 15",
"5"
]
] | RandomSpanInfilling/HumanEval/13/1 | python | code_infilling | HumanEval_RandomSpanInfilling | greatest_common_divisor |
[
[
"3, 7",
"1"
],
[
"10, 15",
"5"
],
[
"49, 14",
"7"
],
[
"144, 60",
"12"
]
] | [] | a, | b = b, a % b
return a
| python | Return a greatest common divisor of two integers a and b | [] |
def greatest_common_divisor(a: int, b: int) -> int:
""" Return a greatest common divisor of two integers a and b
"""
while b:
| [
[
"3, 5",
"1"
],
[
"25, 15",
"5"
]
] | RandomSpanInfilling/HumanEval/13/2 | python | code_infilling | HumanEval_RandomSpanInfilling | greatest_common_divisor |
[
[
"3, 7",
"1"
],
[
"10, 15",
"5"
],
[
"49, 14",
"7"
],
[
"144, 60",
"12"
]
] | [] | b = b, a | % b
return a
| python | Return a greatest common divisor of two integers a and b | [] |
def greatest_common_divisor(a: int, b: int) -> int:
""" Return a greatest common divisor of two integers a and b
"""
while b:
a, | [
[
"3, 5",
"1"
],
[
"25, 15",
"5"
]
] | RandomSpanInfilling/HumanEval/13/3 | python | code_infilling | HumanEval_RandomSpanInfilling | greatest_common_divisor |
[
[
"3, 7",
"1"
],
[
"10, 15",
"5"
],
[
"49, 14",
"7"
],
[
"144, 60",
"12"
]
] | [] | b:
a, b = b, a % b
return | a
| python | Return a greatest common divisor of two integers a and b | [] |
def greatest_common_divisor(a: int, b: int) -> int:
""" Return a greatest common divisor of two integers a and b
"""
while | [
[
"3, 5",
"1"
],
[
"25, 15",
"5"
]
] | RandomSpanInfilling/HumanEval/13/4 | python | code_infilling | HumanEval_RandomSpanInfilling | greatest_common_divisor |
[
[
"3, 7",
"1"
],
[
"10, 15",
"5"
],
[
"49, 14",
"7"
],
[
"144, 60",
"12"
]
] | [] | le b:
a, b = b, a % | b
return a
| python | Return a greatest common divisor of two integers a and b | [] |
def greatest_common_divisor(a: int, b: int) -> int:
""" Return a greatest common divisor of two integers a and b
"""
whi | [
[
"3, 5",
"1"
],
[
"25, 15",
"5"
]
] | RandomSpanInfilling/HumanEval/13/5 | python | code_infilling | HumanEval_RandomSpanInfilling | greatest_common_divisor |
[
[
"3, 7",
"1"
],
[
"10, 15",
"5"
],
[
"49, 14",
"7"
],
[
"144, 60",
"12"
]
] | [] | return a
| python | Return a greatest common divisor of two integers a and b | [] |
def greatest_common_divisor(a: int, b: int) -> int:
""" Return a greatest common divisor of two integers a and b
"""
while b:
a, b = b, a % b
| [
[
"3, 5",
"1"
],
[
"25, 15",
"5"
]
] | RandomSpanInfilling/HumanEval/13/6 | python | code_infilling | HumanEval_RandomSpanInfilling | greatest_common_divisor | |
[
[
"3, 7",
"1"
],
[
"10, 15",
"5"
],
[
"49, 14",
"7"
],
[
"144, 60",
"12"
]
] | [] | a, b = b, a % | b
return a
| python | Return a greatest common divisor of two integers a and b | [] |
def greatest_common_divisor(a: int, b: int) -> int:
""" Return a greatest common divisor of two integers a and b
"""
while b:
| [
[
"3, 5",
"1"
],
[
"25, 15",
"5"
]
] | RandomSpanInfilling/HumanEval/13/7 | python | code_infilling | HumanEval_RandomSpanInfilling | greatest_common_divisor |
[
[
"3, 7",
"1"
],
[
"10, 15",
"5"
],
[
"49, 14",
"7"
],
[
"144, 60",
"12"
]
] | [] | b = b, a % b
return | a
| python | Return a greatest common divisor of two integers a and b | [] |
def greatest_common_divisor(a: int, b: int) -> int:
""" Return a greatest common divisor of two integers a and b
"""
while b:
a, | [
[
"3, 5",
"1"
],
[
"25, 15",
"5"
]
] | RandomSpanInfilling/HumanEval/13/8 | python | code_infilling | HumanEval_RandomSpanInfilling | greatest_common_divisor |
[
[
"3, 7",
"1"
],
[
"10, 15",
"5"
],
[
"49, 14",
"7"
],
[
"144, 60",
"12"
]
] | [] | b = b, a % | b
return a
| python | Return a greatest common divisor of two integers a and b | [] |
def greatest_common_divisor(a: int, b: int) -> int:
""" Return a greatest common divisor of two integers a and b
"""
while b:
a, | [
[
"3, 5",
"1"
],
[
"25, 15",
"5"
]
] | RandomSpanInfilling/HumanEval/13/9 | python | code_infilling | HumanEval_RandomSpanInfilling | greatest_common_divisor |
[
[
"3, 7",
"1"
],
[
"10, 15",
"5"
],
[
"49, 14",
"7"
],
[
"144, 60",
"12"
]
] | [] | a, b = | b, a % b
return a
| python | Return a greatest common divisor of two integers a and b | [] |
def greatest_common_divisor(a: int, b: int) -> int:
""" Return a greatest common divisor of two integers a and b
"""
while b:
| [
[
"3, 5",
"1"
],
[
"25, 15",
"5"
]
] | RandomSpanInfilling/HumanEval/13/10 | python | code_infilling | HumanEval_RandomSpanInfilling | greatest_common_divisor |
[
[
"''",
"[]"
],
[
"'asdfgh'",
"['a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh']"
],
[
"'WWW'",
"['W', 'WW', 'WWW']"
]
] | [
"from typing import List"
] | append(string[:i | +1])
return result
| python | Return list of all prefixes from shortest to longest of the input string | [] | from typing import List
def all_prefixes(string: str) -> List[str]:
""" Return list of all prefixes from shortest to longest of the input string
"""
result = []
for i in range(len(string)):
result. | [
[
"'abc'",
"['a', 'ab', 'abc']"
]
] | RandomSpanInfilling/HumanEval/14/1 | python | code_infilling | HumanEval_RandomSpanInfilling | all_prefixes |
[
[
"''",
"[]"
],
[
"'asdfgh'",
"['a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh']"
],
[
"'WWW'",
"['W', 'WW', 'WWW']"
]
] | [
"from typing import List"
] | e(len(string)):
| result.append(string[:i+1])
return result
| python | Return list of all prefixes from shortest to longest of the input string | [] | from typing import List
def all_prefixes(string: str) -> List[str]:
""" Return list of all prefixes from shortest to longest of the input string
"""
result = []
for i in rang | [
[
"'abc'",
"['a', 'ab', 'abc']"
]
] | RandomSpanInfilling/HumanEval/14/2 | python | code_infilling | HumanEval_RandomSpanInfilling | all_prefixes |
[
[
"''",
"[]"
],
[
"'asdfgh'",
"['a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh']"
],
[
"'WWW'",
"['W', 'WW', 'WWW']"
]
] | [
"from typing import List"
] | sult.append(string[ | :i+1])
return result
| python | Return list of all prefixes from shortest to longest of the input string | [] | from typing import List
def all_prefixes(string: str) -> List[str]:
""" Return list of all prefixes from shortest to longest of the input string
"""
result = []
for i in range(len(string)):
re | [
[
"'abc'",
"['a', 'ab', 'abc']"
]
] | RandomSpanInfilling/HumanEval/14/3 | python | code_infilling | HumanEval_RandomSpanInfilling | all_prefixes |
[
[
"''",
"[]"
],
[
"'asdfgh'",
"['a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh']"
],
[
"'WWW'",
"['W', 'WW', 'WWW']"
]
] | [
"from typing import List"
] | string)):
result.append(string[:i+1])
return re | sult
| python | Return list of all prefixes from shortest to longest of the input string | [] | from typing import List
def all_prefixes(string: str) -> List[str]:
""" Return list of all prefixes from shortest to longest of the input string
"""
result = []
for i in range(len( | [
[
"'abc'",
"['a', 'ab', 'abc']"
]
] | RandomSpanInfilling/HumanEval/14/4 | python | code_infilling | HumanEval_RandomSpanInfilling | all_prefixes |
[
[
"''",
"[]"
],
[
"'asdfgh'",
"['a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh']"
],
[
"'WWW'",
"['W', 'WW', 'WWW']"
]
] | [
"from typing import List"
] | nge(len(string)):
result.ap | pend(string[:i+1])
return result
| python | Return list of all prefixes from shortest to longest of the input string | [] | from typing import List
def all_prefixes(string: str) -> List[str]:
""" Return list of all prefixes from shortest to longest of the input string
"""
result = []
for i in ra | [
[
"'abc'",
"['a', 'ab', 'abc']"
]
] | RandomSpanInfilling/HumanEval/14/5 | python | code_infilling | HumanEval_RandomSpanInfilling | all_prefixes |
[
[
"''",
"[]"
],
[
"'asdfgh'",
"['a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh']"
],
[
"'WWW'",
"['W', 'WW', 'WWW']"
]
] | [
"from typing import List"
] | []
for i in ra | nge(len(string)):
result.append(string[:i+1])
return result
| python | Return list of all prefixes from shortest to longest of the input string | [] | from typing import List
def all_prefixes(string: str) -> List[str]:
""" Return list of all prefixes from shortest to longest of the input string
"""
result = | [
[
"'abc'",
"['a', 'ab', 'abc']"
]
] | RandomSpanInfilling/HumanEval/14/6 | python | code_infilling | HumanEval_RandomSpanInfilling | all_prefixes |
[
[
"''",
"[]"
],
[
"'asdfgh'",
"['a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh']"
],
[
"'WWW'",
"['W', 'WW', 'WWW']"
]
] | [
"from typing import List"
] | for i in range(len(string) | ):
result.append(string[:i+1])
return result
| python | Return list of all prefixes from shortest to longest of the input string | [] | from typing import List
def all_prefixes(string: str) -> List[str]:
""" Return list of all prefixes from shortest to longest of the input string
"""
result = []
| [
[
"'abc'",
"['a', 'ab', 'abc']"
]
] | RandomSpanInfilling/HumanEval/14/7 | python | code_infilling | HumanEval_RandomSpanInfilling | all_prefixes |
[
[
"''",
"[]"
],
[
"'asdfgh'",
"['a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh']"
],
[
"'WWW'",
"['W', 'WW', 'WWW']"
]
] | [
"from typing import List"
] | ult = []
| for i in range(len(string)):
result.append(string[:i+1])
return result
| python | Return list of all prefixes from shortest to longest of the input string | [] | from typing import List
def all_prefixes(string: str) -> List[str]:
""" Return list of all prefixes from shortest to longest of the input string
"""
res | [
[
"'abc'",
"['a', 'ab', 'abc']"
]
] | RandomSpanInfilling/HumanEval/14/8 | python | code_infilling | HumanEval_RandomSpanInfilling | all_prefixes |
[
[
"''",
"[]"
],
[
"'asdfgh'",
"['a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh']"
],
[
"'WWW'",
"['W', 'WW', 'WWW']"
]
] | [
"from typing import List"
] | sult = []
for i in range(len(string)):
result.a | ppend(string[:i+1])
return result
| python | Return list of all prefixes from shortest to longest of the input string | [] | from typing import List
def all_prefixes(string: str) -> List[str]:
""" Return list of all prefixes from shortest to longest of the input string
"""
re | [
[
"'abc'",
"['a', 'ab', 'abc']"
]
] | RandomSpanInfilling/HumanEval/14/9 | python | code_infilling | HumanEval_RandomSpanInfilling | all_prefixes |
[
[
"''",
"[]"
],
[
"'asdfgh'",
"['a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh']"
],
[
"'WWW'",
"['W', 'WW', 'WWW']"
]
] | [
"from typing import List"
] |
for i in ra | nge(len(string)):
result.append(string[:i+1])
return result
| python | Return list of all prefixes from shortest to longest of the input string | [] | from typing import List
def all_prefixes(string: str) -> List[str]:
""" Return list of all prefixes from shortest to longest of the input string
"""
result = []
| [
[
"'abc'",
"['a', 'ab', 'abc']"
]
] | RandomSpanInfilling/HumanEval/14/10 | python | code_infilling | HumanEval_RandomSpanInfilling | all_prefixes |
[
[
"0",
"'0'"
],
[
"3",
"'0 1 2 3'"
],
[
"10",
"'0 1 2 3 4 5 6 7 8 9 10'"
]
] | [] | ' '.join([str(x) for x in range(n + | 1)])
| python | Return a string containing space-delimited numbers starting from 0 upto n inclusive. | [] |
def string_sequence(n: int) -> str:
""" Return a string containing space-delimited numbers starting from 0 upto n inclusive.
"""
return | [
[
"0",
"'0'"
],
[
"5",
"'0 1 2 3 4 5'"
]
] | RandomSpanInfilling/HumanEval/15/1 | python | code_infilling | HumanEval_RandomSpanInfilling | string_sequence |
[
[
"0",
"'0'"
],
[
"3",
"'0 1 2 3'"
],
[
"10",
"'0 1 2 3 4 5 6 7 8 9 10'"
]
] | [] | str(x) for x in range(n + 1)] | )
| python | Return a string containing space-delimited numbers starting from 0 upto n inclusive. | [] |
def string_sequence(n: int) -> str:
""" Return a string containing space-delimited numbers starting from 0 upto n inclusive.
"""
return ' '.join([ | [
[
"0",
"'0'"
],
[
"5",
"'0 1 2 3 4 5'"
]
] | RandomSpanInfilling/HumanEval/15/2 | python | code_infilling | HumanEval_RandomSpanInfilling | string_sequence |
[
[
"0",
"'0'"
],
[
"3",
"'0 1 2 3'"
],
[
"10",
"'0 1 2 3 4 5 6 7 8 9 10'"
]
] | [] | str(x) for x in range(n | + 1)])
| python | Return a string containing space-delimited numbers starting from 0 upto n inclusive. | [] |
def string_sequence(n: int) -> str:
""" Return a string containing space-delimited numbers starting from 0 upto n inclusive.
"""
return ' '.join([ | [
[
"0",
"'0'"
],
[
"5",
"'0 1 2 3 4 5'"
]
] | RandomSpanInfilling/HumanEval/15/3 | python | code_infilling | HumanEval_RandomSpanInfilling | string_sequence |
[
[
"0",
"'0'"
],
[
"3",
"'0 1 2 3'"
],
[
"10",
"'0 1 2 3 4 5 6 7 8 9 10'"
]
] | [] | or x in | range(n + 1)])
| python | Return a string containing space-delimited numbers starting from 0 upto n inclusive. | [] |
def string_sequence(n: int) -> str:
""" Return a string containing space-delimited numbers starting from 0 upto n inclusive.
"""
return ' '.join([str(x) f | [
[
"0",
"'0'"
],
[
"5",
"'0 1 2 3 4 5'"
]
] | RandomSpanInfilling/HumanEval/15/4 | python | code_infilling | HumanEval_RandomSpanInfilling | string_sequence |
[
[
"0",
"'0'"
],
[
"3",
"'0 1 2 3'"
],
[
"10",
"'0 1 2 3 4 5 6 7 8 9 10'"
]
] | [] | range(n | + 1)])
| python | Return a string containing space-delimited numbers starting from 0 upto n inclusive. | [] |
def string_sequence(n: int) -> str:
""" Return a string containing space-delimited numbers starting from 0 upto n inclusive.
"""
return ' '.join([str(x) for x in | [
[
"0",
"'0'"
],
[
"5",
"'0 1 2 3 4 5'"
]
] | RandomSpanInfilling/HumanEval/15/5 | python | code_infilling | HumanEval_RandomSpanInfilling | string_sequence |
[
[
"0",
"'0'"
],
[
"3",
"'0 1 2 3'"
],
[
"10",
"'0 1 2 3 4 5 6 7 8 9 10'"
]
] | [] | urn ' '.join([str(x) for x in range(n + 1)] | )
| python | Return a string containing space-delimited numbers starting from 0 upto n inclusive. | [] |
def string_sequence(n: int) -> str:
""" Return a string containing space-delimited numbers starting from 0 upto n inclusive.
"""
ret | [
[
"0",
"'0'"
],
[
"5",
"'0 1 2 3 4 5'"
]
] | RandomSpanInfilling/HumanEval/15/6 | python | code_infilling | HumanEval_RandomSpanInfilling | string_sequence |
[
[
"0",
"'0'"
],
[
"3",
"'0 1 2 3'"
],
[
"10",
"'0 1 2 3 4 5 6 7 8 9 10'"
]
] | [] | ) for x in range(n + 1)])
| python | Return a string containing space-delimited numbers starting from 0 upto n inclusive. | [] |
def string_sequence(n: int) -> str:
""" Return a string containing space-delimited numbers starting from 0 upto n inclusive.
"""
return ' '.join([str(x | [
[
"0",
"'0'"
],
[
"5",
"'0 1 2 3 4 5'"
]
] | RandomSpanInfilling/HumanEval/15/7 | python | code_infilling | HumanEval_RandomSpanInfilling | string_sequence | |
[
[
"0",
"'0'"
],
[
"3",
"'0 1 2 3'"
],
[
"10",
"'0 1 2 3 4 5 6 7 8 9 10'"
]
] | [] | [str(x) for x | in range(n + 1)])
| python | Return a string containing space-delimited numbers starting from 0 upto n inclusive. | [] |
def string_sequence(n: int) -> str:
""" Return a string containing space-delimited numbers starting from 0 upto n inclusive.
"""
return ' '.join( | [
[
"0",
"'0'"
],
[
"5",
"'0 1 2 3 4 5'"
]
] | RandomSpanInfilling/HumanEval/15/8 | python | code_infilling | HumanEval_RandomSpanInfilling | string_sequence |
[
[
"0",
"'0'"
],
[
"3",
"'0 1 2 3'"
],
[
"10",
"'0 1 2 3 4 5 6 7 8 9 10'"
]
] | [] | or | x in range(n + 1)])
| python | Return a string containing space-delimited numbers starting from 0 upto n inclusive. | [] |
def string_sequence(n: int) -> str:
""" Return a string containing space-delimited numbers starting from 0 upto n inclusive.
"""
return ' '.join([str(x) f | [
[
"0",
"'0'"
],
[
"5",
"'0 1 2 3 4 5'"
]
] | RandomSpanInfilling/HumanEval/15/9 | python | code_infilling | HumanEval_RandomSpanInfilling | string_sequence |
[
[
"0",
"'0'"
],
[
"3",
"'0 1 2 3'"
],
[
"10",
"'0 1 2 3 4 5 6 7 8 9 10'"
]
] | [] | for x in range(n + | 1)])
| python | Return a string containing space-delimited numbers starting from 0 upto n inclusive. | [] |
def string_sequence(n: int) -> str:
""" Return a string containing space-delimited numbers starting from 0 upto n inclusive.
"""
return ' '.join([str(x) | [
[
"0",
"'0'"
],
[
"5",
"'0 1 2 3 4 5'"
]
] | RandomSpanInfilling/HumanEval/15/10 | python | code_infilling | HumanEval_RandomSpanInfilling | string_sequence |
[
[
"''",
"0"
],
[
"'abcde'",
"5"
],
[
"'abcde' + 'cade' + 'CADE'",
"5"
],
[
"'aaaaAAAAaaaa'",
"1"
],
[
"'Jerry jERRY JeRRRY'",
"5"
]
] | [] | return len(set(string.lower( | )))
| python | Given a string, find out how many distinct characters (regardless of case) does it consist of | [] |
def count_distinct_characters(string: str) -> int:
""" Given a string, find out how many distinct characters (regardless of case) does it consist of
"""
| [
[
"'xyzXYZ'",
"3"
],
[
"'Jerry'",
"4"
]
] | RandomSpanInfilling/HumanEval/16/1 | python | code_infilling | HumanEval_RandomSpanInfilling | count_distinct_characters |
[
[
"''",
"0"
],
[
"'abcde'",
"5"
],
[
"'abcde' + 'cade' + 'CADE'",
"5"
],
[
"'aaaaAAAAaaaa'",
"1"
],
[
"'Jerry jERRY JeRRRY'",
"5"
]
] | [] | return len(set | (string.lower()))
| python | Given a string, find out how many distinct characters (regardless of case) does it consist of | [] |
def count_distinct_characters(string: str) -> int:
""" Given a string, find out how many distinct characters (regardless of case) does it consist of
"""
| [
[
"'xyzXYZ'",
"3"
],
[
"'Jerry'",
"4"
]
] | RandomSpanInfilling/HumanEval/16/2 | python | code_infilling | HumanEval_RandomSpanInfilling | count_distinct_characters |
[
[
"''",
"0"
],
[
"'abcde'",
"5"
],
[
"'abcde' + 'cade' + 'CADE'",
"5"
],
[
"'aaaaAAAAaaaa'",
"1"
],
[
"'Jerry jERRY JeRRRY'",
"5"
]
] | [] | et(string.lower()) | )
| python | Given a string, find out how many distinct characters (regardless of case) does it consist of | [] |
def count_distinct_characters(string: str) -> int:
""" Given a string, find out how many distinct characters (regardless of case) does it consist of
"""
return len(s | [
[
"'xyzXYZ'",
"3"
],
[
"'Jerry'",
"4"
]
] | RandomSpanInfilling/HumanEval/16/3 | python | code_infilling | HumanEval_RandomSpanInfilling | count_distinct_characters |
[
[
"''",
"0"
],
[
"'abcde'",
"5"
],
[
"'abcde' + 'cade' + 'CADE'",
"5"
],
[
"'aaaaAAAAaaaa'",
"1"
],
[
"'Jerry jERRY JeRRRY'",
"5"
]
] | [] | ow | er()))
| python | Given a string, find out how many distinct characters (regardless of case) does it consist of | [] |
def count_distinct_characters(string: str) -> int:
""" Given a string, find out how many distinct characters (regardless of case) does it consist of
"""
return len(set(string.l | [
[
"'xyzXYZ'",
"3"
],
[
"'Jerry'",
"4"
]
] | RandomSpanInfilling/HumanEval/16/4 | python | code_infilling | HumanEval_RandomSpanInfilling | count_distinct_characters |
[
[
"''",
"0"
],
[
"'abcde'",
"5"
],
[
"'abcde' + 'cade' + 'CADE'",
"5"
],
[
"'aaaaAAAAaaaa'",
"1"
],
[
"'Jerry jERRY JeRRRY'",
"5"
]
] | [] | eturn len(set(string.lo | wer()))
| python | Given a string, find out how many distinct characters (regardless of case) does it consist of | [] |
def count_distinct_characters(string: str) -> int:
""" Given a string, find out how many distinct characters (regardless of case) does it consist of
"""
r | [
[
"'xyzXYZ'",
"3"
],
[
"'Jerry'",
"4"
]
] | RandomSpanInfilling/HumanEval/16/5 | python | code_infilling | HumanEval_RandomSpanInfilling | count_distinct_characters |
[
[
"''",
"0"
],
[
"'abcde'",
"5"
],
[
"'abcde' + 'cade' + 'CADE'",
"5"
],
[
"'aaaaAAAAaaaa'",
"1"
],
[
"'Jerry jERRY JeRRRY'",
"5"
]
] | [] | )
| python | Given a string, find out how many distinct characters (regardless of case) does it consist of | [] |
def count_distinct_characters(string: str) -> int:
""" Given a string, find out how many distinct characters (regardless of case) does it consist of
"""
return len(set(string.lower()) | [
[
"'xyzXYZ'",
"3"
],
[
"'Jerry'",
"4"
]
] | RandomSpanInfilling/HumanEval/16/6 | python | code_infilling | HumanEval_RandomSpanInfilling | count_distinct_characters | |
[
[
"''",
"0"
],
[
"'abcde'",
"5"
],
[
"'abcde' + 'cade' + 'CADE'",
"5"
],
[
"'aaaaAAAAaaaa'",
"1"
],
[
"'Jerry jERRY JeRRRY'",
"5"
]
] | [] | ng.lo | wer()))
| python | Given a string, find out how many distinct characters (regardless of case) does it consist of | [] |
def count_distinct_characters(string: str) -> int:
""" Given a string, find out how many distinct characters (regardless of case) does it consist of
"""
return len(set(stri | [
[
"'xyzXYZ'",
"3"
],
[
"'Jerry'",
"4"
]
] | RandomSpanInfilling/HumanEval/16/7 | python | code_infilling | HumanEval_RandomSpanInfilling | count_distinct_characters |
[
[
"''",
"0"
],
[
"'abcde'",
"5"
],
[
"'abcde' + 'cade' + 'CADE'",
"5"
],
[
"'aaaaAAAAaaaa'",
"1"
],
[
"'Jerry jERRY JeRRRY'",
"5"
]
] | [] | r()) | )
| python | Given a string, find out how many distinct characters (regardless of case) does it consist of | [] |
def count_distinct_characters(string: str) -> int:
""" Given a string, find out how many distinct characters (regardless of case) does it consist of
"""
return len(set(string.lowe | [
[
"'xyzXYZ'",
"3"
],
[
"'Jerry'",
"4"
]
] | RandomSpanInfilling/HumanEval/16/8 | python | code_infilling | HumanEval_RandomSpanInfilling | count_distinct_characters |
[
[
"''",
"0"
],
[
"'abcde'",
"5"
],
[
"'abcde' + 'cade' + 'CADE'",
"5"
],
[
"'aaaaAAAAaaaa'",
"1"
],
[
"'Jerry jERRY JeRRRY'",
"5"
]
] | [] | tring.lower( | )))
| python | Given a string, find out how many distinct characters (regardless of case) does it consist of | [] |
def count_distinct_characters(string: str) -> int:
""" Given a string, find out how many distinct characters (regardless of case) does it consist of
"""
return len(set(s | [
[
"'xyzXYZ'",
"3"
],
[
"'Jerry'",
"4"
]
] | RandomSpanInfilling/HumanEval/16/9 | python | code_infilling | HumanEval_RandomSpanInfilling | count_distinct_characters |
[
[
"''",
"0"
],
[
"'abcde'",
"5"
],
[
"'abcde' + 'cade' + 'CADE'",
"5"
],
[
"'aaaaAAAAaaaa'",
"1"
],
[
"'Jerry jERRY JeRRRY'",
"5"
]
] | [] | ing.lower | ()))
| python | Given a string, find out how many distinct characters (regardless of case) does it consist of | [] |
def count_distinct_characters(string: str) -> int:
""" Given a string, find out how many distinct characters (regardless of case) does it consist of
"""
return len(set(str | [
[
"'xyzXYZ'",
"3"
],
[
"'Jerry'",
"4"
]
] | RandomSpanInfilling/HumanEval/16/10 | python | code_infilling | HumanEval_RandomSpanInfilling | count_distinct_characters |
[
[
"''",
"[]"
],
[
"'o o o o'",
"[4, 4, 4, 4]"
],
[
"'.| .| .| .|'",
"[1, 1, 1, 1]"
],
[
"'o| o| .| .| o o o o'",
"[2, 2, 1, 1, 4, 4, 4, 4]"
],
[
"'o| .| o| .| o o| o o|'",
"[2, 1, 2, 1, 4, 2, 4, 2]"
]
] | [
"from typing import List"
] | '.|': 1}
return [note_map[x] | for x in music_string.split(' ') if x]
| python | Input to this function is a string representing musical notes in a special ASCII format.
Your task is to parse this string and return list of integers corresponding to how many beats does each
not last.
Here is a legend:
'o' - whole note, lasts four beats
'o|' - half note, lasts two beats
'.|' - quater note, lasts one beat | [] | from typing import List
def parse_music(music_string: str) -> List[int]:
""" Input to this function is a string representing musical notes in a special ASCII format.
Your task is to parse this string and return list of integers corresponding to how many beats does each
not last.
Here is a legend:
'o' - whole note, lasts four beats
'o|' - half note, lasts two beats
'.|' - quater note, lasts one beat
"""
note_map = {'o': 4, 'o|': 2, | [
[
"'o o| .| o| o| .| .| .| .| o o'",
"[4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]"
]
] | RandomSpanInfilling/HumanEval/17/1 | python | code_infilling | HumanEval_RandomSpanInfilling | parse_music |
[
[
"''",
"[]"
],
[
"'o o o o'",
"[4, 4, 4, 4]"
],
[
"'.| .| .| .|'",
"[1, 1, 1, 1]"
],
[
"'o| o| .| .| o o o o'",
"[2, 2, 1, 1, 4, 4, 4, 4]"
],
[
"'o| .| o| .| o o| o o|'",
"[2, 1, 2, 1, 4, 2, 4, 2]"
]
] | [
"from typing import List"
] | o': 4, | 'o|': 2, '.|': 1}
return [note_map[x] for x in music_string.split(' ') if x]
| python | Input to this function is a string representing musical notes in a special ASCII format.
Your task is to parse this string and return list of integers corresponding to how many beats does each
not last.
Here is a legend:
'o' - whole note, lasts four beats
'o|' - half note, lasts two beats
'.|' - quater note, lasts one beat | [] | from typing import List
def parse_music(music_string: str) -> List[int]:
""" Input to this function is a string representing musical notes in a special ASCII format.
Your task is to parse this string and return list of integers corresponding to how many beats does each
not last.
Here is a legend:
'o' - whole note, lasts four beats
'o|' - half note, lasts two beats
'.|' - quater note, lasts one beat
"""
note_map = {' | [
[
"'o o| .| o| o| .| .| .| .| o o'",
"[4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]"
]
] | RandomSpanInfilling/HumanEval/17/2 | python | code_infilling | HumanEval_RandomSpanInfilling | parse_music |
[
[
"''",
"[]"
],
[
"'o o o o'",
"[4, 4, 4, 4]"
],
[
"'.| .| .| .|'",
"[1, 1, 1, 1]"
],
[
"'o| o| .| .| o o o o'",
"[2, 2, 1, 1, 4, 4, 4, 4]"
],
[
"'o| .| o| .| o o| o o|'",
"[2, 1, 2, 1, 4, 2, 4, 2]"
]
] | [
"from typing import List"
] | ' ') if x]
| python | Input to this function is a string representing musical notes in a special ASCII format.
Your task is to parse this string and return list of integers corresponding to how many beats does each
not last.
Here is a legend:
'o' - whole note, lasts four beats
'o|' - half note, lasts two beats
'.|' - quater note, lasts one beat | [] | from typing import List
def parse_music(music_string: str) -> List[int]:
""" Input to this function is a string representing musical notes in a special ASCII format.
Your task is to parse this string and return list of integers corresponding to how many beats does each
not last.
Here is a legend:
'o' - whole note, lasts four beats
'o|' - half note, lasts two beats
'.|' - quater note, lasts one beat
"""
note_map = {'o': 4, 'o|': 2, '.|': 1}
return [note_map[x] for x in music_string.split( | [
[
"'o o| .| o| o| .| .| .| .| o o'",
"[4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]"
]
] | RandomSpanInfilling/HumanEval/17/3 | python | code_infilling | HumanEval_RandomSpanInfilling | parse_music | |
[
[
"''",
"[]"
],
[
"'o o o o'",
"[4, 4, 4, 4]"
],
[
"'.| .| .| .|'",
"[1, 1, 1, 1]"
],
[
"'o| o| .| .| o o o o'",
"[2, 2, 1, 1, 4, 4, 4, 4]"
],
[
"'o| .| o| .| o o| o o|'",
"[2, 1, 2, 1, 4, 2, 4, 2]"
]
] | [
"from typing import List"
] | [not | e_map[x] for x in music_string.split(' ') if x]
| python | Input to this function is a string representing musical notes in a special ASCII format.
Your task is to parse this string and return list of integers corresponding to how many beats does each
not last.
Here is a legend:
'o' - whole note, lasts four beats
'o|' - half note, lasts two beats
'.|' - quater note, lasts one beat | [] | from typing import List
def parse_music(music_string: str) -> List[int]:
""" Input to this function is a string representing musical notes in a special ASCII format.
Your task is to parse this string and return list of integers corresponding to how many beats does each
not last.
Here is a legend:
'o' - whole note, lasts four beats
'o|' - half note, lasts two beats
'.|' - quater note, lasts one beat
"""
note_map = {'o': 4, 'o|': 2, '.|': 1}
return | [
[
"'o o| .| o| o| .| .| .| .| o o'",
"[4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]"
]
] | RandomSpanInfilling/HumanEval/17/4 | python | code_infilling | HumanEval_RandomSpanInfilling | parse_music |
[
[
"''",
"[]"
],
[
"'o o o o'",
"[4, 4, 4, 4]"
],
[
"'.| .| .| .|'",
"[1, 1, 1, 1]"
],
[
"'o| o| .| .| o o o o'",
"[2, 2, 1, 1, 4, 4, 4, 4]"
],
[
"'o| .| o| .| o o| o o|'",
"[2, 1, 2, 1, 4, 2, 4, 2]"
]
] | [
"from typing import List"
] | for x in music_string.split(' ') if x | ]
| python | Input to this function is a string representing musical notes in a special ASCII format.
Your task is to parse this string and return list of integers corresponding to how many beats does each
not last.
Here is a legend:
'o' - whole note, lasts four beats
'o|' - half note, lasts two beats
'.|' - quater note, lasts one beat | [] | from typing import List
def parse_music(music_string: str) -> List[int]:
""" Input to this function is a string representing musical notes in a special ASCII format.
Your task is to parse this string and return list of integers corresponding to how many beats does each
not last.
Here is a legend:
'o' - whole note, lasts four beats
'o|' - half note, lasts two beats
'.|' - quater note, lasts one beat
"""
note_map = {'o': 4, 'o|': 2, '.|': 1}
return [note_map[x] | [
[
"'o o| .| o| o| .| .| .| .| o o'",
"[4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]"
]
] | RandomSpanInfilling/HumanEval/17/5 | python | code_infilling | HumanEval_RandomSpanInfilling | parse_music |
[
[
"''",
"[]"
],
[
"'o o o o'",
"[4, 4, 4, 4]"
],
[
"'.| .| .| .|'",
"[1, 1, 1, 1]"
],
[
"'o| o| .| .| o o o o'",
"[2, 2, 1, 1, 4, 4, 4, 4]"
],
[
"'o| .| o| .| o o| o o|'",
"[2, 1, 2, 1, 4, 2, 4, 2]"
]
] | [
"from typing import List"
] | 'o|': 2, '.|': 1}
| return [note_map[x] for x in music_string.split(' ') if x]
| python | Input to this function is a string representing musical notes in a special ASCII format.
Your task is to parse this string and return list of integers corresponding to how many beats does each
not last.
Here is a legend:
'o' - whole note, lasts four beats
'o|' - half note, lasts two beats
'.|' - quater note, lasts one beat | [] | from typing import List
def parse_music(music_string: str) -> List[int]:
""" Input to this function is a string representing musical notes in a special ASCII format.
Your task is to parse this string and return list of integers corresponding to how many beats does each
not last.
Here is a legend:
'o' - whole note, lasts four beats
'o|' - half note, lasts two beats
'.|' - quater note, lasts one beat
"""
note_map = {'o': 4, | [
[
"'o o| .| o| o| .| .| .| .| o o'",
"[4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]"
]
] | RandomSpanInfilling/HumanEval/17/6 | python | code_infilling | HumanEval_RandomSpanInfilling | parse_music |
[
[
"''",
"[]"
],
[
"'o o o o'",
"[4, 4, 4, 4]"
],
[
"'.| .| .| .|'",
"[1, 1, 1, 1]"
],
[
"'o| o| .| .| o o o o'",
"[2, 2, 1, 1, 4, 4, 4, 4]"
],
[
"'o| .| o| .| o o| o o|'",
"[2, 1, 2, 1, 4, 2, 4, 2]"
]
] | [
"from typing import List"
] | , '.|': 1}
| return [note_map[x] for x in music_string.split(' ') if x]
| python | Input to this function is a string representing musical notes in a special ASCII format.
Your task is to parse this string and return list of integers corresponding to how many beats does each
not last.
Here is a legend:
'o' - whole note, lasts four beats
'o|' - half note, lasts two beats
'.|' - quater note, lasts one beat | [] | from typing import List
def parse_music(music_string: str) -> List[int]:
""" Input to this function is a string representing musical notes in a special ASCII format.
Your task is to parse this string and return list of integers corresponding to how many beats does each
not last.
Here is a legend:
'o' - whole note, lasts four beats
'o|' - half note, lasts two beats
'.|' - quater note, lasts one beat
"""
note_map = {'o': 4, 'o|': 2 | [
[
"'o o| .| o| o| .| .| .| .| o o'",
"[4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]"
]
] | RandomSpanInfilling/HumanEval/17/7 | python | code_infilling | HumanEval_RandomSpanInfilling | parse_music |
[
[
"''",
"[]"
],
[
"'o o o o'",
"[4, 4, 4, 4]"
],
[
"'.| .| .| .|'",
"[1, 1, 1, 1]"
],
[
"'o| o| .| .| o o o o'",
"[2, 2, 1, 1, 4, 4, 4, 4]"
],
[
"'o| .| o| .| o o| o o|'",
"[2, 1, 2, 1, 4, 2, 4, 2]"
]
] | [
"from typing import List"
] | , 'o|': 2, '.|': 1}
return [note_map[x] for x in music_stri | ng.split(' ') if x]
| python | Input to this function is a string representing musical notes in a special ASCII format.
Your task is to parse this string and return list of integers corresponding to how many beats does each
not last.
Here is a legend:
'o' - whole note, lasts four beats
'o|' - half note, lasts two beats
'.|' - quater note, lasts one beat | [] | from typing import List
def parse_music(music_string: str) -> List[int]:
""" Input to this function is a string representing musical notes in a special ASCII format.
Your task is to parse this string and return list of integers corresponding to how many beats does each
not last.
Here is a legend:
'o' - whole note, lasts four beats
'o|' - half note, lasts two beats
'.|' - quater note, lasts one beat
"""
note_map = {'o': 4 | [
[
"'o o| .| o| o| .| .| .| .| o o'",
"[4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]"
]
] | RandomSpanInfilling/HumanEval/17/8 | python | code_infilling | HumanEval_RandomSpanInfilling | parse_music |
[
[
"''",
"[]"
],
[
"'o o o o'",
"[4, 4, 4, 4]"
],
[
"'.| .| .| .|'",
"[1, 1, 1, 1]"
],
[
"'o| o| .| .| o o o o'",
"[2, 2, 1, 1, 4, 4, 4, 4]"
],
[
"'o| .| o| .| o o| o o|'",
"[2, 1, 2, 1, 4, 2, 4, 2]"
]
] | [
"from typing import List"
] | |': 2, '.|': 1}
return [note_map[x] | for x in music_string.split(' ') if x]
| python | Input to this function is a string representing musical notes in a special ASCII format.
Your task is to parse this string and return list of integers corresponding to how many beats does each
not last.
Here is a legend:
'o' - whole note, lasts four beats
'o|' - half note, lasts two beats
'.|' - quater note, lasts one beat | [] | from typing import List
def parse_music(music_string: str) -> List[int]:
""" Input to this function is a string representing musical notes in a special ASCII format.
Your task is to parse this string and return list of integers corresponding to how many beats does each
not last.
Here is a legend:
'o' - whole note, lasts four beats
'o|' - half note, lasts two beats
'.|' - quater note, lasts one beat
"""
note_map = {'o': 4, 'o | [
[
"'o o| .| o| o| .| .| .| .| o o'",
"[4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]"
]
] | RandomSpanInfilling/HumanEval/17/9 | python | code_infilling | HumanEval_RandomSpanInfilling | parse_music |
[
[
"''",
"[]"
],
[
"'o o o o'",
"[4, 4, 4, 4]"
],
[
"'.| .| .| .|'",
"[1, 1, 1, 1]"
],
[
"'o| o| .| .| o o o o'",
"[2, 2, 1, 1, 4, 4, 4, 4]"
],
[
"'o| .| o| .| o o| o o|'",
"[2, 1, 2, 1, 4, 2, 4, 2]"
]
] | [
"from typing import List"
] | note_map = {'o': 4, 'o|': 2, '.|': 1}
return [note_map[x] for x in music_string.split(' ') if x]
| python | Input to this function is a string representing musical notes in a special ASCII format.
Your task is to parse this string and return list of integers corresponding to how many beats does each
not last.
Here is a legend:
'o' - whole note, lasts four beats
'o|' - half note, lasts two beats
'.|' - quater note, lasts one beat | [] | from typing import List
def parse_music(music_string: str) -> List[int]:
""" Input to this function is a string representing musical notes in a special ASCII format.
Your task is to parse this string and return list of integers corresponding to how many beats does each
not last.
Here is a legend:
'o' - whole note, lasts four beats
'o|' - half note, lasts two beats
'.|' - quater note, lasts one beat
"""
| [
[
"'o o| .| o| o| .| .| .| .| o o'",
"[4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]"
]
] | RandomSpanInfilling/HumanEval/17/10 | python | code_infilling | HumanEval_RandomSpanInfilling | parse_music | |
[
[
"'', 'x'",
"0"
],
[
"'xyxyxyx', 'x'",
"4"
],
[
"'cacacacac', 'cac'",
"4"
],
[
"'john doe', 'john'",
"1"
]
] | [] | for i in range(len(string) - len(substring) + 1):
if string[i:i+len(substrin | g)] == substring:
times += 1
return times
| python | Find how many times a given substring can be found in the original string. Count overlaping cases. | [] |
def how_many_times(string: str, substring: str) -> int:
""" Find how many times a given substring can be found in the original string. Count overlaping cases.
"""
times = 0
| [
[
"'', 'a'",
"0"
],
[
"'aaa', 'a'",
"3"
],
[
"'aaaa', 'aa'",
"3"
]
] | RandomSpanInfilling/HumanEval/18/1 | python | code_infilling | HumanEval_RandomSpanInfilling | how_many_times |
[
[
"'', 'x'",
"0"
],
[
"'xyxyxyx', 'x'",
"4"
],
[
"'cacacacac', 'cac'",
"4"
],
[
"'john doe', 'john'",
"1"
]
] | [] | es += 1
return time | s
| python | Find how many times a given substring can be found in the original string. Count overlaping cases. | [] |
def how_many_times(string: str, substring: str) -> int:
""" Find how many times a given substring can be found in the original string. Count overlaping cases.
"""
times = 0
for i in range(len(string) - len(substring) + 1):
if string[i:i+len(substring)] == substring:
tim | [
[
"'', 'a'",
"0"
],
[
"'aaa', 'a'",
"3"
],
[
"'aaaa', 'aa'",
"3"
]
] | RandomSpanInfilling/HumanEval/18/2 | python | code_infilling | HumanEval_RandomSpanInfilling | how_many_times |
[
[
"'', 'x'",
"0"
],
[
"'xyxyxyx', 'x'",
"4"
],
[
"'cacacacac', 'cac'",
"4"
],
[
"'john doe', 'john'",
"1"
]
] | [] | stri | ng) - len(substring) + 1):
if string[i:i+len(substring)] == substring:
times += 1
return times
| python | Find how many times a given substring can be found in the original string. Count overlaping cases. | [] |
def how_many_times(string: str, substring: str) -> int:
""" Find how many times a given substring can be found in the original string. Count overlaping cases.
"""
times = 0
for i in range(len( | [
[
"'', 'a'",
"0"
],
[
"'aaa', 'a'",
"3"
],
[
"'aaaa', 'aa'",
"3"
]
] | RandomSpanInfilling/HumanEval/18/3 | python | code_infilling | HumanEval_RandomSpanInfilling | how_many_times |
[
[
"'', 'x'",
"0"
],
[
"'xyxyxyx', 'x'",
"4"
],
[
"'cacacacac', 'cac'",
"4"
],
[
"'john doe', 'john'",
"1"
]
] | [] | in range(len(string) - len(substring) + 1):
if string[i:i+len(sub | string)] == substring:
times += 1
return times
| python | Find how many times a given substring can be found in the original string. Count overlaping cases. | [] |
def how_many_times(string: str, substring: str) -> int:
""" Find how many times a given substring can be found in the original string. Count overlaping cases.
"""
times = 0
for i | [
[
"'', 'a'",
"0"
],
[
"'aaa', 'a'",
"3"
],
[
"'aaaa', 'aa'",
"3"
]
] | RandomSpanInfilling/HumanEval/18/4 | python | code_infilling | HumanEval_RandomSpanInfilling | how_many_times |
[
[
"'', 'x'",
"0"
],
[
"'xyxyxyx', 'x'",
"4"
],
[
"'cacacacac', 'cac'",
"4"
],
[
"'john doe', 'john'",
"1"
]
] | [] | en(substring) + 1):
if string[i:i+len(substring)] == substring:
times += 1
ret | urn times
| python | Find how many times a given substring can be found in the original string. Count overlaping cases. | [] |
def how_many_times(string: str, substring: str) -> int:
""" Find how many times a given substring can be found in the original string. Count overlaping cases.
"""
times = 0
for i in range(len(string) - l | [
[
"'', 'a'",
"0"
],
[
"'aaa', 'a'",
"3"
],
[
"'aaaa', 'aa'",
"3"
]
] | RandomSpanInfilling/HumanEval/18/5 | python | code_infilling | HumanEval_RandomSpanInfilling | how_many_times |
[
[
"'', 'x'",
"0"
],
[
"'xyxyxyx', 'x'",
"4"
],
[
"'cacacacac', 'cac'",
"4"
],
[
"'john doe', 'john'",
"1"
]
] | [] | 0
for i in range(len(string) - len(substring) + 1):
if string[i:i+len(substring)] == substring:
times += 1
re | turn times
| python | Find how many times a given substring can be found in the original string. Count overlaping cases. | [] |
def how_many_times(string: str, substring: str) -> int:
""" Find how many times a given substring can be found in the original string. Count overlaping cases.
"""
times = | [
[
"'', 'a'",
"0"
],
[
"'aaa', 'a'",
"3"
],
[
"'aaaa', 'aa'",
"3"
]
] | RandomSpanInfilling/HumanEval/18/6 | python | code_infilling | HumanEval_RandomSpanInfilling | how_many_times |
[
[
"'', 'x'",
"0"
],
[
"'xyxyxyx', 'x'",
"4"
],
[
"'cacacacac', 'cac'",
"4"
],
[
"'john doe', 'john'",
"1"
]
] | [] | ng) + 1):
if string[i:i+len(substring)] == substring:
t | imes += 1
return times
| python | Find how many times a given substring can be found in the original string. Count overlaping cases. | [] |
def how_many_times(string: str, substring: str) -> int:
""" Find how many times a given substring can be found in the original string. Count overlaping cases.
"""
times = 0
for i in range(len(string) - len(substri | [
[
"'', 'a'",
"0"
],
[
"'aaa', 'a'",
"3"
],
[
"'aaaa', 'aa'",
"3"
]
] | RandomSpanInfilling/HumanEval/18/7 | python | code_infilling | HumanEval_RandomSpanInfilling | how_many_times |
[
[
"'', 'x'",
"0"
],
[
"'xyxyxyx', 'x'",
"4"
],
[
"'cacacacac', 'cac'",
"4"
],
[
"'john doe', 'john'",
"1"
]
] | [] | en(string) - len(subs | tring) + 1):
if string[i:i+len(substring)] == substring:
times += 1
return times
| python | Find how many times a given substring can be found in the original string. Count overlaping cases. | [] |
def how_many_times(string: str, substring: str) -> int:
""" Find how many times a given substring can be found in the original string. Count overlaping cases.
"""
times = 0
for i in range(l | [
[
"'', 'a'",
"0"
],
[
"'aaa', 'a'",
"3"
],
[
"'aaaa', 'aa'",
"3"
]
] | RandomSpanInfilling/HumanEval/18/8 | python | code_infilling | HumanEval_RandomSpanInfilling | how_many_times |
[
[
"'', 'x'",
"0"
],
[
"'xyxyxyx', 'x'",
"4"
],
[
"'cacacacac', 'cac'",
"4"
],
[
"'john doe', 'john'",
"1"
]
] | [] | for i in range(len(string) - len(substring) + | 1):
if string[i:i+len(substring)] == substring:
times += 1
return times
| python | Find how many times a given substring can be found in the original string. Count overlaping cases. | [] |
def how_many_times(string: str, substring: str) -> int:
""" Find how many times a given substring can be found in the original string. Count overlaping cases.
"""
times = 0
| [
[
"'', 'a'",
"0"
],
[
"'aaa', 'a'",
"3"
],
[
"'aaaa', 'aa'",
"3"
]
] | RandomSpanInfilling/HumanEval/18/9 | python | code_infilling | HumanEval_RandomSpanInfilling | how_many_times |
[
[
"'', 'x'",
"0"
],
[
"'xyxyxyx', 'x'",
"4"
],
[
"'cacacacac', 'cac'",
"4"
],
[
"'john doe', 'john'",
"1"
]
] | [] | es = 0
for i in range(len(string) - len(substring) + 1):
if string[i:i+len(substring)] == substring:
times += 1 |
return times
| python | Find how many times a given substring can be found in the original string. Count overlaping cases. | [] |
def how_many_times(string: str, substring: str) -> int:
""" Find how many times a given substring can be found in the original string. Count overlaping cases.
"""
tim | [
[
"'', 'a'",
"0"
],
[
"'aaa', 'a'",
"3"
],
[
"'aaaa', 'aa'",
"3"
]
] | RandomSpanInfilling/HumanEval/18/10 | python | code_infilling | HumanEval_RandomSpanInfilling | how_many_times |
[
[
"''",
"''"
],
[
"'three'",
"'three'"
],
[
"'three five nine'",
"'three five nine'"
],
[
"'five zero four seven nine eight'",
"'zero four five seven eight nine'"
],
[
"'six five four three two one zero'",
"'zero one two three four five six'"
]
] | [
"from typing import List"
] | i | x': 6,
'seven': 7,
'eight': 8,
'nine': 9
}
return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
| python | Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest | [] | from typing import List
def sort_numbers(numbers: str) -> str:
""" Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
"""
value_map = {
'zero': 0,
'one': 1,
'two': 2,
'three': 3,
'four': 4,
'five': 5,
's | [
[
"'three one five'",
"'one three five'"
]
] | RandomSpanInfilling/HumanEval/19/1 | python | code_infilling | HumanEval_RandomSpanInfilling | sort_numbers |
[
[
"''",
"''"
],
[
"'three'",
"'three'"
],
[
"'three five nine'",
"'three five nine'"
],
[
"'five zero four seven nine eight'",
"'zero four five seven eight nine'"
],
[
"'six five four three two one zero'",
"'zero one two three four five six'"
]
] | [
"from typing import List"
] | ,
'four': 4,
'five': 5,
'six': 6,
'seven': 7,
'eight': 8,
'nine': 9
}
return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambd | a x: value_map[x]))
| python | Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest | [] | from typing import List
def sort_numbers(numbers: str) -> str:
""" Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
"""
value_map = {
'zero': 0,
'one': 1,
'two': 2,
'three': 3 | [
[
"'three one five'",
"'one three five'"
]
] | RandomSpanInfilling/HumanEval/19/2 | python | code_infilling | HumanEval_RandomSpanInfilling | sort_numbers |
[
[
"''",
"''"
],
[
"'three'",
"'three'"
],
[
"'three five nine'",
"'three five nine'"
],
[
"'five zero four seven nine eight'",
"'zero four five seven eight nine'"
],
[
"'six five four three two one zero'",
"'zero one two three four five six'"
]
] | [
"from typing import List"
] | : 1,
'two': 2,
'three': 3,
'four': 4,
'five': 5,
'six': 6,
'seven': 7,
'eight': 8,
'nine': 9
}
| return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
| python | Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest | [] | from typing import List
def sort_numbers(numbers: str) -> str:
""" Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
"""
value_map = {
'zero': 0,
'one' | [
[
"'three one five'",
"'one three five'"
]
] | RandomSpanInfilling/HumanEval/19/3 | python | code_infilling | HumanEval_RandomSpanInfilling | sort_numbers |
[
[
"''",
"''"
],
[
"'three'",
"'three'"
],
[
"'three five nine'",
"'three five nine'"
],
[
"'five zero four seven nine eight'",
"'zero four five seven eight nine'"
],
[
"'six five four three two one zero'",
"'zero one two three four five six'"
]
] | [
"from typing import List"
] | 'seven': 7,
'eight': | 8,
'nine': 9
}
return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
| python | Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest | [] | from typing import List
def sort_numbers(numbers: str) -> str:
""" Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
"""
value_map = {
'zero': 0,
'one': 1,
'two': 2,
'three': 3,
'four': 4,
'five': 5,
'six': 6,
| [
[
"'three one five'",
"'one three five'"
]
] | RandomSpanInfilling/HumanEval/19/4 | python | code_infilling | HumanEval_RandomSpanInfilling | sort_numbers |
[
[
"''",
"''"
],
[
"'three'",
"'three'"
],
[
"'three five nine'",
"'three five nine'"
],
[
"'five zero four seven nine eight'",
"'zero four five seven eight nine'"
],
[
"'six five four three two one zero'",
"'zero one two three four five six'"
]
] | [
"from typing import List"
] | 'two': 2,
'three': 3,
'four': 4,
'five': 5,
'six': 6,
'seven': 7,
'eight': 8,
| 'nine': 9
}
return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
| python | Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest | [] | from typing import List
def sort_numbers(numbers: str) -> str:
""" Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
"""
value_map = {
'zero': 0,
'one': 1,
| [
[
"'three one five'",
"'one three five'"
]
] | RandomSpanInfilling/HumanEval/19/5 | python | code_infilling | HumanEval_RandomSpanInfilling | sort_numbers |
[
[
"''",
"''"
],
[
"'three'",
"'three'"
],
[
"'three five nine'",
"'three five nine'"
],
[
"'five zero four seven nine eight'",
"'zero four five seven eight nine'"
],
[
"'six five four three two one zero'",
"'zero one two three four five six'"
]
] | [
"from typing import List"
] | e': 5,
'six': 6,
| 'seven': 7,
'eight': 8,
'nine': 9
}
return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
| python | Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest | [] | from typing import List
def sort_numbers(numbers: str) -> str:
""" Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
"""
value_map = {
'zero': 0,
'one': 1,
'two': 2,
'three': 3,
'four': 4,
'fiv | [
[
"'three one five'",
"'one three five'"
]
] | RandomSpanInfilling/HumanEval/19/6 | python | code_infilling | HumanEval_RandomSpanInfilling | sort_numbers |
[
[
"''",
"''"
],
[
"'three'",
"'three'"
],
[
"'three five nine'",
"'three five nine'"
],
[
"'five zero four seven nine eight'",
"'zero four five seven eight nine'"
],
[
"'six five four three two one zero'",
"'zero one two three four five six'"
]
] | [
"from typing import List"
] | 'two': 2,
'three': 3,
'four': 4,
'five': 5,
'six': 6,
'seven': 7,
'eight': 8,
'nine': 9
}
return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x] | ))
| python | Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest | [] | from typing import List
def sort_numbers(numbers: str) -> str:
""" Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
"""
value_map = {
'zero': 0,
'one': 1,
| [
[
"'three one five'",
"'one three five'"
]
] | RandomSpanInfilling/HumanEval/19/7 | python | code_infilling | HumanEval_RandomSpanInfilling | sort_numbers |
[
[
"''",
"''"
],
[
"'three'",
"'three'"
],
[
"'three five nine'",
"'three five nine'"
],
[
"'five zero four seven nine eight'",
"'zero four five seven eight nine'"
],
[
"'six five four three two one zero'",
"'zero one two three four five six'"
]
] | [
"from typing import List"
] | 'e | ight': 8,
'nine': 9
}
return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
| python | Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest | [] | from typing import List
def sort_numbers(numbers: str) -> str:
""" Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
"""
value_map = {
'zero': 0,
'one': 1,
'two': 2,
'three': 3,
'four': 4,
'five': 5,
'six': 6,
'seven': 7,
| [
[
"'three one five'",
"'one three five'"
]
] | RandomSpanInfilling/HumanEval/19/8 | python | code_infilling | HumanEval_RandomSpanInfilling | sort_numbers |
[
[
"''",
"''"
],
[
"'three'",
"'three'"
],
[
"'three five nine'",
"'three five nine'"
],
[
"'five zero four seven nine eight'",
"'zero four five seven eight nine'"
],
[
"'six five four three two one zero'",
"'zero one two three four five six'"
]
] | [
"from typing import List"
] | ,
'two': 2,
'three': 3,
'four': 4,
'five': 5,
'six': 6,
'seven': 7,
'eight': 8,
'nine': 9
}
return ' '.join(sorted([x for x in numbers.split(' ') | if x], key=lambda x: value_map[x]))
| python | Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest | [] | from typing import List
def sort_numbers(numbers: str) -> str:
""" Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
"""
value_map = {
'zero': 0,
'one': 1 | [
[
"'three one five'",
"'one three five'"
]
] | RandomSpanInfilling/HumanEval/19/9 | python | code_infilling | HumanEval_RandomSpanInfilling | sort_numbers |
[
[
"''",
"''"
],
[
"'three'",
"'three'"
],
[
"'three five nine'",
"'three five nine'"
],
[
"'five zero four seven nine eight'",
"'zero four five seven eight nine'"
],
[
"'six five four three two one zero'",
"'zero one two three four five six'"
]
] | [
"from typing import List"
] | 'four': 4,
'five': 5,
'six': 6,
'seven': 7,
'eight': 8,
'nine': 9
}
return ' '.join(sorted([x for x in numbers.spl | it(' ') if x], key=lambda x: value_map[x]))
| python | Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest | [] | from typing import List
def sort_numbers(numbers: str) -> str:
""" Input is a space-delimited string of numberals from 'zero' to 'nine'.
Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
Return the string with numbers sorted from smallest to largest
"""
value_map = {
'zero': 0,
'one': 1,
'two': 2,
'three': 3,
| [
[
"'three one five'",
"'one three five'"
]
] | RandomSpanInfilling/HumanEval/19/10 | python | code_infilling | HumanEval_RandomSpanInfilling | sort_numbers |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.