test_cases
listlengths 0
100
| import_str
listlengths 0
1
| solution
stringlengths 0
620
| suffix
stringlengths 0
655
| tgt_lang
stringclasses 1
value | doc_string
stringclasses 164
values | compare_func
listlengths 0
0
| prefix
stringlengths 65
1.63k
| demos
listlengths 0
8
| data_id
stringlengths 33
36
| src_lang
stringclasses 1
value | task_name
stringclasses 1
value | dataset_name
stringclasses 1
value | entry_func
stringclasses 158
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
s) < 3:
return False
for i in range(len(s) - 2):
|
if s[i] == s[i+1] or s[i+1] == s[i+2] or s[i] == s[i+2]:
return False
return True
|
python
|
You are given a string s.
Your task is to check if the string is happy or not.
A string is happy if its length is at least 3 and every 3 consecutive letters are distinct
|
[] |
def is_happy(s):
"""You are given a string s.
Your task is to check if the string is happy or not.
A string is happy if its length is at least 3 and every 3 consecutive letters are distinct
"""
if len(
|
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
RandomSpanInfilling/HumanEval/80/1
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
is_happy
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
) < 3:
return False
|
for i in range(len(s) - 2):
if s[i] == s[i+1] or s[i+1] == s[i+2] or s[i] == s[i+2]:
return False
return True
|
python
|
You are given a string s.
Your task is to check if the string is happy or not.
A string is happy if its length is at least 3 and every 3 consecutive letters are distinct
|
[] |
def is_happy(s):
"""You are given a string s.
Your task is to check if the string is happy or not.
A string is happy if its length is at least 3 and every 3 consecutive letters are distinct
"""
if len(s
|
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
RandomSpanInfilling/HumanEval/80/2
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
is_happy
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
r i in range(len(s) - 2):
if s[i] == s[i+1] or s[i+1] == s[i+2] or s[i] == s[i+2]:
retur
|
n False
return True
|
python
|
You are given a string s.
Your task is to check if the string is happy or not.
A string is happy if its length is at least 3 and every 3 consecutive letters are distinct
|
[] |
def is_happy(s):
"""You are given a string s.
Your task is to check if the string is happy or not.
A string is happy if its length is at least 3 and every 3 consecutive letters are distinct
"""
if len(s) < 3:
return False
fo
|
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
RandomSpanInfilling/HumanEval/80/3
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
is_happy
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
3:
return False
for i in range(len(s) - 2):
if s[i] == s[i+1] or s[i+1]
|
== s[i+2] or s[i] == s[i+2]:
return False
return True
|
python
|
You are given a string s.
Your task is to check if the string is happy or not.
A string is happy if its length is at least 3 and every 3 consecutive letters are distinct
|
[] |
def is_happy(s):
"""You are given a string s.
Your task is to check if the string is happy or not.
A string is happy if its length is at least 3 and every 3 consecutive letters are distinct
"""
if len(s) <
|
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
RandomSpanInfilling/HumanEval/80/4
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
is_happy
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
i+1] o
|
r s[i+1] == s[i+2] or s[i] == s[i+2]:
return False
return True
|
python
|
You are given a string s.
Your task is to check if the string is happy or not.
A string is happy if its length is at least 3 and every 3 consecutive letters are distinct
|
[] |
def is_happy(s):
"""You are given a string s.
Your task is to check if the string is happy or not.
A string is happy if its length is at least 3 and every 3 consecutive letters are distinct
"""
if len(s) < 3:
return False
for i in range(len(s) - 2):
if s[i] == s[
|
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
RandomSpanInfilling/HumanEval/80/5
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
is_happy
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
s[i] == s[i+1] or s[i
|
+1] == s[i+2] or s[i] == s[i+2]:
return False
return True
|
python
|
You are given a string s.
Your task is to check if the string is happy or not.
A string is happy if its length is at least 3 and every 3 consecutive letters are distinct
|
[] |
def is_happy(s):
"""You are given a string s.
Your task is to check if the string is happy or not.
A string is happy if its length is at least 3 and every 3 consecutive letters are distinct
"""
if len(s) < 3:
return False
for i in range(len(s) - 2):
if
|
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
RandomSpanInfilling/HumanEval/80/6
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
is_happy
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
:
if s[i] == s[i+1] or s[i+1] == s[i+2] or s[i] == s[i+2]:
return False
|
return True
|
python
|
You are given a string s.
Your task is to check if the string is happy or not.
A string is happy if its length is at least 3 and every 3 consecutive letters are distinct
|
[] |
def is_happy(s):
"""You are given a string s.
Your task is to check if the string is happy or not.
A string is happy if its length is at least 3 and every 3 consecutive letters are distinct
"""
if len(s) < 3:
return False
for i in range(len(s) - 2)
|
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
RandomSpanInfilling/HumanEval/80/7
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
is_happy
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
if s[i] == s[i+1] or s[i+1] == s[i+2] or s[i] == s[i+2]:
return F
|
alse
return True
|
python
|
You are given a string s.
Your task is to check if the string is happy or not.
A string is happy if its length is at least 3 and every 3 consecutive letters are distinct
|
[] |
def is_happy(s):
"""You are given a string s.
Your task is to check if the string is happy or not.
A string is happy if its length is at least 3 and every 3 consecutive letters are distinct
"""
if len(s) < 3:
return False
for i in range(len(s) - 2):
|
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
RandomSpanInfilling/HumanEval/80/8
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
is_happy
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
s) - 2):
if s[i] == s[i+1] or s[i+1] == s[i+2] or s[i] == s[i+2]:
return
|
False
return True
|
python
|
You are given a string s.
Your task is to check if the string is happy or not.
A string is happy if its length is at least 3 and every 3 consecutive letters are distinct
|
[] |
def is_happy(s):
"""You are given a string s.
Your task is to check if the string is happy or not.
A string is happy if its length is at least 3 and every 3 consecutive letters are distinct
"""
if len(s) < 3:
return False
for i in range(len(
|
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
RandomSpanInfilling/HumanEval/80/9
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
is_happy
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
en(s) - 2):
|
if s[i] == s[i+1] or s[i+1] == s[i+2] or s[i] == s[i+2]:
return False
return True
|
python
|
You are given a string s.
Your task is to check if the string is happy or not.
A string is happy if its length is at least 3 and every 3 consecutive letters are distinct
|
[] |
def is_happy(s):
"""You are given a string s.
Your task is to check if the string is happy or not.
A string is happy if its length is at least 3 and every 3 consecutive letters are distinct
"""
if len(s) < 3:
return False
for i in range(l
|
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
RandomSpanInfilling/HumanEval/80/10
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
is_happy
|
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"['A+', 'B', 'C-', 'C', 'A-']"
],
[
"[1.2]",
"['D+']"
],
[
"[0.5]",
"['D-']"
],
[
"[0.0]",
"['E']"
],
[
"[1, 0.3, 1.5, 2.8, 3.3]",
"['D', 'D-', 'C-', 'B', 'B+']"
],
[
"[0, 0.7]",
"['E', 'D-']"
]
] |
[] |
pa in grades:
if gpa == 4.0:
letter_grade.append("A+")
elif gpa > 3.7:
letter_grade.append("A")
elif gpa > 3.3:
letter_grade.
|
append("A-")
elif gpa > 3.0:
letter_grade.append("B+")
elif gpa > 2.7:
letter_grade.append("B")
elif gpa > 2.3:
letter_grade.append("B-")
elif gpa > 2.0:
letter_grade.append("C+")
elif gpa > 1.7:
letter_grade.append("C")
elif gpa > 1.3:
letter_grade.append("C-")
elif gpa > 1.0:
letter_grade.append("D+")
elif gpa > 0.7:
letter_grade.append("D")
elif gpa > 0.0:
letter_grade.append("D-")
else:
letter_grade.append("E")
return letter_grade
|
python
|
It is the last week of the semester and the teacher has to give the grades
to students. The teacher has been making her own algorithm for grading.
The only problem is, she has lost the code she used for grading.
She has given you a list of GPAs for some students and you have to write
a function that can output a list of letter grades using the following table:
GPA | Letter grade
4.0 A+
> 3.7 A
> 3.3 A-
> 3.0 B+
> 2.7 B
> 2.3 B-
> 2.0 C+
> 1.7 C
> 1.3 C-
> 1.0 D+
> 0.7 D
> 0.0 D-
0.0 E
|
[] |
def numerical_letter_grade(grades):
"""It is the last week of the semester and the teacher has to give the grades
to students. The teacher has been making her own algorithm for grading.
The only problem is, she has lost the code she used for grading.
She has given you a list of GPAs for some students and you have to write
a function that can output a list of letter grades using the following table:
GPA | Letter grade
4.0 A+
> 3.7 A
> 3.3 A-
> 3.0 B+
> 2.7 B
> 2.3 B-
> 2.0 C+
> 1.7 C
> 1.3 C-
> 1.0 D+
> 0.7 D
> 0.0 D-
0.0 E
"""
letter_grade = []
for g
|
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
RandomSpanInfilling/HumanEval/81/1
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
numerical_letter_grade
|
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"['A+', 'B', 'C-', 'C', 'A-']"
],
[
"[1.2]",
"['D+']"
],
[
"[0.5]",
"['D-']"
],
[
"[0.0]",
"['E']"
],
[
"[1, 0.3, 1.5, 2.8, 3.3]",
"['D', 'D-', 'C-', 'B', 'B+']"
],
[
"[0, 0.7]",
"['E', 'D-']"
]
] |
[] |
letter_grade.append("A-")
elif gpa > 3.0:
letter_
|
grade.append("B+")
elif gpa > 2.7:
letter_grade.append("B")
elif gpa > 2.3:
letter_grade.append("B-")
elif gpa > 2.0:
letter_grade.append("C+")
elif gpa > 1.7:
letter_grade.append("C")
elif gpa > 1.3:
letter_grade.append("C-")
elif gpa > 1.0:
letter_grade.append("D+")
elif gpa > 0.7:
letter_grade.append("D")
elif gpa > 0.0:
letter_grade.append("D-")
else:
letter_grade.append("E")
return letter_grade
|
python
|
It is the last week of the semester and the teacher has to give the grades
to students. The teacher has been making her own algorithm for grading.
The only problem is, she has lost the code she used for grading.
She has given you a list of GPAs for some students and you have to write
a function that can output a list of letter grades using the following table:
GPA | Letter grade
4.0 A+
> 3.7 A
> 3.3 A-
> 3.0 B+
> 2.7 B
> 2.3 B-
> 2.0 C+
> 1.7 C
> 1.3 C-
> 1.0 D+
> 0.7 D
> 0.0 D-
0.0 E
|
[] |
def numerical_letter_grade(grades):
"""It is the last week of the semester and the teacher has to give the grades
to students. The teacher has been making her own algorithm for grading.
The only problem is, she has lost the code she used for grading.
She has given you a list of GPAs for some students and you have to write
a function that can output a list of letter grades using the following table:
GPA | Letter grade
4.0 A+
> 3.7 A
> 3.3 A-
> 3.0 B+
> 2.7 B
> 2.3 B-
> 2.0 C+
> 1.7 C
> 1.3 C-
> 1.0 D+
> 0.7 D
> 0.0 D-
0.0 E
"""
letter_grade = []
for gpa in grades:
if gpa == 4.0:
letter_grade.append("A+")
elif gpa > 3.7:
letter_grade.append("A")
elif gpa > 3.3:
|
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
RandomSpanInfilling/HumanEval/81/2
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
numerical_letter_grade
|
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"['A+', 'B', 'C-', 'C', 'A-']"
],
[
"[1.2]",
"['D+']"
],
[
"[0.5]",
"['D-']"
],
[
"[0.0]",
"['E']"
],
[
"[1, 0.3, 1.5, 2.8, 3.3]",
"['D', 'D-', 'C-', 'B', 'B+']"
],
[
"[0, 0.7]",
"['E', 'D-']"
]
] |
[] |
elif gpa > 1.7:
letter_grade.append("C")
elif gpa > 1.3:
letter_grade.append("C-")
elif gpa > 1.0:
letter_grade.append("D+")
elif gpa > 0.7:
letter_grade.append("D")
elif gpa > 0.0:
letter_grade.append("D-")
else:
letter_grade.append("E")
return letter_grade
|
python
|
It is the last week of the semester and the teacher has to give the grades
to students. The teacher has been making her own algorithm for grading.
The only problem is, she has lost the code she used for grading.
She has given you a list of GPAs for some students and you have to write
a function that can output a list of letter grades using the following table:
GPA | Letter grade
4.0 A+
> 3.7 A
> 3.3 A-
> 3.0 B+
> 2.7 B
> 2.3 B-
> 2.0 C+
> 1.7 C
> 1.3 C-
> 1.0 D+
> 0.7 D
> 0.0 D-
0.0 E
|
[] |
def numerical_letter_grade(grades):
"""It is the last week of the semester and the teacher has to give the grades
to students. The teacher has been making her own algorithm for grading.
The only problem is, she has lost the code she used for grading.
She has given you a list of GPAs for some students and you have to write
a function that can output a list of letter grades using the following table:
GPA | Letter grade
4.0 A+
> 3.7 A
> 3.3 A-
> 3.0 B+
> 2.7 B
> 2.3 B-
> 2.0 C+
> 1.7 C
> 1.3 C-
> 1.0 D+
> 0.7 D
> 0.0 D-
0.0 E
"""
letter_grade = []
for gpa in grades:
if gpa == 4.0:
letter_grade.append("A+")
elif gpa > 3.7:
letter_grade.append("A")
elif gpa > 3.3:
letter_grade.append("A-")
elif gpa > 3.0:
letter_grade.append("B+")
elif gpa > 2.7:
letter_grade.append("B")
elif gpa > 2.3:
letter_grade.append("B-")
elif gpa > 2.0:
letter_grade.append("C+")
|
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
RandomSpanInfilling/HumanEval/81/3
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
numerical_letter_grade
|
|
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"['A+', 'B', 'C-', 'C', 'A-']"
],
[
"[1.2]",
"['D+']"
],
[
"[0.5]",
"['D-']"
],
[
"[0.0]",
"['E']"
],
[
"[1, 0.3, 1.5, 2.8, 3.3]",
"['D', 'D-', 'C-', 'B', 'B+']"
],
[
"[0, 0.7]",
"['E', 'D-']"
]
] |
[] |
elif gpa > 3.0:
letter_grade.append("B+")
elif gpa > 2.7:
|
letter_grade.append("B")
elif gpa > 2.3:
letter_grade.append("B-")
elif gpa > 2.0:
letter_grade.append("C+")
elif gpa > 1.7:
letter_grade.append("C")
elif gpa > 1.3:
letter_grade.append("C-")
elif gpa > 1.0:
letter_grade.append("D+")
elif gpa > 0.7:
letter_grade.append("D")
elif gpa > 0.0:
letter_grade.append("D-")
else:
letter_grade.append("E")
return letter_grade
|
python
|
It is the last week of the semester and the teacher has to give the grades
to students. The teacher has been making her own algorithm for grading.
The only problem is, she has lost the code she used for grading.
She has given you a list of GPAs for some students and you have to write
a function that can output a list of letter grades using the following table:
GPA | Letter grade
4.0 A+
> 3.7 A
> 3.3 A-
> 3.0 B+
> 2.7 B
> 2.3 B-
> 2.0 C+
> 1.7 C
> 1.3 C-
> 1.0 D+
> 0.7 D
> 0.0 D-
0.0 E
|
[] |
def numerical_letter_grade(grades):
"""It is the last week of the semester and the teacher has to give the grades
to students. The teacher has been making her own algorithm for grading.
The only problem is, she has lost the code she used for grading.
She has given you a list of GPAs for some students and you have to write
a function that can output a list of letter grades using the following table:
GPA | Letter grade
4.0 A+
> 3.7 A
> 3.3 A-
> 3.0 B+
> 2.7 B
> 2.3 B-
> 2.0 C+
> 1.7 C
> 1.3 C-
> 1.0 D+
> 0.7 D
> 0.0 D-
0.0 E
"""
letter_grade = []
for gpa in grades:
if gpa == 4.0:
letter_grade.append("A+")
elif gpa > 3.7:
letter_grade.append("A")
elif gpa > 3.3:
letter_grade.append("A-")
|
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
RandomSpanInfilling/HumanEval/81/4
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
numerical_letter_grade
|
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"['A+', 'B', 'C-', 'C', 'A-']"
],
[
"[1.2]",
"['D+']"
],
[
"[0.5]",
"['D-']"
],
[
"[0.0]",
"['E']"
],
[
"[1, 0.3, 1.5, 2.8, 3.3]",
"['D', 'D-', 'C-', 'B', 'B+']"
],
[
"[0, 0.7]",
"['E', 'D-']"
]
] |
[] |
3.3:
letter_grade.append("A-")
elif gpa > 3.0:
letter_grade.append("B+")
elif gpa > 2.7:
letter_grade.append("B")
elif gpa > 2.3:
letter_grade.append("B-")
elif gpa > 2.0:
letter_grade.append("C+")
elif gpa > 1.7:
letter_grade.append("C")
elif gpa > 1.3:
letter_grade.append("C-")
elif gpa > 1.0:
letter_grade.append("D+")
elif gpa > 0.7:
letter_grade.append("D")
|
elif gpa > 0.0:
letter_grade.append("D-")
else:
letter_grade.append("E")
return letter_grade
|
python
|
It is the last week of the semester and the teacher has to give the grades
to students. The teacher has been making her own algorithm for grading.
The only problem is, she has lost the code she used for grading.
She has given you a list of GPAs for some students and you have to write
a function that can output a list of letter grades using the following table:
GPA | Letter grade
4.0 A+
> 3.7 A
> 3.3 A-
> 3.0 B+
> 2.7 B
> 2.3 B-
> 2.0 C+
> 1.7 C
> 1.3 C-
> 1.0 D+
> 0.7 D
> 0.0 D-
0.0 E
|
[] |
def numerical_letter_grade(grades):
"""It is the last week of the semester and the teacher has to give the grades
to students. The teacher has been making her own algorithm for grading.
The only problem is, she has lost the code she used for grading.
She has given you a list of GPAs for some students and you have to write
a function that can output a list of letter grades using the following table:
GPA | Letter grade
4.0 A+
> 3.7 A
> 3.3 A-
> 3.0 B+
> 2.7 B
> 2.3 B-
> 2.0 C+
> 1.7 C
> 1.3 C-
> 1.0 D+
> 0.7 D
> 0.0 D-
0.0 E
"""
letter_grade = []
for gpa in grades:
if gpa == 4.0:
letter_grade.append("A+")
elif gpa > 3.7:
letter_grade.append("A")
elif gpa >
|
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
RandomSpanInfilling/HumanEval/81/5
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
numerical_letter_grade
|
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"['A+', 'B', 'C-', 'C', 'A-']"
],
[
"[1.2]",
"['D+']"
],
[
"[0.5]",
"['D-']"
],
[
"[0.0]",
"['E']"
],
[
"[1, 0.3, 1.5, 2.8, 3.3]",
"['D', 'D-', 'C-', 'B', 'B+']"
],
[
"[0, 0.7]",
"['E', 'D-']"
]
] |
[] |
grade = []
for gpa in grades:
if gpa == 4.0:
letter_grade.append("A+")
elif gpa > 3.7:
letter_grade.append("A")
elif gpa > 3.3:
letter_grade.append("A-")
elif gpa > 3.0:
letter_grade.append("B+")
elif gpa > 2.7:
letter_grade.append("B")
elif gpa > 2.3:
letter_grade.append("B-")
elif gpa > 2.0:
letter_grade.append("C+")
elif gpa > 1.7:
letter
|
_grade.append("C")
elif gpa > 1.3:
letter_grade.append("C-")
elif gpa > 1.0:
letter_grade.append("D+")
elif gpa > 0.7:
letter_grade.append("D")
elif gpa > 0.0:
letter_grade.append("D-")
else:
letter_grade.append("E")
return letter_grade
|
python
|
It is the last week of the semester and the teacher has to give the grades
to students. The teacher has been making her own algorithm for grading.
The only problem is, she has lost the code she used for grading.
She has given you a list of GPAs for some students and you have to write
a function that can output a list of letter grades using the following table:
GPA | Letter grade
4.0 A+
> 3.7 A
> 3.3 A-
> 3.0 B+
> 2.7 B
> 2.3 B-
> 2.0 C+
> 1.7 C
> 1.3 C-
> 1.0 D+
> 0.7 D
> 0.0 D-
0.0 E
|
[] |
def numerical_letter_grade(grades):
"""It is the last week of the semester and the teacher has to give the grades
to students. The teacher has been making her own algorithm for grading.
The only problem is, she has lost the code she used for grading.
She has given you a list of GPAs for some students and you have to write
a function that can output a list of letter grades using the following table:
GPA | Letter grade
4.0 A+
> 3.7 A
> 3.3 A-
> 3.0 B+
> 2.7 B
> 2.3 B-
> 2.0 C+
> 1.7 C
> 1.3 C-
> 1.0 D+
> 0.7 D
> 0.0 D-
0.0 E
"""
letter_
|
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
RandomSpanInfilling/HumanEval/81/6
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
numerical_letter_grade
|
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"['A+', 'B', 'C-', 'C', 'A-']"
],
[
"[1.2]",
"['D+']"
],
[
"[0.5]",
"['D-']"
],
[
"[0.0]",
"['E']"
],
[
"[1, 0.3, 1.5, 2.8, 3.3]",
"['D', 'D-', 'C-', 'B', 'B+']"
],
[
"[0, 0.7]",
"['E', 'D-']"
]
] |
[] |
grade.append("B-")
elif gpa > 2.0:
letter_grade.append("C+")
elif gpa > 1.7:
letter_grade.append("C")
elif gpa > 1.3:
letter_grade.append("C-")
elif gpa > 1.0:
letter_grade.append("D+")
elif gpa > 0.7:
le
|
tter_grade.append("D")
elif gpa > 0.0:
letter_grade.append("D-")
else:
letter_grade.append("E")
return letter_grade
|
python
|
It is the last week of the semester and the teacher has to give the grades
to students. The teacher has been making her own algorithm for grading.
The only problem is, she has lost the code she used for grading.
She has given you a list of GPAs for some students and you have to write
a function that can output a list of letter grades using the following table:
GPA | Letter grade
4.0 A+
> 3.7 A
> 3.3 A-
> 3.0 B+
> 2.7 B
> 2.3 B-
> 2.0 C+
> 1.7 C
> 1.3 C-
> 1.0 D+
> 0.7 D
> 0.0 D-
0.0 E
|
[] |
def numerical_letter_grade(grades):
"""It is the last week of the semester and the teacher has to give the grades
to students. The teacher has been making her own algorithm for grading.
The only problem is, she has lost the code she used for grading.
She has given you a list of GPAs for some students and you have to write
a function that can output a list of letter grades using the following table:
GPA | Letter grade
4.0 A+
> 3.7 A
> 3.3 A-
> 3.0 B+
> 2.7 B
> 2.3 B-
> 2.0 C+
> 1.7 C
> 1.3 C-
> 1.0 D+
> 0.7 D
> 0.0 D-
0.0 E
"""
letter_grade = []
for gpa in grades:
if gpa == 4.0:
letter_grade.append("A+")
elif gpa > 3.7:
letter_grade.append("A")
elif gpa > 3.3:
letter_grade.append("A-")
elif gpa > 3.0:
letter_grade.append("B+")
elif gpa > 2.7:
letter_grade.append("B")
elif gpa > 2.3:
letter_
|
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
RandomSpanInfilling/HumanEval/81/7
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
numerical_letter_grade
|
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"['A+', 'B', 'C-', 'C', 'A-']"
],
[
"[1.2]",
"['D+']"
],
[
"[0.5]",
"['D-']"
],
[
"[0.0]",
"['E']"
],
[
"[1, 0.3, 1.5, 2.8, 3.3]",
"['D', 'D-', 'C-', 'B', 'B+']"
],
[
"[0, 0.7]",
"['E', 'D-']"
]
] |
[] |
= []
for gpa in grades:
if gpa == 4.0:
letter_grade.append("A+")
elif gpa > 3.7:
letter_grade.append("A")
elif gpa > 3.3:
letter_grade.append("A-")
elif gpa > 3.0:
letter_grade.append("B+")
elif gpa > 2.7:
letter_grade.append("B")
elif gpa > 2.3:
letter_grade.append("B-")
elif gpa > 2.0:
letter_grade.appen
|
d("C+")
elif gpa > 1.7:
letter_grade.append("C")
elif gpa > 1.3:
letter_grade.append("C-")
elif gpa > 1.0:
letter_grade.append("D+")
elif gpa > 0.7:
letter_grade.append("D")
elif gpa > 0.0:
letter_grade.append("D-")
else:
letter_grade.append("E")
return letter_grade
|
python
|
It is the last week of the semester and the teacher has to give the grades
to students. The teacher has been making her own algorithm for grading.
The only problem is, she has lost the code she used for grading.
She has given you a list of GPAs for some students and you have to write
a function that can output a list of letter grades using the following table:
GPA | Letter grade
4.0 A+
> 3.7 A
> 3.3 A-
> 3.0 B+
> 2.7 B
> 2.3 B-
> 2.0 C+
> 1.7 C
> 1.3 C-
> 1.0 D+
> 0.7 D
> 0.0 D-
0.0 E
|
[] |
def numerical_letter_grade(grades):
"""It is the last week of the semester and the teacher has to give the grades
to students. The teacher has been making her own algorithm for grading.
The only problem is, she has lost the code she used for grading.
She has given you a list of GPAs for some students and you have to write
a function that can output a list of letter grades using the following table:
GPA | Letter grade
4.0 A+
> 3.7 A
> 3.3 A-
> 3.0 B+
> 2.7 B
> 2.3 B-
> 2.0 C+
> 1.7 C
> 1.3 C-
> 1.0 D+
> 0.7 D
> 0.0 D-
0.0 E
"""
letter_grade
|
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
RandomSpanInfilling/HumanEval/81/8
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
numerical_letter_grade
|
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"['A+', 'B', 'C-', 'C', 'A-']"
],
[
"[1.2]",
"['D+']"
],
[
"[0.5]",
"['D-']"
],
[
"[0.0]",
"['E']"
],
[
"[1, 0.3, 1.5, 2.8, 3.3]",
"['D', 'D-', 'C-', 'B', 'B+']"
],
[
"[0, 0.7]",
"['E', 'D-']"
]
] |
[] |
elif gpa > 3.7:
letter_grade.append("A")
elif gpa > 3.3:
l
|
etter_grade.append("A-")
elif gpa > 3.0:
letter_grade.append("B+")
elif gpa > 2.7:
letter_grade.append("B")
elif gpa > 2.3:
letter_grade.append("B-")
elif gpa > 2.0:
letter_grade.append("C+")
elif gpa > 1.7:
letter_grade.append("C")
elif gpa > 1.3:
letter_grade.append("C-")
elif gpa > 1.0:
letter_grade.append("D+")
elif gpa > 0.7:
letter_grade.append("D")
elif gpa > 0.0:
letter_grade.append("D-")
else:
letter_grade.append("E")
return letter_grade
|
python
|
It is the last week of the semester and the teacher has to give the grades
to students. The teacher has been making her own algorithm for grading.
The only problem is, she has lost the code she used for grading.
She has given you a list of GPAs for some students and you have to write
a function that can output a list of letter grades using the following table:
GPA | Letter grade
4.0 A+
> 3.7 A
> 3.3 A-
> 3.0 B+
> 2.7 B
> 2.3 B-
> 2.0 C+
> 1.7 C
> 1.3 C-
> 1.0 D+
> 0.7 D
> 0.0 D-
0.0 E
|
[] |
def numerical_letter_grade(grades):
"""It is the last week of the semester and the teacher has to give the grades
to students. The teacher has been making her own algorithm for grading.
The only problem is, she has lost the code she used for grading.
She has given you a list of GPAs for some students and you have to write
a function that can output a list of letter grades using the following table:
GPA | Letter grade
4.0 A+
> 3.7 A
> 3.3 A-
> 3.0 B+
> 2.7 B
> 2.3 B-
> 2.0 C+
> 1.7 C
> 1.3 C-
> 1.0 D+
> 0.7 D
> 0.0 D-
0.0 E
"""
letter_grade = []
for gpa in grades:
if gpa == 4.0:
letter_grade.append("A+")
|
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
RandomSpanInfilling/HumanEval/81/9
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
numerical_letter_grade
|
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"['A+', 'B', 'C-', 'C', 'A-']"
],
[
"[1.2]",
"['D+']"
],
[
"[0.5]",
"['D-']"
],
[
"[0.0]",
"['E']"
],
[
"[1, 0.3, 1.5, 2.8, 3.3]",
"['D', 'D-', 'C-', 'B', 'B+']"
],
[
"[0, 0.7]",
"['E', 'D-']"
]
] |
[] |
letter_grade.append("B+")
e
|
lif gpa > 2.7:
letter_grade.append("B")
elif gpa > 2.3:
letter_grade.append("B-")
elif gpa > 2.0:
letter_grade.append("C+")
elif gpa > 1.7:
letter_grade.append("C")
elif gpa > 1.3:
letter_grade.append("C-")
elif gpa > 1.0:
letter_grade.append("D+")
elif gpa > 0.7:
letter_grade.append("D")
elif gpa > 0.0:
letter_grade.append("D-")
else:
letter_grade.append("E")
return letter_grade
|
python
|
It is the last week of the semester and the teacher has to give the grades
to students. The teacher has been making her own algorithm for grading.
The only problem is, she has lost the code she used for grading.
She has given you a list of GPAs for some students and you have to write
a function that can output a list of letter grades using the following table:
GPA | Letter grade
4.0 A+
> 3.7 A
> 3.3 A-
> 3.0 B+
> 2.7 B
> 2.3 B-
> 2.0 C+
> 1.7 C
> 1.3 C-
> 1.0 D+
> 0.7 D
> 0.0 D-
0.0 E
|
[] |
def numerical_letter_grade(grades):
"""It is the last week of the semester and the teacher has to give the grades
to students. The teacher has been making her own algorithm for grading.
The only problem is, she has lost the code she used for grading.
She has given you a list of GPAs for some students and you have to write
a function that can output a list of letter grades using the following table:
GPA | Letter grade
4.0 A+
> 3.7 A
> 3.3 A-
> 3.0 B+
> 2.7 B
> 2.3 B-
> 2.0 C+
> 1.7 C
> 1.3 C-
> 1.0 D+
> 0.7 D
> 0.0 D-
0.0 E
"""
letter_grade = []
for gpa in grades:
if gpa == 4.0:
letter_grade.append("A+")
elif gpa > 3.7:
letter_grade.append("A")
elif gpa > 3.3:
letter_grade.append("A-")
elif gpa > 3.0:
|
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
RandomSpanInfilling/HumanEval/81/10
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
numerical_letter_grade
|
[
[
"'Hello'",
"True"
],
[
"'abcdcba'",
"True"
],
[
"'kittens'",
"True"
],
[
"'orange'",
"False"
],
[
"'wow'",
"True"
],
[
"'world'",
"True"
],
[
"'MadaM'",
"True"
],
[
"'Wow'",
"True"
],
[
"''",
"False"
],
[
"'HI'",
"True"
],
[
"'go'",
"True"
],
[
"'gogo'",
"False"
],
[
"'aaaaaaaaaaaaaaa'",
"False"
],
[
"'Madam'",
"True"
],
[
"'M'",
"False"
],
[
"'0'",
"False"
]
] |
[] |
== 0 or l == 1:
return False
for i in range(2, l):
if l % i == 0:
|
return False
return True
|
python
|
Write a function that takes a string and returns True if the string
length is a prime number or False otherwise
|
[] |
def prime_length(string):
"""Write a function that takes a string and returns True if the string
length is a prime number or False otherwise
"""
l = len(string)
if l
|
[
[
"'Hello'",
"True"
],
[
"'abcdcba'",
"True"
],
[
"'kittens'",
"True"
],
[
"'orange'",
"False"
]
] |
RandomSpanInfilling/HumanEval/82/1
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
prime_length
|
[
[
"'Hello'",
"True"
],
[
"'abcdcba'",
"True"
],
[
"'kittens'",
"True"
],
[
"'orange'",
"False"
],
[
"'wow'",
"True"
],
[
"'world'",
"True"
],
[
"'MadaM'",
"True"
],
[
"'Wow'",
"True"
],
[
"''",
"False"
],
[
"'HI'",
"True"
],
[
"'go'",
"True"
],
[
"'gogo'",
"False"
],
[
"'aaaaaaaaaaaaaaa'",
"False"
],
[
"'Madam'",
"True"
],
[
"'M'",
"False"
],
[
"'0'",
"False"
]
] |
[] |
= len(string)
if l
|
== 0 or l == 1:
return False
for i in range(2, l):
if l % i == 0:
return False
return True
|
python
|
Write a function that takes a string and returns True if the string
length is a prime number or False otherwise
|
[] |
def prime_length(string):
"""Write a function that takes a string and returns True if the string
length is a prime number or False otherwise
"""
l
|
[
[
"'Hello'",
"True"
],
[
"'abcdcba'",
"True"
],
[
"'kittens'",
"True"
],
[
"'orange'",
"False"
]
] |
RandomSpanInfilling/HumanEval/82/2
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
prime_length
|
[
[
"'Hello'",
"True"
],
[
"'abcdcba'",
"True"
],
[
"'kittens'",
"True"
],
[
"'orange'",
"False"
],
[
"'wow'",
"True"
],
[
"'world'",
"True"
],
[
"'MadaM'",
"True"
],
[
"'Wow'",
"True"
],
[
"''",
"False"
],
[
"'HI'",
"True"
],
[
"'go'",
"True"
],
[
"'gogo'",
"False"
],
[
"'aaaaaaaaaaaaaaa'",
"False"
],
[
"'Madam'",
"True"
],
[
"'M'",
"False"
],
[
"'0'",
"False"
]
] |
[] |
0 or l == 1:
return False
for i in range(2, l):
if l % i == 0:
return Fals
|
e
return True
|
python
|
Write a function that takes a string and returns True if the string
length is a prime number or False otherwise
|
[] |
def prime_length(string):
"""Write a function that takes a string and returns True if the string
length is a prime number or False otherwise
"""
l = len(string)
if l ==
|
[
[
"'Hello'",
"True"
],
[
"'abcdcba'",
"True"
],
[
"'kittens'",
"True"
],
[
"'orange'",
"False"
]
] |
RandomSpanInfilling/HumanEval/82/3
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
prime_length
|
[
[
"'Hello'",
"True"
],
[
"'abcdcba'",
"True"
],
[
"'kittens'",
"True"
],
[
"'orange'",
"False"
],
[
"'wow'",
"True"
],
[
"'world'",
"True"
],
[
"'MadaM'",
"True"
],
[
"'Wow'",
"True"
],
[
"''",
"False"
],
[
"'HI'",
"True"
],
[
"'go'",
"True"
],
[
"'gogo'",
"False"
],
[
"'aaaaaaaaaaaaaaa'",
"False"
],
[
"'Madam'",
"True"
],
[
"'M'",
"False"
],
[
"'0'",
"False"
]
] |
[] |
= 0:
return
|
False
return True
|
python
|
Write a function that takes a string and returns True if the string
length is a prime number or False otherwise
|
[] |
def prime_length(string):
"""Write a function that takes a string and returns True if the string
length is a prime number or False otherwise
"""
l = len(string)
if l == 0 or l == 1:
return False
for i in range(2, l):
if l % i =
|
[
[
"'Hello'",
"True"
],
[
"'abcdcba'",
"True"
],
[
"'kittens'",
"True"
],
[
"'orange'",
"False"
]
] |
RandomSpanInfilling/HumanEval/82/4
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
prime_length
|
[
[
"'Hello'",
"True"
],
[
"'abcdcba'",
"True"
],
[
"'kittens'",
"True"
],
[
"'orange'",
"False"
],
[
"'wow'",
"True"
],
[
"'world'",
"True"
],
[
"'MadaM'",
"True"
],
[
"'Wow'",
"True"
],
[
"''",
"False"
],
[
"'HI'",
"True"
],
[
"'go'",
"True"
],
[
"'gogo'",
"False"
],
[
"'aaaaaaaaaaaaaaa'",
"False"
],
[
"'Madam'",
"True"
],
[
"'M'",
"False"
],
[
"'0'",
"False"
]
] |
[] |
rn False
for i in
|
range(2, l):
if l % i == 0:
return False
return True
|
python
|
Write a function that takes a string and returns True if the string
length is a prime number or False otherwise
|
[] |
def prime_length(string):
"""Write a function that takes a string and returns True if the string
length is a prime number or False otherwise
"""
l = len(string)
if l == 0 or l == 1:
retu
|
[
[
"'Hello'",
"True"
],
[
"'abcdcba'",
"True"
],
[
"'kittens'",
"True"
],
[
"'orange'",
"False"
]
] |
RandomSpanInfilling/HumanEval/82/5
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
prime_length
|
[
[
"'Hello'",
"True"
],
[
"'abcdcba'",
"True"
],
[
"'kittens'",
"True"
],
[
"'orange'",
"False"
],
[
"'wow'",
"True"
],
[
"'world'",
"True"
],
[
"'MadaM'",
"True"
],
[
"'Wow'",
"True"
],
[
"''",
"False"
],
[
"'HI'",
"True"
],
[
"'go'",
"True"
],
[
"'gogo'",
"False"
],
[
"'aaaaaaaaaaaaaaa'",
"False"
],
[
"'Madam'",
"True"
],
[
"'M'",
"False"
],
[
"'0'",
"False"
]
] |
[] |
f l
|
== 0 or l == 1:
return False
for i in range(2, l):
if l % i == 0:
return False
return True
|
python
|
Write a function that takes a string and returns True if the string
length is a prime number or False otherwise
|
[] |
def prime_length(string):
"""Write a function that takes a string and returns True if the string
length is a prime number or False otherwise
"""
l = len(string)
i
|
[
[
"'Hello'",
"True"
],
[
"'abcdcba'",
"True"
],
[
"'kittens'",
"True"
],
[
"'orange'",
"False"
]
] |
RandomSpanInfilling/HumanEval/82/6
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
prime_length
|
[
[
"'Hello'",
"True"
],
[
"'abcdcba'",
"True"
],
[
"'kittens'",
"True"
],
[
"'orange'",
"False"
],
[
"'wow'",
"True"
],
[
"'world'",
"True"
],
[
"'MadaM'",
"True"
],
[
"'Wow'",
"True"
],
[
"''",
"False"
],
[
"'HI'",
"True"
],
[
"'go'",
"True"
],
[
"'gogo'",
"False"
],
[
"'aaaaaaaaaaaaaaa'",
"False"
],
[
"'Madam'",
"True"
],
[
"'M'",
"False"
],
[
"'0'",
"False"
]
] |
[] |
l = len(string)
if l == 0 or l == 1:
return False
for i in range(2, l):
|
if l % i == 0:
return False
return True
|
python
|
Write a function that takes a string and returns True if the string
length is a prime number or False otherwise
|
[] |
def prime_length(string):
"""Write a function that takes a string and returns True if the string
length is a prime number or False otherwise
"""
|
[
[
"'Hello'",
"True"
],
[
"'abcdcba'",
"True"
],
[
"'kittens'",
"True"
],
[
"'orange'",
"False"
]
] |
RandomSpanInfilling/HumanEval/82/7
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
prime_length
|
[
[
"'Hello'",
"True"
],
[
"'abcdcba'",
"True"
],
[
"'kittens'",
"True"
],
[
"'orange'",
"False"
],
[
"'wow'",
"True"
],
[
"'world'",
"True"
],
[
"'MadaM'",
"True"
],
[
"'Wow'",
"True"
],
[
"''",
"False"
],
[
"'HI'",
"True"
],
[
"'go'",
"True"
],
[
"'gogo'",
"False"
],
[
"'aaaaaaaaaaaaaaa'",
"False"
],
[
"'Madam'",
"True"
],
[
"'M'",
"False"
],
[
"'0'",
"False"
]
] |
[] |
== 1:
return False
for i in range(2, l):
if l % i == 0:
return False
|
return True
|
python
|
Write a function that takes a string and returns True if the string
length is a prime number or False otherwise
|
[] |
def prime_length(string):
"""Write a function that takes a string and returns True if the string
length is a prime number or False otherwise
"""
l = len(string)
if l == 0 or l
|
[
[
"'Hello'",
"True"
],
[
"'abcdcba'",
"True"
],
[
"'kittens'",
"True"
],
[
"'orange'",
"False"
]
] |
RandomSpanInfilling/HumanEval/82/8
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
prime_length
|
[
[
"'Hello'",
"True"
],
[
"'abcdcba'",
"True"
],
[
"'kittens'",
"True"
],
[
"'orange'",
"False"
],
[
"'wow'",
"True"
],
[
"'world'",
"True"
],
[
"'MadaM'",
"True"
],
[
"'Wow'",
"True"
],
[
"''",
"False"
],
[
"'HI'",
"True"
],
[
"'go'",
"True"
],
[
"'gogo'",
"False"
],
[
"'aaaaaaaaaaaaaaa'",
"False"
],
[
"'Madam'",
"True"
],
[
"'M'",
"False"
],
[
"'0'",
"False"
]
] |
[] |
ring)
if l == 0 or l == 1:
return False
for i in range(2, l):
if l % i == 0:
|
return False
return True
|
python
|
Write a function that takes a string and returns True if the string
length is a prime number or False otherwise
|
[] |
def prime_length(string):
"""Write a function that takes a string and returns True if the string
length is a prime number or False otherwise
"""
l = len(st
|
[
[
"'Hello'",
"True"
],
[
"'abcdcba'",
"True"
],
[
"'kittens'",
"True"
],
[
"'orange'",
"False"
]
] |
RandomSpanInfilling/HumanEval/82/9
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
prime_length
|
[
[
"'Hello'",
"True"
],
[
"'abcdcba'",
"True"
],
[
"'kittens'",
"True"
],
[
"'orange'",
"False"
],
[
"'wow'",
"True"
],
[
"'world'",
"True"
],
[
"'MadaM'",
"True"
],
[
"'Wow'",
"True"
],
[
"''",
"False"
],
[
"'HI'",
"True"
],
[
"'go'",
"True"
],
[
"'gogo'",
"False"
],
[
"'aaaaaaaaaaaaaaa'",
"False"
],
[
"'Madam'",
"True"
],
[
"'M'",
"False"
],
[
"'0'",
"False"
]
] |
[] |
== 0 or l == 1:
return False
for i in range(2, l):
if l % i == 0:
return False
return True
|
python
|
Write a function that takes a string and returns True if the string
length is a prime number or False otherwise
|
[] |
def prime_length(string):
"""Write a function that takes a string and returns True if the string
length is a prime number or False otherwise
"""
l = len(string)
if l
|
[
[
"'Hello'",
"True"
],
[
"'abcdcba'",
"True"
],
[
"'kittens'",
"True"
],
[
"'orange'",
"False"
]
] |
RandomSpanInfilling/HumanEval/82/10
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
prime_length
|
|
[
[
"1",
"1"
],
[
"2",
"18"
],
[
"3",
"180"
],
[
"4",
"1800"
],
[
"5",
"18000"
]
] |
[] |
= 1: return 1
return 18 * (10 ** (n -
|
2))
|
python
|
Given a positive integer n, return the count of the numbers of n-digit
positive integers that start or end with 1.
|
[] |
def starts_one_ends(n):
"""
Given a positive integer n, return the count of the numbers of n-digit
positive integers that start or end with 1.
"""
if n =
|
[] |
RandomSpanInfilling/HumanEval/83/1
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
starts_one_ends
|
[
[
"1",
"1"
],
[
"2",
"18"
],
[
"3",
"180"
],
[
"4",
"1800"
],
[
"5",
"18000"
]
] |
[] |
if n == 1: return 1
ret
|
urn 18 * (10 ** (n - 2))
|
python
|
Given a positive integer n, return the count of the numbers of n-digit
positive integers that start or end with 1.
|
[] |
def starts_one_ends(n):
"""
Given a positive integer n, return the count of the numbers of n-digit
positive integers that start or end with 1.
"""
|
[] |
RandomSpanInfilling/HumanEval/83/2
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
starts_one_ends
|
[
[
"1",
"1"
],
[
"2",
"18"
],
[
"3",
"180"
],
[
"4",
"1800"
],
[
"5",
"18000"
]
] |
[] |
: return 1
return 18 * (10 **
|
(n - 2))
|
python
|
Given a positive integer n, return the count of the numbers of n-digit
positive integers that start or end with 1.
|
[] |
def starts_one_ends(n):
"""
Given a positive integer n, return the count of the numbers of n-digit
positive integers that start or end with 1.
"""
if n == 1
|
[] |
RandomSpanInfilling/HumanEval/83/3
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
starts_one_ends
|
[
[
"1",
"1"
],
[
"2",
"18"
],
[
"3",
"180"
],
[
"4",
"1800"
],
[
"5",
"18000"
]
] |
[] |
rn
|
1
return 18 * (10 ** (n - 2))
|
python
|
Given a positive integer n, return the count of the numbers of n-digit
positive integers that start or end with 1.
|
[] |
def starts_one_ends(n):
"""
Given a positive integer n, return the count of the numbers of n-digit
positive integers that start or end with 1.
"""
if n == 1: retu
|
[] |
RandomSpanInfilling/HumanEval/83/4
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
starts_one_ends
|
[
[
"1",
"1"
],
[
"2",
"18"
],
[
"3",
"180"
],
[
"4",
"1800"
],
[
"5",
"18000"
]
] |
[] |
= 1: return 1
|
return 18 * (10 ** (n - 2))
|
python
|
Given a positive integer n, return the count of the numbers of n-digit
positive integers that start or end with 1.
|
[] |
def starts_one_ends(n):
"""
Given a positive integer n, return the count of the numbers of n-digit
positive integers that start or end with 1.
"""
if n =
|
[] |
RandomSpanInfilling/HumanEval/83/5
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
starts_one_ends
|
[
[
"1",
"1"
],
[
"2",
"18"
],
[
"3",
"180"
],
[
"4",
"1800"
],
[
"5",
"18000"
]
] |
[] |
if n == 1: r
|
eturn 1
return 18 * (10 ** (n - 2))
|
python
|
Given a positive integer n, return the count of the numbers of n-digit
positive integers that start or end with 1.
|
[] |
def starts_one_ends(n):
"""
Given a positive integer n, return the count of the numbers of n-digit
positive integers that start or end with 1.
"""
|
[] |
RandomSpanInfilling/HumanEval/83/6
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
starts_one_ends
|
[
[
"1",
"1"
],
[
"2",
"18"
],
[
"3",
"180"
],
[
"4",
"1800"
],
[
"5",
"18000"
]
] |
[] |
** (n - 2))
|
python
|
Given a positive integer n, return the count of the numbers of n-digit
positive integers that start or end with 1.
|
[] |
def starts_one_ends(n):
"""
Given a positive integer n, return the count of the numbers of n-digit
positive integers that start or end with 1.
"""
if n == 1: return 1
return 18 * (10
|
[] |
RandomSpanInfilling/HumanEval/83/7
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
starts_one_ends
|
|
[
[
"1",
"1"
],
[
"2",
"18"
],
[
"3",
"180"
],
[
"4",
"1800"
],
[
"5",
"18000"
]
] |
[] |
return 18 * (10 ** (n - 2))
|
python
|
Given a positive integer n, return the count of the numbers of n-digit
positive integers that start or end with 1.
|
[] |
def starts_one_ends(n):
"""
Given a positive integer n, return the count of the numbers of n-digit
positive integers that start or end with 1.
"""
if n == 1: return 1
|
[] |
RandomSpanInfilling/HumanEval/83/8
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
starts_one_ends
|
|
[
[
"1",
"1"
],
[
"2",
"18"
],
[
"3",
"180"
],
[
"4",
"1800"
],
[
"5",
"18000"
]
] |
[] |
n 1
return 18 * (10 **
|
(n - 2))
|
python
|
Given a positive integer n, return the count of the numbers of n-digit
positive integers that start or end with 1.
|
[] |
def starts_one_ends(n):
"""
Given a positive integer n, return the count of the numbers of n-digit
positive integers that start or end with 1.
"""
if n == 1: retur
|
[] |
RandomSpanInfilling/HumanEval/83/9
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
starts_one_ends
|
[
[
"1",
"1"
],
[
"2",
"18"
],
[
"3",
"180"
],
[
"4",
"1800"
],
[
"5",
"18000"
]
] |
[] |
return 1
return 1
|
8 * (10 ** (n - 2))
|
python
|
Given a positive integer n, return the count of the numbers of n-digit
positive integers that start or end with 1.
|
[] |
def starts_one_ends(n):
"""
Given a positive integer n, return the count of the numbers of n-digit
positive integers that start or end with 1.
"""
if n == 1:
|
[] |
RandomSpanInfilling/HumanEval/83/10
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
starts_one_ends
|
[
[
"1000",
"\"1\""
],
[
"150",
"\"110\""
],
[
"147",
"\"1100\""
],
[
"333",
"\"1001\""
],
[
"963",
"\"10010\""
]
] |
[] |
eturn bin(sum(
|
int(i) for i in str(N)))[2:]
|
python
|
Given a positive integer N, return the total sum of its digits in binary.
|
[] |
def solve(N):
"""Given a positive integer N, return the total sum of its digits in binary.
"""
r
|
[
[
"1000",
"\"1\""
],
[
"150",
"\"110\""
],
[
"147",
"\"1100\""
]
] |
RandomSpanInfilling/HumanEval/84/1
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
solve
|
[
[
"1000",
"\"1\""
],
[
"150",
"\"110\""
],
[
"147",
"\"1100\""
],
[
"333",
"\"1001\""
],
[
"963",
"\"10010\""
]
] |
[] |
return bin(sum
|
(int(i) for i in str(N)))[2:]
|
python
|
Given a positive integer N, return the total sum of its digits in binary.
|
[] |
def solve(N):
"""Given a positive integer N, return the total sum of its digits in binary.
"""
|
[
[
"1000",
"\"1\""
],
[
"150",
"\"110\""
],
[
"147",
"\"1100\""
]
] |
RandomSpanInfilling/HumanEval/84/2
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
solve
|
[
[
"1000",
"\"1\""
],
[
"150",
"\"110\""
],
[
"147",
"\"1100\""
],
[
"333",
"\"1001\""
],
[
"963",
"\"10010\""
]
] |
[] |
return bin(sum(int(i) for i in str(N)))[2:]
|
python
|
Given a positive integer N, return the total sum of its digits in binary.
|
[] |
def solve(N):
"""Given a positive integer N, return the total sum of its digits in binary.
"""
|
[
[
"1000",
"\"1\""
],
[
"150",
"\"110\""
],
[
"147",
"\"1100\""
]
] |
RandomSpanInfilling/HumanEval/84/3
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
solve
|
|
[
[
"1000",
"\"1\""
],
[
"150",
"\"110\""
],
[
"147",
"\"1100\""
],
[
"333",
"\"1001\""
],
[
"963",
"\"10010\""
]
] |
[] |
(sum(int(i) for i in st
|
r(N)))[2:]
|
python
|
Given a positive integer N, return the total sum of its digits in binary.
|
[] |
def solve(N):
"""Given a positive integer N, return the total sum of its digits in binary.
"""
return bin
|
[
[
"1000",
"\"1\""
],
[
"150",
"\"110\""
],
[
"147",
"\"1100\""
]
] |
RandomSpanInfilling/HumanEval/84/4
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
solve
|
[
[
"1000",
"\"1\""
],
[
"150",
"\"110\""
],
[
"147",
"\"1100\""
],
[
"333",
"\"1001\""
],
[
"963",
"\"10010\""
]
] |
[] |
n
|
str(N)))[2:]
|
python
|
Given a positive integer N, return the total sum of its digits in binary.
|
[] |
def solve(N):
"""Given a positive integer N, return the total sum of its digits in binary.
"""
return bin(sum(int(i) for i i
|
[
[
"1000",
"\"1\""
],
[
"150",
"\"110\""
],
[
"147",
"\"1100\""
]
] |
RandomSpanInfilling/HumanEval/84/5
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
solve
|
[
[
"1000",
"\"1\""
],
[
"150",
"\"110\""
],
[
"147",
"\"1100\""
],
[
"333",
"\"1001\""
],
[
"963",
"\"10010\""
]
] |
[] |
) for i in str(N)))[2:]
|
python
|
Given a positive integer N, return the total sum of its digits in binary.
|
[] |
def solve(N):
"""Given a positive integer N, return the total sum of its digits in binary.
"""
return bin(sum(int(i
|
[
[
"1000",
"\"1\""
],
[
"150",
"\"110\""
],
[
"147",
"\"1100\""
]
] |
RandomSpanInfilling/HumanEval/84/6
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
solve
|
|
[
[
"1000",
"\"1\""
],
[
"150",
"\"110\""
],
[
"147",
"\"1100\""
],
[
"333",
"\"1001\""
],
[
"963",
"\"10010\""
]
] |
[] |
bin(sum(int(
|
i) for i in str(N)))[2:]
|
python
|
Given a positive integer N, return the total sum of its digits in binary.
|
[] |
def solve(N):
"""Given a positive integer N, return the total sum of its digits in binary.
"""
return
|
[
[
"1000",
"\"1\""
],
[
"150",
"\"110\""
],
[
"147",
"\"1100\""
]
] |
RandomSpanInfilling/HumanEval/84/7
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
solve
|
[
[
"1000",
"\"1\""
],
[
"150",
"\"110\""
],
[
"147",
"\"1100\""
],
[
"333",
"\"1001\""
],
[
"963",
"\"10010\""
]
] |
[] |
(su
|
m(int(i) for i in str(N)))[2:]
|
python
|
Given a positive integer N, return the total sum of its digits in binary.
|
[] |
def solve(N):
"""Given a positive integer N, return the total sum of its digits in binary.
"""
return bin
|
[
[
"1000",
"\"1\""
],
[
"150",
"\"110\""
],
[
"147",
"\"1100\""
]
] |
RandomSpanInfilling/HumanEval/84/8
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
solve
|
[
[
"1000",
"\"1\""
],
[
"150",
"\"110\""
],
[
"147",
"\"1100\""
],
[
"333",
"\"1001\""
],
[
"963",
"\"10010\""
]
] |
[] |
sum(int(i) for i in str(N)))
|
[2:]
|
python
|
Given a positive integer N, return the total sum of its digits in binary.
|
[] |
def solve(N):
"""Given a positive integer N, return the total sum of its digits in binary.
"""
return bin(
|
[
[
"1000",
"\"1\""
],
[
"150",
"\"110\""
],
[
"147",
"\"1100\""
]
] |
RandomSpanInfilling/HumanEval/84/9
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
solve
|
[
[
"1000",
"\"1\""
],
[
"150",
"\"110\""
],
[
"147",
"\"1100\""
],
[
"333",
"\"1001\""
],
[
"963",
"\"10010\""
]
] |
[] |
urn bin(sum(int(i)
|
for i in str(N)))[2:]
|
python
|
Given a positive integer N, return the total sum of its digits in binary.
|
[] |
def solve(N):
"""Given a positive integer N, return the total sum of its digits in binary.
"""
ret
|
[
[
"1000",
"\"1\""
],
[
"150",
"\"110\""
],
[
"147",
"\"1100\""
]
] |
RandomSpanInfilling/HumanEval/84/10
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
solve
|
[
[
"[4, 88]",
"88"
],
[
"[4, 5, 6, 7, 2, 122]",
"122"
],
[
"[4, 0, 6, 7]",
"0"
],
[
"[4, 4, 6, 8]",
"12"
]
] |
[] |
lst), 2) if ls
|
t[i]%2 == 0])
|
python
|
Given a non-empty list of integers lst. add the even elements that are at odd indices..
|
[] |
def add(lst):
"""Given a non-empty list of integers lst. add the even elements that are at odd indices..
"""
return sum([lst[i] for i in range(1, len(
|
[
[
"[4, 2, 6, 7]",
"> 2"
]
] |
RandomSpanInfilling/HumanEval/85/1
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
add
|
[
[
"[4, 88]",
"88"
],
[
"[4, 5, 6, 7, 2, 122]",
"122"
],
[
"[4, 0, 6, 7]",
"0"
],
[
"[4, 4, 6, 8]",
"12"
]
] |
[] |
lst[i] for i in range(1, len(lst), 2
|
) if lst[i]%2 == 0])
|
python
|
Given a non-empty list of integers lst. add the even elements that are at odd indices..
|
[] |
def add(lst):
"""Given a non-empty list of integers lst. add the even elements that are at odd indices..
"""
return sum([
|
[
[
"[4, 2, 6, 7]",
"> 2"
]
] |
RandomSpanInfilling/HumanEval/85/2
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
add
|
[
[
"[4, 88]",
"88"
],
[
"[4, 5, 6, 7, 2, 122]",
"122"
],
[
"[4, 0, 6, 7]",
"0"
],
[
"[4, 4, 6, 8]",
"12"
]
] |
[] |
urn sum([lst[i] for
|
i in range(1, len(lst), 2) if lst[i]%2 == 0])
|
python
|
Given a non-empty list of integers lst. add the even elements that are at odd indices..
|
[] |
def add(lst):
"""Given a non-empty list of integers lst. add the even elements that are at odd indices..
"""
ret
|
[
[
"[4, 2, 6, 7]",
"> 2"
]
] |
RandomSpanInfilling/HumanEval/85/3
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
add
|
[
[
"[4, 88]",
"88"
],
[
"[4, 5, 6, 7, 2, 122]",
"122"
],
[
"[4, 0, 6, 7]",
"0"
],
[
"[4, 4, 6, 8]",
"12"
]
] |
[] |
lst)
|
, 2) if lst[i]%2 == 0])
|
python
|
Given a non-empty list of integers lst. add the even elements that are at odd indices..
|
[] |
def add(lst):
"""Given a non-empty list of integers lst. add the even elements that are at odd indices..
"""
return sum([lst[i] for i in range(1, len(
|
[
[
"[4, 2, 6, 7]",
"> 2"
]
] |
RandomSpanInfilling/HumanEval/85/4
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
add
|
[
[
"[4, 88]",
"88"
],
[
"[4, 5, 6, 7, 2, 122]",
"122"
],
[
"[4, 0, 6, 7]",
"0"
],
[
"[4, 4, 6, 8]",
"12"
]
] |
[] |
return sum([lst[i] for i in range(1, len(lst), 2) if lst[i]%2 == 0
|
])
|
python
|
Given a non-empty list of integers lst. add the even elements that are at odd indices..
|
[] |
def add(lst):
"""Given a non-empty list of integers lst. add the even elements that are at odd indices..
"""
|
[
[
"[4, 2, 6, 7]",
"> 2"
]
] |
RandomSpanInfilling/HumanEval/85/5
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
add
|
[
[
"[4, 88]",
"88"
],
[
"[4, 5, 6, 7, 2, 122]",
"122"
],
[
"[4, 0, 6, 7]",
"0"
],
[
"[4, 4, 6, 8]",
"12"
]
] |
[] |
n(lst), 2) if lst[i]
|
%2 == 0])
|
python
|
Given a non-empty list of integers lst. add the even elements that are at odd indices..
|
[] |
def add(lst):
"""Given a non-empty list of integers lst. add the even elements that are at odd indices..
"""
return sum([lst[i] for i in range(1, le
|
[
[
"[4, 2, 6, 7]",
"> 2"
]
] |
RandomSpanInfilling/HumanEval/85/6
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
add
|
[
[
"[4, 88]",
"88"
],
[
"[4, 5, 6, 7, 2, 122]",
"122"
],
[
"[4, 0, 6, 7]",
"0"
],
[
"[4, 4, 6, 8]",
"12"
]
] |
[] |
for i in range(1, len(lst), 2
|
) if lst[i]%2 == 0])
|
python
|
Given a non-empty list of integers lst. add the even elements that are at odd indices..
|
[] |
def add(lst):
"""Given a non-empty list of integers lst. add the even elements that are at odd indices..
"""
return sum([lst[i]
|
[
[
"[4, 2, 6, 7]",
"> 2"
]
] |
RandomSpanInfilling/HumanEval/85/7
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
add
|
[
[
"[4, 88]",
"88"
],
[
"[4, 5, 6, 7, 2, 122]",
"122"
],
[
"[4, 0, 6, 7]",
"0"
],
[
"[4, 4, 6, 8]",
"12"
]
] |
[] |
return sum([lst[i] for i in range(1, len(lst), 2) if ls
|
t[i]%2 == 0])
|
python
|
Given a non-empty list of integers lst. add the even elements that are at odd indices..
|
[] |
def add(lst):
"""Given a non-empty list of integers lst. add the even elements that are at odd indices..
"""
|
[
[
"[4, 2, 6, 7]",
"> 2"
]
] |
RandomSpanInfilling/HumanEval/85/8
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
add
|
[
[
"[4, 88]",
"88"
],
[
"[4, 5, 6, 7, 2, 122]",
"122"
],
[
"[4, 0, 6, 7]",
"0"
],
[
"[4, 4, 6, 8]",
"12"
]
] |
[] |
[i] for i in range(1, len(
|
lst), 2) if lst[i]%2 == 0])
|
python
|
Given a non-empty list of integers lst. add the even elements that are at odd indices..
|
[] |
def add(lst):
"""Given a non-empty list of integers lst. add the even elements that are at odd indices..
"""
return sum([lst
|
[
[
"[4, 2, 6, 7]",
"> 2"
]
] |
RandomSpanInfilling/HumanEval/85/9
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
add
|
[
[
"[4, 88]",
"88"
],
[
"[4, 5, 6, 7, 2, 122]",
"122"
],
[
"[4, 0, 6, 7]",
"0"
],
[
"[4, 4, 6, 8]",
"12"
]
] |
[] |
([lst[i] f
|
or i in range(1, len(lst), 2) if lst[i]%2 == 0])
|
python
|
Given a non-empty list of integers lst. add the even elements that are at odd indices..
|
[] |
def add(lst):
"""Given a non-empty list of integers lst. add the even elements that are at odd indices..
"""
return sum
|
[
[
"[4, 2, 6, 7]",
"> 2"
]
] |
RandomSpanInfilling/HumanEval/85/10
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
add
|
[
[
"'Hi'",
"'Hi'"
],
[
"'hello'",
"'ehllo'"
],
[
"'number'",
"'bemnru'"
],
[
"'abcd'",
"'abcd'"
],
[
"'Hello World!!!'",
"'Hello !!!Wdlor'"
],
[
"''",
"''"
],
[
"'Hi. My name is Mister Robot. How are you?'",
"'.Hi My aemn is Meirst .Rboot How aer ?ouy'"
]
] |
[] |
oin([''.join(sorted(list(i))) for i in s.split(' ')])
|
python
|
Write a function that takes a string and returns an ordered version of it.
Ordered version of string, is a string where all words (separated by space)
are replaced by a new word where all the characters arranged in
ascending order based on ascii value.
Note: You should keep the order of words and blank spaces in the sentence.
|
[] |
def anti_shuffle(s):
"""
Write a function that takes a string and returns an ordered version of it.
Ordered version of string, is a string where all words (separated by space)
are replaced by a new word where all the characters arranged in
ascending order based on ascii value.
Note: You should keep the order of words and blank spaces in the sentence.
"""
return ' '.j
|
[
[
"'Hi'",
"'Hi'"
],
[
"'hello'",
"'ehllo'"
],
[
"'Hello World!!!'",
"'Hello !!!Wdlor'"
]
] |
RandomSpanInfilling/HumanEval/86/1
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
anti_shuffle
|
|
[
[
"'Hi'",
"'Hi'"
],
[
"'hello'",
"'ehllo'"
],
[
"'number'",
"'bemnru'"
],
[
"'abcd'",
"'abcd'"
],
[
"'Hello World!!!'",
"'Hello !!!Wdlor'"
],
[
"''",
"''"
],
[
"'Hi. My name is Mister Robot. How are you?'",
"'.Hi My aemn is Meirst .Rboot How aer ?ouy'"
]
] |
[] |
rn ' '.join([''.join(sorted(l
|
ist(i))) for i in s.split(' ')])
|
python
|
Write a function that takes a string and returns an ordered version of it.
Ordered version of string, is a string where all words (separated by space)
are replaced by a new word where all the characters arranged in
ascending order based on ascii value.
Note: You should keep the order of words and blank spaces in the sentence.
|
[] |
def anti_shuffle(s):
"""
Write a function that takes a string and returns an ordered version of it.
Ordered version of string, is a string where all words (separated by space)
are replaced by a new word where all the characters arranged in
ascending order based on ascii value.
Note: You should keep the order of words and blank spaces in the sentence.
"""
retu
|
[
[
"'Hi'",
"'Hi'"
],
[
"'hello'",
"'ehllo'"
],
[
"'Hello World!!!'",
"'Hello !!!Wdlor'"
]
] |
RandomSpanInfilling/HumanEval/86/2
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
anti_shuffle
|
[
[
"'Hi'",
"'Hi'"
],
[
"'hello'",
"'ehllo'"
],
[
"'number'",
"'bemnru'"
],
[
"'abcd'",
"'abcd'"
],
[
"'Hello World!!!'",
"'Hello !!!Wdlor'"
],
[
"''",
"''"
],
[
"'Hi. My name is Mister Robot. How are you?'",
"'.Hi My aemn is Meirst .Rboot How aer ?ouy'"
]
] |
[] |
or i in s.sp
|
lit(' ')])
|
python
|
Write a function that takes a string and returns an ordered version of it.
Ordered version of string, is a string where all words (separated by space)
are replaced by a new word where all the characters arranged in
ascending order based on ascii value.
Note: You should keep the order of words and blank spaces in the sentence.
|
[] |
def anti_shuffle(s):
"""
Write a function that takes a string and returns an ordered version of it.
Ordered version of string, is a string where all words (separated by space)
are replaced by a new word where all the characters arranged in
ascending order based on ascii value.
Note: You should keep the order of words and blank spaces in the sentence.
"""
return ' '.join([''.join(sorted(list(i))) f
|
[
[
"'Hi'",
"'Hi'"
],
[
"'hello'",
"'ehllo'"
],
[
"'Hello World!!!'",
"'Hello !!!Wdlor'"
]
] |
RandomSpanInfilling/HumanEval/86/3
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
anti_shuffle
|
[
[
"'Hi'",
"'Hi'"
],
[
"'hello'",
"'ehllo'"
],
[
"'number'",
"'bemnru'"
],
[
"'abcd'",
"'abcd'"
],
[
"'Hello World!!!'",
"'Hello !!!Wdlor'"
],
[
"''",
"''"
],
[
"'Hi. My name is Mister Robot. How are you?'",
"'.Hi My aemn is Meirst .Rboot How aer ?ouy'"
]
] |
[] |
return ' '.join([''.join(sorted(list(i))) for i in s.split
|
(' ')])
|
python
|
Write a function that takes a string and returns an ordered version of it.
Ordered version of string, is a string where all words (separated by space)
are replaced by a new word where all the characters arranged in
ascending order based on ascii value.
Note: You should keep the order of words and blank spaces in the sentence.
|
[] |
def anti_shuffle(s):
"""
Write a function that takes a string and returns an ordered version of it.
Ordered version of string, is a string where all words (separated by space)
are replaced by a new word where all the characters arranged in
ascending order based on ascii value.
Note: You should keep the order of words and blank spaces in the sentence.
"""
|
[
[
"'Hi'",
"'Hi'"
],
[
"'hello'",
"'ehllo'"
],
[
"'Hello World!!!'",
"'Hello !!!Wdlor'"
]
] |
RandomSpanInfilling/HumanEval/86/4
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
anti_shuffle
|
[
[
"'Hi'",
"'Hi'"
],
[
"'hello'",
"'ehllo'"
],
[
"'number'",
"'bemnru'"
],
[
"'abcd'",
"'abcd'"
],
[
"'Hello World!!!'",
"'Hello !!!Wdlor'"
],
[
"''",
"''"
],
[
"'Hi. My name is Mister Robot. How are you?'",
"'.Hi My aemn is Meirst .Rboot How aer ?ouy'"
]
] |
[] |
' '.join([''.join(sorted(list(i))) for i in s.split(
|
' ')])
|
python
|
Write a function that takes a string and returns an ordered version of it.
Ordered version of string, is a string where all words (separated by space)
are replaced by a new word where all the characters arranged in
ascending order based on ascii value.
Note: You should keep the order of words and blank spaces in the sentence.
|
[] |
def anti_shuffle(s):
"""
Write a function that takes a string and returns an ordered version of it.
Ordered version of string, is a string where all words (separated by space)
are replaced by a new word where all the characters arranged in
ascending order based on ascii value.
Note: You should keep the order of words and blank spaces in the sentence.
"""
return
|
[
[
"'Hi'",
"'Hi'"
],
[
"'hello'",
"'ehllo'"
],
[
"'Hello World!!!'",
"'Hello !!!Wdlor'"
]
] |
RandomSpanInfilling/HumanEval/86/5
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
anti_shuffle
|
[
[
"'Hi'",
"'Hi'"
],
[
"'hello'",
"'ehllo'"
],
[
"'number'",
"'bemnru'"
],
[
"'abcd'",
"'abcd'"
],
[
"'Hello World!!!'",
"'Hello !!!Wdlor'"
],
[
"''",
"''"
],
[
"'Hi. My name is Mister Robot. How are you?'",
"'.Hi My aemn is Meirst .Rboot How aer ?ouy'"
]
] |
[] |
in(
|
[''.join(sorted(list(i))) for i in s.split(' ')])
|
python
|
Write a function that takes a string and returns an ordered version of it.
Ordered version of string, is a string where all words (separated by space)
are replaced by a new word where all the characters arranged in
ascending order based on ascii value.
Note: You should keep the order of words and blank spaces in the sentence.
|
[] |
def anti_shuffle(s):
"""
Write a function that takes a string and returns an ordered version of it.
Ordered version of string, is a string where all words (separated by space)
are replaced by a new word where all the characters arranged in
ascending order based on ascii value.
Note: You should keep the order of words and blank spaces in the sentence.
"""
return ' '.jo
|
[
[
"'Hi'",
"'Hi'"
],
[
"'hello'",
"'ehllo'"
],
[
"'Hello World!!!'",
"'Hello !!!Wdlor'"
]
] |
RandomSpanInfilling/HumanEval/86/6
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
anti_shuffle
|
[
[
"'Hi'",
"'Hi'"
],
[
"'hello'",
"'ehllo'"
],
[
"'number'",
"'bemnru'"
],
[
"'abcd'",
"'abcd'"
],
[
"'Hello World!!!'",
"'Hello !!!Wdlor'"
],
[
"''",
"''"
],
[
"'Hi. My name is Mister Robot. How are you?'",
"'.Hi My aemn is Meirst .Rboot How aer ?ouy'"
]
] |
[] |
ist(i))) for i in s.split(
|
' ')])
|
python
|
Write a function that takes a string and returns an ordered version of it.
Ordered version of string, is a string where all words (separated by space)
are replaced by a new word where all the characters arranged in
ascending order based on ascii value.
Note: You should keep the order of words and blank spaces in the sentence.
|
[] |
def anti_shuffle(s):
"""
Write a function that takes a string and returns an ordered version of it.
Ordered version of string, is a string where all words (separated by space)
are replaced by a new word where all the characters arranged in
ascending order based on ascii value.
Note: You should keep the order of words and blank spaces in the sentence.
"""
return ' '.join([''.join(sorted(l
|
[
[
"'Hi'",
"'Hi'"
],
[
"'hello'",
"'ehllo'"
],
[
"'Hello World!!!'",
"'Hello !!!Wdlor'"
]
] |
RandomSpanInfilling/HumanEval/86/7
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
anti_shuffle
|
[
[
"'Hi'",
"'Hi'"
],
[
"'hello'",
"'ehllo'"
],
[
"'number'",
"'bemnru'"
],
[
"'abcd'",
"'abcd'"
],
[
"'Hello World!!!'",
"'Hello !!!Wdlor'"
],
[
"''",
"''"
],
[
"'Hi. My name is Mister Robot. How are you?'",
"'.Hi My aemn is Meirst .Rboot How aer ?ouy'"
]
] |
[] |
' '.join([''.join(so
|
rted(list(i))) for i in s.split(' ')])
|
python
|
Write a function that takes a string and returns an ordered version of it.
Ordered version of string, is a string where all words (separated by space)
are replaced by a new word where all the characters arranged in
ascending order based on ascii value.
Note: You should keep the order of words and blank spaces in the sentence.
|
[] |
def anti_shuffle(s):
"""
Write a function that takes a string and returns an ordered version of it.
Ordered version of string, is a string where all words (separated by space)
are replaced by a new word where all the characters arranged in
ascending order based on ascii value.
Note: You should keep the order of words and blank spaces in the sentence.
"""
return
|
[
[
"'Hi'",
"'Hi'"
],
[
"'hello'",
"'ehllo'"
],
[
"'Hello World!!!'",
"'Hello !!!Wdlor'"
]
] |
RandomSpanInfilling/HumanEval/86/8
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
anti_shuffle
|
[
[
"'Hi'",
"'Hi'"
],
[
"'hello'",
"'ehllo'"
],
[
"'number'",
"'bemnru'"
],
[
"'abcd'",
"'abcd'"
],
[
"'Hello World!!!'",
"'Hello !!!Wdlor'"
],
[
"''",
"''"
],
[
"'Hi. My name is Mister Robot. How are you?'",
"'.Hi My aemn is Meirst .Rboot How aer ?ouy'"
]
] |
[] |
ted(list(i))
|
) for i in s.split(' ')])
|
python
|
Write a function that takes a string and returns an ordered version of it.
Ordered version of string, is a string where all words (separated by space)
are replaced by a new word where all the characters arranged in
ascending order based on ascii value.
Note: You should keep the order of words and blank spaces in the sentence.
|
[] |
def anti_shuffle(s):
"""
Write a function that takes a string and returns an ordered version of it.
Ordered version of string, is a string where all words (separated by space)
are replaced by a new word where all the characters arranged in
ascending order based on ascii value.
Note: You should keep the order of words and blank spaces in the sentence.
"""
return ' '.join([''.join(sor
|
[
[
"'Hi'",
"'Hi'"
],
[
"'hello'",
"'ehllo'"
],
[
"'Hello World!!!'",
"'Hello !!!Wdlor'"
]
] |
RandomSpanInfilling/HumanEval/86/9
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
anti_shuffle
|
[
[
"'Hi'",
"'Hi'"
],
[
"'hello'",
"'ehllo'"
],
[
"'number'",
"'bemnru'"
],
[
"'abcd'",
"'abcd'"
],
[
"'Hello World!!!'",
"'Hello !!!Wdlor'"
],
[
"''",
"''"
],
[
"'Hi. My name is Mister Robot. How are you?'",
"'.Hi My aemn is Meirst .Rboot How aer ?ouy'"
]
] |
[] |
urn ' '.join([''.join(sorted(list
|
(i))) for i in s.split(' ')])
|
python
|
Write a function that takes a string and returns an ordered version of it.
Ordered version of string, is a string where all words (separated by space)
are replaced by a new word where all the characters arranged in
ascending order based on ascii value.
Note: You should keep the order of words and blank spaces in the sentence.
|
[] |
def anti_shuffle(s):
"""
Write a function that takes a string and returns an ordered version of it.
Ordered version of string, is a string where all words (separated by space)
are replaced by a new word where all the characters arranged in
ascending order based on ascii value.
Note: You should keep the order of words and blank spaces in the sentence.
"""
ret
|
[
[
"'Hi'",
"'Hi'"
],
[
"'hello'",
"'ehllo'"
],
[
"'Hello World!!!'",
"'Hello !!!Wdlor'"
]
] |
RandomSpanInfilling/HumanEval/86/10
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
anti_shuffle
|
[
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,1,6],\n [1,2,3,4,5,1]\n ], 1",
"[(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]"
],
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6]\n ], 2",
"[(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1)]"
],
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,1,3,4,5,6],\n [1,2,1,4,5,6],\n [1,2,3,1,5,6],\n [1,2,3,4,1,6],\n [1,2,3,4,5,1]\n ], 1",
"[(0, 0), (1, 0), (2, 1), (2, 0), (3, 2), (3, 0), (4, 3), (4, 0), (5, 4), (5, 0), (6, 5), (6, 0)]"
],
[
"[], 1",
"[]"
],
[
"[[1]], 2",
"[]"
],
[
"[[], [1], [1, 2, 3]], 3",
"[(2, 2)]"
]
] |
[] |
= [(i, j) for i in range(len(lst)) for j in range(len(lst[i])) if lst[i][j] == x]
return sorted(sorted(coords, key=lambda x: x[1], reverse=True), key=lambda x: x[0
|
])
|
python
|
You are given a 2 dimensional data, as a nested lists,
which is similar to matrix, however, unlike matrices,
each row may contain a different number of columns.
Given lst, and integer x, find integers x in the list,
and return list of tuples, [(x1, y1), (x2, y2) ...] such that
each tuple is a coordinate - (row, columns), starting with 0.
Sort coordinates initially by rows in ascending order.
Also, sort coordinates of the row by columns in descending order.
|
[] |
def get_row(lst, x):
"""
You are given a 2 dimensional data, as a nested lists,
which is similar to matrix, however, unlike matrices,
each row may contain a different number of columns.
Given lst, and integer x, find integers x in the list,
and return list of tuples, [(x1, y1), (x2, y2) ...] such that
each tuple is a coordinate - (row, columns), starting with 0.
Sort coordinates initially by rows in ascending order.
Also, sort coordinates of the row by columns in descending order.
"""
coords
|
[
[
"[], 1",
"[]"
],
[
"[[], [1], [1, 2, 3]], 3",
"[(2, 2)]"
]
] |
RandomSpanInfilling/HumanEval/87/1
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
get_row
|
[
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,1,6],\n [1,2,3,4,5,1]\n ], 1",
"[(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]"
],
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6]\n ], 2",
"[(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1)]"
],
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,1,3,4,5,6],\n [1,2,1,4,5,6],\n [1,2,3,1,5,6],\n [1,2,3,4,1,6],\n [1,2,3,4,5,1]\n ], 1",
"[(0, 0), (1, 0), (2, 1), (2, 0), (3, 2), (3, 0), (4, 3), (4, 0), (5, 4), (5, 0), (6, 5), (6, 0)]"
],
[
"[], 1",
"[]"
],
[
"[[1]], 2",
"[]"
],
[
"[[], [1], [1, 2, 3]], 3",
"[(2, 2)]"
]
] |
[] |
lst)) for j in range(len(lst[i])) if lst[i][j]
|
== x]
return sorted(sorted(coords, key=lambda x: x[1], reverse=True), key=lambda x: x[0])
|
python
|
You are given a 2 dimensional data, as a nested lists,
which is similar to matrix, however, unlike matrices,
each row may contain a different number of columns.
Given lst, and integer x, find integers x in the list,
and return list of tuples, [(x1, y1), (x2, y2) ...] such that
each tuple is a coordinate - (row, columns), starting with 0.
Sort coordinates initially by rows in ascending order.
Also, sort coordinates of the row by columns in descending order.
|
[] |
def get_row(lst, x):
"""
You are given a 2 dimensional data, as a nested lists,
which is similar to matrix, however, unlike matrices,
each row may contain a different number of columns.
Given lst, and integer x, find integers x in the list,
and return list of tuples, [(x1, y1), (x2, y2) ...] such that
each tuple is a coordinate - (row, columns), starting with 0.
Sort coordinates initially by rows in ascending order.
Also, sort coordinates of the row by columns in descending order.
"""
coords = [(i, j) for i in range(len(
|
[
[
"[], 1",
"[]"
],
[
"[[], [1], [1, 2, 3]], 3",
"[(2, 2)]"
]
] |
RandomSpanInfilling/HumanEval/87/2
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
get_row
|
[
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,1,6],\n [1,2,3,4,5,1]\n ], 1",
"[(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]"
],
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6]\n ], 2",
"[(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1)]"
],
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,1,3,4,5,6],\n [1,2,1,4,5,6],\n [1,2,3,1,5,6],\n [1,2,3,4,1,6],\n [1,2,3,4,5,1]\n ], 1",
"[(0, 0), (1, 0), (2, 1), (2, 0), (3, 2), (3, 0), (4, 3), (4, 0), (5, 4), (5, 0), (6, 5), (6, 0)]"
],
[
"[], 1",
"[]"
],
[
"[[1]], 2",
"[]"
],
[
"[[], [1], [1, 2, 3]], 3",
"[(2, 2)]"
]
] |
[] |
f lst[i][j] == x]
return sorted(sorted(coords, key=lambda x: x[1]
|
, reverse=True), key=lambda x: x[0])
|
python
|
You are given a 2 dimensional data, as a nested lists,
which is similar to matrix, however, unlike matrices,
each row may contain a different number of columns.
Given lst, and integer x, find integers x in the list,
and return list of tuples, [(x1, y1), (x2, y2) ...] such that
each tuple is a coordinate - (row, columns), starting with 0.
Sort coordinates initially by rows in ascending order.
Also, sort coordinates of the row by columns in descending order.
|
[] |
def get_row(lst, x):
"""
You are given a 2 dimensional data, as a nested lists,
which is similar to matrix, however, unlike matrices,
each row may contain a different number of columns.
Given lst, and integer x, find integers x in the list,
and return list of tuples, [(x1, y1), (x2, y2) ...] such that
each tuple is a coordinate - (row, columns), starting with 0.
Sort coordinates initially by rows in ascending order.
Also, sort coordinates of the row by columns in descending order.
"""
coords = [(i, j) for i in range(len(lst)) for j in range(len(lst[i])) i
|
[
[
"[], 1",
"[]"
],
[
"[[], [1], [1, 2, 3]], 3",
"[(2, 2)]"
]
] |
RandomSpanInfilling/HumanEval/87/3
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
get_row
|
[
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,1,6],\n [1,2,3,4,5,1]\n ], 1",
"[(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]"
],
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6]\n ], 2",
"[(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1)]"
],
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,1,3,4,5,6],\n [1,2,1,4,5,6],\n [1,2,3,1,5,6],\n [1,2,3,4,1,6],\n [1,2,3,4,5,1]\n ], 1",
"[(0, 0), (1, 0), (2, 1), (2, 0), (3, 2), (3, 0), (4, 3), (4, 0), (5, 4), (5, 0), (6, 5), (6, 0)]"
],
[
"[], 1",
"[]"
],
[
"[[1]], 2",
"[]"
],
[
"[[], [1], [1, 2, 3]], 3",
"[(2, 2)]"
]
] |
[] |
for j in range(len(lst[i])) if lst[i][j] == x]
return sorted(sorted(co
|
ords, key=lambda x: x[1], reverse=True), key=lambda x: x[0])
|
python
|
You are given a 2 dimensional data, as a nested lists,
which is similar to matrix, however, unlike matrices,
each row may contain a different number of columns.
Given lst, and integer x, find integers x in the list,
and return list of tuples, [(x1, y1), (x2, y2) ...] such that
each tuple is a coordinate - (row, columns), starting with 0.
Sort coordinates initially by rows in ascending order.
Also, sort coordinates of the row by columns in descending order.
|
[] |
def get_row(lst, x):
"""
You are given a 2 dimensional data, as a nested lists,
which is similar to matrix, however, unlike matrices,
each row may contain a different number of columns.
Given lst, and integer x, find integers x in the list,
and return list of tuples, [(x1, y1), (x2, y2) ...] such that
each tuple is a coordinate - (row, columns), starting with 0.
Sort coordinates initially by rows in ascending order.
Also, sort coordinates of the row by columns in descending order.
"""
coords = [(i, j) for i in range(len(lst))
|
[
[
"[], 1",
"[]"
],
[
"[[], [1], [1, 2, 3]], 3",
"[(2, 2)]"
]
] |
RandomSpanInfilling/HumanEval/87/4
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
get_row
|
[
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,1,6],\n [1,2,3,4,5,1]\n ], 1",
"[(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]"
],
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6]\n ], 2",
"[(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1)]"
],
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,1,3,4,5,6],\n [1,2,1,4,5,6],\n [1,2,3,1,5,6],\n [1,2,3,4,1,6],\n [1,2,3,4,5,1]\n ], 1",
"[(0, 0), (1, 0), (2, 1), (2, 0), (3, 2), (3, 0), (4, 3), (4, 0), (5, 4), (5, 0), (6, 5), (6, 0)]"
],
[
"[], 1",
"[]"
],
[
"[[1]], 2",
"[]"
],
[
"[[], [1], [1, 2, 3]], 3",
"[(2, 2)]"
]
] |
[] |
t[i][j] == x]
return sorted(sorted(coords, key=lambda x: x[1], reverse=True)
|
, key=lambda x: x[0])
|
python
|
You are given a 2 dimensional data, as a nested lists,
which is similar to matrix, however, unlike matrices,
each row may contain a different number of columns.
Given lst, and integer x, find integers x in the list,
and return list of tuples, [(x1, y1), (x2, y2) ...] such that
each tuple is a coordinate - (row, columns), starting with 0.
Sort coordinates initially by rows in ascending order.
Also, sort coordinates of the row by columns in descending order.
|
[] |
def get_row(lst, x):
"""
You are given a 2 dimensional data, as a nested lists,
which is similar to matrix, however, unlike matrices,
each row may contain a different number of columns.
Given lst, and integer x, find integers x in the list,
and return list of tuples, [(x1, y1), (x2, y2) ...] such that
each tuple is a coordinate - (row, columns), starting with 0.
Sort coordinates initially by rows in ascending order.
Also, sort coordinates of the row by columns in descending order.
"""
coords = [(i, j) for i in range(len(lst)) for j in range(len(lst[i])) if ls
|
[
[
"[], 1",
"[]"
],
[
"[[], [1], [1, 2, 3]], 3",
"[(2, 2)]"
]
] |
RandomSpanInfilling/HumanEval/87/5
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
get_row
|
[
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,1,6],\n [1,2,3,4,5,1]\n ], 1",
"[(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]"
],
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6]\n ], 2",
"[(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1)]"
],
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,1,3,4,5,6],\n [1,2,1,4,5,6],\n [1,2,3,1,5,6],\n [1,2,3,4,1,6],\n [1,2,3,4,5,1]\n ], 1",
"[(0, 0), (1, 0), (2, 1), (2, 0), (3, 2), (3, 0), (4, 3), (4, 0), (5, 4), (5, 0), (6, 5), (6, 0)]"
],
[
"[], 1",
"[]"
],
[
"[[1]], 2",
"[]"
],
[
"[[], [1], [1, 2, 3]], 3",
"[(2, 2)]"
]
] |
[] |
n range(len(lst[i])) if lst[i][j
|
] == x]
return sorted(sorted(coords, key=lambda x: x[1], reverse=True), key=lambda x: x[0])
|
python
|
You are given a 2 dimensional data, as a nested lists,
which is similar to matrix, however, unlike matrices,
each row may contain a different number of columns.
Given lst, and integer x, find integers x in the list,
and return list of tuples, [(x1, y1), (x2, y2) ...] such that
each tuple is a coordinate - (row, columns), starting with 0.
Sort coordinates initially by rows in ascending order.
Also, sort coordinates of the row by columns in descending order.
|
[] |
def get_row(lst, x):
"""
You are given a 2 dimensional data, as a nested lists,
which is similar to matrix, however, unlike matrices,
each row may contain a different number of columns.
Given lst, and integer x, find integers x in the list,
and return list of tuples, [(x1, y1), (x2, y2) ...] such that
each tuple is a coordinate - (row, columns), starting with 0.
Sort coordinates initially by rows in ascending order.
Also, sort coordinates of the row by columns in descending order.
"""
coords = [(i, j) for i in range(len(lst)) for j i
|
[
[
"[], 1",
"[]"
],
[
"[[], [1], [1, 2, 3]], 3",
"[(2, 2)]"
]
] |
RandomSpanInfilling/HumanEval/87/6
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
get_row
|
[
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,1,6],\n [1,2,3,4,5,1]\n ], 1",
"[(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]"
],
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6]\n ], 2",
"[(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1)]"
],
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,1,3,4,5,6],\n [1,2,1,4,5,6],\n [1,2,3,1,5,6],\n [1,2,3,4,1,6],\n [1,2,3,4,5,1]\n ], 1",
"[(0, 0), (1, 0), (2, 1), (2, 0), (3, 2), (3, 0), (4, 3), (4, 0), (5, 4), (5, 0), (6, 5), (6, 0)]"
],
[
"[], 1",
"[]"
],
[
"[[1]], 2",
"[]"
],
[
"[[], [1], [1, 2, 3]], 3",
"[(2, 2)]"
]
] |
[] |
]
return sorted(sorted(coords, key=lambda x: x[1], r
|
everse=True), key=lambda x: x[0])
|
python
|
You are given a 2 dimensional data, as a nested lists,
which is similar to matrix, however, unlike matrices,
each row may contain a different number of columns.
Given lst, and integer x, find integers x in the list,
and return list of tuples, [(x1, y1), (x2, y2) ...] such that
each tuple is a coordinate - (row, columns), starting with 0.
Sort coordinates initially by rows in ascending order.
Also, sort coordinates of the row by columns in descending order.
|
[] |
def get_row(lst, x):
"""
You are given a 2 dimensional data, as a nested lists,
which is similar to matrix, however, unlike matrices,
each row may contain a different number of columns.
Given lst, and integer x, find integers x in the list,
and return list of tuples, [(x1, y1), (x2, y2) ...] such that
each tuple is a coordinate - (row, columns), starting with 0.
Sort coordinates initially by rows in ascending order.
Also, sort coordinates of the row by columns in descending order.
"""
coords = [(i, j) for i in range(len(lst)) for j in range(len(lst[i])) if lst[i][j] == x
|
[
[
"[], 1",
"[]"
],
[
"[[], [1], [1, 2, 3]], 3",
"[(2, 2)]"
]
] |
RandomSpanInfilling/HumanEval/87/7
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
get_row
|
[
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,1,6],\n [1,2,3,4,5,1]\n ], 1",
"[(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]"
],
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6]\n ], 2",
"[(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1)]"
],
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,1,3,4,5,6],\n [1,2,1,4,5,6],\n [1,2,3,1,5,6],\n [1,2,3,4,1,6],\n [1,2,3,4,5,1]\n ], 1",
"[(0, 0), (1, 0), (2, 1), (2, 0), (3, 2), (3, 0), (4, 3), (4, 0), (5, 4), (5, 0), (6, 5), (6, 0)]"
],
[
"[], 1",
"[]"
],
[
"[[1]], 2",
"[]"
],
[
"[[], [1], [1, 2, 3]], 3",
"[(2, 2)]"
]
] |
[] |
key=la
|
mbda x: x[0])
|
python
|
You are given a 2 dimensional data, as a nested lists,
which is similar to matrix, however, unlike matrices,
each row may contain a different number of columns.
Given lst, and integer x, find integers x in the list,
and return list of tuples, [(x1, y1), (x2, y2) ...] such that
each tuple is a coordinate - (row, columns), starting with 0.
Sort coordinates initially by rows in ascending order.
Also, sort coordinates of the row by columns in descending order.
|
[] |
def get_row(lst, x):
"""
You are given a 2 dimensional data, as a nested lists,
which is similar to matrix, however, unlike matrices,
each row may contain a different number of columns.
Given lst, and integer x, find integers x in the list,
and return list of tuples, [(x1, y1), (x2, y2) ...] such that
each tuple is a coordinate - (row, columns), starting with 0.
Sort coordinates initially by rows in ascending order.
Also, sort coordinates of the row by columns in descending order.
"""
coords = [(i, j) for i in range(len(lst)) for j in range(len(lst[i])) if lst[i][j] == x]
return sorted(sorted(coords, key=lambda x: x[1], reverse=True),
|
[
[
"[], 1",
"[]"
],
[
"[[], [1], [1, 2, 3]], 3",
"[(2, 2)]"
]
] |
RandomSpanInfilling/HumanEval/87/8
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
get_row
|
[
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,1,6],\n [1,2,3,4,5,1]\n ], 1",
"[(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]"
],
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6]\n ], 2",
"[(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1)]"
],
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,1,3,4,5,6],\n [1,2,1,4,5,6],\n [1,2,3,1,5,6],\n [1,2,3,4,1,6],\n [1,2,3,4,5,1]\n ], 1",
"[(0, 0), (1, 0), (2, 1), (2, 0), (3, 2), (3, 0), (4, 3), (4, 0), (5, 4), (5, 0), (6, 5), (6, 0)]"
],
[
"[], 1",
"[]"
],
[
"[[1]], 2",
"[]"
],
[
"[[], [1], [1, 2, 3]], 3",
"[(2, 2)]"
]
] |
[] |
return sorted(sorted(coords, key=lambda x: x[1], reverse=True)
|
, key=lambda x: x[0])
|
python
|
You are given a 2 dimensional data, as a nested lists,
which is similar to matrix, however, unlike matrices,
each row may contain a different number of columns.
Given lst, and integer x, find integers x in the list,
and return list of tuples, [(x1, y1), (x2, y2) ...] such that
each tuple is a coordinate - (row, columns), starting with 0.
Sort coordinates initially by rows in ascending order.
Also, sort coordinates of the row by columns in descending order.
|
[] |
def get_row(lst, x):
"""
You are given a 2 dimensional data, as a nested lists,
which is similar to matrix, however, unlike matrices,
each row may contain a different number of columns.
Given lst, and integer x, find integers x in the list,
and return list of tuples, [(x1, y1), (x2, y2) ...] such that
each tuple is a coordinate - (row, columns), starting with 0.
Sort coordinates initially by rows in ascending order.
Also, sort coordinates of the row by columns in descending order.
"""
coords = [(i, j) for i in range(len(lst)) for j in range(len(lst[i])) if lst[i][j] == x]
|
[
[
"[], 1",
"[]"
],
[
"[[], [1], [1, 2, 3]], 3",
"[(2, 2)]"
]
] |
RandomSpanInfilling/HumanEval/87/9
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
get_row
|
[
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,1,6],\n [1,2,3,4,5,1]\n ], 1",
"[(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]"
],
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,2,3,4,5,6]\n ], 2",
"[(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1)]"
],
[
"[\n [1,2,3,4,5,6],\n [1,2,3,4,5,6],\n [1,1,3,4,5,6],\n [1,2,1,4,5,6],\n [1,2,3,1,5,6],\n [1,2,3,4,1,6],\n [1,2,3,4,5,1]\n ], 1",
"[(0, 0), (1, 0), (2, 1), (2, 0), (3, 2), (3, 0), (4, 3), (4, 0), (5, 4), (5, 0), (6, 5), (6, 0)]"
],
[
"[], 1",
"[]"
],
[
"[[1]], 2",
"[]"
],
[
"[[], [1], [1, 2, 3]], 3",
"[(2, 2)]"
]
] |
[] |
coords = [(i, j) for i in ra
|
nge(len(lst)) for j in range(len(lst[i])) if lst[i][j] == x]
return sorted(sorted(coords, key=lambda x: x[1], reverse=True), key=lambda x: x[0])
|
python
|
You are given a 2 dimensional data, as a nested lists,
which is similar to matrix, however, unlike matrices,
each row may contain a different number of columns.
Given lst, and integer x, find integers x in the list,
and return list of tuples, [(x1, y1), (x2, y2) ...] such that
each tuple is a coordinate - (row, columns), starting with 0.
Sort coordinates initially by rows in ascending order.
Also, sort coordinates of the row by columns in descending order.
|
[] |
def get_row(lst, x):
"""
You are given a 2 dimensional data, as a nested lists,
which is similar to matrix, however, unlike matrices,
each row may contain a different number of columns.
Given lst, and integer x, find integers x in the list,
and return list of tuples, [(x1, y1), (x2, y2) ...] such that
each tuple is a coordinate - (row, columns), starting with 0.
Sort coordinates initially by rows in ascending order.
Also, sort coordinates of the row by columns in descending order.
"""
|
[
[
"[], 1",
"[]"
],
[
"[[], [1], [1, 2, 3]], 3",
"[(2, 2)]"
]
] |
RandomSpanInfilling/HumanEval/87/10
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
get_row
|
[
[
"[]",
"[]"
],
[
"[5]",
"[5]"
],
[
"[2, 4, 3, 0, 1, 5]",
"[0, 1, 2, 3, 4, 5]"
],
[
"[2, 4, 3, 0, 1, 5, 6]",
"[6, 5, 4, 3, 2, 1, 0]"
],
[
"[2, 1]",
"[1, 2]"
],
[
"[15, 42, 87, 32 ,11, 0]",
"[0, 11, 15, 32, 42, 87]"
],
[
"[21, 14, 23, 11]",
"[23, 21, 14, 11]"
]
] |
[] |
= 0 else sorted(array, reverse= (array[0]+array
|
[-1]) % 2 == 0)
|
python
|
Given an array of non-negative integers, return a copy of the given array after sorting,
you will sort the given array in ascending order if the sum( first index value, last index value) is odd,
or sort it in descending order if the sum( first index value, last index value) is even.
Note:
* don't change the given array.
|
[] |
def sort_array(array):
"""
Given an array of non-negative integers, return a copy of the given array after sorting,
you will sort the given array in ascending order if the sum( first index value, last index value) is odd,
or sort it in descending order if the sum( first index value, last index value) is even.
Note:
* don't change the given array.
"""
return [] if len(array) =
|
[
[
"[]",
"[]"
],
[
"[5]",
"[5]"
],
[
"[2, 4, 3, 0, 1, 5]",
"[0, 1, 2, 3, 4, 5]"
],
[
"[2, 4, 3, 0, 1, 5, 6]",
"[6, 5, 4, 3, 2, 1, 0]"
]
] |
RandomSpanInfilling/HumanEval/88/1
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
sort_array
|
[
[
"[]",
"[]"
],
[
"[5]",
"[5]"
],
[
"[2, 4, 3, 0, 1, 5]",
"[0, 1, 2, 3, 4, 5]"
],
[
"[2, 4, 3, 0, 1, 5, 6]",
"[6, 5, 4, 3, 2, 1, 0]"
],
[
"[2, 1]",
"[1, 2]"
],
[
"[15, 42, 87, 32 ,11, 0]",
"[0, 11, 15, 32, 42, 87]"
],
[
"[21, 14, 23, 11]",
"[23, 21, 14, 11]"
]
] |
[] |
else sorted(array, reverse= (array[0]+array
|
[-1]) % 2 == 0)
|
python
|
Given an array of non-negative integers, return a copy of the given array after sorting,
you will sort the given array in ascending order if the sum( first index value, last index value) is odd,
or sort it in descending order if the sum( first index value, last index value) is even.
Note:
* don't change the given array.
|
[] |
def sort_array(array):
"""
Given an array of non-negative integers, return a copy of the given array after sorting,
you will sort the given array in ascending order if the sum( first index value, last index value) is odd,
or sort it in descending order if the sum( first index value, last index value) is even.
Note:
* don't change the given array.
"""
return [] if len(array) == 0
|
[
[
"[]",
"[]"
],
[
"[5]",
"[5]"
],
[
"[2, 4, 3, 0, 1, 5]",
"[0, 1, 2, 3, 4, 5]"
],
[
"[2, 4, 3, 0, 1, 5, 6]",
"[6, 5, 4, 3, 2, 1, 0]"
]
] |
RandomSpanInfilling/HumanEval/88/2
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
sort_array
|
[
[
"[]",
"[]"
],
[
"[5]",
"[5]"
],
[
"[2, 4, 3, 0, 1, 5]",
"[0, 1, 2, 3, 4, 5]"
],
[
"[2, 4, 3, 0, 1, 5, 6]",
"[6, 5, 4, 3, 2, 1, 0]"
],
[
"[2, 1]",
"[1, 2]"
],
[
"[15, 42, 87, 32 ,11, 0]",
"[0, 11, 15, 32, 42, 87]"
],
[
"[21, 14, 23, 11]",
"[23, 21, 14, 11]"
]
] |
[] |
arra
|
y) == 0 else sorted(array, reverse= (array[0]+array[-1]) % 2 == 0)
|
python
|
Given an array of non-negative integers, return a copy of the given array after sorting,
you will sort the given array in ascending order if the sum( first index value, last index value) is odd,
or sort it in descending order if the sum( first index value, last index value) is even.
Note:
* don't change the given array.
|
[] |
def sort_array(array):
"""
Given an array of non-negative integers, return a copy of the given array after sorting,
you will sort the given array in ascending order if the sum( first index value, last index value) is odd,
or sort it in descending order if the sum( first index value, last index value) is even.
Note:
* don't change the given array.
"""
return [] if len(
|
[
[
"[]",
"[]"
],
[
"[5]",
"[5]"
],
[
"[2, 4, 3, 0, 1, 5]",
"[0, 1, 2, 3, 4, 5]"
],
[
"[2, 4, 3, 0, 1, 5, 6]",
"[6, 5, 4, 3, 2, 1, 0]"
]
] |
RandomSpanInfilling/HumanEval/88/3
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
sort_array
|
[
[
"[]",
"[]"
],
[
"[5]",
"[5]"
],
[
"[2, 4, 3, 0, 1, 5]",
"[0, 1, 2, 3, 4, 5]"
],
[
"[2, 4, 3, 0, 1, 5, 6]",
"[6, 5, 4, 3, 2, 1, 0]"
],
[
"[2, 1]",
"[1, 2]"
],
[
"[15, 42, 87, 32 ,11, 0]",
"[0, 11, 15, 32, 42, 87]"
],
[
"[21, 14, 23, 11]",
"[23, 21, 14, 11]"
]
] |
[] |
sorted(array, reverse= (arr
|
ay[0]+array[-1]) % 2 == 0)
|
python
|
Given an array of non-negative integers, return a copy of the given array after sorting,
you will sort the given array in ascending order if the sum( first index value, last index value) is odd,
or sort it in descending order if the sum( first index value, last index value) is even.
Note:
* don't change the given array.
|
[] |
def sort_array(array):
"""
Given an array of non-negative integers, return a copy of the given array after sorting,
you will sort the given array in ascending order if the sum( first index value, last index value) is odd,
or sort it in descending order if the sum( first index value, last index value) is even.
Note:
* don't change the given array.
"""
return [] if len(array) == 0 else
|
[
[
"[]",
"[]"
],
[
"[5]",
"[5]"
],
[
"[2, 4, 3, 0, 1, 5]",
"[0, 1, 2, 3, 4, 5]"
],
[
"[2, 4, 3, 0, 1, 5, 6]",
"[6, 5, 4, 3, 2, 1, 0]"
]
] |
RandomSpanInfilling/HumanEval/88/4
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
sort_array
|
[
[
"[]",
"[]"
],
[
"[5]",
"[5]"
],
[
"[2, 4, 3, 0, 1, 5]",
"[0, 1, 2, 3, 4, 5]"
],
[
"[2, 4, 3, 0, 1, 5, 6]",
"[6, 5, 4, 3, 2, 1, 0]"
],
[
"[2, 1]",
"[1, 2]"
],
[
"[15, 42, 87, 32 ,11, 0]",
"[0, 11, 15, 32, 42, 87]"
],
[
"[21, 14, 23, 11]",
"[23, 21, 14, 11]"
]
] |
[] |
array, reverse= (array[0]+array[-1]) % 2 ==
|
0)
|
python
|
Given an array of non-negative integers, return a copy of the given array after sorting,
you will sort the given array in ascending order if the sum( first index value, last index value) is odd,
or sort it in descending order if the sum( first index value, last index value) is even.
Note:
* don't change the given array.
|
[] |
def sort_array(array):
"""
Given an array of non-negative integers, return a copy of the given array after sorting,
you will sort the given array in ascending order if the sum( first index value, last index value) is odd,
or sort it in descending order if the sum( first index value, last index value) is even.
Note:
* don't change the given array.
"""
return [] if len(array) == 0 else sorted(
|
[
[
"[]",
"[]"
],
[
"[5]",
"[5]"
],
[
"[2, 4, 3, 0, 1, 5]",
"[0, 1, 2, 3, 4, 5]"
],
[
"[2, 4, 3, 0, 1, 5, 6]",
"[6, 5, 4, 3, 2, 1, 0]"
]
] |
RandomSpanInfilling/HumanEval/88/5
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
sort_array
|
[
[
"[]",
"[]"
],
[
"[5]",
"[5]"
],
[
"[2, 4, 3, 0, 1, 5]",
"[0, 1, 2, 3, 4, 5]"
],
[
"[2, 4, 3, 0, 1, 5, 6]",
"[6, 5, 4, 3, 2, 1, 0]"
],
[
"[2, 1]",
"[1, 2]"
],
[
"[15, 42, 87, 32 ,11, 0]",
"[0, 11, 15, 32, 42, 87]"
],
[
"[21, 14, 23, 11]",
"[23, 21, 14, 11]"
]
] |
[] |
if len(array) == 0 else sorte
|
d(array, reverse= (array[0]+array[-1]) % 2 == 0)
|
python
|
Given an array of non-negative integers, return a copy of the given array after sorting,
you will sort the given array in ascending order if the sum( first index value, last index value) is odd,
or sort it in descending order if the sum( first index value, last index value) is even.
Note:
* don't change the given array.
|
[] |
def sort_array(array):
"""
Given an array of non-negative integers, return a copy of the given array after sorting,
you will sort the given array in ascending order if the sum( first index value, last index value) is odd,
or sort it in descending order if the sum( first index value, last index value) is even.
Note:
* don't change the given array.
"""
return []
|
[
[
"[]",
"[]"
],
[
"[5]",
"[5]"
],
[
"[2, 4, 3, 0, 1, 5]",
"[0, 1, 2, 3, 4, 5]"
],
[
"[2, 4, 3, 0, 1, 5, 6]",
"[6, 5, 4, 3, 2, 1, 0]"
]
] |
RandomSpanInfilling/HumanEval/88/6
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
sort_array
|
[
[
"[]",
"[]"
],
[
"[5]",
"[5]"
],
[
"[2, 4, 3, 0, 1, 5]",
"[0, 1, 2, 3, 4, 5]"
],
[
"[2, 4, 3, 0, 1, 5, 6]",
"[6, 5, 4, 3, 2, 1, 0]"
],
[
"[2, 1]",
"[1, 2]"
],
[
"[15, 42, 87, 32 ,11, 0]",
"[0, 11, 15, 32, 42, 87]"
],
[
"[21, 14, 23, 11]",
"[23, 21, 14, 11]"
]
] |
[] |
ay, reverse= (array[0]+arr
|
ay[-1]) % 2 == 0)
|
python
|
Given an array of non-negative integers, return a copy of the given array after sorting,
you will sort the given array in ascending order if the sum( first index value, last index value) is odd,
or sort it in descending order if the sum( first index value, last index value) is even.
Note:
* don't change the given array.
|
[] |
def sort_array(array):
"""
Given an array of non-negative integers, return a copy of the given array after sorting,
you will sort the given array in ascending order if the sum( first index value, last index value) is odd,
or sort it in descending order if the sum( first index value, last index value) is even.
Note:
* don't change the given array.
"""
return [] if len(array) == 0 else sorted(arr
|
[
[
"[]",
"[]"
],
[
"[5]",
"[5]"
],
[
"[2, 4, 3, 0, 1, 5]",
"[0, 1, 2, 3, 4, 5]"
],
[
"[2, 4, 3, 0, 1, 5, 6]",
"[6, 5, 4, 3, 2, 1, 0]"
]
] |
RandomSpanInfilling/HumanEval/88/7
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
sort_array
|
[
[
"[]",
"[]"
],
[
"[5]",
"[5]"
],
[
"[2, 4, 3, 0, 1, 5]",
"[0, 1, 2, 3, 4, 5]"
],
[
"[2, 4, 3, 0, 1, 5, 6]",
"[6, 5, 4, 3, 2, 1, 0]"
],
[
"[2, 1]",
"[1, 2]"
],
[
"[15, 42, 87, 32 ,11, 0]",
"[0, 11, 15, 32, 42, 87]"
],
[
"[21, 14, 23, 11]",
"[23, 21, 14, 11]"
]
] |
[] |
(arra
|
y[0]+array[-1]) % 2 == 0)
|
python
|
Given an array of non-negative integers, return a copy of the given array after sorting,
you will sort the given array in ascending order if the sum( first index value, last index value) is odd,
or sort it in descending order if the sum( first index value, last index value) is even.
Note:
* don't change the given array.
|
[] |
def sort_array(array):
"""
Given an array of non-negative integers, return a copy of the given array after sorting,
you will sort the given array in ascending order if the sum( first index value, last index value) is odd,
or sort it in descending order if the sum( first index value, last index value) is even.
Note:
* don't change the given array.
"""
return [] if len(array) == 0 else sorted(array, reverse=
|
[
[
"[]",
"[]"
],
[
"[5]",
"[5]"
],
[
"[2, 4, 3, 0, 1, 5]",
"[0, 1, 2, 3, 4, 5]"
],
[
"[2, 4, 3, 0, 1, 5, 6]",
"[6, 5, 4, 3, 2, 1, 0]"
]
] |
RandomSpanInfilling/HumanEval/88/8
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
sort_array
|
[
[
"[]",
"[]"
],
[
"[5]",
"[5]"
],
[
"[2, 4, 3, 0, 1, 5]",
"[0, 1, 2, 3, 4, 5]"
],
[
"[2, 4, 3, 0, 1, 5, 6]",
"[6, 5, 4, 3, 2, 1, 0]"
],
[
"[2, 1]",
"[1, 2]"
],
[
"[15, 42, 87, 32 ,11, 0]",
"[0, 11, 15, 32, 42, 87]"
],
[
"[21, 14, 23, 11]",
"[23, 21, 14, 11]"
]
] |
[] |
etu
|
rn [] if len(array) == 0 else sorted(array, reverse= (array[0]+array[-1]) % 2 == 0)
|
python
|
Given an array of non-negative integers, return a copy of the given array after sorting,
you will sort the given array in ascending order if the sum( first index value, last index value) is odd,
or sort it in descending order if the sum( first index value, last index value) is even.
Note:
* don't change the given array.
|
[] |
def sort_array(array):
"""
Given an array of non-negative integers, return a copy of the given array after sorting,
you will sort the given array in ascending order if the sum( first index value, last index value) is odd,
or sort it in descending order if the sum( first index value, last index value) is even.
Note:
* don't change the given array.
"""
r
|
[
[
"[]",
"[]"
],
[
"[5]",
"[5]"
],
[
"[2, 4, 3, 0, 1, 5]",
"[0, 1, 2, 3, 4, 5]"
],
[
"[2, 4, 3, 0, 1, 5, 6]",
"[6, 5, 4, 3, 2, 1, 0]"
]
] |
RandomSpanInfilling/HumanEval/88/9
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
sort_array
|
[
[
"[]",
"[]"
],
[
"[5]",
"[5]"
],
[
"[2, 4, 3, 0, 1, 5]",
"[0, 1, 2, 3, 4, 5]"
],
[
"[2, 4, 3, 0, 1, 5, 6]",
"[6, 5, 4, 3, 2, 1, 0]"
],
[
"[2, 1]",
"[1, 2]"
],
[
"[15, 42, 87, 32 ,11, 0]",
"[0, 11, 15, 32, 42, 87]"
],
[
"[21, 14, 23, 11]",
"[23, 21, 14, 11]"
]
] |
[] |
eturn [] if len(array) == 0 else sorted(array, reverse= (array[0]+a
|
rray[-1]) % 2 == 0)
|
python
|
Given an array of non-negative integers, return a copy of the given array after sorting,
you will sort the given array in ascending order if the sum( first index value, last index value) is odd,
or sort it in descending order if the sum( first index value, last index value) is even.
Note:
* don't change the given array.
|
[] |
def sort_array(array):
"""
Given an array of non-negative integers, return a copy of the given array after sorting,
you will sort the given array in ascending order if the sum( first index value, last index value) is odd,
or sort it in descending order if the sum( first index value, last index value) is even.
Note:
* don't change the given array.
"""
r
|
[
[
"[]",
"[]"
],
[
"[5]",
"[5]"
],
[
"[2, 4, 3, 0, 1, 5]",
"[0, 1, 2, 3, 4, 5]"
],
[
"[2, 4, 3, 0, 1, 5, 6]",
"[6, 5, 4, 3, 2, 1, 0]"
]
] |
RandomSpanInfilling/HumanEval/88/10
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
sort_array
|
[
[
"'hi'",
"'lm'"
],
[
"'asdfghjkl'",
"'ewhjklnop'"
],
[
"'gf'",
"'kj'"
],
[
"'et'",
"'ix'"
],
[
"'faewfawefaewg'",
"'jeiajeaijeiak'"
],
[
"'hellomyfriend'",
"'lippsqcjvmirh'"
],
[
"'dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh'",
"'hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl'"
],
[
"'a'",
"'e'"
]
] |
[] |
= d[(d.index(c)+2*2) % 26]
else:
out
|
+= c
return out
|
python
|
Create a function encrypt that takes a string as an argument and
returns a string encrypted with the alphabet being rotated.
The alphabet should be rotated in a manner such that the letters
shift down by two multiplied to two places.
|
[] |
def encrypt(s):
"""Create a function encrypt that takes a string as an argument and
returns a string encrypted with the alphabet being rotated.
The alphabet should be rotated in a manner such that the letters
shift down by two multiplied to two places.
"""
d = 'abcdefghijklmnopqrstuvwxyz'
out = ''
for c in s:
if c in d:
out +
|
[
[
"'hi'",
"'lm'"
],
[
"'asdfghjkl'",
"'ewhjklnop'"
],
[
"'gf'",
"'kj'"
],
[
"'et'",
"'ix'"
]
] |
RandomSpanInfilling/HumanEval/89/1
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
encrypt
|
[
[
"'hi'",
"'lm'"
],
[
"'asdfghjkl'",
"'ewhjklnop'"
],
[
"'gf'",
"'kj'"
],
[
"'et'",
"'ix'"
],
[
"'faewfawefaewg'",
"'jeiajeaijeiak'"
],
[
"'hellomyfriend'",
"'lippsqcjvmirh'"
],
[
"'dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh'",
"'hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl'"
],
[
"'a'",
"'e'"
]
] |
[] |
out = ''
for c in s:
if c in d:
out += d[(d.inde
|
x(c)+2*2) % 26]
else:
out += c
return out
|
python
|
Create a function encrypt that takes a string as an argument and
returns a string encrypted with the alphabet being rotated.
The alphabet should be rotated in a manner such that the letters
shift down by two multiplied to two places.
|
[] |
def encrypt(s):
"""Create a function encrypt that takes a string as an argument and
returns a string encrypted with the alphabet being rotated.
The alphabet should be rotated in a manner such that the letters
shift down by two multiplied to two places.
"""
d = 'abcdefghijklmnopqrstuvwxyz'
|
[
[
"'hi'",
"'lm'"
],
[
"'asdfghjkl'",
"'ewhjklnop'"
],
[
"'gf'",
"'kj'"
],
[
"'et'",
"'ix'"
]
] |
RandomSpanInfilling/HumanEval/89/2
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
encrypt
|
[
[
"'hi'",
"'lm'"
],
[
"'asdfghjkl'",
"'ewhjklnop'"
],
[
"'gf'",
"'kj'"
],
[
"'et'",
"'ix'"
],
[
"'faewfawefaewg'",
"'jeiajeaijeiak'"
],
[
"'hellomyfriend'",
"'lippsqcjvmirh'"
],
[
"'dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh'",
"'hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl'"
],
[
"'a'",
"'e'"
]
] |
[] |
'abcdefghijklmnopqrstuvwxyz'
out = ''
for c in s:
|
if c in d:
out += d[(d.index(c)+2*2) % 26]
else:
out += c
return out
|
python
|
Create a function encrypt that takes a string as an argument and
returns a string encrypted with the alphabet being rotated.
The alphabet should be rotated in a manner such that the letters
shift down by two multiplied to two places.
|
[] |
def encrypt(s):
"""Create a function encrypt that takes a string as an argument and
returns a string encrypted with the alphabet being rotated.
The alphabet should be rotated in a manner such that the letters
shift down by two multiplied to two places.
"""
d =
|
[
[
"'hi'",
"'lm'"
],
[
"'asdfghjkl'",
"'ewhjklnop'"
],
[
"'gf'",
"'kj'"
],
[
"'et'",
"'ix'"
]
] |
RandomSpanInfilling/HumanEval/89/3
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
encrypt
|
[
[
"'hi'",
"'lm'"
],
[
"'asdfghjkl'",
"'ewhjklnop'"
],
[
"'gf'",
"'kj'"
],
[
"'et'",
"'ix'"
],
[
"'faewfawefaewg'",
"'jeiajeaijeiak'"
],
[
"'hellomyfriend'",
"'lippsqcjvmirh'"
],
[
"'dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh'",
"'hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl'"
],
[
"'a'",
"'e'"
]
] |
[] |
out += d[(d.index(c)+2*2) % 26]
else:
out += c
return ou
|
t
|
python
|
Create a function encrypt that takes a string as an argument and
returns a string encrypted with the alphabet being rotated.
The alphabet should be rotated in a manner such that the letters
shift down by two multiplied to two places.
|
[] |
def encrypt(s):
"""Create a function encrypt that takes a string as an argument and
returns a string encrypted with the alphabet being rotated.
The alphabet should be rotated in a manner such that the letters
shift down by two multiplied to two places.
"""
d = 'abcdefghijklmnopqrstuvwxyz'
out = ''
for c in s:
if c in d:
|
[
[
"'hi'",
"'lm'"
],
[
"'asdfghjkl'",
"'ewhjklnop'"
],
[
"'gf'",
"'kj'"
],
[
"'et'",
"'ix'"
]
] |
RandomSpanInfilling/HumanEval/89/4
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
encrypt
|
[
[
"'hi'",
"'lm'"
],
[
"'asdfghjkl'",
"'ewhjklnop'"
],
[
"'gf'",
"'kj'"
],
[
"'et'",
"'ix'"
],
[
"'faewfawefaewg'",
"'jeiajeaijeiak'"
],
[
"'hellomyfriend'",
"'lippsqcjvmirh'"
],
[
"'dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh'",
"'hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl'"
],
[
"'a'",
"'e'"
]
] |
[] |
n s:
if c in d
|
:
out += d[(d.index(c)+2*2) % 26]
else:
out += c
return out
|
python
|
Create a function encrypt that takes a string as an argument and
returns a string encrypted with the alphabet being rotated.
The alphabet should be rotated in a manner such that the letters
shift down by two multiplied to two places.
|
[] |
def encrypt(s):
"""Create a function encrypt that takes a string as an argument and
returns a string encrypted with the alphabet being rotated.
The alphabet should be rotated in a manner such that the letters
shift down by two multiplied to two places.
"""
d = 'abcdefghijklmnopqrstuvwxyz'
out = ''
for c i
|
[
[
"'hi'",
"'lm'"
],
[
"'asdfghjkl'",
"'ewhjklnop'"
],
[
"'gf'",
"'kj'"
],
[
"'et'",
"'ix'"
]
] |
RandomSpanInfilling/HumanEval/89/5
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
encrypt
|
[
[
"'hi'",
"'lm'"
],
[
"'asdfghjkl'",
"'ewhjklnop'"
],
[
"'gf'",
"'kj'"
],
[
"'et'",
"'ix'"
],
[
"'faewfawefaewg'",
"'jeiajeaijeiak'"
],
[
"'hellomyfriend'",
"'lippsqcjvmirh'"
],
[
"'dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh'",
"'hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl'"
],
[
"'a'",
"'e'"
]
] |
[] |
n s:
if c in d:
out += d[(d.i
|
ndex(c)+2*2) % 26]
else:
out += c
return out
|
python
|
Create a function encrypt that takes a string as an argument and
returns a string encrypted with the alphabet being rotated.
The alphabet should be rotated in a manner such that the letters
shift down by two multiplied to two places.
|
[] |
def encrypt(s):
"""Create a function encrypt that takes a string as an argument and
returns a string encrypted with the alphabet being rotated.
The alphabet should be rotated in a manner such that the letters
shift down by two multiplied to two places.
"""
d = 'abcdefghijklmnopqrstuvwxyz'
out = ''
for c i
|
[
[
"'hi'",
"'lm'"
],
[
"'asdfghjkl'",
"'ewhjklnop'"
],
[
"'gf'",
"'kj'"
],
[
"'et'",
"'ix'"
]
] |
RandomSpanInfilling/HumanEval/89/6
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
encrypt
|
[
[
"'hi'",
"'lm'"
],
[
"'asdfghjkl'",
"'ewhjklnop'"
],
[
"'gf'",
"'kj'"
],
[
"'et'",
"'ix'"
],
[
"'faewfawefaewg'",
"'jeiajeaijeiak'"
],
[
"'hellomyfriend'",
"'lippsqcjvmirh'"
],
[
"'dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh'",
"'hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl'"
],
[
"'a'",
"'e'"
]
] |
[] |
= 'abcdefghijklmnopqrstuvwxyz'
out = ''
for c in s:
if c in d:
out += d[(d.index(c)+2*2) % 2
|
6]
else:
out += c
return out
|
python
|
Create a function encrypt that takes a string as an argument and
returns a string encrypted with the alphabet being rotated.
The alphabet should be rotated in a manner such that the letters
shift down by two multiplied to two places.
|
[] |
def encrypt(s):
"""Create a function encrypt that takes a string as an argument and
returns a string encrypted with the alphabet being rotated.
The alphabet should be rotated in a manner such that the letters
shift down by two multiplied to two places.
"""
d
|
[
[
"'hi'",
"'lm'"
],
[
"'asdfghjkl'",
"'ewhjklnop'"
],
[
"'gf'",
"'kj'"
],
[
"'et'",
"'ix'"
]
] |
RandomSpanInfilling/HumanEval/89/7
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
encrypt
|
[
[
"'hi'",
"'lm'"
],
[
"'asdfghjkl'",
"'ewhjklnop'"
],
[
"'gf'",
"'kj'"
],
[
"'et'",
"'ix'"
],
[
"'faewfawefaewg'",
"'jeiajeaijeiak'"
],
[
"'hellomyfriend'",
"'lippsqcjvmirh'"
],
[
"'dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh'",
"'hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl'"
],
[
"'a'",
"'e'"
]
] |
[] |
:
out += d[(d.index(c)+2*2) % 26]
|
else:
out += c
return out
|
python
|
Create a function encrypt that takes a string as an argument and
returns a string encrypted with the alphabet being rotated.
The alphabet should be rotated in a manner such that the letters
shift down by two multiplied to two places.
|
[] |
def encrypt(s):
"""Create a function encrypt that takes a string as an argument and
returns a string encrypted with the alphabet being rotated.
The alphabet should be rotated in a manner such that the letters
shift down by two multiplied to two places.
"""
d = 'abcdefghijklmnopqrstuvwxyz'
out = ''
for c in s:
if c in d
|
[
[
"'hi'",
"'lm'"
],
[
"'asdfghjkl'",
"'ewhjklnop'"
],
[
"'gf'",
"'kj'"
],
[
"'et'",
"'ix'"
]
] |
RandomSpanInfilling/HumanEval/89/8
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
encrypt
|
[
[
"'hi'",
"'lm'"
],
[
"'asdfghjkl'",
"'ewhjklnop'"
],
[
"'gf'",
"'kj'"
],
[
"'et'",
"'ix'"
],
[
"'faewfawefaewg'",
"'jeiajeaijeiak'"
],
[
"'hellomyfriend'",
"'lippsqcjvmirh'"
],
[
"'dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh'",
"'hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl'"
],
[
"'a'",
"'e'"
]
] |
[] |
c in s:
if c in d:
out += d[(d.index(c)+2*2) % 26]
|
else:
out += c
return out
|
python
|
Create a function encrypt that takes a string as an argument and
returns a string encrypted with the alphabet being rotated.
The alphabet should be rotated in a manner such that the letters
shift down by two multiplied to two places.
|
[] |
def encrypt(s):
"""Create a function encrypt that takes a string as an argument and
returns a string encrypted with the alphabet being rotated.
The alphabet should be rotated in a manner such that the letters
shift down by two multiplied to two places.
"""
d = 'abcdefghijklmnopqrstuvwxyz'
out = ''
for
|
[
[
"'hi'",
"'lm'"
],
[
"'asdfghjkl'",
"'ewhjklnop'"
],
[
"'gf'",
"'kj'"
],
[
"'et'",
"'ix'"
]
] |
RandomSpanInfilling/HumanEval/89/9
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
encrypt
|
[
[
"'hi'",
"'lm'"
],
[
"'asdfghjkl'",
"'ewhjklnop'"
],
[
"'gf'",
"'kj'"
],
[
"'et'",
"'ix'"
],
[
"'faewfawefaewg'",
"'jeiajeaijeiak'"
],
[
"'hellomyfriend'",
"'lippsqcjvmirh'"
],
[
"'dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh'",
"'hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl'"
],
[
"'a'",
"'e'"
]
] |
[] |
mnopqrstuvwxyz'
out = ''
for c in s:
if c in d:
out += d[(d.index(c)+2*2) % 26]
else:
|
out += c
return out
|
python
|
Create a function encrypt that takes a string as an argument and
returns a string encrypted with the alphabet being rotated.
The alphabet should be rotated in a manner such that the letters
shift down by two multiplied to two places.
|
[] |
def encrypt(s):
"""Create a function encrypt that takes a string as an argument and
returns a string encrypted with the alphabet being rotated.
The alphabet should be rotated in a manner such that the letters
shift down by two multiplied to two places.
"""
d = 'abcdefghijkl
|
[
[
"'hi'",
"'lm'"
],
[
"'asdfghjkl'",
"'ewhjklnop'"
],
[
"'gf'",
"'kj'"
],
[
"'et'",
"'ix'"
]
] |
RandomSpanInfilling/HumanEval/89/10
|
python
|
code_infilling
|
HumanEval_RandomSpanInfilling
|
encrypt
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.