import_str
sequencelengths 0
1
| doc_string
stringclasses 164
values | suffix
stringlengths 0
837
| compare_func
sequencelengths 0
0
| data_id
stringlengths 34
37
| task_name
stringclasses 1
value | solution
stringlengths 6
141
| demos
sequencelengths 0
8
| prefix
stringlengths 65
1.8k
| dataset_name
stringclasses 1
value | entry_func
stringclasses 158
values | tgt_lang
stringclasses 1
value | src_lang
stringclasses 1
value | test_cases
sequencelengths 0
100
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
[] | Given a dictionary, return True if all keys are strings in lower
case or all keys are strings in upper case, else return False.
The function should return False is the given dictionary is empty. | state = "upper"
elif key.islower():
state = "lower"
else:
break
elif (state == "upper" and not key.isupper()) or (state == "lower" and not key.islower()):
state = "mixed"
break
else:
break
return state == "upper" or state == "lower"
| [] | SingleLineInfilling/HumanEval/95/L10 | code_infilling | if key.isupper():
| [
[
"{\"a\":\"apple\", \"b\":\"banana\"}",
"True"
],
[
"{\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}",
"True"
],
[
"{\"a\":\"apple\", 8:\"banana\", \"a\":\"apple\"}",
"False"
],
[
"{\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}",
"False"
],
[
"{\"STATE\":\"NC\", \"ZIP\":\"12345\" }",
"True"
]
] |
def check_dict_case(dict):
"""
Given a dictionary, return True if all keys are strings in lower
case or all keys are strings in upper case, else return False.
The function should return False is the given dictionary is empty.
"""
if len(dict.keys()) == 0:
return False
else:
state = "start"
for key in dict.keys():
if isinstance(key, str) == False:
state = "mixed"
break
if state == "start":
| HumanEval_SingleLineInfillingLight | check_dict_case | python | python | [
[
"{\"p\":\"pineapple\", \"b\":\"banana\"}",
"True"
],
[
"{\"p\":\"pineapple\", \"A\":\"banana\", \"B\":\"banana\"}",
"False"
],
[
"{\"p\":\"pineapple\", 5:\"banana\", \"a\":\"apple\"}",
"False"
],
[
"{\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}",
"False"
],
[
"{\"STATE\":\"NC\", \"ZIP\":\"12345\" }",
"True"
],
[
"{\"fruit\":\"Orange\", \"taste\":\"Sweet\" }",
"True"
],
[
"{}",
"False"
]
] |
[] | Given a dictionary, return True if all keys are strings in lower
case or all keys are strings in upper case, else return False.
The function should return False is the given dictionary is empty. | elif key.islower():
state = "lower"
else:
break
elif (state == "upper" and not key.isupper()) or (state == "lower" and not key.islower()):
state = "mixed"
break
else:
break
return state == "upper" or state == "lower"
| [] | SingleLineInfilling/HumanEval/95/L11 | code_infilling | state = "upper"
| [
[
"{\"a\":\"apple\", \"b\":\"banana\"}",
"True"
],
[
"{\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}",
"True"
],
[
"{\"a\":\"apple\", 8:\"banana\", \"a\":\"apple\"}",
"False"
],
[
"{\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}",
"False"
],
[
"{\"STATE\":\"NC\", \"ZIP\":\"12345\" }",
"True"
]
] |
def check_dict_case(dict):
"""
Given a dictionary, return True if all keys are strings in lower
case or all keys are strings in upper case, else return False.
The function should return False is the given dictionary is empty.
"""
if len(dict.keys()) == 0:
return False
else:
state = "start"
for key in dict.keys():
if isinstance(key, str) == False:
state = "mixed"
break
if state == "start":
if key.isupper():
| HumanEval_SingleLineInfillingLight | check_dict_case | python | python | [
[
"{\"p\":\"pineapple\", \"b\":\"banana\"}",
"True"
],
[
"{\"p\":\"pineapple\", \"A\":\"banana\", \"B\":\"banana\"}",
"False"
],
[
"{\"p\":\"pineapple\", 5:\"banana\", \"a\":\"apple\"}",
"False"
],
[
"{\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}",
"False"
],
[
"{\"STATE\":\"NC\", \"ZIP\":\"12345\" }",
"True"
],
[
"{\"fruit\":\"Orange\", \"taste\":\"Sweet\" }",
"True"
],
[
"{}",
"False"
]
] |
[] | Given a dictionary, return True if all keys are strings in lower
case or all keys are strings in upper case, else return False.
The function should return False is the given dictionary is empty. | state = "lower"
else:
break
elif (state == "upper" and not key.isupper()) or (state == "lower" and not key.islower()):
state = "mixed"
break
else:
break
return state == "upper" or state == "lower"
| [] | SingleLineInfilling/HumanEval/95/L12 | code_infilling | elif key.islower():
| [
[
"{\"a\":\"apple\", \"b\":\"banana\"}",
"True"
],
[
"{\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}",
"True"
],
[
"{\"a\":\"apple\", 8:\"banana\", \"a\":\"apple\"}",
"False"
],
[
"{\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}",
"False"
],
[
"{\"STATE\":\"NC\", \"ZIP\":\"12345\" }",
"True"
]
] |
def check_dict_case(dict):
"""
Given a dictionary, return True if all keys are strings in lower
case or all keys are strings in upper case, else return False.
The function should return False is the given dictionary is empty.
"""
if len(dict.keys()) == 0:
return False
else:
state = "start"
for key in dict.keys():
if isinstance(key, str) == False:
state = "mixed"
break
if state == "start":
if key.isupper():
state = "upper"
| HumanEval_SingleLineInfillingLight | check_dict_case | python | python | [
[
"{\"p\":\"pineapple\", \"b\":\"banana\"}",
"True"
],
[
"{\"p\":\"pineapple\", \"A\":\"banana\", \"B\":\"banana\"}",
"False"
],
[
"{\"p\":\"pineapple\", 5:\"banana\", \"a\":\"apple\"}",
"False"
],
[
"{\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}",
"False"
],
[
"{\"STATE\":\"NC\", \"ZIP\":\"12345\" }",
"True"
],
[
"{\"fruit\":\"Orange\", \"taste\":\"Sweet\" }",
"True"
],
[
"{}",
"False"
]
] |
[] | Given a dictionary, return True if all keys are strings in lower
case or all keys are strings in upper case, else return False.
The function should return False is the given dictionary is empty. | else:
break
elif (state == "upper" and not key.isupper()) or (state == "lower" and not key.islower()):
state = "mixed"
break
else:
break
return state == "upper" or state == "lower"
| [] | SingleLineInfilling/HumanEval/95/L13 | code_infilling | state = "lower"
| [
[
"{\"a\":\"apple\", \"b\":\"banana\"}",
"True"
],
[
"{\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}",
"True"
],
[
"{\"a\":\"apple\", 8:\"banana\", \"a\":\"apple\"}",
"False"
],
[
"{\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}",
"False"
],
[
"{\"STATE\":\"NC\", \"ZIP\":\"12345\" }",
"True"
]
] |
def check_dict_case(dict):
"""
Given a dictionary, return True if all keys are strings in lower
case or all keys are strings in upper case, else return False.
The function should return False is the given dictionary is empty.
"""
if len(dict.keys()) == 0:
return False
else:
state = "start"
for key in dict.keys():
if isinstance(key, str) == False:
state = "mixed"
break
if state == "start":
if key.isupper():
state = "upper"
elif key.islower():
| HumanEval_SingleLineInfillingLight | check_dict_case | python | python | [
[
"{\"p\":\"pineapple\", \"b\":\"banana\"}",
"True"
],
[
"{\"p\":\"pineapple\", \"A\":\"banana\", \"B\":\"banana\"}",
"False"
],
[
"{\"p\":\"pineapple\", 5:\"banana\", \"a\":\"apple\"}",
"False"
],
[
"{\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}",
"False"
],
[
"{\"STATE\":\"NC\", \"ZIP\":\"12345\" }",
"True"
],
[
"{\"fruit\":\"Orange\", \"taste\":\"Sweet\" }",
"True"
],
[
"{}",
"False"
]
] |
[] | Given a dictionary, return True if all keys are strings in lower
case or all keys are strings in upper case, else return False.
The function should return False is the given dictionary is empty. | break
elif (state == "upper" and not key.isupper()) or (state == "lower" and not key.islower()):
state = "mixed"
break
else:
break
return state == "upper" or state == "lower"
| [] | SingleLineInfilling/HumanEval/95/L14 | code_infilling | else:
| [
[
"{\"a\":\"apple\", \"b\":\"banana\"}",
"True"
],
[
"{\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}",
"True"
],
[
"{\"a\":\"apple\", 8:\"banana\", \"a\":\"apple\"}",
"False"
],
[
"{\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}",
"False"
],
[
"{\"STATE\":\"NC\", \"ZIP\":\"12345\" }",
"True"
]
] |
def check_dict_case(dict):
"""
Given a dictionary, return True if all keys are strings in lower
case or all keys are strings in upper case, else return False.
The function should return False is the given dictionary is empty.
"""
if len(dict.keys()) == 0:
return False
else:
state = "start"
for key in dict.keys():
if isinstance(key, str) == False:
state = "mixed"
break
if state == "start":
if key.isupper():
state = "upper"
elif key.islower():
state = "lower"
| HumanEval_SingleLineInfillingLight | check_dict_case | python | python | [
[
"{\"p\":\"pineapple\", \"b\":\"banana\"}",
"True"
],
[
"{\"p\":\"pineapple\", \"A\":\"banana\", \"B\":\"banana\"}",
"False"
],
[
"{\"p\":\"pineapple\", 5:\"banana\", \"a\":\"apple\"}",
"False"
],
[
"{\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}",
"False"
],
[
"{\"STATE\":\"NC\", \"ZIP\":\"12345\" }",
"True"
],
[
"{\"fruit\":\"Orange\", \"taste\":\"Sweet\" }",
"True"
],
[
"{}",
"False"
]
] |
[] | Given a dictionary, return True if all keys are strings in lower
case or all keys are strings in upper case, else return False.
The function should return False is the given dictionary is empty. | elif (state == "upper" and not key.isupper()) or (state == "lower" and not key.islower()):
state = "mixed"
break
else:
break
return state == "upper" or state == "lower"
| [] | SingleLineInfilling/HumanEval/95/L15 | code_infilling | break
| [
[
"{\"a\":\"apple\", \"b\":\"banana\"}",
"True"
],
[
"{\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}",
"True"
],
[
"{\"a\":\"apple\", 8:\"banana\", \"a\":\"apple\"}",
"False"
],
[
"{\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}",
"False"
],
[
"{\"STATE\":\"NC\", \"ZIP\":\"12345\" }",
"True"
]
] |
def check_dict_case(dict):
"""
Given a dictionary, return True if all keys are strings in lower
case or all keys are strings in upper case, else return False.
The function should return False is the given dictionary is empty.
"""
if len(dict.keys()) == 0:
return False
else:
state = "start"
for key in dict.keys():
if isinstance(key, str) == False:
state = "mixed"
break
if state == "start":
if key.isupper():
state = "upper"
elif key.islower():
state = "lower"
else:
| HumanEval_SingleLineInfillingLight | check_dict_case | python | python | [
[
"{\"p\":\"pineapple\", \"b\":\"banana\"}",
"True"
],
[
"{\"p\":\"pineapple\", \"A\":\"banana\", \"B\":\"banana\"}",
"False"
],
[
"{\"p\":\"pineapple\", 5:\"banana\", \"a\":\"apple\"}",
"False"
],
[
"{\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}",
"False"
],
[
"{\"STATE\":\"NC\", \"ZIP\":\"12345\" }",
"True"
],
[
"{\"fruit\":\"Orange\", \"taste\":\"Sweet\" }",
"True"
],
[
"{}",
"False"
]
] |
[] | Given a dictionary, return True if all keys are strings in lower
case or all keys are strings in upper case, else return False.
The function should return False is the given dictionary is empty. | state = "mixed"
break
else:
break
return state == "upper" or state == "lower"
| [] | SingleLineInfilling/HumanEval/95/L16 | code_infilling | elif (state == "upper" and not key.isupper()) or (state == "lower" and not key.islower()):
| [
[
"{\"a\":\"apple\", \"b\":\"banana\"}",
"True"
],
[
"{\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}",
"True"
],
[
"{\"a\":\"apple\", 8:\"banana\", \"a\":\"apple\"}",
"False"
],
[
"{\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}",
"False"
],
[
"{\"STATE\":\"NC\", \"ZIP\":\"12345\" }",
"True"
]
] |
def check_dict_case(dict):
"""
Given a dictionary, return True if all keys are strings in lower
case or all keys are strings in upper case, else return False.
The function should return False is the given dictionary is empty.
"""
if len(dict.keys()) == 0:
return False
else:
state = "start"
for key in dict.keys():
if isinstance(key, str) == False:
state = "mixed"
break
if state == "start":
if key.isupper():
state = "upper"
elif key.islower():
state = "lower"
else:
break
| HumanEval_SingleLineInfillingLight | check_dict_case | python | python | [
[
"{\"p\":\"pineapple\", \"b\":\"banana\"}",
"True"
],
[
"{\"p\":\"pineapple\", \"A\":\"banana\", \"B\":\"banana\"}",
"False"
],
[
"{\"p\":\"pineapple\", 5:\"banana\", \"a\":\"apple\"}",
"False"
],
[
"{\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}",
"False"
],
[
"{\"STATE\":\"NC\", \"ZIP\":\"12345\" }",
"True"
],
[
"{\"fruit\":\"Orange\", \"taste\":\"Sweet\" }",
"True"
],
[
"{}",
"False"
]
] |
[] | Given a dictionary, return True if all keys are strings in lower
case or all keys are strings in upper case, else return False.
The function should return False is the given dictionary is empty. | break
else:
break
return state == "upper" or state == "lower"
| [] | SingleLineInfilling/HumanEval/95/L17 | code_infilling | state = "mixed"
| [
[
"{\"a\":\"apple\", \"b\":\"banana\"}",
"True"
],
[
"{\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}",
"True"
],
[
"{\"a\":\"apple\", 8:\"banana\", \"a\":\"apple\"}",
"False"
],
[
"{\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}",
"False"
],
[
"{\"STATE\":\"NC\", \"ZIP\":\"12345\" }",
"True"
]
] |
def check_dict_case(dict):
"""
Given a dictionary, return True if all keys are strings in lower
case or all keys are strings in upper case, else return False.
The function should return False is the given dictionary is empty.
"""
if len(dict.keys()) == 0:
return False
else:
state = "start"
for key in dict.keys():
if isinstance(key, str) == False:
state = "mixed"
break
if state == "start":
if key.isupper():
state = "upper"
elif key.islower():
state = "lower"
else:
break
elif (state == "upper" and not key.isupper()) or (state == "lower" and not key.islower()):
| HumanEval_SingleLineInfillingLight | check_dict_case | python | python | [
[
"{\"p\":\"pineapple\", \"b\":\"banana\"}",
"True"
],
[
"{\"p\":\"pineapple\", \"A\":\"banana\", \"B\":\"banana\"}",
"False"
],
[
"{\"p\":\"pineapple\", 5:\"banana\", \"a\":\"apple\"}",
"False"
],
[
"{\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}",
"False"
],
[
"{\"STATE\":\"NC\", \"ZIP\":\"12345\" }",
"True"
],
[
"{\"fruit\":\"Orange\", \"taste\":\"Sweet\" }",
"True"
],
[
"{}",
"False"
]
] |
[] | Given a dictionary, return True if all keys are strings in lower
case or all keys are strings in upper case, else return False.
The function should return False is the given dictionary is empty. | else:
break
return state == "upper" or state == "lower"
| [] | SingleLineInfilling/HumanEval/95/L18 | code_infilling | break
| [
[
"{\"a\":\"apple\", \"b\":\"banana\"}",
"True"
],
[
"{\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}",
"True"
],
[
"{\"a\":\"apple\", 8:\"banana\", \"a\":\"apple\"}",
"False"
],
[
"{\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}",
"False"
],
[
"{\"STATE\":\"NC\", \"ZIP\":\"12345\" }",
"True"
]
] |
def check_dict_case(dict):
"""
Given a dictionary, return True if all keys are strings in lower
case or all keys are strings in upper case, else return False.
The function should return False is the given dictionary is empty.
"""
if len(dict.keys()) == 0:
return False
else:
state = "start"
for key in dict.keys():
if isinstance(key, str) == False:
state = "mixed"
break
if state == "start":
if key.isupper():
state = "upper"
elif key.islower():
state = "lower"
else:
break
elif (state == "upper" and not key.isupper()) or (state == "lower" and not key.islower()):
state = "mixed"
| HumanEval_SingleLineInfillingLight | check_dict_case | python | python | [
[
"{\"p\":\"pineapple\", \"b\":\"banana\"}",
"True"
],
[
"{\"p\":\"pineapple\", \"A\":\"banana\", \"B\":\"banana\"}",
"False"
],
[
"{\"p\":\"pineapple\", 5:\"banana\", \"a\":\"apple\"}",
"False"
],
[
"{\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}",
"False"
],
[
"{\"STATE\":\"NC\", \"ZIP\":\"12345\" }",
"True"
],
[
"{\"fruit\":\"Orange\", \"taste\":\"Sweet\" }",
"True"
],
[
"{}",
"False"
]
] |
[] | Given a dictionary, return True if all keys are strings in lower
case or all keys are strings in upper case, else return False.
The function should return False is the given dictionary is empty. | break
return state == "upper" or state == "lower"
| [] | SingleLineInfilling/HumanEval/95/L19 | code_infilling | else:
| [
[
"{\"a\":\"apple\", \"b\":\"banana\"}",
"True"
],
[
"{\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}",
"True"
],
[
"{\"a\":\"apple\", 8:\"banana\", \"a\":\"apple\"}",
"False"
],
[
"{\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}",
"False"
],
[
"{\"STATE\":\"NC\", \"ZIP\":\"12345\" }",
"True"
]
] |
def check_dict_case(dict):
"""
Given a dictionary, return True if all keys are strings in lower
case or all keys are strings in upper case, else return False.
The function should return False is the given dictionary is empty.
"""
if len(dict.keys()) == 0:
return False
else:
state = "start"
for key in dict.keys():
if isinstance(key, str) == False:
state = "mixed"
break
if state == "start":
if key.isupper():
state = "upper"
elif key.islower():
state = "lower"
else:
break
elif (state == "upper" and not key.isupper()) or (state == "lower" and not key.islower()):
state = "mixed"
break
| HumanEval_SingleLineInfillingLight | check_dict_case | python | python | [
[
"{\"p\":\"pineapple\", \"b\":\"banana\"}",
"True"
],
[
"{\"p\":\"pineapple\", \"A\":\"banana\", \"B\":\"banana\"}",
"False"
],
[
"{\"p\":\"pineapple\", 5:\"banana\", \"a\":\"apple\"}",
"False"
],
[
"{\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}",
"False"
],
[
"{\"STATE\":\"NC\", \"ZIP\":\"12345\" }",
"True"
],
[
"{\"fruit\":\"Orange\", \"taste\":\"Sweet\" }",
"True"
],
[
"{}",
"False"
]
] |
[] | Given a dictionary, return True if all keys are strings in lower
case or all keys are strings in upper case, else return False.
The function should return False is the given dictionary is empty. | return state == "upper" or state == "lower"
| [] | SingleLineInfilling/HumanEval/95/L20 | code_infilling | break
| [
[
"{\"a\":\"apple\", \"b\":\"banana\"}",
"True"
],
[
"{\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}",
"True"
],
[
"{\"a\":\"apple\", 8:\"banana\", \"a\":\"apple\"}",
"False"
],
[
"{\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}",
"False"
],
[
"{\"STATE\":\"NC\", \"ZIP\":\"12345\" }",
"True"
]
] |
def check_dict_case(dict):
"""
Given a dictionary, return True if all keys are strings in lower
case or all keys are strings in upper case, else return False.
The function should return False is the given dictionary is empty.
"""
if len(dict.keys()) == 0:
return False
else:
state = "start"
for key in dict.keys():
if isinstance(key, str) == False:
state = "mixed"
break
if state == "start":
if key.isupper():
state = "upper"
elif key.islower():
state = "lower"
else:
break
elif (state == "upper" and not key.isupper()) or (state == "lower" and not key.islower()):
state = "mixed"
break
else:
| HumanEval_SingleLineInfillingLight | check_dict_case | python | python | [
[
"{\"p\":\"pineapple\", \"b\":\"banana\"}",
"True"
],
[
"{\"p\":\"pineapple\", \"A\":\"banana\", \"B\":\"banana\"}",
"False"
],
[
"{\"p\":\"pineapple\", 5:\"banana\", \"a\":\"apple\"}",
"False"
],
[
"{\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}",
"False"
],
[
"{\"STATE\":\"NC\", \"ZIP\":\"12345\" }",
"True"
],
[
"{\"fruit\":\"Orange\", \"taste\":\"Sweet\" }",
"True"
],
[
"{}",
"False"
]
] |
[] | Given a dictionary, return True if all keys are strings in lower
case or all keys are strings in upper case, else return False.
The function should return False is the given dictionary is empty. | [] | SingleLineInfilling/HumanEval/95/L21 | code_infilling | return state == "upper" or state == "lower"
| [
[
"{\"a\":\"apple\", \"b\":\"banana\"}",
"True"
],
[
"{\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}",
"True"
],
[
"{\"a\":\"apple\", 8:\"banana\", \"a\":\"apple\"}",
"False"
],
[
"{\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}",
"False"
],
[
"{\"STATE\":\"NC\", \"ZIP\":\"12345\" }",
"True"
]
] |
def check_dict_case(dict):
"""
Given a dictionary, return True if all keys are strings in lower
case or all keys are strings in upper case, else return False.
The function should return False is the given dictionary is empty.
"""
if len(dict.keys()) == 0:
return False
else:
state = "start"
for key in dict.keys():
if isinstance(key, str) == False:
state = "mixed"
break
if state == "start":
if key.isupper():
state = "upper"
elif key.islower():
state = "lower"
else:
break
elif (state == "upper" and not key.isupper()) or (state == "lower" and not key.islower()):
state = "mixed"
break
else:
break
| HumanEval_SingleLineInfillingLight | check_dict_case | python | python | [
[
"{\"p\":\"pineapple\", \"b\":\"banana\"}",
"True"
],
[
"{\"p\":\"pineapple\", \"A\":\"banana\", \"B\":\"banana\"}",
"False"
],
[
"{\"p\":\"pineapple\", 5:\"banana\", \"a\":\"apple\"}",
"False"
],
[
"{\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}",
"False"
],
[
"{\"STATE\":\"NC\", \"ZIP\":\"12345\" }",
"True"
],
[
"{\"fruit\":\"Orange\", \"taste\":\"Sweet\" }",
"True"
],
[
"{}",
"False"
]
] |
|
[] | Implement a function that takes an non-negative integer and returns an array of the first n
integers that are prime numbers and less than n. | for i in range(2, n):
is_prime = True
for j in range(2, i):
if i % j == 0:
is_prime = False
break
if is_prime:
primes.append(i)
return primes
| [] | SingleLineInfilling/HumanEval/96/L0 | code_infilling | primes = []
| [
[
"5",
"[2,3]"
],
[
"11",
"[2,3,5,7]"
],
[
"0",
"[]"
],
[
"20",
"[2,3,5,7,11,13,17,19]"
],
[
"1",
"[]"
],
[
"18",
"[2,3,5,7,11,13,17]"
]
] |
def count_up_to(n):
"""Implement a function that takes an non-negative integer and returns an array of the first n
integers that are prime numbers and less than n.
"""
| HumanEval_SingleLineInfillingLight | count_up_to | python | python | [
[
"5",
"[2,3]"
],
[
"6",
"[2,3,5]"
],
[
"7",
"[2,3,5]"
],
[
"10",
"[2,3,5,7]"
],
[
"0",
"[]"
],
[
"22",
"[2,3,5,7,11,13,17,19]"
],
[
"1",
"[]"
],
[
"18",
"[2,3,5,7,11,13,17]"
],
[
"47",
"[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]"
],
[
"101",
"[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]"
]
] |
[] | Implement a function that takes an non-negative integer and returns an array of the first n
integers that are prime numbers and less than n. | is_prime = True
for j in range(2, i):
if i % j == 0:
is_prime = False
break
if is_prime:
primes.append(i)
return primes
| [] | SingleLineInfilling/HumanEval/96/L1 | code_infilling | for i in range(2, n):
| [
[
"5",
"[2,3]"
],
[
"11",
"[2,3,5,7]"
],
[
"0",
"[]"
],
[
"20",
"[2,3,5,7,11,13,17,19]"
],
[
"1",
"[]"
],
[
"18",
"[2,3,5,7,11,13,17]"
]
] |
def count_up_to(n):
"""Implement a function that takes an non-negative integer and returns an array of the first n
integers that are prime numbers and less than n.
"""
primes = []
| HumanEval_SingleLineInfillingLight | count_up_to | python | python | [
[
"5",
"[2,3]"
],
[
"6",
"[2,3,5]"
],
[
"7",
"[2,3,5]"
],
[
"10",
"[2,3,5,7]"
],
[
"0",
"[]"
],
[
"22",
"[2,3,5,7,11,13,17,19]"
],
[
"1",
"[]"
],
[
"18",
"[2,3,5,7,11,13,17]"
],
[
"47",
"[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]"
],
[
"101",
"[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]"
]
] |
[] | Implement a function that takes an non-negative integer and returns an array of the first n
integers that are prime numbers and less than n. | for j in range(2, i):
if i % j == 0:
is_prime = False
break
if is_prime:
primes.append(i)
return primes
| [] | SingleLineInfilling/HumanEval/96/L2 | code_infilling | is_prime = True
| [
[
"5",
"[2,3]"
],
[
"11",
"[2,3,5,7]"
],
[
"0",
"[]"
],
[
"20",
"[2,3,5,7,11,13,17,19]"
],
[
"1",
"[]"
],
[
"18",
"[2,3,5,7,11,13,17]"
]
] |
def count_up_to(n):
"""Implement a function that takes an non-negative integer and returns an array of the first n
integers that are prime numbers and less than n.
"""
primes = []
for i in range(2, n):
| HumanEval_SingleLineInfillingLight | count_up_to | python | python | [
[
"5",
"[2,3]"
],
[
"6",
"[2,3,5]"
],
[
"7",
"[2,3,5]"
],
[
"10",
"[2,3,5,7]"
],
[
"0",
"[]"
],
[
"22",
"[2,3,5,7,11,13,17,19]"
],
[
"1",
"[]"
],
[
"18",
"[2,3,5,7,11,13,17]"
],
[
"47",
"[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]"
],
[
"101",
"[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]"
]
] |
[] | Implement a function that takes an non-negative integer and returns an array of the first n
integers that are prime numbers and less than n. | if i % j == 0:
is_prime = False
break
if is_prime:
primes.append(i)
return primes
| [] | SingleLineInfilling/HumanEval/96/L3 | code_infilling | for j in range(2, i):
| [
[
"5",
"[2,3]"
],
[
"11",
"[2,3,5,7]"
],
[
"0",
"[]"
],
[
"20",
"[2,3,5,7,11,13,17,19]"
],
[
"1",
"[]"
],
[
"18",
"[2,3,5,7,11,13,17]"
]
] |
def count_up_to(n):
"""Implement a function that takes an non-negative integer and returns an array of the first n
integers that are prime numbers and less than n.
"""
primes = []
for i in range(2, n):
is_prime = True
| HumanEval_SingleLineInfillingLight | count_up_to | python | python | [
[
"5",
"[2,3]"
],
[
"6",
"[2,3,5]"
],
[
"7",
"[2,3,5]"
],
[
"10",
"[2,3,5,7]"
],
[
"0",
"[]"
],
[
"22",
"[2,3,5,7,11,13,17,19]"
],
[
"1",
"[]"
],
[
"18",
"[2,3,5,7,11,13,17]"
],
[
"47",
"[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]"
],
[
"101",
"[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]"
]
] |
[] | Implement a function that takes an non-negative integer and returns an array of the first n
integers that are prime numbers and less than n. | is_prime = False
break
if is_prime:
primes.append(i)
return primes
| [] | SingleLineInfilling/HumanEval/96/L4 | code_infilling | if i % j == 0:
| [
[
"5",
"[2,3]"
],
[
"11",
"[2,3,5,7]"
],
[
"0",
"[]"
],
[
"20",
"[2,3,5,7,11,13,17,19]"
],
[
"1",
"[]"
],
[
"18",
"[2,3,5,7,11,13,17]"
]
] |
def count_up_to(n):
"""Implement a function that takes an non-negative integer and returns an array of the first n
integers that are prime numbers and less than n.
"""
primes = []
for i in range(2, n):
is_prime = True
for j in range(2, i):
| HumanEval_SingleLineInfillingLight | count_up_to | python | python | [
[
"5",
"[2,3]"
],
[
"6",
"[2,3,5]"
],
[
"7",
"[2,3,5]"
],
[
"10",
"[2,3,5,7]"
],
[
"0",
"[]"
],
[
"22",
"[2,3,5,7,11,13,17,19]"
],
[
"1",
"[]"
],
[
"18",
"[2,3,5,7,11,13,17]"
],
[
"47",
"[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]"
],
[
"101",
"[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]"
]
] |
[] | Implement a function that takes an non-negative integer and returns an array of the first n
integers that are prime numbers and less than n. | break
if is_prime:
primes.append(i)
return primes
| [] | SingleLineInfilling/HumanEval/96/L5 | code_infilling | is_prime = False
| [
[
"5",
"[2,3]"
],
[
"11",
"[2,3,5,7]"
],
[
"0",
"[]"
],
[
"20",
"[2,3,5,7,11,13,17,19]"
],
[
"1",
"[]"
],
[
"18",
"[2,3,5,7,11,13,17]"
]
] |
def count_up_to(n):
"""Implement a function that takes an non-negative integer and returns an array of the first n
integers that are prime numbers and less than n.
"""
primes = []
for i in range(2, n):
is_prime = True
for j in range(2, i):
if i % j == 0:
| HumanEval_SingleLineInfillingLight | count_up_to | python | python | [
[
"5",
"[2,3]"
],
[
"6",
"[2,3,5]"
],
[
"7",
"[2,3,5]"
],
[
"10",
"[2,3,5,7]"
],
[
"0",
"[]"
],
[
"22",
"[2,3,5,7,11,13,17,19]"
],
[
"1",
"[]"
],
[
"18",
"[2,3,5,7,11,13,17]"
],
[
"47",
"[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]"
],
[
"101",
"[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]"
]
] |
[] | Implement a function that takes an non-negative integer and returns an array of the first n
integers that are prime numbers and less than n. | if is_prime:
primes.append(i)
return primes
| [] | SingleLineInfilling/HumanEval/96/L6 | code_infilling | break
| [
[
"5",
"[2,3]"
],
[
"11",
"[2,3,5,7]"
],
[
"0",
"[]"
],
[
"20",
"[2,3,5,7,11,13,17,19]"
],
[
"1",
"[]"
],
[
"18",
"[2,3,5,7,11,13,17]"
]
] |
def count_up_to(n):
"""Implement a function that takes an non-negative integer and returns an array of the first n
integers that are prime numbers and less than n.
"""
primes = []
for i in range(2, n):
is_prime = True
for j in range(2, i):
if i % j == 0:
is_prime = False
| HumanEval_SingleLineInfillingLight | count_up_to | python | python | [
[
"5",
"[2,3]"
],
[
"6",
"[2,3,5]"
],
[
"7",
"[2,3,5]"
],
[
"10",
"[2,3,5,7]"
],
[
"0",
"[]"
],
[
"22",
"[2,3,5,7,11,13,17,19]"
],
[
"1",
"[]"
],
[
"18",
"[2,3,5,7,11,13,17]"
],
[
"47",
"[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]"
],
[
"101",
"[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]"
]
] |
[] | Implement a function that takes an non-negative integer and returns an array of the first n
integers that are prime numbers and less than n. | primes.append(i)
return primes
| [] | SingleLineInfilling/HumanEval/96/L7 | code_infilling | if is_prime:
| [
[
"5",
"[2,3]"
],
[
"11",
"[2,3,5,7]"
],
[
"0",
"[]"
],
[
"20",
"[2,3,5,7,11,13,17,19]"
],
[
"1",
"[]"
],
[
"18",
"[2,3,5,7,11,13,17]"
]
] |
def count_up_to(n):
"""Implement a function that takes an non-negative integer and returns an array of the first n
integers that are prime numbers and less than n.
"""
primes = []
for i in range(2, n):
is_prime = True
for j in range(2, i):
if i % j == 0:
is_prime = False
break
| HumanEval_SingleLineInfillingLight | count_up_to | python | python | [
[
"5",
"[2,3]"
],
[
"6",
"[2,3,5]"
],
[
"7",
"[2,3,5]"
],
[
"10",
"[2,3,5,7]"
],
[
"0",
"[]"
],
[
"22",
"[2,3,5,7,11,13,17,19]"
],
[
"1",
"[]"
],
[
"18",
"[2,3,5,7,11,13,17]"
],
[
"47",
"[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]"
],
[
"101",
"[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]"
]
] |
[] | Implement a function that takes an non-negative integer and returns an array of the first n
integers that are prime numbers and less than n. | return primes
| [] | SingleLineInfilling/HumanEval/96/L8 | code_infilling | primes.append(i)
| [
[
"5",
"[2,3]"
],
[
"11",
"[2,3,5,7]"
],
[
"0",
"[]"
],
[
"20",
"[2,3,5,7,11,13,17,19]"
],
[
"1",
"[]"
],
[
"18",
"[2,3,5,7,11,13,17]"
]
] |
def count_up_to(n):
"""Implement a function that takes an non-negative integer and returns an array of the first n
integers that are prime numbers and less than n.
"""
primes = []
for i in range(2, n):
is_prime = True
for j in range(2, i):
if i % j == 0:
is_prime = False
break
if is_prime:
| HumanEval_SingleLineInfillingLight | count_up_to | python | python | [
[
"5",
"[2,3]"
],
[
"6",
"[2,3,5]"
],
[
"7",
"[2,3,5]"
],
[
"10",
"[2,3,5,7]"
],
[
"0",
"[]"
],
[
"22",
"[2,3,5,7,11,13,17,19]"
],
[
"1",
"[]"
],
[
"18",
"[2,3,5,7,11,13,17]"
],
[
"47",
"[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]"
],
[
"101",
"[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]"
]
] |
[] | Implement a function that takes an non-negative integer and returns an array of the first n
integers that are prime numbers and less than n. | [] | SingleLineInfilling/HumanEval/96/L9 | code_infilling | return primes
| [
[
"5",
"[2,3]"
],
[
"11",
"[2,3,5,7]"
],
[
"0",
"[]"
],
[
"20",
"[2,3,5,7,11,13,17,19]"
],
[
"1",
"[]"
],
[
"18",
"[2,3,5,7,11,13,17]"
]
] |
def count_up_to(n):
"""Implement a function that takes an non-negative integer and returns an array of the first n
integers that are prime numbers and less than n.
"""
primes = []
for i in range(2, n):
is_prime = True
for j in range(2, i):
if i % j == 0:
is_prime = False
break
if is_prime:
primes.append(i)
| HumanEval_SingleLineInfillingLight | count_up_to | python | python | [
[
"5",
"[2,3]"
],
[
"6",
"[2,3,5]"
],
[
"7",
"[2,3,5]"
],
[
"10",
"[2,3,5,7]"
],
[
"0",
"[]"
],
[
"22",
"[2,3,5,7,11,13,17,19]"
],
[
"1",
"[]"
],
[
"18",
"[2,3,5,7,11,13,17]"
],
[
"47",
"[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]"
],
[
"101",
"[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]"
]
] |
|
[] | Complete the function that takes two integers and returns
the product of their unit digits.
Assume the input is always valid. | [] | SingleLineInfilling/HumanEval/97/L0 | code_infilling | return abs(a % 10) * abs(b % 10)
| [
[
"148, 412",
"16"
],
[
"19, 28",
"72"
],
[
"2020, 1851",
"0"
],
[
"14, -15",
"20"
]
] |
def multiply(a, b):
"""Complete the function that takes two integers and returns
the product of their unit digits.
Assume the input is always valid.
"""
| HumanEval_SingleLineInfillingLight | multiply | python | python | [
[
"148, 412",
"16"
],
[
"19, 28",
"72"
],
[
"2020, 1851",
"0"
],
[
"14, -15",
"20"
],
[
"76, 67",
"42"
],
[
"17, 27",
"49"
],
[
"0, 1",
"0"
],
[
"0, 0",
"0"
]
] |
|
[] | Given a string s, count the number of uppercase vowels in even indices. | for i in range(0,len(s),2):
if s[i] in "AEIOU":
count += 1
return count
| [] | SingleLineInfilling/HumanEval/98/L0 | code_infilling | count = 0
| [
[
"'aBCdEf'",
"1"
],
[
"'abcdefg'",
"0"
],
[
"'dBBE'",
"0"
]
] |
def count_upper(s):
"""
Given a string s, count the number of uppercase vowels in even indices.
"""
| HumanEval_SingleLineInfillingLight | count_upper | python | python | [
[
"'aBCdEf'",
"1"
],
[
"'abcdefg'",
"0"
],
[
"'dBBE'",
"0"
],
[
"'B'",
"0"
],
[
"'U'",
"1"
],
[
"''",
"0"
],
[
"'EEEE'",
"2"
]
] |
[] | Given a string s, count the number of uppercase vowels in even indices. | if s[i] in "AEIOU":
count += 1
return count
| [] | SingleLineInfilling/HumanEval/98/L1 | code_infilling | for i in range(0,len(s),2):
| [
[
"'aBCdEf'",
"1"
],
[
"'abcdefg'",
"0"
],
[
"'dBBE'",
"0"
]
] |
def count_upper(s):
"""
Given a string s, count the number of uppercase vowels in even indices.
"""
count = 0
| HumanEval_SingleLineInfillingLight | count_upper | python | python | [
[
"'aBCdEf'",
"1"
],
[
"'abcdefg'",
"0"
],
[
"'dBBE'",
"0"
],
[
"'B'",
"0"
],
[
"'U'",
"1"
],
[
"''",
"0"
],
[
"'EEEE'",
"2"
]
] |
[] | Given a string s, count the number of uppercase vowels in even indices. | count += 1
return count
| [] | SingleLineInfilling/HumanEval/98/L2 | code_infilling | if s[i] in "AEIOU":
| [
[
"'aBCdEf'",
"1"
],
[
"'abcdefg'",
"0"
],
[
"'dBBE'",
"0"
]
] |
def count_upper(s):
"""
Given a string s, count the number of uppercase vowels in even indices.
"""
count = 0
for i in range(0,len(s),2):
| HumanEval_SingleLineInfillingLight | count_upper | python | python | [
[
"'aBCdEf'",
"1"
],
[
"'abcdefg'",
"0"
],
[
"'dBBE'",
"0"
],
[
"'B'",
"0"
],
[
"'U'",
"1"
],
[
"''",
"0"
],
[
"'EEEE'",
"2"
]
] |
[] | Given a string s, count the number of uppercase vowels in even indices. | return count
| [] | SingleLineInfilling/HumanEval/98/L3 | code_infilling | count += 1
| [
[
"'aBCdEf'",
"1"
],
[
"'abcdefg'",
"0"
],
[
"'dBBE'",
"0"
]
] |
def count_upper(s):
"""
Given a string s, count the number of uppercase vowels in even indices.
"""
count = 0
for i in range(0,len(s),2):
if s[i] in "AEIOU":
| HumanEval_SingleLineInfillingLight | count_upper | python | python | [
[
"'aBCdEf'",
"1"
],
[
"'abcdefg'",
"0"
],
[
"'dBBE'",
"0"
],
[
"'B'",
"0"
],
[
"'U'",
"1"
],
[
"''",
"0"
],
[
"'EEEE'",
"2"
]
] |
[] | Given a string s, count the number of uppercase vowels in even indices. | [] | SingleLineInfilling/HumanEval/98/L4 | code_infilling | return count
| [
[
"'aBCdEf'",
"1"
],
[
"'abcdefg'",
"0"
],
[
"'dBBE'",
"0"
]
] |
def count_upper(s):
"""
Given a string s, count the number of uppercase vowels in even indices.
"""
count = 0
for i in range(0,len(s),2):
if s[i] in "AEIOU":
count += 1
| HumanEval_SingleLineInfillingLight | count_upper | python | python | [
[
"'aBCdEf'",
"1"
],
[
"'abcdefg'",
"0"
],
[
"'dBBE'",
"0"
],
[
"'B'",
"0"
],
[
"'U'",
"1"
],
[
"''",
"0"
],
[
"'EEEE'",
"2"
]
] |
|
[] | Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero. |
if value.count('.') == 1:
# remove trailing zeros
while (value[-1] == '0'):
value = value[:-1]
num = float(value)
if value[-2:] == '.5':
if num > 0:
res = ceil(num)
else:
res = floor(num)
elif len(value) > 0:
res = int(round(num))
else:
res = 0
return res
| [] | SingleLineInfilling/HumanEval/99/L0 | code_infilling | from math import floor, ceil
| [
[
"\"10\"",
"10"
],
[
"\"15.3\"",
"15"
]
] |
def closest_integer(value):
"""
Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero.
"""
| HumanEval_SingleLineInfillingLight | closest_integer | python | python | [
[
"\"10\"",
"10"
],
[
"\"14.5\"",
"15"
],
[
"\"-15.5\"",
"-16"
],
[
"\"15.3\"",
"15"
],
[
"\"0\"",
"0"
]
] |
[] | Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero. | # remove trailing zeros
while (value[-1] == '0'):
value = value[:-1]
num = float(value)
if value[-2:] == '.5':
if num > 0:
res = ceil(num)
else:
res = floor(num)
elif len(value) > 0:
res = int(round(num))
else:
res = 0
return res
| [] | SingleLineInfilling/HumanEval/99/L2 | code_infilling | if value.count('.') == 1:
| [
[
"\"10\"",
"10"
],
[
"\"15.3\"",
"15"
]
] |
def closest_integer(value):
"""
Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero.
"""
from math import floor, ceil
| HumanEval_SingleLineInfillingLight | closest_integer | python | python | [
[
"\"10\"",
"10"
],
[
"\"14.5\"",
"15"
],
[
"\"-15.5\"",
"-16"
],
[
"\"15.3\"",
"15"
],
[
"\"0\"",
"0"
]
] |
[] | Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero. | while (value[-1] == '0'):
value = value[:-1]
num = float(value)
if value[-2:] == '.5':
if num > 0:
res = ceil(num)
else:
res = floor(num)
elif len(value) > 0:
res = int(round(num))
else:
res = 0
return res
| [] | SingleLineInfilling/HumanEval/99/L3 | code_infilling | # remove trailing zeros
| [
[
"\"10\"",
"10"
],
[
"\"15.3\"",
"15"
]
] |
def closest_integer(value):
"""
Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero.
"""
from math import floor, ceil
if value.count('.') == 1:
| HumanEval_SingleLineInfillingLight | closest_integer | python | python | [
[
"\"10\"",
"10"
],
[
"\"14.5\"",
"15"
],
[
"\"-15.5\"",
"-16"
],
[
"\"15.3\"",
"15"
],
[
"\"0\"",
"0"
]
] |
[] | Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero. | value = value[:-1]
num = float(value)
if value[-2:] == '.5':
if num > 0:
res = ceil(num)
else:
res = floor(num)
elif len(value) > 0:
res = int(round(num))
else:
res = 0
return res
| [] | SingleLineInfilling/HumanEval/99/L4 | code_infilling | while (value[-1] == '0'):
| [
[
"\"10\"",
"10"
],
[
"\"15.3\"",
"15"
]
] |
def closest_integer(value):
"""
Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero.
"""
from math import floor, ceil
if value.count('.') == 1:
# remove trailing zeros
| HumanEval_SingleLineInfillingLight | closest_integer | python | python | [
[
"\"10\"",
"10"
],
[
"\"14.5\"",
"15"
],
[
"\"-15.5\"",
"-16"
],
[
"\"15.3\"",
"15"
],
[
"\"0\"",
"0"
]
] |
[] | Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero. |
num = float(value)
if value[-2:] == '.5':
if num > 0:
res = ceil(num)
else:
res = floor(num)
elif len(value) > 0:
res = int(round(num))
else:
res = 0
return res
| [] | SingleLineInfilling/HumanEval/99/L5 | code_infilling | value = value[:-1]
| [
[
"\"10\"",
"10"
],
[
"\"15.3\"",
"15"
]
] |
def closest_integer(value):
"""
Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero.
"""
from math import floor, ceil
if value.count('.') == 1:
# remove trailing zeros
while (value[-1] == '0'):
| HumanEval_SingleLineInfillingLight | closest_integer | python | python | [
[
"\"10\"",
"10"
],
[
"\"14.5\"",
"15"
],
[
"\"-15.5\"",
"-16"
],
[
"\"15.3\"",
"15"
],
[
"\"0\"",
"0"
]
] |
[] | Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero. | if value[-2:] == '.5':
if num > 0:
res = ceil(num)
else:
res = floor(num)
elif len(value) > 0:
res = int(round(num))
else:
res = 0
return res
| [] | SingleLineInfilling/HumanEval/99/L7 | code_infilling | num = float(value)
| [
[
"\"10\"",
"10"
],
[
"\"15.3\"",
"15"
]
] |
def closest_integer(value):
"""
Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero.
"""
from math import floor, ceil
if value.count('.') == 1:
# remove trailing zeros
while (value[-1] == '0'):
value = value[:-1]
| HumanEval_SingleLineInfillingLight | closest_integer | python | python | [
[
"\"10\"",
"10"
],
[
"\"14.5\"",
"15"
],
[
"\"-15.5\"",
"-16"
],
[
"\"15.3\"",
"15"
],
[
"\"0\"",
"0"
]
] |
[] | Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero. | if num > 0:
res = ceil(num)
else:
res = floor(num)
elif len(value) > 0:
res = int(round(num))
else:
res = 0
return res
| [] | SingleLineInfilling/HumanEval/99/L8 | code_infilling | if value[-2:] == '.5':
| [
[
"\"10\"",
"10"
],
[
"\"15.3\"",
"15"
]
] |
def closest_integer(value):
"""
Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero.
"""
from math import floor, ceil
if value.count('.') == 1:
# remove trailing zeros
while (value[-1] == '0'):
value = value[:-1]
num = float(value)
| HumanEval_SingleLineInfillingLight | closest_integer | python | python | [
[
"\"10\"",
"10"
],
[
"\"14.5\"",
"15"
],
[
"\"-15.5\"",
"-16"
],
[
"\"15.3\"",
"15"
],
[
"\"0\"",
"0"
]
] |
[] | Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero. | res = ceil(num)
else:
res = floor(num)
elif len(value) > 0:
res = int(round(num))
else:
res = 0
return res
| [] | SingleLineInfilling/HumanEval/99/L9 | code_infilling | if num > 0:
| [
[
"\"10\"",
"10"
],
[
"\"15.3\"",
"15"
]
] |
def closest_integer(value):
"""
Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero.
"""
from math import floor, ceil
if value.count('.') == 1:
# remove trailing zeros
while (value[-1] == '0'):
value = value[:-1]
num = float(value)
if value[-2:] == '.5':
| HumanEval_SingleLineInfillingLight | closest_integer | python | python | [
[
"\"10\"",
"10"
],
[
"\"14.5\"",
"15"
],
[
"\"-15.5\"",
"-16"
],
[
"\"15.3\"",
"15"
],
[
"\"0\"",
"0"
]
] |
[] | Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero. | else:
res = floor(num)
elif len(value) > 0:
res = int(round(num))
else:
res = 0
return res
| [] | SingleLineInfilling/HumanEval/99/L10 | code_infilling | res = ceil(num)
| [
[
"\"10\"",
"10"
],
[
"\"15.3\"",
"15"
]
] |
def closest_integer(value):
"""
Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero.
"""
from math import floor, ceil
if value.count('.') == 1:
# remove trailing zeros
while (value[-1] == '0'):
value = value[:-1]
num = float(value)
if value[-2:] == '.5':
if num > 0:
| HumanEval_SingleLineInfillingLight | closest_integer | python | python | [
[
"\"10\"",
"10"
],
[
"\"14.5\"",
"15"
],
[
"\"-15.5\"",
"-16"
],
[
"\"15.3\"",
"15"
],
[
"\"0\"",
"0"
]
] |
[] | Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero. | res = floor(num)
elif len(value) > 0:
res = int(round(num))
else:
res = 0
return res
| [] | SingleLineInfilling/HumanEval/99/L11 | code_infilling | else:
| [
[
"\"10\"",
"10"
],
[
"\"15.3\"",
"15"
]
] |
def closest_integer(value):
"""
Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero.
"""
from math import floor, ceil
if value.count('.') == 1:
# remove trailing zeros
while (value[-1] == '0'):
value = value[:-1]
num = float(value)
if value[-2:] == '.5':
if num > 0:
res = ceil(num)
| HumanEval_SingleLineInfillingLight | closest_integer | python | python | [
[
"\"10\"",
"10"
],
[
"\"14.5\"",
"15"
],
[
"\"-15.5\"",
"-16"
],
[
"\"15.3\"",
"15"
],
[
"\"0\"",
"0"
]
] |
[] | Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero. | elif len(value) > 0:
res = int(round(num))
else:
res = 0
return res
| [] | SingleLineInfilling/HumanEval/99/L12 | code_infilling | res = floor(num)
| [
[
"\"10\"",
"10"
],
[
"\"15.3\"",
"15"
]
] |
def closest_integer(value):
"""
Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero.
"""
from math import floor, ceil
if value.count('.') == 1:
# remove trailing zeros
while (value[-1] == '0'):
value = value[:-1]
num = float(value)
if value[-2:] == '.5':
if num > 0:
res = ceil(num)
else:
| HumanEval_SingleLineInfillingLight | closest_integer | python | python | [
[
"\"10\"",
"10"
],
[
"\"14.5\"",
"15"
],
[
"\"-15.5\"",
"-16"
],
[
"\"15.3\"",
"15"
],
[
"\"0\"",
"0"
]
] |
[] | Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero. | res = int(round(num))
else:
res = 0
return res
| [] | SingleLineInfilling/HumanEval/99/L13 | code_infilling | elif len(value) > 0:
| [
[
"\"10\"",
"10"
],
[
"\"15.3\"",
"15"
]
] |
def closest_integer(value):
"""
Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero.
"""
from math import floor, ceil
if value.count('.') == 1:
# remove trailing zeros
while (value[-1] == '0'):
value = value[:-1]
num = float(value)
if value[-2:] == '.5':
if num > 0:
res = ceil(num)
else:
res = floor(num)
| HumanEval_SingleLineInfillingLight | closest_integer | python | python | [
[
"\"10\"",
"10"
],
[
"\"14.5\"",
"15"
],
[
"\"-15.5\"",
"-16"
],
[
"\"15.3\"",
"15"
],
[
"\"0\"",
"0"
]
] |
[] | Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero. | else:
res = 0
return res
| [] | SingleLineInfilling/HumanEval/99/L14 | code_infilling | res = int(round(num))
| [
[
"\"10\"",
"10"
],
[
"\"15.3\"",
"15"
]
] |
def closest_integer(value):
"""
Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero.
"""
from math import floor, ceil
if value.count('.') == 1:
# remove trailing zeros
while (value[-1] == '0'):
value = value[:-1]
num = float(value)
if value[-2:] == '.5':
if num > 0:
res = ceil(num)
else:
res = floor(num)
elif len(value) > 0:
| HumanEval_SingleLineInfillingLight | closest_integer | python | python | [
[
"\"10\"",
"10"
],
[
"\"14.5\"",
"15"
],
[
"\"-15.5\"",
"-16"
],
[
"\"15.3\"",
"15"
],
[
"\"0\"",
"0"
]
] |
[] | Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero. | res = 0
return res
| [] | SingleLineInfilling/HumanEval/99/L15 | code_infilling | else:
| [
[
"\"10\"",
"10"
],
[
"\"15.3\"",
"15"
]
] |
def closest_integer(value):
"""
Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero.
"""
from math import floor, ceil
if value.count('.') == 1:
# remove trailing zeros
while (value[-1] == '0'):
value = value[:-1]
num = float(value)
if value[-2:] == '.5':
if num > 0:
res = ceil(num)
else:
res = floor(num)
elif len(value) > 0:
res = int(round(num))
| HumanEval_SingleLineInfillingLight | closest_integer | python | python | [
[
"\"10\"",
"10"
],
[
"\"14.5\"",
"15"
],
[
"\"-15.5\"",
"-16"
],
[
"\"15.3\"",
"15"
],
[
"\"0\"",
"0"
]
] |
[] | Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero. |
return res
| [] | SingleLineInfilling/HumanEval/99/L16 | code_infilling | res = 0
| [
[
"\"10\"",
"10"
],
[
"\"15.3\"",
"15"
]
] |
def closest_integer(value):
"""
Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero.
"""
from math import floor, ceil
if value.count('.') == 1:
# remove trailing zeros
while (value[-1] == '0'):
value = value[:-1]
num = float(value)
if value[-2:] == '.5':
if num > 0:
res = ceil(num)
else:
res = floor(num)
elif len(value) > 0:
res = int(round(num))
else:
| HumanEval_SingleLineInfillingLight | closest_integer | python | python | [
[
"\"10\"",
"10"
],
[
"\"14.5\"",
"15"
],
[
"\"-15.5\"",
"-16"
],
[
"\"15.3\"",
"15"
],
[
"\"0\"",
"0"
]
] |
[] | Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero. | [] | SingleLineInfilling/HumanEval/99/L18 | code_infilling | return res
| [
[
"\"10\"",
"10"
],
[
"\"15.3\"",
"15"
]
] |
def closest_integer(value):
"""
Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero.
"""
from math import floor, ceil
if value.count('.') == 1:
# remove trailing zeros
while (value[-1] == '0'):
value = value[:-1]
num = float(value)
if value[-2:] == '.5':
if num > 0:
res = ceil(num)
else:
res = floor(num)
elif len(value) > 0:
res = int(round(num))
else:
res = 0
| HumanEval_SingleLineInfillingLight | closest_integer | python | python | [
[
"\"10\"",
"10"
],
[
"\"14.5\"",
"15"
],
[
"\"-15.5\"",
"-16"
],
[
"\"15.3\"",
"15"
],
[
"\"0\"",
"0"
]
] |
|
[] | Given a positive integer n, you have to make a pile of n levels of stones.
The first level has n stones.
The number of stones in the next level is:
- the next odd number if n is odd.
- the next even number if n is even.
Return the number of stones in each level in a list, where element at index
i represents the number of stones in the level (i+1). | [] | SingleLineInfilling/HumanEval/100/L0 | code_infilling | return [n + 2*i for i in range(n)]
| [
[
"3",
"[3, 5, 7]"
]
] |
def make_a_pile(n):
"""
Given a positive integer n, you have to make a pile of n levels of stones.
The first level has n stones.
The number of stones in the next level is:
- the next odd number if n is odd.
- the next even number if n is even.
Return the number of stones in each level in a list, where element at index
i represents the number of stones in the level (i+1).
"""
| HumanEval_SingleLineInfillingLight | make_a_pile | python | python | [
[
"3",
"[3, 5, 7]"
],
[
"4",
"[4,6,8,10]"
],
[
"5",
"[5, 7, 9, 11, 13]"
],
[
"6",
"[6, 8, 10, 12, 14, 16]"
],
[
"8",
"[8, 10, 12, 14, 16, 18, 20, 22]"
]
] |
|
[] | You will be given a string of words separated by commas or spaces. Your task is
to split the string into words and return an array of the words. | return []
s_list = []
for letter in s:
if letter == ',':
s_list.append(' ')
else:
s_list.append(letter)
s_list = "".join(s_list)
return s_list.split()
| [] | SingleLineInfilling/HumanEval/101/L0 | code_infilling | if not s:
| [
[
"\"Hi, my name is John\"",
"[\"Hi\", \"my\", \"name\", \"is\", \"John\"]"
],
[
"\"One, two, three, four, five, six\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
]
] |
def words_string(s):
"""
You will be given a string of words separated by commas or spaces. Your task is
to split the string into words and return an array of the words.
"""
| HumanEval_SingleLineInfillingLight | words_string | python | python | [
[
"\"Hi, my name is John\"",
"[\"Hi\", \"my\", \"name\", \"is\", \"John\"]"
],
[
"\"One, two, three, four, five, six\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
],
[
"\"Hi, my name\"",
"[\"Hi\", \"my\", \"name\"]"
],
[
"\"One,, two, three, four, five, six,\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
],
[
"\"\"",
"[]"
],
[
"\"ahmed , gamal\"",
"[\"ahmed\", \"gamal\"]"
]
] |
[] | You will be given a string of words separated by commas or spaces. Your task is
to split the string into words and return an array of the words. |
s_list = []
for letter in s:
if letter == ',':
s_list.append(' ')
else:
s_list.append(letter)
s_list = "".join(s_list)
return s_list.split()
| [] | SingleLineInfilling/HumanEval/101/L1 | code_infilling | return []
| [
[
"\"Hi, my name is John\"",
"[\"Hi\", \"my\", \"name\", \"is\", \"John\"]"
],
[
"\"One, two, three, four, five, six\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
]
] |
def words_string(s):
"""
You will be given a string of words separated by commas or spaces. Your task is
to split the string into words and return an array of the words.
"""
if not s:
| HumanEval_SingleLineInfillingLight | words_string | python | python | [
[
"\"Hi, my name is John\"",
"[\"Hi\", \"my\", \"name\", \"is\", \"John\"]"
],
[
"\"One, two, three, four, five, six\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
],
[
"\"Hi, my name\"",
"[\"Hi\", \"my\", \"name\"]"
],
[
"\"One,, two, three, four, five, six,\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
],
[
"\"\"",
"[]"
],
[
"\"ahmed , gamal\"",
"[\"ahmed\", \"gamal\"]"
]
] |
[] | You will be given a string of words separated by commas or spaces. Your task is
to split the string into words and return an array of the words. |
for letter in s:
if letter == ',':
s_list.append(' ')
else:
s_list.append(letter)
s_list = "".join(s_list)
return s_list.split()
| [] | SingleLineInfilling/HumanEval/101/L3 | code_infilling | s_list = []
| [
[
"\"Hi, my name is John\"",
"[\"Hi\", \"my\", \"name\", \"is\", \"John\"]"
],
[
"\"One, two, three, four, five, six\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
]
] |
def words_string(s):
"""
You will be given a string of words separated by commas or spaces. Your task is
to split the string into words and return an array of the words.
"""
if not s:
return []
| HumanEval_SingleLineInfillingLight | words_string | python | python | [
[
"\"Hi, my name is John\"",
"[\"Hi\", \"my\", \"name\", \"is\", \"John\"]"
],
[
"\"One, two, three, four, five, six\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
],
[
"\"Hi, my name\"",
"[\"Hi\", \"my\", \"name\"]"
],
[
"\"One,, two, three, four, five, six,\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
],
[
"\"\"",
"[]"
],
[
"\"ahmed , gamal\"",
"[\"ahmed\", \"gamal\"]"
]
] |
[] | You will be given a string of words separated by commas or spaces. Your task is
to split the string into words and return an array of the words. | if letter == ',':
s_list.append(' ')
else:
s_list.append(letter)
s_list = "".join(s_list)
return s_list.split()
| [] | SingleLineInfilling/HumanEval/101/L5 | code_infilling | for letter in s:
| [
[
"\"Hi, my name is John\"",
"[\"Hi\", \"my\", \"name\", \"is\", \"John\"]"
],
[
"\"One, two, three, four, five, six\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
]
] |
def words_string(s):
"""
You will be given a string of words separated by commas or spaces. Your task is
to split the string into words and return an array of the words.
"""
if not s:
return []
s_list = []
| HumanEval_SingleLineInfillingLight | words_string | python | python | [
[
"\"Hi, my name is John\"",
"[\"Hi\", \"my\", \"name\", \"is\", \"John\"]"
],
[
"\"One, two, three, four, five, six\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
],
[
"\"Hi, my name\"",
"[\"Hi\", \"my\", \"name\"]"
],
[
"\"One,, two, three, four, five, six,\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
],
[
"\"\"",
"[]"
],
[
"\"ahmed , gamal\"",
"[\"ahmed\", \"gamal\"]"
]
] |
[] | You will be given a string of words separated by commas or spaces. Your task is
to split the string into words and return an array of the words. | s_list.append(' ')
else:
s_list.append(letter)
s_list = "".join(s_list)
return s_list.split()
| [] | SingleLineInfilling/HumanEval/101/L6 | code_infilling | if letter == ',':
| [
[
"\"Hi, my name is John\"",
"[\"Hi\", \"my\", \"name\", \"is\", \"John\"]"
],
[
"\"One, two, three, four, five, six\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
]
] |
def words_string(s):
"""
You will be given a string of words separated by commas or spaces. Your task is
to split the string into words and return an array of the words.
"""
if not s:
return []
s_list = []
for letter in s:
| HumanEval_SingleLineInfillingLight | words_string | python | python | [
[
"\"Hi, my name is John\"",
"[\"Hi\", \"my\", \"name\", \"is\", \"John\"]"
],
[
"\"One, two, three, four, five, six\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
],
[
"\"Hi, my name\"",
"[\"Hi\", \"my\", \"name\"]"
],
[
"\"One,, two, three, four, five, six,\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
],
[
"\"\"",
"[]"
],
[
"\"ahmed , gamal\"",
"[\"ahmed\", \"gamal\"]"
]
] |
[] | You will be given a string of words separated by commas or spaces. Your task is
to split the string into words and return an array of the words. | else:
s_list.append(letter)
s_list = "".join(s_list)
return s_list.split()
| [] | SingleLineInfilling/HumanEval/101/L7 | code_infilling | s_list.append(' ')
| [
[
"\"Hi, my name is John\"",
"[\"Hi\", \"my\", \"name\", \"is\", \"John\"]"
],
[
"\"One, two, three, four, five, six\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
]
] |
def words_string(s):
"""
You will be given a string of words separated by commas or spaces. Your task is
to split the string into words and return an array of the words.
"""
if not s:
return []
s_list = []
for letter in s:
if letter == ',':
| HumanEval_SingleLineInfillingLight | words_string | python | python | [
[
"\"Hi, my name is John\"",
"[\"Hi\", \"my\", \"name\", \"is\", \"John\"]"
],
[
"\"One, two, three, four, five, six\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
],
[
"\"Hi, my name\"",
"[\"Hi\", \"my\", \"name\"]"
],
[
"\"One,, two, three, four, five, six,\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
],
[
"\"\"",
"[]"
],
[
"\"ahmed , gamal\"",
"[\"ahmed\", \"gamal\"]"
]
] |
[] | You will be given a string of words separated by commas or spaces. Your task is
to split the string into words and return an array of the words. | s_list.append(letter)
s_list = "".join(s_list)
return s_list.split()
| [] | SingleLineInfilling/HumanEval/101/L8 | code_infilling | else:
| [
[
"\"Hi, my name is John\"",
"[\"Hi\", \"my\", \"name\", \"is\", \"John\"]"
],
[
"\"One, two, three, four, five, six\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
]
] |
def words_string(s):
"""
You will be given a string of words separated by commas or spaces. Your task is
to split the string into words and return an array of the words.
"""
if not s:
return []
s_list = []
for letter in s:
if letter == ',':
s_list.append(' ')
| HumanEval_SingleLineInfillingLight | words_string | python | python | [
[
"\"Hi, my name is John\"",
"[\"Hi\", \"my\", \"name\", \"is\", \"John\"]"
],
[
"\"One, two, three, four, five, six\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
],
[
"\"Hi, my name\"",
"[\"Hi\", \"my\", \"name\"]"
],
[
"\"One,, two, three, four, five, six,\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
],
[
"\"\"",
"[]"
],
[
"\"ahmed , gamal\"",
"[\"ahmed\", \"gamal\"]"
]
] |
[] | You will be given a string of words separated by commas or spaces. Your task is
to split the string into words and return an array of the words. |
s_list = "".join(s_list)
return s_list.split()
| [] | SingleLineInfilling/HumanEval/101/L9 | code_infilling | s_list.append(letter)
| [
[
"\"Hi, my name is John\"",
"[\"Hi\", \"my\", \"name\", \"is\", \"John\"]"
],
[
"\"One, two, three, four, five, six\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
]
] |
def words_string(s):
"""
You will be given a string of words separated by commas or spaces. Your task is
to split the string into words and return an array of the words.
"""
if not s:
return []
s_list = []
for letter in s:
if letter == ',':
s_list.append(' ')
else:
| HumanEval_SingleLineInfillingLight | words_string | python | python | [
[
"\"Hi, my name is John\"",
"[\"Hi\", \"my\", \"name\", \"is\", \"John\"]"
],
[
"\"One, two, three, four, five, six\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
],
[
"\"Hi, my name\"",
"[\"Hi\", \"my\", \"name\"]"
],
[
"\"One,, two, three, four, five, six,\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
],
[
"\"\"",
"[]"
],
[
"\"ahmed , gamal\"",
"[\"ahmed\", \"gamal\"]"
]
] |
[] | You will be given a string of words separated by commas or spaces. Your task is
to split the string into words and return an array of the words. | return s_list.split()
| [] | SingleLineInfilling/HumanEval/101/L11 | code_infilling | s_list = "".join(s_list)
| [
[
"\"Hi, my name is John\"",
"[\"Hi\", \"my\", \"name\", \"is\", \"John\"]"
],
[
"\"One, two, three, four, five, six\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
]
] |
def words_string(s):
"""
You will be given a string of words separated by commas or spaces. Your task is
to split the string into words and return an array of the words.
"""
if not s:
return []
s_list = []
for letter in s:
if letter == ',':
s_list.append(' ')
else:
s_list.append(letter)
| HumanEval_SingleLineInfillingLight | words_string | python | python | [
[
"\"Hi, my name is John\"",
"[\"Hi\", \"my\", \"name\", \"is\", \"John\"]"
],
[
"\"One, two, three, four, five, six\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
],
[
"\"Hi, my name\"",
"[\"Hi\", \"my\", \"name\"]"
],
[
"\"One,, two, three, four, five, six,\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
],
[
"\"\"",
"[]"
],
[
"\"ahmed , gamal\"",
"[\"ahmed\", \"gamal\"]"
]
] |
[] | You will be given a string of words separated by commas or spaces. Your task is
to split the string into words and return an array of the words. | [] | SingleLineInfilling/HumanEval/101/L12 | code_infilling | return s_list.split()
| [
[
"\"Hi, my name is John\"",
"[\"Hi\", \"my\", \"name\", \"is\", \"John\"]"
],
[
"\"One, two, three, four, five, six\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
]
] |
def words_string(s):
"""
You will be given a string of words separated by commas or spaces. Your task is
to split the string into words and return an array of the words.
"""
if not s:
return []
s_list = []
for letter in s:
if letter == ',':
s_list.append(' ')
else:
s_list.append(letter)
s_list = "".join(s_list)
| HumanEval_SingleLineInfillingLight | words_string | python | python | [
[
"\"Hi, my name is John\"",
"[\"Hi\", \"my\", \"name\", \"is\", \"John\"]"
],
[
"\"One, two, three, four, five, six\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
],
[
"\"Hi, my name\"",
"[\"Hi\", \"my\", \"name\"]"
],
[
"\"One,, two, three, four, five, six,\"",
"[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]"
],
[
"\"\"",
"[]"
],
[
"\"ahmed , gamal\"",
"[\"ahmed\", \"gamal\"]"
]
] |
|
[] | This function takes two positive numbers x and y and returns the
biggest even integer number that is in the range [x, y] inclusive. If
there's no such number, then the function should return -1. | return -1
if y % 2 == 0:
return y
if x == y:
return -1
return y - 1
| [] | SingleLineInfilling/HumanEval/102/L0 | code_infilling | if x > y:
| [
[
"12, 15",
"14"
],
[
"13, 12",
"-1"
]
] |
def choose_num(x, y):
"""This function takes two positive numbers x and y and returns the
biggest even integer number that is in the range [x, y] inclusive. If
there's no such number, then the function should return -1.
"""
| HumanEval_SingleLineInfillingLight | choose_num | python | python | [
[
"12, 15",
"14"
],
[
"13, 12",
"-1"
],
[
"33, 12354",
"12354"
],
[
"5234, 5233",
"-1"
],
[
"6, 29",
"28"
],
[
"27, 10",
"-1"
],
[
"7, 7",
"-1"
],
[
"546, 546",
"546"
]
] |
[] | This function takes two positive numbers x and y and returns the
biggest even integer number that is in the range [x, y] inclusive. If
there's no such number, then the function should return -1. | if y % 2 == 0:
return y
if x == y:
return -1
return y - 1
| [] | SingleLineInfilling/HumanEval/102/L1 | code_infilling | return -1
| [
[
"12, 15",
"14"
],
[
"13, 12",
"-1"
]
] |
def choose_num(x, y):
"""This function takes two positive numbers x and y and returns the
biggest even integer number that is in the range [x, y] inclusive. If
there's no such number, then the function should return -1.
"""
if x > y:
| HumanEval_SingleLineInfillingLight | choose_num | python | python | [
[
"12, 15",
"14"
],
[
"13, 12",
"-1"
],
[
"33, 12354",
"12354"
],
[
"5234, 5233",
"-1"
],
[
"6, 29",
"28"
],
[
"27, 10",
"-1"
],
[
"7, 7",
"-1"
],
[
"546, 546",
"546"
]
] |
[] | This function takes two positive numbers x and y and returns the
biggest even integer number that is in the range [x, y] inclusive. If
there's no such number, then the function should return -1. | return y
if x == y:
return -1
return y - 1
| [] | SingleLineInfilling/HumanEval/102/L2 | code_infilling | if y % 2 == 0:
| [
[
"12, 15",
"14"
],
[
"13, 12",
"-1"
]
] |
def choose_num(x, y):
"""This function takes two positive numbers x and y and returns the
biggest even integer number that is in the range [x, y] inclusive. If
there's no such number, then the function should return -1.
"""
if x > y:
return -1
| HumanEval_SingleLineInfillingLight | choose_num | python | python | [
[
"12, 15",
"14"
],
[
"13, 12",
"-1"
],
[
"33, 12354",
"12354"
],
[
"5234, 5233",
"-1"
],
[
"6, 29",
"28"
],
[
"27, 10",
"-1"
],
[
"7, 7",
"-1"
],
[
"546, 546",
"546"
]
] |
[] | This function takes two positive numbers x and y and returns the
biggest even integer number that is in the range [x, y] inclusive. If
there's no such number, then the function should return -1. | if x == y:
return -1
return y - 1
| [] | SingleLineInfilling/HumanEval/102/L3 | code_infilling | return y
| [
[
"12, 15",
"14"
],
[
"13, 12",
"-1"
]
] |
def choose_num(x, y):
"""This function takes two positive numbers x and y and returns the
biggest even integer number that is in the range [x, y] inclusive. If
there's no such number, then the function should return -1.
"""
if x > y:
return -1
if y % 2 == 0:
| HumanEval_SingleLineInfillingLight | choose_num | python | python | [
[
"12, 15",
"14"
],
[
"13, 12",
"-1"
],
[
"33, 12354",
"12354"
],
[
"5234, 5233",
"-1"
],
[
"6, 29",
"28"
],
[
"27, 10",
"-1"
],
[
"7, 7",
"-1"
],
[
"546, 546",
"546"
]
] |
[] | This function takes two positive numbers x and y and returns the
biggest even integer number that is in the range [x, y] inclusive. If
there's no such number, then the function should return -1. | return -1
return y - 1
| [] | SingleLineInfilling/HumanEval/102/L4 | code_infilling | if x == y:
| [
[
"12, 15",
"14"
],
[
"13, 12",
"-1"
]
] |
def choose_num(x, y):
"""This function takes two positive numbers x and y and returns the
biggest even integer number that is in the range [x, y] inclusive. If
there's no such number, then the function should return -1.
"""
if x > y:
return -1
if y % 2 == 0:
return y
| HumanEval_SingleLineInfillingLight | choose_num | python | python | [
[
"12, 15",
"14"
],
[
"13, 12",
"-1"
],
[
"33, 12354",
"12354"
],
[
"5234, 5233",
"-1"
],
[
"6, 29",
"28"
],
[
"27, 10",
"-1"
],
[
"7, 7",
"-1"
],
[
"546, 546",
"546"
]
] |
[] | This function takes two positive numbers x and y and returns the
biggest even integer number that is in the range [x, y] inclusive. If
there's no such number, then the function should return -1. | return y - 1
| [] | SingleLineInfilling/HumanEval/102/L5 | code_infilling | return -1
| [
[
"12, 15",
"14"
],
[
"13, 12",
"-1"
]
] |
def choose_num(x, y):
"""This function takes two positive numbers x and y and returns the
biggest even integer number that is in the range [x, y] inclusive. If
there's no such number, then the function should return -1.
"""
if x > y:
return -1
if y % 2 == 0:
return y
if x == y:
| HumanEval_SingleLineInfillingLight | choose_num | python | python | [
[
"12, 15",
"14"
],
[
"13, 12",
"-1"
],
[
"33, 12354",
"12354"
],
[
"5234, 5233",
"-1"
],
[
"6, 29",
"28"
],
[
"27, 10",
"-1"
],
[
"7, 7",
"-1"
],
[
"546, 546",
"546"
]
] |
[] | This function takes two positive numbers x and y and returns the
biggest even integer number that is in the range [x, y] inclusive. If
there's no such number, then the function should return -1. | [] | SingleLineInfilling/HumanEval/102/L6 | code_infilling | return y - 1
| [
[
"12, 15",
"14"
],
[
"13, 12",
"-1"
]
] |
def choose_num(x, y):
"""This function takes two positive numbers x and y and returns the
biggest even integer number that is in the range [x, y] inclusive. If
there's no such number, then the function should return -1.
"""
if x > y:
return -1
if y % 2 == 0:
return y
if x == y:
return -1
| HumanEval_SingleLineInfillingLight | choose_num | python | python | [
[
"12, 15",
"14"
],
[
"13, 12",
"-1"
],
[
"33, 12354",
"12354"
],
[
"5234, 5233",
"-1"
],
[
"6, 29",
"28"
],
[
"27, 10",
"-1"
],
[
"7, 7",
"-1"
],
[
"546, 546",
"546"
]
] |
|
[] | You are given two positive integers n and m, and your task is to compute the
average of the integers from n through m (including n and m).
Round the answer to the nearest integer and convert that to binary.
If n is greater than m, return -1. | return -1
summation = 0
for i in range(n, m+1):
summation += i
return bin(round(summation/(m - n + 1)))
| [] | SingleLineInfilling/HumanEval/103/L0 | code_infilling | if m < n:
| [
[
"1, 5",
"\"0b11\""
],
[
"7, 5",
"-1"
],
[
"10, 20",
"\"0b1111\""
],
[
"20, 33",
"\"0b11010\""
]
] |
def rounded_avg(n, m):
"""You are given two positive integers n and m, and your task is to compute the
average of the integers from n through m (including n and m).
Round the answer to the nearest integer and convert that to binary.
If n is greater than m, return -1.
"""
| HumanEval_SingleLineInfillingLight | rounded_avg | python | python | [
[
"1, 5",
"\"0b11\""
],
[
"7, 13",
"\"0b1010\""
],
[
"964, 977",
"\"0b1111001010\""
],
[
"996, 997",
"\"0b1111100100\""
],
[
"560, 851",
"\"0b1011000010\""
],
[
"185, 546",
"\"0b101101110\""
],
[
"362, 496",
"\"0b110101101\""
],
[
"350, 902",
"\"0b1001110010\""
],
[
"197, 233",
"\"0b11010111\""
],
[
"7, 5",
"-1"
],
[
"5, 1",
"-1"
],
[
"5, 5",
"\"0b101\""
]
] |
[] | You are given two positive integers n and m, and your task is to compute the
average of the integers from n through m (including n and m).
Round the answer to the nearest integer and convert that to binary.
If n is greater than m, return -1. | summation = 0
for i in range(n, m+1):
summation += i
return bin(round(summation/(m - n + 1)))
| [] | SingleLineInfilling/HumanEval/103/L1 | code_infilling | return -1
| [
[
"1, 5",
"\"0b11\""
],
[
"7, 5",
"-1"
],
[
"10, 20",
"\"0b1111\""
],
[
"20, 33",
"\"0b11010\""
]
] |
def rounded_avg(n, m):
"""You are given two positive integers n and m, and your task is to compute the
average of the integers from n through m (including n and m).
Round the answer to the nearest integer and convert that to binary.
If n is greater than m, return -1.
"""
if m < n:
| HumanEval_SingleLineInfillingLight | rounded_avg | python | python | [
[
"1, 5",
"\"0b11\""
],
[
"7, 13",
"\"0b1010\""
],
[
"964, 977",
"\"0b1111001010\""
],
[
"996, 997",
"\"0b1111100100\""
],
[
"560, 851",
"\"0b1011000010\""
],
[
"185, 546",
"\"0b101101110\""
],
[
"362, 496",
"\"0b110101101\""
],
[
"350, 902",
"\"0b1001110010\""
],
[
"197, 233",
"\"0b11010111\""
],
[
"7, 5",
"-1"
],
[
"5, 1",
"-1"
],
[
"5, 5",
"\"0b101\""
]
] |
[] | You are given two positive integers n and m, and your task is to compute the
average of the integers from n through m (including n and m).
Round the answer to the nearest integer and convert that to binary.
If n is greater than m, return -1. | for i in range(n, m+1):
summation += i
return bin(round(summation/(m - n + 1)))
| [] | SingleLineInfilling/HumanEval/103/L2 | code_infilling | summation = 0
| [
[
"1, 5",
"\"0b11\""
],
[
"7, 5",
"-1"
],
[
"10, 20",
"\"0b1111\""
],
[
"20, 33",
"\"0b11010\""
]
] |
def rounded_avg(n, m):
"""You are given two positive integers n and m, and your task is to compute the
average of the integers from n through m (including n and m).
Round the answer to the nearest integer and convert that to binary.
If n is greater than m, return -1.
"""
if m < n:
return -1
| HumanEval_SingleLineInfillingLight | rounded_avg | python | python | [
[
"1, 5",
"\"0b11\""
],
[
"7, 13",
"\"0b1010\""
],
[
"964, 977",
"\"0b1111001010\""
],
[
"996, 997",
"\"0b1111100100\""
],
[
"560, 851",
"\"0b1011000010\""
],
[
"185, 546",
"\"0b101101110\""
],
[
"362, 496",
"\"0b110101101\""
],
[
"350, 902",
"\"0b1001110010\""
],
[
"197, 233",
"\"0b11010111\""
],
[
"7, 5",
"-1"
],
[
"5, 1",
"-1"
],
[
"5, 5",
"\"0b101\""
]
] |
[] | You are given two positive integers n and m, and your task is to compute the
average of the integers from n through m (including n and m).
Round the answer to the nearest integer and convert that to binary.
If n is greater than m, return -1. | summation += i
return bin(round(summation/(m - n + 1)))
| [] | SingleLineInfilling/HumanEval/103/L3 | code_infilling | for i in range(n, m+1):
| [
[
"1, 5",
"\"0b11\""
],
[
"7, 5",
"-1"
],
[
"10, 20",
"\"0b1111\""
],
[
"20, 33",
"\"0b11010\""
]
] |
def rounded_avg(n, m):
"""You are given two positive integers n and m, and your task is to compute the
average of the integers from n through m (including n and m).
Round the answer to the nearest integer and convert that to binary.
If n is greater than m, return -1.
"""
if m < n:
return -1
summation = 0
| HumanEval_SingleLineInfillingLight | rounded_avg | python | python | [
[
"1, 5",
"\"0b11\""
],
[
"7, 13",
"\"0b1010\""
],
[
"964, 977",
"\"0b1111001010\""
],
[
"996, 997",
"\"0b1111100100\""
],
[
"560, 851",
"\"0b1011000010\""
],
[
"185, 546",
"\"0b101101110\""
],
[
"362, 496",
"\"0b110101101\""
],
[
"350, 902",
"\"0b1001110010\""
],
[
"197, 233",
"\"0b11010111\""
],
[
"7, 5",
"-1"
],
[
"5, 1",
"-1"
],
[
"5, 5",
"\"0b101\""
]
] |
[] | You are given two positive integers n and m, and your task is to compute the
average of the integers from n through m (including n and m).
Round the answer to the nearest integer and convert that to binary.
If n is greater than m, return -1. | return bin(round(summation/(m - n + 1)))
| [] | SingleLineInfilling/HumanEval/103/L4 | code_infilling | summation += i
| [
[
"1, 5",
"\"0b11\""
],
[
"7, 5",
"-1"
],
[
"10, 20",
"\"0b1111\""
],
[
"20, 33",
"\"0b11010\""
]
] |
def rounded_avg(n, m):
"""You are given two positive integers n and m, and your task is to compute the
average of the integers from n through m (including n and m).
Round the answer to the nearest integer and convert that to binary.
If n is greater than m, return -1.
"""
if m < n:
return -1
summation = 0
for i in range(n, m+1):
| HumanEval_SingleLineInfillingLight | rounded_avg | python | python | [
[
"1, 5",
"\"0b11\""
],
[
"7, 13",
"\"0b1010\""
],
[
"964, 977",
"\"0b1111001010\""
],
[
"996, 997",
"\"0b1111100100\""
],
[
"560, 851",
"\"0b1011000010\""
],
[
"185, 546",
"\"0b101101110\""
],
[
"362, 496",
"\"0b110101101\""
],
[
"350, 902",
"\"0b1001110010\""
],
[
"197, 233",
"\"0b11010111\""
],
[
"7, 5",
"-1"
],
[
"5, 1",
"-1"
],
[
"5, 5",
"\"0b101\""
]
] |
[] | You are given two positive integers n and m, and your task is to compute the
average of the integers from n through m (including n and m).
Round the answer to the nearest integer and convert that to binary.
If n is greater than m, return -1. | [] | SingleLineInfilling/HumanEval/103/L5 | code_infilling | return bin(round(summation/(m - n + 1)))
| [
[
"1, 5",
"\"0b11\""
],
[
"7, 5",
"-1"
],
[
"10, 20",
"\"0b1111\""
],
[
"20, 33",
"\"0b11010\""
]
] |
def rounded_avg(n, m):
"""You are given two positive integers n and m, and your task is to compute the
average of the integers from n through m (including n and m).
Round the answer to the nearest integer and convert that to binary.
If n is greater than m, return -1.
"""
if m < n:
return -1
summation = 0
for i in range(n, m+1):
summation += i
| HumanEval_SingleLineInfillingLight | rounded_avg | python | python | [
[
"1, 5",
"\"0b11\""
],
[
"7, 13",
"\"0b1010\""
],
[
"964, 977",
"\"0b1111001010\""
],
[
"996, 997",
"\"0b1111100100\""
],
[
"560, 851",
"\"0b1011000010\""
],
[
"185, 546",
"\"0b101101110\""
],
[
"362, 496",
"\"0b110101101\""
],
[
"350, 902",
"\"0b1001110010\""
],
[
"197, 233",
"\"0b11010111\""
],
[
"7, 5",
"-1"
],
[
"5, 1",
"-1"
],
[
"5, 5",
"\"0b101\""
]
] |
|
[] | Given a list of positive integers x. return a sorted list of all
elements that hasn't any even digit.
Note: Returned list should be sorted in increasing order. | for i in x:
if all (int(c) % 2 == 1 for c in str(i)):
odd_digit_elements.append(i)
return sorted(odd_digit_elements)
| [] | SingleLineInfilling/HumanEval/104/L0 | code_infilling | odd_digit_elements = []
| [
[
"[15, 33, 1422, 1]",
"[1, 15, 33]"
],
[
"[152, 323, 1422, 10]",
"[]"
]
] |
def unique_digits(x):
"""Given a list of positive integers x. return a sorted list of all
elements that hasn't any even digit.
Note: Returned list should be sorted in increasing order.
"""
| HumanEval_SingleLineInfillingLight | unique_digits | python | python | [
[
"[15, 33, 1422, 1]",
"[1, 15, 33]"
],
[
"[152, 323, 1422, 10]",
"[]"
],
[
"[12345, 2033, 111, 151]",
"[111, 151]"
],
[
"[135, 103, 31]",
"[31, 135]"
]
] |
[] | Given a list of positive integers x. return a sorted list of all
elements that hasn't any even digit.
Note: Returned list should be sorted in increasing order. | if all (int(c) % 2 == 1 for c in str(i)):
odd_digit_elements.append(i)
return sorted(odd_digit_elements)
| [] | SingleLineInfilling/HumanEval/104/L1 | code_infilling | for i in x:
| [
[
"[15, 33, 1422, 1]",
"[1, 15, 33]"
],
[
"[152, 323, 1422, 10]",
"[]"
]
] |
def unique_digits(x):
"""Given a list of positive integers x. return a sorted list of all
elements that hasn't any even digit.
Note: Returned list should be sorted in increasing order.
"""
odd_digit_elements = []
| HumanEval_SingleLineInfillingLight | unique_digits | python | python | [
[
"[15, 33, 1422, 1]",
"[1, 15, 33]"
],
[
"[152, 323, 1422, 10]",
"[]"
],
[
"[12345, 2033, 111, 151]",
"[111, 151]"
],
[
"[135, 103, 31]",
"[31, 135]"
]
] |
[] | Given a list of positive integers x. return a sorted list of all
elements that hasn't any even digit.
Note: Returned list should be sorted in increasing order. | odd_digit_elements.append(i)
return sorted(odd_digit_elements)
| [] | SingleLineInfilling/HumanEval/104/L2 | code_infilling | if all (int(c) % 2 == 1 for c in str(i)):
| [
[
"[15, 33, 1422, 1]",
"[1, 15, 33]"
],
[
"[152, 323, 1422, 10]",
"[]"
]
] |
def unique_digits(x):
"""Given a list of positive integers x. return a sorted list of all
elements that hasn't any even digit.
Note: Returned list should be sorted in increasing order.
"""
odd_digit_elements = []
for i in x:
| HumanEval_SingleLineInfillingLight | unique_digits | python | python | [
[
"[15, 33, 1422, 1]",
"[1, 15, 33]"
],
[
"[152, 323, 1422, 10]",
"[]"
],
[
"[12345, 2033, 111, 151]",
"[111, 151]"
],
[
"[135, 103, 31]",
"[31, 135]"
]
] |
[] | Given a list of positive integers x. return a sorted list of all
elements that hasn't any even digit.
Note: Returned list should be sorted in increasing order. | return sorted(odd_digit_elements)
| [] | SingleLineInfilling/HumanEval/104/L3 | code_infilling | odd_digit_elements.append(i)
| [
[
"[15, 33, 1422, 1]",
"[1, 15, 33]"
],
[
"[152, 323, 1422, 10]",
"[]"
]
] |
def unique_digits(x):
"""Given a list of positive integers x. return a sorted list of all
elements that hasn't any even digit.
Note: Returned list should be sorted in increasing order.
"""
odd_digit_elements = []
for i in x:
if all (int(c) % 2 == 1 for c in str(i)):
| HumanEval_SingleLineInfillingLight | unique_digits | python | python | [
[
"[15, 33, 1422, 1]",
"[1, 15, 33]"
],
[
"[152, 323, 1422, 10]",
"[]"
],
[
"[12345, 2033, 111, 151]",
"[111, 151]"
],
[
"[135, 103, 31]",
"[31, 135]"
]
] |
[] | Given a list of positive integers x. return a sorted list of all
elements that hasn't any even digit.
Note: Returned list should be sorted in increasing order. | [] | SingleLineInfilling/HumanEval/104/L4 | code_infilling | return sorted(odd_digit_elements)
| [
[
"[15, 33, 1422, 1]",
"[1, 15, 33]"
],
[
"[152, 323, 1422, 10]",
"[]"
]
] |
def unique_digits(x):
"""Given a list of positive integers x. return a sorted list of all
elements that hasn't any even digit.
Note: Returned list should be sorted in increasing order.
"""
odd_digit_elements = []
for i in x:
if all (int(c) % 2 == 1 for c in str(i)):
odd_digit_elements.append(i)
| HumanEval_SingleLineInfillingLight | unique_digits | python | python | [
[
"[15, 33, 1422, 1]",
"[1, 15, 33]"
],
[
"[152, 323, 1422, 10]",
"[]"
],
[
"[12345, 2033, 111, 151]",
"[111, 151]"
],
[
"[135, 103, 31]",
"[31, 135]"
]
] |
|
[] | Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine". | 1: "One",
2: "Two",
3: "Three",
4: "Four",
5: "Five",
6: "Six",
7: "Seven",
8: "Eight",
9: "Nine",
}
sorted_arr = sorted(arr, reverse=True)
new_arr = []
for var in sorted_arr:
try:
new_arr.append(dic[var])
except:
pass
return new_arr
| [] | SingleLineInfilling/HumanEval/105/L0 | code_infilling | dic = {
| [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"[\"One\"]"
]
] |
def by_length(arr):
"""
Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine".
"""
| HumanEval_SingleLineInfillingLight | by_length | python | python | [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"['One']"
],
[
"[1, -1, 3, 2]",
"[\"Three\", \"Two\", \"One\"]"
],
[
"[9, 4, 8]",
"[\"Nine\", \"Eight\", \"Four\"]"
]
] |
[] | Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine". | 2: "Two",
3: "Three",
4: "Four",
5: "Five",
6: "Six",
7: "Seven",
8: "Eight",
9: "Nine",
}
sorted_arr = sorted(arr, reverse=True)
new_arr = []
for var in sorted_arr:
try:
new_arr.append(dic[var])
except:
pass
return new_arr
| [] | SingleLineInfilling/HumanEval/105/L1 | code_infilling | 1: "One",
| [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"[\"One\"]"
]
] |
def by_length(arr):
"""
Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine".
"""
dic = {
| HumanEval_SingleLineInfillingLight | by_length | python | python | [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"['One']"
],
[
"[1, -1, 3, 2]",
"[\"Three\", \"Two\", \"One\"]"
],
[
"[9, 4, 8]",
"[\"Nine\", \"Eight\", \"Four\"]"
]
] |
[] | Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine". | 3: "Three",
4: "Four",
5: "Five",
6: "Six",
7: "Seven",
8: "Eight",
9: "Nine",
}
sorted_arr = sorted(arr, reverse=True)
new_arr = []
for var in sorted_arr:
try:
new_arr.append(dic[var])
except:
pass
return new_arr
| [] | SingleLineInfilling/HumanEval/105/L2 | code_infilling | 2: "Two",
| [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"[\"One\"]"
]
] |
def by_length(arr):
"""
Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine".
"""
dic = {
1: "One",
| HumanEval_SingleLineInfillingLight | by_length | python | python | [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"['One']"
],
[
"[1, -1, 3, 2]",
"[\"Three\", \"Two\", \"One\"]"
],
[
"[9, 4, 8]",
"[\"Nine\", \"Eight\", \"Four\"]"
]
] |
[] | Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine". | 4: "Four",
5: "Five",
6: "Six",
7: "Seven",
8: "Eight",
9: "Nine",
}
sorted_arr = sorted(arr, reverse=True)
new_arr = []
for var in sorted_arr:
try:
new_arr.append(dic[var])
except:
pass
return new_arr
| [] | SingleLineInfilling/HumanEval/105/L3 | code_infilling | 3: "Three",
| [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"[\"One\"]"
]
] |
def by_length(arr):
"""
Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine".
"""
dic = {
1: "One",
2: "Two",
| HumanEval_SingleLineInfillingLight | by_length | python | python | [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"['One']"
],
[
"[1, -1, 3, 2]",
"[\"Three\", \"Two\", \"One\"]"
],
[
"[9, 4, 8]",
"[\"Nine\", \"Eight\", \"Four\"]"
]
] |
[] | Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine". | 5: "Five",
6: "Six",
7: "Seven",
8: "Eight",
9: "Nine",
}
sorted_arr = sorted(arr, reverse=True)
new_arr = []
for var in sorted_arr:
try:
new_arr.append(dic[var])
except:
pass
return new_arr
| [] | SingleLineInfilling/HumanEval/105/L4 | code_infilling | 4: "Four",
| [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"[\"One\"]"
]
] |
def by_length(arr):
"""
Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine".
"""
dic = {
1: "One",
2: "Two",
3: "Three",
| HumanEval_SingleLineInfillingLight | by_length | python | python | [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"['One']"
],
[
"[1, -1, 3, 2]",
"[\"Three\", \"Two\", \"One\"]"
],
[
"[9, 4, 8]",
"[\"Nine\", \"Eight\", \"Four\"]"
]
] |
[] | Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine". | 6: "Six",
7: "Seven",
8: "Eight",
9: "Nine",
}
sorted_arr = sorted(arr, reverse=True)
new_arr = []
for var in sorted_arr:
try:
new_arr.append(dic[var])
except:
pass
return new_arr
| [] | SingleLineInfilling/HumanEval/105/L5 | code_infilling | 5: "Five",
| [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"[\"One\"]"
]
] |
def by_length(arr):
"""
Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine".
"""
dic = {
1: "One",
2: "Two",
3: "Three",
4: "Four",
| HumanEval_SingleLineInfillingLight | by_length | python | python | [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"['One']"
],
[
"[1, -1, 3, 2]",
"[\"Three\", \"Two\", \"One\"]"
],
[
"[9, 4, 8]",
"[\"Nine\", \"Eight\", \"Four\"]"
]
] |
[] | Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine". | 7: "Seven",
8: "Eight",
9: "Nine",
}
sorted_arr = sorted(arr, reverse=True)
new_arr = []
for var in sorted_arr:
try:
new_arr.append(dic[var])
except:
pass
return new_arr
| [] | SingleLineInfilling/HumanEval/105/L6 | code_infilling | 6: "Six",
| [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"[\"One\"]"
]
] |
def by_length(arr):
"""
Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine".
"""
dic = {
1: "One",
2: "Two",
3: "Three",
4: "Four",
5: "Five",
| HumanEval_SingleLineInfillingLight | by_length | python | python | [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"['One']"
],
[
"[1, -1, 3, 2]",
"[\"Three\", \"Two\", \"One\"]"
],
[
"[9, 4, 8]",
"[\"Nine\", \"Eight\", \"Four\"]"
]
] |
[] | Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine". | 8: "Eight",
9: "Nine",
}
sorted_arr = sorted(arr, reverse=True)
new_arr = []
for var in sorted_arr:
try:
new_arr.append(dic[var])
except:
pass
return new_arr
| [] | SingleLineInfilling/HumanEval/105/L7 | code_infilling | 7: "Seven",
| [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"[\"One\"]"
]
] |
def by_length(arr):
"""
Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine".
"""
dic = {
1: "One",
2: "Two",
3: "Three",
4: "Four",
5: "Five",
6: "Six",
| HumanEval_SingleLineInfillingLight | by_length | python | python | [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"['One']"
],
[
"[1, -1, 3, 2]",
"[\"Three\", \"Two\", \"One\"]"
],
[
"[9, 4, 8]",
"[\"Nine\", \"Eight\", \"Four\"]"
]
] |
[] | Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine". | 9: "Nine",
}
sorted_arr = sorted(arr, reverse=True)
new_arr = []
for var in sorted_arr:
try:
new_arr.append(dic[var])
except:
pass
return new_arr
| [] | SingleLineInfilling/HumanEval/105/L8 | code_infilling | 8: "Eight",
| [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"[\"One\"]"
]
] |
def by_length(arr):
"""
Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine".
"""
dic = {
1: "One",
2: "Two",
3: "Three",
4: "Four",
5: "Five",
6: "Six",
7: "Seven",
| HumanEval_SingleLineInfillingLight | by_length | python | python | [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"['One']"
],
[
"[1, -1, 3, 2]",
"[\"Three\", \"Two\", \"One\"]"
],
[
"[9, 4, 8]",
"[\"Nine\", \"Eight\", \"Four\"]"
]
] |
[] | Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine". | }
sorted_arr = sorted(arr, reverse=True)
new_arr = []
for var in sorted_arr:
try:
new_arr.append(dic[var])
except:
pass
return new_arr
| [] | SingleLineInfilling/HumanEval/105/L9 | code_infilling | 9: "Nine",
| [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"[\"One\"]"
]
] |
def by_length(arr):
"""
Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine".
"""
dic = {
1: "One",
2: "Two",
3: "Three",
4: "Four",
5: "Five",
6: "Six",
7: "Seven",
8: "Eight",
| HumanEval_SingleLineInfillingLight | by_length | python | python | [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"['One']"
],
[
"[1, -1, 3, 2]",
"[\"Three\", \"Two\", \"One\"]"
],
[
"[9, 4, 8]",
"[\"Nine\", \"Eight\", \"Four\"]"
]
] |
[] | Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine". | sorted_arr = sorted(arr, reverse=True)
new_arr = []
for var in sorted_arr:
try:
new_arr.append(dic[var])
except:
pass
return new_arr
| [] | SingleLineInfilling/HumanEval/105/L10 | code_infilling | }
| [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"[\"One\"]"
]
] |
def by_length(arr):
"""
Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine".
"""
dic = {
1: "One",
2: "Two",
3: "Three",
4: "Four",
5: "Five",
6: "Six",
7: "Seven",
8: "Eight",
9: "Nine",
| HumanEval_SingleLineInfillingLight | by_length | python | python | [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"['One']"
],
[
"[1, -1, 3, 2]",
"[\"Three\", \"Two\", \"One\"]"
],
[
"[9, 4, 8]",
"[\"Nine\", \"Eight\", \"Four\"]"
]
] |
[] | Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine". | new_arr = []
for var in sorted_arr:
try:
new_arr.append(dic[var])
except:
pass
return new_arr
| [] | SingleLineInfilling/HumanEval/105/L11 | code_infilling | sorted_arr = sorted(arr, reverse=True)
| [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"[\"One\"]"
]
] |
def by_length(arr):
"""
Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine".
"""
dic = {
1: "One",
2: "Two",
3: "Three",
4: "Four",
5: "Five",
6: "Six",
7: "Seven",
8: "Eight",
9: "Nine",
}
| HumanEval_SingleLineInfillingLight | by_length | python | python | [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"['One']"
],
[
"[1, -1, 3, 2]",
"[\"Three\", \"Two\", \"One\"]"
],
[
"[9, 4, 8]",
"[\"Nine\", \"Eight\", \"Four\"]"
]
] |
[] | Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine". | for var in sorted_arr:
try:
new_arr.append(dic[var])
except:
pass
return new_arr
| [] | SingleLineInfilling/HumanEval/105/L12 | code_infilling | new_arr = []
| [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"[\"One\"]"
]
] |
def by_length(arr):
"""
Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine".
"""
dic = {
1: "One",
2: "Two",
3: "Three",
4: "Four",
5: "Five",
6: "Six",
7: "Seven",
8: "Eight",
9: "Nine",
}
sorted_arr = sorted(arr, reverse=True)
| HumanEval_SingleLineInfillingLight | by_length | python | python | [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"['One']"
],
[
"[1, -1, 3, 2]",
"[\"Three\", \"Two\", \"One\"]"
],
[
"[9, 4, 8]",
"[\"Nine\", \"Eight\", \"Four\"]"
]
] |
[] | Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine". | try:
new_arr.append(dic[var])
except:
pass
return new_arr
| [] | SingleLineInfilling/HumanEval/105/L13 | code_infilling | for var in sorted_arr:
| [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"[\"One\"]"
]
] |
def by_length(arr):
"""
Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine".
"""
dic = {
1: "One",
2: "Two",
3: "Three",
4: "Four",
5: "Five",
6: "Six",
7: "Seven",
8: "Eight",
9: "Nine",
}
sorted_arr = sorted(arr, reverse=True)
new_arr = []
| HumanEval_SingleLineInfillingLight | by_length | python | python | [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"['One']"
],
[
"[1, -1, 3, 2]",
"[\"Three\", \"Two\", \"One\"]"
],
[
"[9, 4, 8]",
"[\"Nine\", \"Eight\", \"Four\"]"
]
] |
[] | Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine". | new_arr.append(dic[var])
except:
pass
return new_arr
| [] | SingleLineInfilling/HumanEval/105/L14 | code_infilling | try:
| [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"[\"One\"]"
]
] |
def by_length(arr):
"""
Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine".
"""
dic = {
1: "One",
2: "Two",
3: "Three",
4: "Four",
5: "Five",
6: "Six",
7: "Seven",
8: "Eight",
9: "Nine",
}
sorted_arr = sorted(arr, reverse=True)
new_arr = []
for var in sorted_arr:
| HumanEval_SingleLineInfillingLight | by_length | python | python | [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"['One']"
],
[
"[1, -1, 3, 2]",
"[\"Three\", \"Two\", \"One\"]"
],
[
"[9, 4, 8]",
"[\"Nine\", \"Eight\", \"Four\"]"
]
] |
[] | Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine". | except:
pass
return new_arr
| [] | SingleLineInfilling/HumanEval/105/L15 | code_infilling | new_arr.append(dic[var])
| [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"[\"One\"]"
]
] |
def by_length(arr):
"""
Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine".
"""
dic = {
1: "One",
2: "Two",
3: "Three",
4: "Four",
5: "Five",
6: "Six",
7: "Seven",
8: "Eight",
9: "Nine",
}
sorted_arr = sorted(arr, reverse=True)
new_arr = []
for var in sorted_arr:
try:
| HumanEval_SingleLineInfillingLight | by_length | python | python | [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"['One']"
],
[
"[1, -1, 3, 2]",
"[\"Three\", \"Two\", \"One\"]"
],
[
"[9, 4, 8]",
"[\"Nine\", \"Eight\", \"Four\"]"
]
] |
[] | Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine". | pass
return new_arr
| [] | SingleLineInfilling/HumanEval/105/L16 | code_infilling | except:
| [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"[\"One\"]"
]
] |
def by_length(arr):
"""
Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine".
"""
dic = {
1: "One",
2: "Two",
3: "Three",
4: "Four",
5: "Five",
6: "Six",
7: "Seven",
8: "Eight",
9: "Nine",
}
sorted_arr = sorted(arr, reverse=True)
new_arr = []
for var in sorted_arr:
try:
new_arr.append(dic[var])
| HumanEval_SingleLineInfillingLight | by_length | python | python | [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"['One']"
],
[
"[1, -1, 3, 2]",
"[\"Three\", \"Two\", \"One\"]"
],
[
"[9, 4, 8]",
"[\"Nine\", \"Eight\", \"Four\"]"
]
] |
[] | Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine". | return new_arr
| [] | SingleLineInfilling/HumanEval/105/L17 | code_infilling | pass
| [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"[\"One\"]"
]
] |
def by_length(arr):
"""
Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine".
"""
dic = {
1: "One",
2: "Two",
3: "Three",
4: "Four",
5: "Five",
6: "Six",
7: "Seven",
8: "Eight",
9: "Nine",
}
sorted_arr = sorted(arr, reverse=True)
new_arr = []
for var in sorted_arr:
try:
new_arr.append(dic[var])
except:
| HumanEval_SingleLineInfillingLight | by_length | python | python | [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"['One']"
],
[
"[1, -1, 3, 2]",
"[\"Three\", \"Two\", \"One\"]"
],
[
"[9, 4, 8]",
"[\"Nine\", \"Eight\", \"Four\"]"
]
] |
[] | Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine". | [] | SingleLineInfilling/HumanEval/105/L18 | code_infilling | return new_arr
| [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"[\"One\"]"
]
] |
def by_length(arr):
"""
Given an array of integers, sort the integers that are between 1 and 9 inclusive,
reverse the resulting array, and then replace each digit by its corresponding name from
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine".
"""
dic = {
1: "One",
2: "Two",
3: "Three",
4: "Four",
5: "Five",
6: "Six",
7: "Seven",
8: "Eight",
9: "Nine",
}
sorted_arr = sorted(arr, reverse=True)
new_arr = []
for var in sorted_arr:
try:
new_arr.append(dic[var])
except:
pass
| HumanEval_SingleLineInfillingLight | by_length | python | python | [
[
"[2, 1, 1, 4, 5, 8, 2, 3]",
"[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]"
],
[
"[]",
"[]"
],
[
"[1, -1 , 55]",
"['One']"
],
[
"[1, -1, 3, 2]",
"[\"Three\", \"Two\", \"One\"]"
],
[
"[9, 4, 8]",
"[\"Nine\", \"Eight\", \"Four\"]"
]
] |
|
[] | Implement the function f that takes n as a parameter,
and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even
or the sum of numbers from 1 to i otherwise.
i starts from 1.
the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i). | for i in range(1,n+1):
if i%2 == 0:
x = 1
for j in range(1,i+1): x *= j
ret += [x]
else:
x = 0
for j in range(1,i+1): x += j
ret += [x]
return ret
| [] | SingleLineInfilling/HumanEval/106/L0 | code_infilling | ret = []
| [
[
"5",
"[1, 2, 6, 24, 15]"
]
] |
def f(n):
""" Implement the function f that takes n as a parameter,
and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even
or the sum of numbers from 1 to i otherwise.
i starts from 1.
the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).
"""
| HumanEval_SingleLineInfillingLight | f | python | python | [
[
"5",
"[1, 2, 6, 24, 15]"
],
[
"7",
"[1, 2, 6, 24, 15, 720, 28]"
],
[
"1",
"[1]"
],
[
"3",
"[1, 2, 6]"
]
] |
[] | Implement the function f that takes n as a parameter,
and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even
or the sum of numbers from 1 to i otherwise.
i starts from 1.
the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i). | if i%2 == 0:
x = 1
for j in range(1,i+1): x *= j
ret += [x]
else:
x = 0
for j in range(1,i+1): x += j
ret += [x]
return ret
| [] | SingleLineInfilling/HumanEval/106/L1 | code_infilling | for i in range(1,n+1):
| [
[
"5",
"[1, 2, 6, 24, 15]"
]
] |
def f(n):
""" Implement the function f that takes n as a parameter,
and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even
or the sum of numbers from 1 to i otherwise.
i starts from 1.
the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).
"""
ret = []
| HumanEval_SingleLineInfillingLight | f | python | python | [
[
"5",
"[1, 2, 6, 24, 15]"
],
[
"7",
"[1, 2, 6, 24, 15, 720, 28]"
],
[
"1",
"[1]"
],
[
"3",
"[1, 2, 6]"
]
] |
[] | Implement the function f that takes n as a parameter,
and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even
or the sum of numbers from 1 to i otherwise.
i starts from 1.
the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i). | x = 1
for j in range(1,i+1): x *= j
ret += [x]
else:
x = 0
for j in range(1,i+1): x += j
ret += [x]
return ret
| [] | SingleLineInfilling/HumanEval/106/L2 | code_infilling | if i%2 == 0:
| [
[
"5",
"[1, 2, 6, 24, 15]"
]
] |
def f(n):
""" Implement the function f that takes n as a parameter,
and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even
or the sum of numbers from 1 to i otherwise.
i starts from 1.
the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).
"""
ret = []
for i in range(1,n+1):
| HumanEval_SingleLineInfillingLight | f | python | python | [
[
"5",
"[1, 2, 6, 24, 15]"
],
[
"7",
"[1, 2, 6, 24, 15, 720, 28]"
],
[
"1",
"[1]"
],
[
"3",
"[1, 2, 6]"
]
] |
[] | Implement the function f that takes n as a parameter,
and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even
or the sum of numbers from 1 to i otherwise.
i starts from 1.
the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i). | for j in range(1,i+1): x *= j
ret += [x]
else:
x = 0
for j in range(1,i+1): x += j
ret += [x]
return ret
| [] | SingleLineInfilling/HumanEval/106/L3 | code_infilling | x = 1
| [
[
"5",
"[1, 2, 6, 24, 15]"
]
] |
def f(n):
""" Implement the function f that takes n as a parameter,
and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even
or the sum of numbers from 1 to i otherwise.
i starts from 1.
the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).
"""
ret = []
for i in range(1,n+1):
if i%2 == 0:
| HumanEval_SingleLineInfillingLight | f | python | python | [
[
"5",
"[1, 2, 6, 24, 15]"
],
[
"7",
"[1, 2, 6, 24, 15, 720, 28]"
],
[
"1",
"[1]"
],
[
"3",
"[1, 2, 6]"
]
] |
[] | Implement the function f that takes n as a parameter,
and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even
or the sum of numbers from 1 to i otherwise.
i starts from 1.
the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i). | ret += [x]
else:
x = 0
for j in range(1,i+1): x += j
ret += [x]
return ret
| [] | SingleLineInfilling/HumanEval/106/L4 | code_infilling | for j in range(1,i+1): x *= j
| [
[
"5",
"[1, 2, 6, 24, 15]"
]
] |
def f(n):
""" Implement the function f that takes n as a parameter,
and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even
or the sum of numbers from 1 to i otherwise.
i starts from 1.
the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).
"""
ret = []
for i in range(1,n+1):
if i%2 == 0:
x = 1
| HumanEval_SingleLineInfillingLight | f | python | python | [
[
"5",
"[1, 2, 6, 24, 15]"
],
[
"7",
"[1, 2, 6, 24, 15, 720, 28]"
],
[
"1",
"[1]"
],
[
"3",
"[1, 2, 6]"
]
] |
[] | Implement the function f that takes n as a parameter,
and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even
or the sum of numbers from 1 to i otherwise.
i starts from 1.
the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i). | else:
x = 0
for j in range(1,i+1): x += j
ret += [x]
return ret
| [] | SingleLineInfilling/HumanEval/106/L5 | code_infilling | ret += [x]
| [
[
"5",
"[1, 2, 6, 24, 15]"
]
] |
def f(n):
""" Implement the function f that takes n as a parameter,
and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even
or the sum of numbers from 1 to i otherwise.
i starts from 1.
the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).
"""
ret = []
for i in range(1,n+1):
if i%2 == 0:
x = 1
for j in range(1,i+1): x *= j
| HumanEval_SingleLineInfillingLight | f | python | python | [
[
"5",
"[1, 2, 6, 24, 15]"
],
[
"7",
"[1, 2, 6, 24, 15, 720, 28]"
],
[
"1",
"[1]"
],
[
"3",
"[1, 2, 6]"
]
] |
[] | Implement the function f that takes n as a parameter,
and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even
or the sum of numbers from 1 to i otherwise.
i starts from 1.
the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i). | x = 0
for j in range(1,i+1): x += j
ret += [x]
return ret
| [] | SingleLineInfilling/HumanEval/106/L6 | code_infilling | else:
| [
[
"5",
"[1, 2, 6, 24, 15]"
]
] |
def f(n):
""" Implement the function f that takes n as a parameter,
and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even
or the sum of numbers from 1 to i otherwise.
i starts from 1.
the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).
"""
ret = []
for i in range(1,n+1):
if i%2 == 0:
x = 1
for j in range(1,i+1): x *= j
ret += [x]
| HumanEval_SingleLineInfillingLight | f | python | python | [
[
"5",
"[1, 2, 6, 24, 15]"
],
[
"7",
"[1, 2, 6, 24, 15, 720, 28]"
],
[
"1",
"[1]"
],
[
"3",
"[1, 2, 6]"
]
] |
[] | Implement the function f that takes n as a parameter,
and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even
or the sum of numbers from 1 to i otherwise.
i starts from 1.
the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i). | for j in range(1,i+1): x += j
ret += [x]
return ret
| [] | SingleLineInfilling/HumanEval/106/L7 | code_infilling | x = 0
| [
[
"5",
"[1, 2, 6, 24, 15]"
]
] |
def f(n):
""" Implement the function f that takes n as a parameter,
and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even
or the sum of numbers from 1 to i otherwise.
i starts from 1.
the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).
"""
ret = []
for i in range(1,n+1):
if i%2 == 0:
x = 1
for j in range(1,i+1): x *= j
ret += [x]
else:
| HumanEval_SingleLineInfillingLight | f | python | python | [
[
"5",
"[1, 2, 6, 24, 15]"
],
[
"7",
"[1, 2, 6, 24, 15, 720, 28]"
],
[
"1",
"[1]"
],
[
"3",
"[1, 2, 6]"
]
] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.