prefix
stringlengths 65
1.8k
| suffix
stringclasses 839
values | solution
stringlengths 6
859
| test_cases
listlengths 0
100
| import_str
listlengths 0
1
| demos
listlengths 0
8
| entry_func
stringclasses 158
values | data_id
stringlengths 36
40
| doc_string
stringclasses 164
values | dataset_name
stringclasses 1
value | task_name
stringclasses 1
value | compare_func
listlengths 0
0
| src_lang
stringclasses 1
value | tgt_lang
stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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)
|
return eval(expression)
|
[
[
"['**', '*', '+'], [2, 3, 4, 5]",
"37"
],
[
"['+', '*', '-'], [2, 3, 4, 5]",
"9"
],
[
"['//', '*'], [7, 3, 4]",
"8"
]
] |
[] |
[
[
"['+', '*', '-'], [2, 3, 4, 5]",
"9"
]
] |
do_algebra
|
MultiLineInfilling/HumanEval/160/L3_L3
|
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 ( ** )
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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.
"""
|
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:
return s[len(s)::-1]
return s
|
flg = 0
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L0_L0
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.
"""
|
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
|
flg = 0
idx = 0
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L0_L1
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.
"""
|
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
|
flg = 0
idx = 0
new_str = list(s)
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L0_L2
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.
"""
|
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
|
flg = 0
idx = 0
new_str = list(s)
for i in s:
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L0_L3
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.
"""
|
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
|
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L0_L4
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L0_L5
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.
"""
|
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L0_L6
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.
"""
|
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L0_L7
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.
"""
|
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
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 = ""
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L0_L8
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.
"""
|
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
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:
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L0_L9
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.
"""
|
if flg == 0:
return s[len(s)::-1]
return s
|
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
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L0_L10
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.
"""
|
return s[len(s)::-1]
return s
|
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:
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L0_L11
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.
"""
|
return s
|
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:
return s[len(s)::-1]
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L0_L12
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
return s[len(s)::-1]
return s
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L0_L13
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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
|
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
|
idx = 0
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L1_L1
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
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
|
idx = 0
new_str = list(s)
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L1_L2
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
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
|
idx = 0
new_str = list(s)
for i in s:
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L1_L3
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
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
|
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L1_L4
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L1_L5
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L1_L6
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L1_L7
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L1_L8
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
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:
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L1_L9
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
if flg == 0:
return s[len(s)::-1]
return s
|
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
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L1_L10
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
return s[len(s)::-1]
return s
|
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:
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L1_L11
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
return s
|
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:
return s[len(s)::-1]
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L1_L12
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
return s[len(s)::-1]
return s
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L1_L13
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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
|
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
|
new_str = list(s)
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L2_L2
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
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
|
new_str = list(s)
for i in s:
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L2_L3
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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[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
|
new_str = list(s)
for i in s:
if i.isalpha():
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L2_L4
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L2_L5
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L2_L6
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L2_L7
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L2_L8
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
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:
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L2_L9
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
if flg == 0:
return s[len(s)::-1]
return s
|
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
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L2_L10
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
return s[len(s)::-1]
return s
|
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:
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L2_L11
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
return s
|
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]
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L2_L12
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
return s[len(s)::-1]
return s
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L2_L13
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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)
|
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
|
for i in s:
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L3_L3
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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)
|
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
|
for i in s:
if i.isalpha():
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L3_L4
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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)
|
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L3_L5
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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)
|
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L3_L6
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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)
|
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L3_L7
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L3_L8
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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)
|
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L3_L9
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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)
|
if flg == 0:
return s[len(s)::-1]
return 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
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L3_L10
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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)
|
return s[len(s)::-1]
return 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:
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L3_L11
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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)
|
return 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]
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L3_L12
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
return s[len(s)::-1]
return s
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L3_L13
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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:
|
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
|
if i.isalpha():
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L4_L4
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
if i.isalpha():
new_str[idx] = i.swapcase()
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L4_L5
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L4_L6
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L4_L7
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L4_L8
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L4_L9
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 flg == 0:
return s[len(s)::-1]
return s
|
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L4_L10
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
return s[len(s)::-1]
return s
|
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L4_L11
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
return 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]
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L4_L12
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
return s[len(s)::-1]
return s
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L4_L13
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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():
|
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
new_str[idx] = i.swapcase()
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L5_L5
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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():
|
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
new_str[idx] = i.swapcase()
flg = 1
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L5_L6
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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():
|
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
new_str[idx] = i.swapcase()
flg = 1
idx += 1
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L5_L7
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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():
|
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L5_L8
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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():
|
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L5_L9
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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():
|
if flg == 0:
return s[len(s)::-1]
return s
|
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L5_L10
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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():
|
return s[len(s)::-1]
return s
|
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L5_L11
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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():
|
return s
|
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]
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L5_L12
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
return s[len(s)::-1]
return s
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L5_L13
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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()
|
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
flg = 1
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L6_L6
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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()
|
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
flg = 1
idx += 1
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L6_L7
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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()
|
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
flg = 1
idx += 1
s = ""
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L6_L8
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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()
|
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
flg = 1
idx += 1
s = ""
for i in new_str:
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L6_L9
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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()
|
if flg == 0:
return s[len(s)::-1]
return s
|
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L6_L10
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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()
|
return s[len(s)::-1]
return s
|
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L6_L11
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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()
|
return s
|
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L6_L12
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
return s[len(s)::-1]
return s
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L6_L13
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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
|
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
idx += 1
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L7_L7
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
idx += 1
s = ""
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L7_L8
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
idx += 1
s = ""
for i in new_str:
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L7_L9
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
if flg == 0:
return s[len(s)::-1]
return s
|
idx += 1
s = ""
for i in new_str:
s += i
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L7_L10
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
return s[len(s)::-1]
return s
|
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L7_L11
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
return s
|
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L7_L12
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
return s[len(s)::-1]
return s
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L7_L13
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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
|
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
s = ""
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L8_L8
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 += i
if flg == 0:
return s[len(s)::-1]
return s
|
s = ""
for i in new_str:
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L8_L9
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
if flg == 0:
return s[len(s)::-1]
return s
|
s = ""
for i in new_str:
s += i
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L8_L10
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
return s[len(s)::-1]
return s
|
s = ""
for i in new_str:
s += i
if flg == 0:
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L8_L11
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
return s
|
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L8_L12
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
return s[len(s)::-1]
return s
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L8_L13
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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 = ""
|
s += i
if flg == 0:
return s[len(s)::-1]
return s
|
for i in new_str:
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L9_L9
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = ""
|
if flg == 0:
return s[len(s)::-1]
return s
|
for i in new_str:
s += i
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L9_L10
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = ""
|
return s[len(s)::-1]
return s
|
for i in new_str:
s += i
if flg == 0:
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L9_L11
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = ""
|
return s
|
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L9_L12
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
return s[len(s)::-1]
return s
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L9_L13
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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:
|
if flg == 0:
return s[len(s)::-1]
return s
|
s += i
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L10_L10
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
return s[len(s)::-1]
return s
|
s += i
if flg == 0:
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L10_L11
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
return s
|
s += i
if flg == 0:
return s[len(s)::-1]
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L10_L12
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
return s[len(s)::-1]
return s
|
[
[
"\"AsDf\"",
"\"aSdF\""
],
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
],
[
"\"#AsdfW^45\"",
"\"#aSDFw^45\""
],
[
"\"#6@2\"",
"\"2@6#\""
],
[
"\"#$a^D\"",
"\"#$A^d\""
],
[
"\"#ccc\"",
"\"#CCC\""
]
] |
[] |
[
[
"\"1234\"",
"\"4321\""
],
[
"\"ab\"",
"\"AB\""
],
[
"\"#a@C\"",
"\"#A@c\""
]
] |
solve
|
MultiLineInfilling/HumanEval/161/L10_L13
|
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.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.