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 fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
| elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| end += 1
else:
if end - start > 2:
new_text += "-"+text[i]
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L5_L8 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
| new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| end += 1
else:
if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L5_L9 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
| else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| end += 1
else:
if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L5_L10 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
| new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| end += 1
else:
if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L5_L11 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
| start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| end += 1
else:
if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L5_L12 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
| i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| end += 1
else:
if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L5_L13 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
| if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| end += 1
else:
if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L5_L14 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
| new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| end += 1
else:
if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L5_L15 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
| elif end - start > 0:
new_text += "_"
return new_text
| end += 1
else:
if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
... | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L5_L16 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
| new_text += "_"
return new_text
| end += 1
else:
if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
... | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L5_L17 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
| return new_text
| end += 1
else:
if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
... | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L5_L18 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
| end += 1
else:
if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
... | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L5_L19 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python | |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif en... | else:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L6_L6 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text ... | else:
if end - start > 2:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L6_L7 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| else:
if end - start > 2:
new_text += "-"+text[i]
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L6_L8 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| else:
if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L6_L9 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| else:
if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L6_L10 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| else:
if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L6_L11 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| else:
if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L6_L12 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| else:
if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L6_L13 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| else:
if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L6_L14 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| else:
if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L6_L15 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | elif end - start > 0:
new_text += "_"
return new_text
| else:
if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "... | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L6_L16 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += "_"
return new_text
| else:
if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "... | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L6_L17 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | return new_text
| else:
if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "... | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L6_L18 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | else:
if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "... | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L6_L19 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python | |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text ... | if end - start > 2:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L7_L7 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| if end - start > 2:
new_text += "-"+text[i]
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L7_L8 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L7_L9 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L7_L10 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L7_L11 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L7_L12 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L7_L13 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L7_L14 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L7_L15 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | elif end - start > 0:
new_text += "_"
return new_text
| if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L7_L16 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += "_"
return new_text
| if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif en... | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L7_L17 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | return new_text
| if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif en... | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L7_L18 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | if end - start > 2:
new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif en... | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L7_L19 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python | |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| new_text += "-"+text[i]
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L8_L8 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| new_text += "-"+text[i]
elif end - start > 0:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L8_L9 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L8_L10 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L8_L11 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L8_L12 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L8_L13 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L8_L14 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L8_L15 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | elif end - start > 0:
new_text += "_"
return new_text
| new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L8_L16 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += "_"
return new_text
| new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L8_L17 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | return new_text
| new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text ... | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L8_L18 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += "-"+text[i]
elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text ... | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L8_L19 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python | |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| elif end - start > 0:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L9_L9 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| elif end - start > 0:
new_text += "_"*(end - start)+text[i]
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L9_L10 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L9_L11 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L9_L12 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L9_L13 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L9_L14 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L9_L15 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | elif end - start > 0:
new_text += "_"
return new_text
| elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L9_L16 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += "_"
return new_text
| elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L9_L17 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | return new_text
| elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L9_L18 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | elif end - start > 0:
new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L9_L19 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python | |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| new_text += "_"*(end - start)+text[i]
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L10_L10 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| new_text += "_"*(end - start)+text[i]
else:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L10_L11 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L10_L12 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L10_L13 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L10_L14 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L10_L15 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | elif end - start > 0:
new_text += "_"
return new_text
| new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L10_L16 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += "_"
return new_text
| new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L10_L17 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | return new_text
| new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L10_L18 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += "_"*(end - start)+text[i]
else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L10_L19 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python | |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| else:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L11_L11 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| else:
new_text += text[i]
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L11_L12 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| else:
new_text += text[i]
start, end = i+1, i+1
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L11_L13 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| else:
new_text += text[i]
start, end = i+1, i+1
i+=1
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L11_L14 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L11_L15 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | elif end - start > 0:
new_text += "_"
return new_text
| else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L11_L16 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += "_"
return new_text
| else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L11_L17 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | return new_text
| else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L11_L18 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | else:
new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L11_L19 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python | |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| new_text += text[i]
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L12_L12 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| new_text += text[i]
start, end = i+1, i+1
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L12_L13 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| new_text += text[i]
start, end = i+1, i+1
i+=1
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L12_L14 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L12_L15 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | elif end - start > 0:
new_text += "_"
return new_text
| new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L12_L16 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += "_"
return new_text
| new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L12_L17 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | return new_text
| new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L12_L18 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += text[i]
start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L12_L19 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python | |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| start, end = i+1, i+1
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L13_L13 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| start, end = i+1, i+1
i+=1
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L13_L14 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| start, end = i+1, i+1
i+=1
if end - start > 2:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L13_L15 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | elif end - start > 0:
new_text += "_"
return new_text
| start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L13_L16 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += "_"
return new_text
| start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L13_L17 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | return new_text
| start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L13_L18 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | start, end = i+1, i+1
i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L13_L19 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python | |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | if end - start > 2:
new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| i+=1
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L14_L14 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += "-"
elif end - start > 0:
new_text += "_"
return new_text
| i+=1
if end - start > 2:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L14_L15 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | elif end - start > 0:
new_text += "_"
return new_text
| i+=1
if end - start > 2:
new_text += "-"
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L14_L16 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | HumanEval_MultiLineInfilling | code_infilling | [] | python | python |
def fix_spaces(text):
"""
Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with -
"""
new_text = ""
i = 0
start, end = 0, 0
while i < len(text):
if text[i] == " ":
... | new_text += "_"
return new_text
| i+=1
if end - start > 2:
new_text += "-"
elif end - start > 0:
| [
[
"\"Example\"",
"\"Example\""
],
[
"\"Mudasir Hanif \"",
"\"Mudasir_Hanif_\""
],
[
"\"Yellow Yellow Dirty Fellow\"",
"\"Yellow_Yellow__Dirty__Fellow\""
],
[
"\"Exa mple\"",
"\"Exa-mple\""
],
[
"\" Exa 1 2 2 mple\"",
"\"-Exa_1_2_2_mple\""
]
] | [] | [
[
"\"Example\"",
"\"Example\""
],
[
"\"Example 1\"",
"\"Example_1\""
],
[
"\" Example 2\"",
"\"_Example_2\""
],
[
"\" Example 3\"",
"\"_Example-3\""
]
] | fix_spaces | MultiLineInfilling/HumanEval/140/L14_L17 | Given a string text, replace all spaces in it with underscores,
and if a string has more than 2 consecutive spaces,
then replace all consecutive spaces with - | 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.