test_cases
listlengths 0
100
| import_str
listlengths 0
1
| solution
stringlengths 0
620
| suffix
stringlengths 0
655
| tgt_lang
stringclasses 1
value | doc_string
stringclasses 164
values | compare_func
listlengths 0
0
| prefix
stringlengths 65
1.63k
| demos
listlengths 0
8
| data_id
stringlengths 33
36
| src_lang
stringclasses 1
value | task_name
stringclasses 1
value | dataset_name
stringclasses 1
value | entry_func
stringclasses 158
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
[
[
"['**', '*', '+'], [2, 3, 4, 5]",
"37"
],
[
"['+', '*', '-'], [2, 3, 4, 5]",
"9"
],
[
"['//', '*'], [7, 3, 4]",
"8"
]
] |
[] |
, operand[1:]):
expression+= oprt + str(oprn)
return eval(expressi
|
on)
|
python
|
Given two lists operator, and operand. The first list has basic algebra operations, and
the second list is a list of integers. Use the two given lists to build the algebric
expression and return the evaluation of this expression.
The basic algebra operations:
Addition ( + )
Subtraction ( - )
Multiplication ( * )
Floor division ( // )
Exponentiation ( ** )
|
[] |
def do_algebra(operator, operand):
"""
Given two lists operator, and operand. The first list has basic algebra operations, and
the second list is a list of integers. Use the two given lists to build the algebric
expression and return the evaluation of this expression.
The basic algebra operations:
Addition ( + )
Subtraction ( - )
Multiplication ( * )
Floor division ( // )
Exponentiation ( ** )
"""
expression = str(operand[0])
for oprt, oprn in zip(operator
|
[
[
"['+', '*', '-'], [2, 3, 4, 5]",
"9"
]
] |
RandomSpanInfilling/HumanEval/160/1
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
do_algebra
|
[
[
"['**', '*', '+'], [2, 3, 4, 5]",
"37"
],
[
"['+', '*', '-'], [2, 3, 4, 5]",
"9"
],
[
"['//', '*'], [7, 3, 4]",
"8"
]
] |
[] |
:
expression+= oprt + str(oprn)
r
|
eturn eval(expression)
|
python
|
Given two lists operator, and operand. The first list has basic algebra operations, and
the second list is a list of integers. Use the two given lists to build the algebric
expression and return the evaluation of this expression.
The basic algebra operations:
Addition ( + )
Subtraction ( - )
Multiplication ( * )
Floor division ( // )
Exponentiation ( ** )
|
[] |
def do_algebra(operator, operand):
"""
Given two lists operator, and operand. The first list has basic algebra operations, and
the second list is a list of integers. Use the two given lists to build the algebric
expression and return the evaluation of this expression.
The basic algebra operations:
Addition ( + )
Subtraction ( - )
Multiplication ( * )
Floor division ( // )
Exponentiation ( ** )
"""
expression = str(operand[0])
for oprt, oprn in zip(operator, operand[1:])
|
[
[
"['+', '*', '-'], [2, 3, 4, 5]",
"9"
]
] |
RandomSpanInfilling/HumanEval/160/2
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
do_algebra
|
[
[
"['**', '*', '+'], [2, 3, 4, 5]",
"37"
],
[
"['+', '*', '-'], [2, 3, 4, 5]",
"9"
],
[
"['//', '*'], [7, 3, 4]",
"8"
]
] |
[] |
expression+= oprt + str(oprn)
return eval(expressio
|
n)
|
python
|
Given two lists operator, and operand. The first list has basic algebra operations, and
the second list is a list of integers. Use the two given lists to build the algebric
expression and return the evaluation of this expression.
The basic algebra operations:
Addition ( + )
Subtraction ( - )
Multiplication ( * )
Floor division ( // )
Exponentiation ( ** )
|
[] |
def do_algebra(operator, operand):
"""
Given two lists operator, and operand. The first list has basic algebra operations, and
the second list is a list of integers. Use the two given lists to build the algebric
expression and return the evaluation of this expression.
The basic algebra operations:
Addition ( + )
Subtraction ( - )
Multiplication ( * )
Floor division ( // )
Exponentiation ( ** )
"""
expression = str(operand[0])
for oprt, oprn in zip(operator, operand[1:]):
|
[
[
"['+', '*', '-'], [2, 3, 4, 5]",
"9"
]
] |
RandomSpanInfilling/HumanEval/160/3
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
do_algebra
|
[
[
"['**', '*', '+'], [2, 3, 4, 5]",
"37"
],
[
"['+', '*', '-'], [2, 3, 4, 5]",
"9"
],
[
"['//', '*'], [7, 3, 4]",
"8"
]
] |
[] |
d[1:]):
expression+= oprt + s
|
tr(oprn)
return eval(expression)
|
python
|
Given two lists operator, and operand. The first list has basic algebra operations, and
the second list is a list of integers. Use the two given lists to build the algebric
expression and return the evaluation of this expression.
The basic algebra operations:
Addition ( + )
Subtraction ( - )
Multiplication ( * )
Floor division ( // )
Exponentiation ( ** )
|
[] |
def do_algebra(operator, operand):
"""
Given two lists operator, and operand. The first list has basic algebra operations, and
the second list is a list of integers. Use the two given lists to build the algebric
expression and return the evaluation of this expression.
The basic algebra operations:
Addition ( + )
Subtraction ( - )
Multiplication ( * )
Floor division ( // )
Exponentiation ( ** )
"""
expression = str(operand[0])
for oprt, oprn in zip(operator, operan
|
[
[
"['+', '*', '-'], [2, 3, 4, 5]",
"9"
]
] |
RandomSpanInfilling/HumanEval/160/4
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
do_algebra
|
[
[
"['**', '*', '+'], [2, 3, 4, 5]",
"37"
],
[
"['+', '*', '-'], [2, 3, 4, 5]",
"9"
],
[
"['//', '*'], [7, 3, 4]",
"8"
]
] |
[] |
return eval(expre
|
ssion)
|
python
|
Given two lists operator, and operand. The first list has basic algebra operations, and
the second list is a list of integers. Use the two given lists to build the algebric
expression and return the evaluation of this expression.
The basic algebra operations:
Addition ( + )
Subtraction ( - )
Multiplication ( * )
Floor division ( // )
Exponentiation ( ** )
|
[] |
def do_algebra(operator, operand):
"""
Given two lists operator, and operand. The first list has basic algebra operations, and
the second list is a list of integers. Use the two given lists to build the algebric
expression and return the evaluation of this expression.
The basic algebra operations:
Addition ( + )
Subtraction ( - )
Multiplication ( * )
Floor division ( // )
Exponentiation ( ** )
"""
expression = str(operand[0])
for oprt, oprn in zip(operator, operand[1:]):
expression+= oprt + str(oprn)
|
[
[
"['+', '*', '-'], [2, 3, 4, 5]",
"9"
]
] |
RandomSpanInfilling/HumanEval/160/5
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
do_algebra
|
[
[
"['**', '*', '+'], [2, 3, 4, 5]",
"37"
],
[
"['+', '*', '-'], [2, 3, 4, 5]",
"9"
],
[
"['//', '*'], [7, 3, 4]",
"8"
]
] |
[] |
expression = str(operand[0])
for
|
oprt, oprn in zip(operator, operand[1:]):
expression+= oprt + str(oprn)
return eval(expression)
|
python
|
Given two lists operator, and operand. The first list has basic algebra operations, and
the second list is a list of integers. Use the two given lists to build the algebric
expression and return the evaluation of this expression.
The basic algebra operations:
Addition ( + )
Subtraction ( - )
Multiplication ( * )
Floor division ( // )
Exponentiation ( ** )
|
[] |
def do_algebra(operator, operand):
"""
Given two lists operator, and operand. The first list has basic algebra operations, and
the second list is a list of integers. Use the two given lists to build the algebric
expression and return the evaluation of this expression.
The basic algebra operations:
Addition ( + )
Subtraction ( - )
Multiplication ( * )
Floor division ( // )
Exponentiation ( ** )
"""
|
[
[
"['+', '*', '-'], [2, 3, 4, 5]",
"9"
]
] |
RandomSpanInfilling/HumanEval/160/6
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
do_algebra
|
[
[
"['**', '*', '+'], [2, 3, 4, 5]",
"37"
],
[
"['+', '*', '-'], [2, 3, 4, 5]",
"9"
],
[
"['//', '*'], [7, 3, 4]",
"8"
]
] |
[] |
[0])
for oprt, oprn in zip(operator, operand[1:]):
expression+=
|
oprt + str(oprn)
return eval(expression)
|
python
|
Given two lists operator, and operand. The first list has basic algebra operations, and
the second list is a list of integers. Use the two given lists to build the algebric
expression and return the evaluation of this expression.
The basic algebra operations:
Addition ( + )
Subtraction ( - )
Multiplication ( * )
Floor division ( // )
Exponentiation ( ** )
|
[] |
def do_algebra(operator, operand):
"""
Given two lists operator, and operand. The first list has basic algebra operations, and
the second list is a list of integers. Use the two given lists to build the algebric
expression and return the evaluation of this expression.
The basic algebra operations:
Addition ( + )
Subtraction ( - )
Multiplication ( * )
Floor division ( // )
Exponentiation ( ** )
"""
expression = str(operand
|
[
[
"['+', '*', '-'], [2, 3, 4, 5]",
"9"
]
] |
RandomSpanInfilling/HumanEval/160/7
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
do_algebra
|
[
[
"['**', '*', '+'], [2, 3, 4, 5]",
"37"
],
[
"['+', '*', '-'], [2, 3, 4, 5]",
"9"
],
[
"['//', '*'], [7, 3, 4]",
"8"
]
] |
[] |
n in zip(operator, opera
|
nd[1:]):
expression+= oprt + str(oprn)
return eval(expression)
|
python
|
Given two lists operator, and operand. The first list has basic algebra operations, and
the second list is a list of integers. Use the two given lists to build the algebric
expression and return the evaluation of this expression.
The basic algebra operations:
Addition ( + )
Subtraction ( - )
Multiplication ( * )
Floor division ( // )
Exponentiation ( ** )
|
[] |
def do_algebra(operator, operand):
"""
Given two lists operator, and operand. The first list has basic algebra operations, and
the second list is a list of integers. Use the two given lists to build the algebric
expression and return the evaluation of this expression.
The basic algebra operations:
Addition ( + )
Subtraction ( - )
Multiplication ( * )
Floor division ( // )
Exponentiation ( ** )
"""
expression = str(operand[0])
for oprt, opr
|
[
[
"['+', '*', '-'], [2, 3, 4, 5]",
"9"
]
] |
RandomSpanInfilling/HumanEval/160/8
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
do_algebra
|
[
[
"['**', '*', '+'], [2, 3, 4, 5]",
"37"
],
[
"['+', '*', '-'], [2, 3, 4, 5]",
"9"
],
[
"['//', '*'], [7, 3, 4]",
"8"
]
] |
[] |
ssion = str(operand[0])
for oprt, oprn in zip(operator, operand[1:]):
expression+= oprt + str(oprn)
return eval(expr
|
ession)
|
python
|
Given two lists operator, and operand. The first list has basic algebra operations, and
the second list is a list of integers. Use the two given lists to build the algebric
expression and return the evaluation of this expression.
The basic algebra operations:
Addition ( + )
Subtraction ( - )
Multiplication ( * )
Floor division ( // )
Exponentiation ( ** )
|
[] |
def do_algebra(operator, operand):
"""
Given two lists operator, and operand. The first list has basic algebra operations, and
the second list is a list of integers. Use the two given lists to build the algebric
expression and return the evaluation of this expression.
The basic algebra operations:
Addition ( + )
Subtraction ( - )
Multiplication ( * )
Floor division ( // )
Exponentiation ( ** )
"""
expre
|
[
[
"['+', '*', '-'], [2, 3, 4, 5]",
"9"
]
] |
RandomSpanInfilling/HumanEval/160/9
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
do_algebra
|
[
[
"['**', '*', '+'], [2, 3, 4, 5]",
"37"
],
[
"['+', '*', '-'], [2, 3, 4, 5]",
"9"
],
[
"['//', '*'], [7, 3, 4]",
"8"
]
] |
[] |
n in zip(operator, operand[1:]):
expression+= oprt + str(op
|
rn)
return eval(expression)
|
python
|
Given two lists operator, and operand. The first list has basic algebra operations, and
the second list is a list of integers. Use the two given lists to build the algebric
expression and return the evaluation of this expression.
The basic algebra operations:
Addition ( + )
Subtraction ( - )
Multiplication ( * )
Floor division ( // )
Exponentiation ( ** )
|
[] |
def do_algebra(operator, operand):
"""
Given two lists operator, and operand. The first list has basic algebra operations, and
the second list is a list of integers. Use the two given lists to build the algebric
expression and return the evaluation of this expression.
The basic algebra operations:
Addition ( + )
Subtraction ( - )
Multiplication ( * )
Floor division ( // )
Exponentiation ( ** )
"""
expression = str(operand[0])
for oprt, opr
|
[
[
"['+', '*', '-'], [2, 3, 4, 5]",
"9"
]
] |
RandomSpanInfilling/HumanEval/160/10
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
do_algebra
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
|
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
python
|
You are given a string s.
if s[i] is a letter, reverse its case from lower to upper or vise versa,
otherwise keep it as it is.
If the string contains no letters, reverse the string.
The function should return the resulted string.
|
[] |
def solve(s):
"""You are given a string s.
if s[i] is a letter, reverse its case from lower to upper or vise versa,
otherwise keep it as it is.
If the string contains no letters, reverse the string.
The function should return the resulted string.
"""
flg = 0
idx = 0
new_str =
|
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
RandomSpanInfilling/HumanEval/161/1
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
solve
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
|
return s
|
python
|
You are given a string s.
if s[i] is a letter, reverse its case from lower to upper or vise versa,
otherwise keep it as it is.
If the string contains no letters, reverse the string.
The function should return the resulted string.
|
[] |
def solve(s):
"""You are given a string s.
if s[i] is a letter, reverse its case from lower to upper or vise versa,
otherwise keep it as it is.
If the string contains no letters, reverse the string.
The function should return the resulted string.
"""
flg = 0
idx = 0
|
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
RandomSpanInfilling/HumanEval/161/2
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
solve
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
):
new_str[idx] = i.swapcase()
flg = 1
|
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
python
|
You are given a string s.
if s[i] is a letter, reverse its case from lower to upper or vise versa,
otherwise keep it as it is.
If the string contains no letters, reverse the string.
The function should return the resulted string.
|
[] |
def solve(s):
"""You are given a string s.
if s[i] is a letter, reverse its case from lower to upper or vise versa,
otherwise keep it as it is.
If the string contains no letters, reverse the string.
The function should return the resulted string.
"""
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalpha(
|
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
RandomSpanInfilling/HumanEval/161/3
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
solve
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.s
|
wapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
python
|
You are given a string s.
if s[i] is a letter, reverse its case from lower to upper or vise versa,
otherwise keep it as it is.
If the string contains no letters, reverse the string.
The function should return the resulted string.
|
[] |
def solve(s):
"""You are given a string s.
if s[i] is a letter, reverse its case from lower to upper or vise versa,
otherwise keep it as it is.
If the string contains no letters, reverse the string.
The function should return the resulted string.
"""
|
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
RandomSpanInfilling/HumanEval/161/4
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
solve
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
new_str[idx] = i.swapcase()
flg = 1
idx += 1
|
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
python
|
You are given a string s.
if s[i] is a letter, reverse its case from lower to upper or vise versa,
otherwise keep it as it is.
If the string contains no letters, reverse the string.
The function should return the resulted string.
|
[] |
def solve(s):
"""You are given a string s.
if s[i] is a letter, reverse its case from lower to upper or vise versa,
otherwise keep it as it is.
If the string contains no letters, reverse the string.
The function should return the resulted string.
"""
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
|
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
RandomSpanInfilling/HumanEval/161/5
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
solve
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
ha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
|
return s
|
python
|
You are given a string s.
if s[i] is a letter, reverse its case from lower to upper or vise versa,
otherwise keep it as it is.
If the string contains no letters, reverse the string.
The function should return the resulted string.
|
[] |
def solve(s):
"""You are given a string s.
if s[i] is a letter, reverse its case from lower to upper or vise versa,
otherwise keep it as it is.
If the string contains no letters, reverse the string.
The function should return the resulted string.
"""
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalp
|
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
RandomSpanInfilling/HumanEval/161/6
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
solve
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
return s[len(s)::-1]
return
|
s
|
python
|
You are given a string s.
if s[i] is a letter, reverse its case from lower to upper or vise versa,
otherwise keep it as it is.
If the string contains no letters, reverse the string.
The function should return the resulted string.
|
[] |
def solve(s):
"""You are given a string s.
if s[i] is a letter, reverse its case from lower to upper or vise versa,
otherwise keep it as it is.
If the string contains no letters, reverse the string.
The function should return the resulted string.
"""
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
|
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
RandomSpanInfilling/HumanEval/161/7
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
solve
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
|
if flg == 0:
return s[len(s)::-1]
return s
|
python
|
You are given a string s.
if s[i] is a letter, reverse its case from lower to upper or vise versa,
otherwise keep it as it is.
If the string contains no letters, reverse the string.
The function should return the resulted string.
|
[] |
def solve(s):
"""You are given a string s.
if s[i] is a letter, reverse its case from lower to upper or vise versa,
otherwise keep it as it is.
If the string contains no letters, reverse the string.
The function should return the resulted string.
"""
flg = 0
idx = 0
new_str = list(s)
for i in s:
|
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
RandomSpanInfilling/HumanEval/161/8
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
solve
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
|
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
python
|
You are given a string s.
if s[i] is a letter, reverse its case from lower to upper or vise versa,
otherwise keep it as it is.
If the string contains no letters, reverse the string.
The function should return the resulted string.
|
[] |
def solve(s):
"""You are given a string s.
if s[i] is a letter, reverse its case from lower to upper or vise versa,
otherwise keep it as it is.
If the string contains no letters, reverse the string.
The function should return the resulted string.
"""
flg = 0
idx = 0
new_str = list(s)
|
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
RandomSpanInfilling/HumanEval/161/9
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
solve
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg
|
== 0:
return s[len(s)::-1]
return s
|
python
|
You are given a string s.
if s[i] is a letter, reverse its case from lower to upper or vise versa,
otherwise keep it as it is.
If the string contains no letters, reverse the string.
The function should return the resulted string.
|
[] |
def solve(s):
"""You are given a string s.
if s[i] is a letter, reverse its case from lower to upper or vise versa,
otherwise keep it as it is.
If the string contains no letters, reverse the string.
The function should return the resulted string.
"""
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[
|
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
RandomSpanInfilling/HumanEval/161/10
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
solve
|
[
[
"'Hello world'",
"'3e25960a79dbc69b674cd4ec67a72c62'"
],
[
"''",
"None"
],
[
"'A B C'",
"'0ef78513b0cb8cef12743f5aeb35f888'"
],
[
"'password'",
"'5f4dcc3b5aa765d61d8327deb882cf99'"
]
] |
[] |
b
return hashl
|
ib.md5(text.encode('ascii')).hexdigest() if text else None
|
python
|
Given a string 'text', return its md5 hash equivalent string.
If 'text' is an empty string, return None.
|
[] |
def string_to_md5(text):
"""
Given a string 'text', return its md5 hash equivalent string.
If 'text' is an empty string, return None.
"""
import hashli
|
[
[
"'Hello world'",
"'3e25960a79dbc69b674cd4ec67a72c62'"
]
] |
RandomSpanInfilling/HumanEval/162/1
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
string_to_md5
|
[
[
"'Hello world'",
"'3e25960a79dbc69b674cd4ec67a72c62'"
],
[
"''",
"None"
],
[
"'A B C'",
"'0ef78513b0cb8cef12743f5aeb35f888'"
],
[
"'password'",
"'5f4dcc3b5aa765d61d8327deb882cf99'"
]
] |
[] |
xt.encode('ascii')).hexdiges
|
t() if text else None
|
python
|
Given a string 'text', return its md5 hash equivalent string.
If 'text' is an empty string, return None.
|
[] |
def string_to_md5(text):
"""
Given a string 'text', return its md5 hash equivalent string.
If 'text' is an empty string, return None.
"""
import hashlib
return hashlib.md5(te
|
[
[
"'Hello world'",
"'3e25960a79dbc69b674cd4ec67a72c62'"
]
] |
RandomSpanInfilling/HumanEval/162/2
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
string_to_md5
|
[
[
"'Hello world'",
"'3e25960a79dbc69b674cd4ec67a72c62'"
],
[
"''",
"None"
],
[
"'A B C'",
"'0ef78513b0cb8cef12743f5aeb35f888'"
],
[
"'password'",
"'5f4dcc3b5aa765d61d8327deb882cf99'"
]
] |
[] |
hashlib.md5(text.encod
|
e('ascii')).hexdigest() if text else None
|
python
|
Given a string 'text', return its md5 hash equivalent string.
If 'text' is an empty string, return None.
|
[] |
def string_to_md5(text):
"""
Given a string 'text', return its md5 hash equivalent string.
If 'text' is an empty string, return None.
"""
import hashlib
return
|
[
[
"'Hello world'",
"'3e25960a79dbc69b674cd4ec67a72c62'"
]
] |
RandomSpanInfilling/HumanEval/162/3
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
string_to_md5
|
[
[
"'Hello world'",
"'3e25960a79dbc69b674cd4ec67a72c62'"
],
[
"''",
"None"
],
[
"'A B C'",
"'0ef78513b0cb8cef12743f5aeb35f888'"
],
[
"'password'",
"'5f4dcc3b5aa765d61d8327deb882cf99'"
]
] |
[] |
ashlib.md5(text.encode('asci
|
i')).hexdigest() if text else None
|
python
|
Given a string 'text', return its md5 hash equivalent string.
If 'text' is an empty string, return None.
|
[] |
def string_to_md5(text):
"""
Given a string 'text', return its md5 hash equivalent string.
If 'text' is an empty string, return None.
"""
import hashlib
return h
|
[
[
"'Hello world'",
"'3e25960a79dbc69b674cd4ec67a72c62'"
]
] |
RandomSpanInfilling/HumanEval/162/4
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
string_to_md5
|
[
[
"'Hello world'",
"'3e25960a79dbc69b674cd4ec67a72c62'"
],
[
"''",
"None"
],
[
"'A B C'",
"'0ef78513b0cb8cef12743f5aeb35f888'"
],
[
"'password'",
"'5f4dcc3b5aa765d61d8327deb882cf99'"
]
] |
[] |
xdigest() if text else None
|
python
|
Given a string 'text', return its md5 hash equivalent string.
If 'text' is an empty string, return None.
|
[] |
def string_to_md5(text):
"""
Given a string 'text', return its md5 hash equivalent string.
If 'text' is an empty string, return None.
"""
import hashlib
return hashlib.md5(text.encode('ascii')).he
|
[
[
"'Hello world'",
"'3e25960a79dbc69b674cd4ec67a72c62'"
]
] |
RandomSpanInfilling/HumanEval/162/5
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
string_to_md5
|
|
[
[
"'Hello world'",
"'3e25960a79dbc69b674cd4ec67a72c62'"
],
[
"''",
"None"
],
[
"'A B C'",
"'0ef78513b0cb8cef12743f5aeb35f888'"
],
[
"'password'",
"'5f4dcc3b5aa765d61d8327deb882cf99'"
]
] |
[] |
rn hashlib.md5(t
|
ext.encode('ascii')).hexdigest() if text else None
|
python
|
Given a string 'text', return its md5 hash equivalent string.
If 'text' is an empty string, return None.
|
[] |
def string_to_md5(text):
"""
Given a string 'text', return its md5 hash equivalent string.
If 'text' is an empty string, return None.
"""
import hashlib
retu
|
[
[
"'Hello world'",
"'3e25960a79dbc69b674cd4ec67a72c62'"
]
] |
RandomSpanInfilling/HumanEval/162/6
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
string_to_md5
|
[
[
"'Hello world'",
"'3e25960a79dbc69b674cd4ec67a72c62'"
],
[
"''",
"None"
],
[
"'A B C'",
"'0ef78513b0cb8cef12743f5aeb35f888'"
],
[
"'password'",
"'5f4dcc3b5aa765d61d8327deb882cf99'"
]
] |
[] |
5(text.encode('ascii')).hexdigest() if
|
text else None
|
python
|
Given a string 'text', return its md5 hash equivalent string.
If 'text' is an empty string, return None.
|
[] |
def string_to_md5(text):
"""
Given a string 'text', return its md5 hash equivalent string.
If 'text' is an empty string, return None.
"""
import hashlib
return hashlib.md
|
[
[
"'Hello world'",
"'3e25960a79dbc69b674cd4ec67a72c62'"
]
] |
RandomSpanInfilling/HumanEval/162/7
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
string_to_md5
|
[
[
"'Hello world'",
"'3e25960a79dbc69b674cd4ec67a72c62'"
],
[
"''",
"None"
],
[
"'A B C'",
"'0ef78513b0cb8cef12743f5aeb35f888'"
],
[
"'password'",
"'5f4dcc3b5aa765d61d8327deb882cf99'"
]
] |
[] |
return hashlib.md5(text.encode('ascii')
|
).hexdigest() if text else None
|
python
|
Given a string 'text', return its md5 hash equivalent string.
If 'text' is an empty string, return None.
|
[] |
def string_to_md5(text):
"""
Given a string 'text', return its md5 hash equivalent string.
If 'text' is an empty string, return None.
"""
import hashlib
|
[
[
"'Hello world'",
"'3e25960a79dbc69b674cd4ec67a72c62'"
]
] |
RandomSpanInfilling/HumanEval/162/8
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
string_to_md5
|
[
[
"'Hello world'",
"'3e25960a79dbc69b674cd4ec67a72c62'"
],
[
"''",
"None"
],
[
"'A B C'",
"'0ef78513b0cb8cef12743f5aeb35f888'"
],
[
"'password'",
"'5f4dcc3b5aa765d61d8327deb882cf99'"
]
] |
[] |
encode('ascii')).hexdigest(
|
) if text else None
|
python
|
Given a string 'text', return its md5 hash equivalent string.
If 'text' is an empty string, return None.
|
[] |
def string_to_md5(text):
"""
Given a string 'text', return its md5 hash equivalent string.
If 'text' is an empty string, return None.
"""
import hashlib
return hashlib.md5(text.
|
[
[
"'Hello world'",
"'3e25960a79dbc69b674cd4ec67a72c62'"
]
] |
RandomSpanInfilling/HumanEval/162/9
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
string_to_md5
|
[
[
"'Hello world'",
"'3e25960a79dbc69b674cd4ec67a72c62'"
],
[
"''",
"None"
],
[
"'A B C'",
"'0ef78513b0cb8cef12743f5aeb35f888'"
],
[
"'password'",
"'5f4dcc3b5aa765d61d8327deb882cf99'"
]
] |
[] |
ashlib.md5(text.encode('a
|
scii')).hexdigest() if text else None
|
python
|
Given a string 'text', return its md5 hash equivalent string.
If 'text' is an empty string, return None.
|
[] |
def string_to_md5(text):
"""
Given a string 'text', return its md5 hash equivalent string.
If 'text' is an empty string, return None.
"""
import hashlib
return h
|
[
[
"'Hello world'",
"'3e25960a79dbc69b674cd4ec67a72c62'"
]
] |
RandomSpanInfilling/HumanEval/162/10
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
string_to_md5
|
[
[
"2, 10",
"[2, 4, 6, 8]"
],
[
"10, 2",
"[2, 4, 6, 8]"
],
[
"132, 2",
"[2, 4, 6, 8]"
],
[
"17, 89",
"[]"
]
] |
[] |
per+1) if i % 2 ==
|
0]
|
python
|
Given two positive integers a and b, return the even digits between a
and b, in ascending order.
|
[] |
def generate_integers(a, b):
"""
Given two positive integers a and b, return the even digits between a
and b, in ascending order.
"""
lower = max(2, min(a, b))
upper = min(8, max(a, b))
return [i for i in range(lower, up
|
[
[
"2, 8",
"[2, 4, 6, 8]"
],
[
"8, 2",
"[2, 4, 6, 8]"
],
[
"10, 14",
"[]"
]
] |
RandomSpanInfilling/HumanEval/163/1
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
generate_integers
|
[
[
"2, 10",
"[2, 4, 6, 8]"
],
[
"10, 2",
"[2, 4, 6, 8]"
],
[
"132, 2",
"[2, 4, 6, 8]"
],
[
"17, 89",
"[]"
]
] |
[] |
a, b))
|
upper = min(8, max(a, b))
return [i for i in range(lower, upper+1) if i % 2 == 0]
|
python
|
Given two positive integers a and b, return the even digits between a
and b, in ascending order.
|
[] |
def generate_integers(a, b):
"""
Given two positive integers a and b, return the even digits between a
and b, in ascending order.
"""
lower = max(2, min(
|
[
[
"2, 8",
"[2, 4, 6, 8]"
],
[
"8, 2",
"[2, 4, 6, 8]"
],
[
"10, 14",
"[]"
]
] |
RandomSpanInfilling/HumanEval/163/2
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
generate_integers
|
[
[
"2, 10",
"[2, 4, 6, 8]"
],
[
"10, 2",
"[2, 4, 6, 8]"
],
[
"132, 2",
"[2, 4, 6, 8]"
],
[
"17, 89",
"[]"
]
] |
[] |
uppe
|
r = min(8, max(a, b))
return [i for i in range(lower, upper+1) if i % 2 == 0]
|
python
|
Given two positive integers a and b, return the even digits between a
and b, in ascending order.
|
[] |
def generate_integers(a, b):
"""
Given two positive integers a and b, return the even digits between a
and b, in ascending order.
"""
lower = max(2, min(a, b))
|
[
[
"2, 8",
"[2, 4, 6, 8]"
],
[
"8, 2",
"[2, 4, 6, 8]"
],
[
"10, 14",
"[]"
]
] |
RandomSpanInfilling/HumanEval/163/3
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
generate_integers
|
[
[
"2, 10",
"[2, 4, 6, 8]"
],
[
"10, 2",
"[2, 4, 6, 8]"
],
[
"132, 2",
"[2, 4, 6, 8]"
],
[
"17, 89",
"[]"
]
] |
[] |
))
upper = min(8, max(a,
|
b))
return [i for i in range(lower, upper+1) if i % 2 == 0]
|
python
|
Given two positive integers a and b, return the even digits between a
and b, in ascending order.
|
[] |
def generate_integers(a, b):
"""
Given two positive integers a and b, return the even digits between a
and b, in ascending order.
"""
lower = max(2, min(a, b
|
[
[
"2, 8",
"[2, 4, 6, 8]"
],
[
"8, 2",
"[2, 4, 6, 8]"
],
[
"10, 14",
"[]"
]
] |
RandomSpanInfilling/HumanEval/163/4
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
generate_integers
|
[
[
"2, 10",
"[2, 4, 6, 8]"
],
[
"10, 2",
"[2, 4, 6, 8]"
],
[
"132, 2",
"[2, 4, 6, 8]"
],
[
"17, 89",
"[]"
]
] |
[] |
wer = max(2, min(a, b))
up
|
per = min(8, max(a, b))
return [i for i in range(lower, upper+1) if i % 2 == 0]
|
python
|
Given two positive integers a and b, return the even digits between a
and b, in ascending order.
|
[] |
def generate_integers(a, b):
"""
Given two positive integers a and b, return the even digits between a
and b, in ascending order.
"""
lo
|
[
[
"2, 8",
"[2, 4, 6, 8]"
],
[
"8, 2",
"[2, 4, 6, 8]"
],
[
"10, 14",
"[]"
]
] |
RandomSpanInfilling/HumanEval/163/5
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
generate_integers
|
[
[
"2, 10",
"[2, 4, 6, 8]"
],
[
"10, 2",
"[2, 4, 6, 8]"
],
[
"132, 2",
"[2, 4, 6, 8]"
],
[
"17, 89",
"[]"
]
] |
[] |
per = min(8, max(a, b))
re
|
turn [i for i in range(lower, upper+1) if i % 2 == 0]
|
python
|
Given two positive integers a and b, return the even digits between a
and b, in ascending order.
|
[] |
def generate_integers(a, b):
"""
Given two positive integers a and b, return the even digits between a
and b, in ascending order.
"""
lower = max(2, min(a, b))
up
|
[
[
"2, 8",
"[2, 4, 6, 8]"
],
[
"8, 2",
"[2, 4, 6, 8]"
],
[
"10, 14",
"[]"
]
] |
RandomSpanInfilling/HumanEval/163/6
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
generate_integers
|
[
[
"2, 10",
"[2, 4, 6, 8]"
],
[
"10, 2",
"[2, 4, 6, 8]"
],
[
"132, 2",
"[2, 4, 6, 8]"
],
[
"17, 89",
"[]"
]
] |
[] |
b))
|
return [i for i in range(lower, upper+1) if i % 2 == 0]
|
python
|
Given two positive integers a and b, return the even digits between a
and b, in ascending order.
|
[] |
def generate_integers(a, b):
"""
Given two positive integers a and b, return the even digits between a
and b, in ascending order.
"""
lower = max(2, min(a, b))
upper = min(8, max(a,
|
[
[
"2, 8",
"[2, 4, 6, 8]"
],
[
"8, 2",
"[2, 4, 6, 8]"
],
[
"10, 14",
"[]"
]
] |
RandomSpanInfilling/HumanEval/163/7
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
generate_integers
|
[
[
"2, 10",
"[2, 4, 6, 8]"
],
[
"10, 2",
"[2, 4, 6, 8]"
],
[
"132, 2",
"[2, 4, 6, 8]"
],
[
"17, 89",
"[]"
]
] |
[] |
8, max(a, b))
|
return [i for i in range(lower, upper+1) if i % 2 == 0]
|
python
|
Given two positive integers a and b, return the even digits between a
and b, in ascending order.
|
[] |
def generate_integers(a, b):
"""
Given two positive integers a and b, return the even digits between a
and b, in ascending order.
"""
lower = max(2, min(a, b))
upper = min(
|
[
[
"2, 8",
"[2, 4, 6, 8]"
],
[
"8, 2",
"[2, 4, 6, 8]"
],
[
"10, 14",
"[]"
]
] |
RandomSpanInfilling/HumanEval/163/8
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
generate_integers
|
[
[
"2, 10",
"[2, 4, 6, 8]"
],
[
"10, 2",
"[2, 4, 6, 8]"
],
[
"132, 2",
"[2, 4, 6, 8]"
],
[
"17, 89",
"[]"
]
] |
[] |
min(a, b))
upper = min(8, max(a, b))
return [i for i in range(lower, upper+1) if i % 2 == 0]
|
python
|
Given two positive integers a and b, return the even digits between a
and b, in ascending order.
|
[] |
def generate_integers(a, b):
"""
Given two positive integers a and b, return the even digits between a
and b, in ascending order.
"""
lower = max(2,
|
[
[
"2, 8",
"[2, 4, 6, 8]"
],
[
"8, 2",
"[2, 4, 6, 8]"
],
[
"10, 14",
"[]"
]
] |
RandomSpanInfilling/HumanEval/163/9
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
generate_integers
|
|
[
[
"2, 10",
"[2, 4, 6, 8]"
],
[
"10, 2",
"[2, 4, 6, 8]"
],
[
"132, 2",
"[2, 4, 6, 8]"
],
[
"17, 89",
"[]"
]
] |
[] |
)
upper = min(8, max(a, b))
return [
|
i for i in range(lower, upper+1) if i % 2 == 0]
|
python
|
Given two positive integers a and b, return the even digits between a
and b, in ascending order.
|
[] |
def generate_integers(a, b):
"""
Given two positive integers a and b, return the even digits between a
and b, in ascending order.
"""
lower = max(2, min(a, b)
|
[
[
"2, 8",
"[2, 4, 6, 8]"
],
[
"8, 2",
"[2, 4, 6, 8]"
],
[
"10, 14",
"[]"
]
] |
RandomSpanInfilling/HumanEval/163/10
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
generate_integers
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.