prefix
stringlengths 65
1.8k
| suffix
stringclasses 839
values | solution
stringlengths 6
859
| test_cases
listlengths 0
100
| import_str
listlengths 0
1
| demos
listlengths 0
8
| entry_func
stringclasses 158
values | data_id
stringlengths 36
40
| doc_string
stringclasses 164
values | dataset_name
stringclasses 1
value | task_name
stringclasses 1
value | compare_func
listlengths 0
0
| src_lang
stringclasses 1
value | tgt_lang
stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
def hex_key(num):
"""You have been tasked to write a function that receives
a hexadecimal number as a string and counts the number of hexadecimal
digits that are primes (prime number, or a prime, is a natural number
greater than 1 that is not a product of two smaller natural numbers).
Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.
Prime numbers are 2, 3, 5, 7, 11, 13, 17,...
So you have to determine a number of the following digits: 2, 3, 5, 7,
B (=decimal 11), D (=decimal 13).
Note: you may assume the input is always correct or empty string,
and symbols A,B,C,D,E,F are always uppercase.
"""
primes = ('2', '3', '5', '7', 'B', 'D')
total = 0
for i in range(0, len(num)):
if num[i] in primes:
|
total += 1
return total
|
[
[
"\"AB\"",
"1"
],
[
"\"1077E\"",
"2"
],
[
"\"ABED1A33\"",
"4"
],
[
"\"2020\"",
"2"
],
[
"\"123456789ABCDEF0\"",
"6"
],
[
"\"112233445566778899AABBCCDDEEFF00\"",
"12"
],
[
"[]",
"0"
]
] |
[] |
[
[
"\"AB\"",
"1"
],
[
"\"1077E\"",
"2"
],
[
"\"ABED1A33\"",
"4"
],
[
"\"123456789ABCDEF0\"",
"6"
],
[
"\"2020\"",
"2"
]
] |
hex_key
|
MultiLineInfilling/HumanEval/78/L4_L5
|
You have been tasked to write a function that receives
a hexadecimal number as a string and counts the number of hexadecimal
digits that are primes (prime number, or a prime, is a natural number
greater than 1 that is not a product of two smaller natural numbers).
Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.
Prime numbers are 2, 3, 5, 7, 11, 13, 17,...
So you have to determine a number of the following digits: 2, 3, 5, 7,
B (=decimal 11), D (=decimal 13).
Note: you may assume the input is always correct or empty string,
and symbols A,B,C,D,E,F are always uppercase.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
def hex_key(num):
"""You have been tasked to write a function that receives
a hexadecimal number as a string and counts the number of hexadecimal
digits that are primes (prime number, or a prime, is a natural number
greater than 1 that is not a product of two smaller natural numbers).
Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.
Prime numbers are 2, 3, 5, 7, 11, 13, 17,...
So you have to determine a number of the following digits: 2, 3, 5, 7,
B (=decimal 11), D (=decimal 13).
Note: you may assume the input is always correct or empty string,
and symbols A,B,C,D,E,F are always uppercase.
"""
primes = ('2', '3', '5', '7', 'B', 'D')
total = 0
for i in range(0, len(num)):
if num[i] in primes:
total += 1
|
return total
|
[
[
"\"AB\"",
"1"
],
[
"\"1077E\"",
"2"
],
[
"\"ABED1A33\"",
"4"
],
[
"\"2020\"",
"2"
],
[
"\"123456789ABCDEF0\"",
"6"
],
[
"\"112233445566778899AABBCCDDEEFF00\"",
"12"
],
[
"[]",
"0"
]
] |
[] |
[
[
"\"AB\"",
"1"
],
[
"\"1077E\"",
"2"
],
[
"\"ABED1A33\"",
"4"
],
[
"\"123456789ABCDEF0\"",
"6"
],
[
"\"2020\"",
"2"
]
] |
hex_key
|
MultiLineInfilling/HumanEval/78/L5_L5
|
You have been tasked to write a function that receives
a hexadecimal number as a string and counts the number of hexadecimal
digits that are primes (prime number, or a prime, is a natural number
greater than 1 that is not a product of two smaller natural numbers).
Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.
Prime numbers are 2, 3, 5, 7, 11, 13, 17,...
So you have to determine a number of the following digits: 2, 3, 5, 7,
B (=decimal 11), D (=decimal 13).
Note: you may assume the input is always correct or empty string,
and symbols A,B,C,D,E,F are always uppercase.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
def decimal_to_binary(decimal):
"""You will be given a number in decimal form and your task is to convert it to
binary format. The function should return a string, with each character representing a binary
number. Each character in the string will be '0' or '1'.
There will be an extra couple of characters 'db' at the beginning and at the end of the string.
The extra characters are there to help with the format.
"""
|
return "db" + bin(decimal)[2:] + "db"
|
[
[
"0",
"\"db0db\""
],
[
"32",
"\"db100000db\""
],
[
"103",
"\"db1100111db\""
],
[
"15",
"\"db1111db\""
]
] |
[] |
[
[
"15",
"\"db1111db\""
],
[
"32",
"\"db100000db\""
]
] |
decimal_to_binary
|
MultiLineInfilling/HumanEval/79/L0_L0
|
You will be given a number in decimal form and your task is to convert it to
binary format. The function should return a string, with each character representing a binary
number. Each character in the string will be '0' or '1'.
There will be an extra couple of characters 'db' at the beginning and at the end of the string.
The extra characters are there to help with the format.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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
"""
|
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
|
if len(s) < 3:
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
is_happy
|
MultiLineInfilling/HumanEval/80/L0_L0
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
"""
|
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
|
if len(s) < 3:
return False
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
is_happy
|
MultiLineInfilling/HumanEval/80/L0_L1
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 s[i] == s[i+1] or s[i+1] == s[i+2] or s[i] == s[i+2]:
return False
return True
|
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"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
is_happy
|
MultiLineInfilling/HumanEval/80/L0_L3
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
"""
|
return False
return True
|
if len(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]:
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
is_happy
|
MultiLineInfilling/HumanEval/80/L0_L5
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
"""
|
return True
|
if len(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
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
is_happy
|
MultiLineInfilling/HumanEval/80/L0_L6
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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[i+1] or s[i+1] == s[i+2] or s[i] == s[i+2]:
return False
return True
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
is_happy
|
MultiLineInfilling/HumanEval/80/L0_L7
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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:
|
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
|
return False
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
is_happy
|
MultiLineInfilling/HumanEval/80/L1_L1
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
if s[i] == s[i+1] or s[i+1] == s[i+2] or s[i] == s[i+2]:
return False
return True
|
return False
for i in range(len(s) - 2):
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
is_happy
|
MultiLineInfilling/HumanEval/80/L1_L3
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
return True
|
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]:
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
is_happy
|
MultiLineInfilling/HumanEval/80/L1_L5
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 True
|
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
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
is_happy
|
MultiLineInfilling/HumanEval/80/L1_L6
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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[i+1] or s[i+1] == s[i+2] or s[i] == s[i+2]:
return False
return True
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
is_happy
|
MultiLineInfilling/HumanEval/80/L1_L7
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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
|
if s[i] == s[i+1] or s[i+1] == s[i+2] or s[i] == s[i+2]:
return False
return True
|
for i in range(len(s) - 2):
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
is_happy
|
MultiLineInfilling/HumanEval/80/L3_L3
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
return False
return True
|
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]:
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
is_happy
|
MultiLineInfilling/HumanEval/80/L3_L5
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
|
return True
|
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
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
is_happy
|
MultiLineInfilling/HumanEval/80/L3_L6
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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[i+1] or s[i+1] == s[i+2] or s[i] == s[i+2]:
return False
return True
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
is_happy
|
MultiLineInfilling/HumanEval/80/L3_L7
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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):
|
return False
return True
|
if s[i] == s[i+1] or s[i+1] == s[i+2] or s[i] == s[i+2]:
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
is_happy
|
MultiLineInfilling/HumanEval/80/L5_L5
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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):
|
return True
|
if s[i] == s[i+1] or s[i+1] == s[i+2] or s[i] == s[i+2]:
return False
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
is_happy
|
MultiLineInfilling/HumanEval/80/L5_L6
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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[i+1] or s[i+1] == s[i+2] or s[i] == s[i+2]:
return False
return True
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
is_happy
|
MultiLineInfilling/HumanEval/80/L5_L7
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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[i+1] or s[i+1] == s[i+2] or s[i] == s[i+2]:
|
return True
|
return False
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
is_happy
|
MultiLineInfilling/HumanEval/80/L6_L6
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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[i+1] or s[i+1] == s[i+2] or s[i] == s[i+2]:
|
return False
return True
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
is_happy
|
MultiLineInfilling/HumanEval/80/L6_L7
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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[i+1] or s[i+1] == s[i+2] or s[i] == s[i+2]:
return False
|
return True
|
[
[
"\"a\"",
"False"
],
[
"\"aa\"",
"False"
],
[
"\"abcd\"",
"True"
],
[
"\"aabb\"",
"False"
],
[
"\"adb\"",
"True"
],
[
"\"xyy\"",
"False"
],
[
"\"iopaxpoi\"",
"True"
],
[
"\"iopaxioi\"",
"False"
]
] |
[] |
[
[
"a",
"False"
],
[
"aa",
"False"
],
[
"abcd",
"True"
],
[
"aabb",
"False"
],
[
"adb",
"True"
],
[
"xyy",
"False"
]
] |
is_happy
|
MultiLineInfilling/HumanEval/80/L7_L7
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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
"""
|
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
|
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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L2
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
"""
|
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
|
letter_grade = []
for gpa in grades:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L3
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.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
|
letter_grade = []
for gpa in grades:
if gpa == 4.0:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L4
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
"""
|
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
|
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-']"
],
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L5
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.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
|
letter_grade = []
for gpa in grades:
if gpa == 4.0:
letter_grade.append("A+")
elif gpa > 3.7:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L6
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
"""
|
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
|
letter_grade = []
for gpa in grades:
if gpa == 4.0:
letter_grade.append("A+")
elif gpa > 3.7:
letter_grade.append("A")
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L7
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.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
|
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-']"
],
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L8
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
"""
|
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
|
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-']"
],
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L9
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.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
|
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-']"
],
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L10
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
"""
|
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
|
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+")
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L11
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.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
|
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:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L12
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
"""
|
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
|
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")
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L13
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.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
|
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:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L14
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
"""
|
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
|
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-")
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L15
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.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
|
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:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L16
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
"""
|
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
|
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-']"
],
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L17
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.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
|
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+")
elif gpa > 1.7:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L18
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
"""
|
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
|
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+")
elif gpa > 1.7:
letter_grade.append("C")
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L19
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.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
|
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+")
elif gpa > 1.7:
letter_grade.append("C")
elif gpa > 1.3:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L20
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
"""
|
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
|
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+")
elif gpa > 1.7:
letter_grade.append("C")
elif gpa > 1.3:
letter_grade.append("C-")
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L21
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.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
|
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+")
elif gpa > 1.7:
letter_grade.append("C")
elif gpa > 1.3:
letter_grade.append("C-")
elif gpa > 1.0:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L22
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
"""
|
elif gpa > 0.7:
letter_grade.append("D")
elif gpa > 0.0:
letter_grade.append("D-")
else:
letter_grade.append("E")
return letter_grade
|
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+")
elif gpa > 1.7:
letter_grade.append("C")
elif gpa > 1.3:
letter_grade.append("C-")
elif gpa > 1.0:
letter_grade.append("D+")
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L23
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.append("D")
elif gpa > 0.0:
letter_grade.append("D-")
else:
letter_grade.append("E")
return letter_grade
|
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+")
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:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L24
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
"""
|
elif gpa > 0.0:
letter_grade.append("D-")
else:
letter_grade.append("E")
return letter_grade
|
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+")
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")
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L25
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.append("D-")
else:
letter_grade.append("E")
return letter_grade
|
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+")
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:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L26
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
"""
|
else:
letter_grade.append("E")
return letter_grade
|
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+")
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-")
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L27
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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.append("E")
return letter_grade
|
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+")
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:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L28
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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
"""
|
return letter_grade
|
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+")
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")
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L29
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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+")
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
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L2_L30
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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 = []
|
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
|
for gpa in grades:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L3
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = []
|
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
|
for gpa in grades:
if gpa == 4.0:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L4
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = []
|
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
|
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-']"
],
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L5
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = []
|
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
|
for gpa in grades:
if gpa == 4.0:
letter_grade.append("A+")
elif gpa > 3.7:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L6
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = []
|
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
|
for gpa in grades:
if gpa == 4.0:
letter_grade.append("A+")
elif gpa > 3.7:
letter_grade.append("A")
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L7
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = []
|
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
|
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-']"
],
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L8
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = []
|
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
|
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-']"
],
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L9
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = []
|
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
|
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-']"
],
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L10
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = []
|
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
|
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+")
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L11
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = []
|
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
|
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:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L12
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = []
|
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
|
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")
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L13
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = []
|
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
|
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:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L14
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = []
|
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
|
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-")
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L15
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = []
|
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
|
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:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L16
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = []
|
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
|
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-']"
],
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L17
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = []
|
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
|
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:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L18
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = []
|
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
|
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")
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L19
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = []
|
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
|
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:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L20
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = []
|
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
|
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-")
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L21
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = []
|
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
|
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:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L22
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = []
|
elif gpa > 0.7:
letter_grade.append("D")
elif gpa > 0.0:
letter_grade.append("D-")
else:
letter_grade.append("E")
return 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+")
elif gpa > 1.7:
letter_grade.append("C")
elif gpa > 1.3:
letter_grade.append("C-")
elif gpa > 1.0:
letter_grade.append("D+")
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L23
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = []
|
letter_grade.append("D")
elif gpa > 0.0:
letter_grade.append("D-")
else:
letter_grade.append("E")
return 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+")
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:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L24
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = []
|
elif gpa > 0.0:
letter_grade.append("D-")
else:
letter_grade.append("E")
return 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+")
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")
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L25
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = []
|
letter_grade.append("D-")
else:
letter_grade.append("E")
return 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+")
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:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L26
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = []
|
else:
letter_grade.append("E")
return 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+")
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-")
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L27
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = []
|
letter_grade.append("E")
return 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+")
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:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L28
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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 = []
|
return 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+")
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")
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L29
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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+")
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
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L3_L30
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
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:
|
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
|
if gpa == 4.0:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L4_L4
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
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
|
if gpa == 4.0:
letter_grade.append("A+")
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L4_L5
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
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
|
if gpa == 4.0:
letter_grade.append("A+")
elif gpa > 3.7:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L4_L6
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
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
|
if gpa == 4.0:
letter_grade.append("A+")
elif gpa > 3.7:
letter_grade.append("A")
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L4_L7
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
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
|
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-']"
],
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L4_L8
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
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
|
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-']"
],
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L4_L9
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
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
|
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-']"
],
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L4_L10
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
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
|
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+")
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L4_L11
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
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
|
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:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L4_L12
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
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
|
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")
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L4_L13
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
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
|
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:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L4_L14
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
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
|
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-")
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L4_L15
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
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
|
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:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L4_L16
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
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
|
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-']"
],
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L4_L17
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
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
|
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:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L4_L18
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
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
|
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")
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L4_L19
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
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
|
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:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L4_L20
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
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
|
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-")
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L4_L21
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
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:
|
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
|
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:
|
[
[
"[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-']"
]
] |
[] |
[
[
"[4.0, 3, 1.7, 2, 3.5]",
"> ['A+', 'B', 'C-', 'C', 'A-']"
]
] |
numerical_letter_grade
|
MultiLineInfilling/HumanEval/81/L4_L22
|
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
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.