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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
"""
running_max = None
result = []
|
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
return result
|
for n in numbers:
if running_max is None:
|
[
[
"[]",
"[]"
],
[
"[1, 2, 3, 4]",
"[1, 2, 3, 4]"
],
[
"[4, 3, 2, 1]",
"[4, 4, 4, 4]"
],
[
"[3, 2, 3, 100, 3]",
"[3, 3, 3, 100, 100]"
]
] |
[
"from typing import List, Tuple"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L3_L4
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
"""
running_max = None
result = []
|
else:
running_max = max(running_max, n)
result.append(running_max)
return result
|
for n in numbers:
if running_max is None:
running_max = n
|
[
[
"[]",
"[]"
],
[
"[1, 2, 3, 4]",
"[1, 2, 3, 4]"
],
[
"[4, 3, 2, 1]",
"[4, 4, 4, 4]"
],
[
"[3, 2, 3, 100, 3]",
"[3, 3, 3, 100, 100]"
]
] |
[
"from typing import List, Tuple"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L3_L5
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
"""
running_max = None
result = []
|
running_max = max(running_max, n)
result.append(running_max)
return result
|
for n in numbers:
if running_max is None:
running_max = n
else:
|
[
[
"[]",
"[]"
],
[
"[1, 2, 3, 4]",
"[1, 2, 3, 4]"
],
[
"[4, 3, 2, 1]",
"[4, 4, 4, 4]"
],
[
"[3, 2, 3, 100, 3]",
"[3, 3, 3, 100, 100]"
]
] |
[
"from typing import List, Tuple"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L3_L6
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
"""
running_max = None
result = []
|
result.append(running_max)
return result
|
for n in numbers:
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
|
[
[
"[]",
"[]"
],
[
"[1, 2, 3, 4]",
"[1, 2, 3, 4]"
],
[
"[4, 3, 2, 1]",
"[4, 4, 4, 4]"
],
[
"[3, 2, 3, 100, 3]",
"[3, 3, 3, 100, 100]"
]
] |
[
"from typing import List, Tuple"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L3_L7
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
"""
running_max = None
result = []
|
return result
|
for n in numbers:
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
|
[
[
"[]",
"[]"
],
[
"[1, 2, 3, 4]",
"[1, 2, 3, 4]"
],
[
"[4, 3, 2, 1]",
"[4, 4, 4, 4]"
],
[
"[3, 2, 3, 100, 3]",
"[3, 3, 3, 100, 100]"
]
] |
[
"from typing import List, Tuple"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L3_L9
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
"""
running_max = None
result = []
|
for n in numbers:
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
return result
|
[
[
"[]",
"[]"
],
[
"[1, 2, 3, 4]",
"[1, 2, 3, 4]"
],
[
"[4, 3, 2, 1]",
"[4, 4, 4, 4]"
],
[
"[3, 2, 3, 100, 3]",
"[3, 3, 3, 100, 100]"
]
] |
[
"from typing import List, Tuple"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L3_L11
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
"""
running_max = None
result = []
for n in numbers:
|
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
return result
|
if running_max is None:
|
[
[
"[]",
"[]"
],
[
"[1, 2, 3, 4]",
"[1, 2, 3, 4]"
],
[
"[4, 3, 2, 1]",
"[4, 4, 4, 4]"
],
[
"[3, 2, 3, 100, 3]",
"[3, 3, 3, 100, 100]"
]
] |
[
"from typing import List, Tuple"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L4_L4
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
"""
running_max = None
result = []
for n in numbers:
|
else:
running_max = max(running_max, n)
result.append(running_max)
return result
|
if running_max is None:
running_max = n
|
[
[
"[]",
"[]"
],
[
"[1, 2, 3, 4]",
"[1, 2, 3, 4]"
],
[
"[4, 3, 2, 1]",
"[4, 4, 4, 4]"
],
[
"[3, 2, 3, 100, 3]",
"[3, 3, 3, 100, 100]"
]
] |
[
"from typing import List, Tuple"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L4_L5
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
"""
running_max = None
result = []
for n in numbers:
|
running_max = max(running_max, n)
result.append(running_max)
return result
|
if running_max is None:
running_max = n
else:
|
[
[
"[]",
"[]"
],
[
"[1, 2, 3, 4]",
"[1, 2, 3, 4]"
],
[
"[4, 3, 2, 1]",
"[4, 4, 4, 4]"
],
[
"[3, 2, 3, 100, 3]",
"[3, 3, 3, 100, 100]"
]
] |
[
"from typing import List, Tuple"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L4_L6
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
"""
running_max = None
result = []
for n in numbers:
|
result.append(running_max)
return result
|
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
|
[
[
"[]",
"[]"
],
[
"[1, 2, 3, 4]",
"[1, 2, 3, 4]"
],
[
"[4, 3, 2, 1]",
"[4, 4, 4, 4]"
],
[
"[3, 2, 3, 100, 3]",
"[3, 3, 3, 100, 100]"
]
] |
[
"from typing import List, Tuple"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L4_L7
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
"""
running_max = None
result = []
for n in numbers:
|
return result
|
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
|
[
[
"[]",
"[]"
],
[
"[1, 2, 3, 4]",
"[1, 2, 3, 4]"
],
[
"[4, 3, 2, 1]",
"[4, 4, 4, 4]"
],
[
"[3, 2, 3, 100, 3]",
"[3, 3, 3, 100, 100]"
]
] |
[
"from typing import List, Tuple"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L4_L9
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
"""
running_max = None
result = []
for n in numbers:
|
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
return result
|
[
[
"[]",
"[]"
],
[
"[1, 2, 3, 4]",
"[1, 2, 3, 4]"
],
[
"[4, 3, 2, 1]",
"[4, 4, 4, 4]"
],
[
"[3, 2, 3, 100, 3]",
"[3, 3, 3, 100, 100]"
]
] |
[
"from typing import List, Tuple"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L4_L11
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
"""
running_max = None
result = []
for n in numbers:
if running_max is None:
|
else:
running_max = max(running_max, n)
result.append(running_max)
return result
|
running_max = n
|
[
[
"[]",
"[]"
],
[
"[1, 2, 3, 4]",
"[1, 2, 3, 4]"
],
[
"[4, 3, 2, 1]",
"[4, 4, 4, 4]"
],
[
"[3, 2, 3, 100, 3]",
"[3, 3, 3, 100, 100]"
]
] |
[
"from typing import List, Tuple"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L5_L5
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
"""
running_max = None
result = []
for n in numbers:
if running_max is None:
|
running_max = max(running_max, n)
result.append(running_max)
return result
|
running_max = n
else:
|
[
[
"[]",
"[]"
],
[
"[1, 2, 3, 4]",
"[1, 2, 3, 4]"
],
[
"[4, 3, 2, 1]",
"[4, 4, 4, 4]"
],
[
"[3, 2, 3, 100, 3]",
"[3, 3, 3, 100, 100]"
]
] |
[
"from typing import List, Tuple"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L5_L6
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
"""
running_max = None
result = []
for n in numbers:
if running_max is None:
|
result.append(running_max)
return result
|
running_max = n
else:
running_max = max(running_max, n)
|
[
[
"[]",
"[]"
],
[
"[1, 2, 3, 4]",
"[1, 2, 3, 4]"
],
[
"[4, 3, 2, 1]",
"[4, 4, 4, 4]"
],
[
"[3, 2, 3, 100, 3]",
"[3, 3, 3, 100, 100]"
]
] |
[
"from typing import List, Tuple"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L5_L7
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
"""
running_max = None
result = []
for n in numbers:
if running_max is None:
|
return result
|
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
|
[
[
"[]",
"[]"
],
[
"[1, 2, 3, 4]",
"[1, 2, 3, 4]"
],
[
"[4, 3, 2, 1]",
"[4, 4, 4, 4]"
],
[
"[3, 2, 3, 100, 3]",
"[3, 3, 3, 100, 100]"
]
] |
[
"from typing import List, Tuple"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L5_L9
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
"""
running_max = None
result = []
for n in numbers:
if running_max is None:
|
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
return result
|
[
[
"[]",
"[]"
],
[
"[1, 2, 3, 4]",
"[1, 2, 3, 4]"
],
[
"[4, 3, 2, 1]",
"[4, 4, 4, 4]"
],
[
"[3, 2, 3, 100, 3]",
"[3, 3, 3, 100, 100]"
]
] |
[
"from typing import List, Tuple"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L5_L11
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
"""
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
|
running_max = max(running_max, n)
result.append(running_max)
return result
|
else:
|
[
[
"[]",
"[]"
],
[
"[1, 2, 3, 4]",
"[1, 2, 3, 4]"
],
[
"[4, 3, 2, 1]",
"[4, 4, 4, 4]"
],
[
"[3, 2, 3, 100, 3]",
"[3, 3, 3, 100, 100]"
]
] |
[
"from typing import List, Tuple"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L6_L6
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
"""
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
|
result.append(running_max)
return result
|
else:
running_max = max(running_max, n)
|
[
[
"[]",
"[]"
],
[
"[1, 2, 3, 4]",
"[1, 2, 3, 4]"
],
[
"[4, 3, 2, 1]",
"[4, 4, 4, 4]"
],
[
"[3, 2, 3, 100, 3]",
"[3, 3, 3, 100, 100]"
]
] |
[
"from typing import List, Tuple"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L6_L7
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
"""
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
|
return result
|
else:
running_max = max(running_max, n)
result.append(running_max)
|
[
[
"[]",
"[]"
],
[
"[1, 2, 3, 4]",
"[1, 2, 3, 4]"
],
[
"[4, 3, 2, 1]",
"[4, 4, 4, 4]"
],
[
"[3, 2, 3, 100, 3]",
"[3, 3, 3, 100, 100]"
]
] |
[
"from typing import List, Tuple"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L6_L9
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
"""
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
|
else:
running_max = max(running_max, n)
result.append(running_max)
return result
|
[
[
"[]",
"[]"
],
[
"[1, 2, 3, 4]",
"[1, 2, 3, 4]"
],
[
"[4, 3, 2, 1]",
"[4, 4, 4, 4]"
],
[
"[3, 2, 3, 100, 3]",
"[3, 3, 3, 100, 100]"
]
] |
[
"from typing import List, Tuple"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L6_L11
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
"""
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
|
result.append(running_max)
return result
|
running_max = max(running_max, n)
|
[
[
"[]",
"[]"
],
[
"[1, 2, 3, 4]",
"[1, 2, 3, 4]"
],
[
"[4, 3, 2, 1]",
"[4, 4, 4, 4]"
],
[
"[3, 2, 3, 100, 3]",
"[3, 3, 3, 100, 100]"
]
] |
[
"from typing import List, Tuple"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L7_L7
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
"""
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
|
return result
|
running_max = max(running_max, n)
result.append(running_max)
|
[
[
"[]",
"[]"
],
[
"[1, 2, 3, 4]",
"[1, 2, 3, 4]"
],
[
"[4, 3, 2, 1]",
"[4, 4, 4, 4]"
],
[
"[3, 2, 3, 100, 3]",
"[3, 3, 3, 100, 100]"
]
] |
[
"from typing import List, Tuple"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L7_L9
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
"""
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
|
running_max = max(running_max, n)
result.append(running_max)
return result
|
[
[
"[]",
"[]"
],
[
"[1, 2, 3, 4]",
"[1, 2, 3, 4]"
],
[
"[4, 3, 2, 1]",
"[4, 4, 4, 4]"
],
[
"[3, 2, 3, 100, 3]",
"[3, 3, 3, 100, 100]"
]
] |
[
"from typing import List, Tuple"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L7_L11
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
"""
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
|
return result
|
result.append(running_max)
|
[
[
"[]",
"[]"
],
[
"[1, 2, 3, 4]",
"[1, 2, 3, 4]"
],
[
"[4, 3, 2, 1]",
"[4, 4, 4, 4]"
],
[
"[3, 2, 3, 100, 3]",
"[3, 3, 3, 100, 100]"
]
] |
[
"from typing import List, Tuple"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L9_L9
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
"""
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
|
result.append(running_max)
return result
|
[
[
"[]",
"[]"
],
[
"[1, 2, 3, 4]",
"[1, 2, 3, 4]"
],
[
"[4, 3, 2, 1]",
"[4, 4, 4, 4]"
],
[
"[3, 2, 3, 100, 3]",
"[3, 3, 3, 100, 100]"
]
] |
[
"from typing import List, Tuple"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L9_L11
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
"""
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
|
return result
|
[
[
"[]",
"[]"
],
[
"[1, 2, 3, 4]",
"[1, 2, 3, 4]"
],
[
"[4, 3, 2, 1]",
"[4, 4, 4, 4]"
],
[
"[3, 2, 3, 100, 3]",
"[3, 3, 3, 100, 100]"
]
] |
[
"from typing import List, Tuple"
] |
[
[
"[1, 2, 3, 2, 3, 4, 2]",
"[1, 2, 3, 3, 3, 4, 4]"
]
] |
rolling_max
|
MultiLineInfilling/HumanEval/9/L11_L11
|
From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
|
return ''
beginning_of_suffix = 0
while not is_palindrome(string[beginning_of_suffix:]):
beginning_of_suffix += 1
return string + string[:beginning_of_suffix][::-1]
|
if not string:
|
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] |
[] |
[
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] |
make_palindrome
|
MultiLineInfilling/HumanEval/10/L0_L0
|
Test if given string is a palindrome
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
|
beginning_of_suffix = 0
while not is_palindrome(string[beginning_of_suffix:]):
beginning_of_suffix += 1
return string + string[:beginning_of_suffix][::-1]
|
if not string:
return ''
|
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] |
[] |
[
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] |
make_palindrome
|
MultiLineInfilling/HumanEval/10/L0_L1
|
Test if given string is a palindrome
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
|
while not is_palindrome(string[beginning_of_suffix:]):
beginning_of_suffix += 1
return string + string[:beginning_of_suffix][::-1]
|
if not string:
return ''
beginning_of_suffix = 0
|
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] |
[] |
[
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] |
make_palindrome
|
MultiLineInfilling/HumanEval/10/L0_L3
|
Test if given string is a palindrome
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
|
beginning_of_suffix += 1
return string + string[:beginning_of_suffix][::-1]
|
if not string:
return ''
beginning_of_suffix = 0
while not is_palindrome(string[beginning_of_suffix:]):
|
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] |
[] |
[
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] |
make_palindrome
|
MultiLineInfilling/HumanEval/10/L0_L5
|
Test if given string is a palindrome
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
|
return string + string[:beginning_of_suffix][::-1]
|
if not string:
return ''
beginning_of_suffix = 0
while not is_palindrome(string[beginning_of_suffix:]):
beginning_of_suffix += 1
|
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] |
[] |
[
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] |
make_palindrome
|
MultiLineInfilling/HumanEval/10/L0_L6
|
Test if given string is a palindrome
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
|
if not string:
return ''
beginning_of_suffix = 0
while not is_palindrome(string[beginning_of_suffix:]):
beginning_of_suffix += 1
return string + string[:beginning_of_suffix][::-1]
|
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] |
[] |
[
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] |
make_palindrome
|
MultiLineInfilling/HumanEval/10/L0_L8
|
Test if given string is a palindrome
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
if not string:
|
beginning_of_suffix = 0
while not is_palindrome(string[beginning_of_suffix:]):
beginning_of_suffix += 1
return string + string[:beginning_of_suffix][::-1]
|
return ''
|
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] |
[] |
[
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] |
make_palindrome
|
MultiLineInfilling/HumanEval/10/L1_L1
|
Test if given string is a palindrome
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
if not string:
|
while not is_palindrome(string[beginning_of_suffix:]):
beginning_of_suffix += 1
return string + string[:beginning_of_suffix][::-1]
|
return ''
beginning_of_suffix = 0
|
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] |
[] |
[
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] |
make_palindrome
|
MultiLineInfilling/HumanEval/10/L1_L3
|
Test if given string is a palindrome
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
if not string:
|
beginning_of_suffix += 1
return string + string[:beginning_of_suffix][::-1]
|
return ''
beginning_of_suffix = 0
while not is_palindrome(string[beginning_of_suffix:]):
|
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] |
[] |
[
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] |
make_palindrome
|
MultiLineInfilling/HumanEval/10/L1_L5
|
Test if given string is a palindrome
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
if not string:
|
return string + string[:beginning_of_suffix][::-1]
|
return ''
beginning_of_suffix = 0
while not is_palindrome(string[beginning_of_suffix:]):
beginning_of_suffix += 1
|
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] |
[] |
[
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] |
make_palindrome
|
MultiLineInfilling/HumanEval/10/L1_L6
|
Test if given string is a palindrome
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
if not string:
|
return ''
beginning_of_suffix = 0
while not is_palindrome(string[beginning_of_suffix:]):
beginning_of_suffix += 1
return string + string[:beginning_of_suffix][::-1]
|
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] |
[] |
[
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] |
make_palindrome
|
MultiLineInfilling/HumanEval/10/L1_L8
|
Test if given string is a palindrome
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
if not string:
return ''
|
while not is_palindrome(string[beginning_of_suffix:]):
beginning_of_suffix += 1
return string + string[:beginning_of_suffix][::-1]
|
beginning_of_suffix = 0
|
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] |
[] |
[
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] |
make_palindrome
|
MultiLineInfilling/HumanEval/10/L3_L3
|
Test if given string is a palindrome
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
if not string:
return ''
|
beginning_of_suffix += 1
return string + string[:beginning_of_suffix][::-1]
|
beginning_of_suffix = 0
while not is_palindrome(string[beginning_of_suffix:]):
|
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] |
[] |
[
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] |
make_palindrome
|
MultiLineInfilling/HumanEval/10/L3_L5
|
Test if given string is a palindrome
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
if not string:
return ''
|
return string + string[:beginning_of_suffix][::-1]
|
beginning_of_suffix = 0
while not is_palindrome(string[beginning_of_suffix:]):
beginning_of_suffix += 1
|
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] |
[] |
[
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] |
make_palindrome
|
MultiLineInfilling/HumanEval/10/L3_L6
|
Test if given string is a palindrome
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
if not string:
return ''
|
beginning_of_suffix = 0
while not is_palindrome(string[beginning_of_suffix:]):
beginning_of_suffix += 1
return string + string[:beginning_of_suffix][::-1]
|
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] |
[] |
[
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] |
make_palindrome
|
MultiLineInfilling/HumanEval/10/L3_L8
|
Test if given string is a palindrome
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
if not string:
return ''
beginning_of_suffix = 0
|
beginning_of_suffix += 1
return string + string[:beginning_of_suffix][::-1]
|
while not is_palindrome(string[beginning_of_suffix:]):
|
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] |
[] |
[
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] |
make_palindrome
|
MultiLineInfilling/HumanEval/10/L5_L5
|
Test if given string is a palindrome
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
if not string:
return ''
beginning_of_suffix = 0
|
return string + string[:beginning_of_suffix][::-1]
|
while not is_palindrome(string[beginning_of_suffix:]):
beginning_of_suffix += 1
|
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] |
[] |
[
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] |
make_palindrome
|
MultiLineInfilling/HumanEval/10/L5_L6
|
Test if given string is a palindrome
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
if not string:
return ''
beginning_of_suffix = 0
|
while not is_palindrome(string[beginning_of_suffix:]):
beginning_of_suffix += 1
return string + string[:beginning_of_suffix][::-1]
|
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] |
[] |
[
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] |
make_palindrome
|
MultiLineInfilling/HumanEval/10/L5_L8
|
Test if given string is a palindrome
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
if not string:
return ''
beginning_of_suffix = 0
while not is_palindrome(string[beginning_of_suffix:]):
|
return string + string[:beginning_of_suffix][::-1]
|
beginning_of_suffix += 1
|
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] |
[] |
[
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] |
make_palindrome
|
MultiLineInfilling/HumanEval/10/L6_L6
|
Test if given string is a palindrome
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
if not string:
return ''
beginning_of_suffix = 0
while not is_palindrome(string[beginning_of_suffix:]):
|
beginning_of_suffix += 1
return string + string[:beginning_of_suffix][::-1]
|
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] |
[] |
[
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] |
make_palindrome
|
MultiLineInfilling/HumanEval/10/L6_L8
|
Test if given string is a palindrome
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
def is_palindrome(string: str) -> bool:
""" Test if given string is a palindrome """
return string == string[::-1]
def make_palindrome(string: str) -> str:
""" Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple:
- Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome('')
''
>>> make_palindrome('cat')
'catac'
>>> make_palindrome('cata')
'catac'
"""
if not string:
return ''
beginning_of_suffix = 0
while not is_palindrome(string[beginning_of_suffix:]):
beginning_of_suffix += 1
|
return string + string[:beginning_of_suffix][::-1]
|
[
[
"''",
"''"
],
[
"'x'",
"'x'"
],
[
"'xyz'",
"'xyzyx'"
],
[
"'xyx'",
"'xyx'"
],
[
"'jerry'",
"'jerryrrej'"
]
] |
[] |
[
[
"''",
"''"
],
[
"'cat'",
"'catac'"
],
[
"'cata'",
"'catac'"
]
] |
make_palindrome
|
MultiLineInfilling/HumanEval/10/L8_L8
|
Test if given string is a palindrome
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
|
if i == j:
return '0'
else:
return '1'
return ''.join(xor(x, y) for x, y in zip(a, b))
|
def xor(i, j):
|
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] |
[
"from typing import List"
] |
[
[
"'010', '110'",
"'100'"
]
] |
string_xor
|
MultiLineInfilling/HumanEval/11/L0_L0
|
Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
|
return '0'
else:
return '1'
return ''.join(xor(x, y) for x, y in zip(a, b))
|
def xor(i, j):
if i == j:
|
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] |
[
"from typing import List"
] |
[
[
"'010', '110'",
"'100'"
]
] |
string_xor
|
MultiLineInfilling/HumanEval/11/L0_L1
|
Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
|
else:
return '1'
return ''.join(xor(x, y) for x, y in zip(a, b))
|
def xor(i, j):
if i == j:
return '0'
|
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] |
[
"from typing import List"
] |
[
[
"'010', '110'",
"'100'"
]
] |
string_xor
|
MultiLineInfilling/HumanEval/11/L0_L2
|
Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
|
return '1'
return ''.join(xor(x, y) for x, y in zip(a, b))
|
def xor(i, j):
if i == j:
return '0'
else:
|
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] |
[
"from typing import List"
] |
[
[
"'010', '110'",
"'100'"
]
] |
string_xor
|
MultiLineInfilling/HumanEval/11/L0_L3
|
Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
|
return ''.join(xor(x, y) for x, y in zip(a, b))
|
def xor(i, j):
if i == j:
return '0'
else:
return '1'
|
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] |
[
"from typing import List"
] |
[
[
"'010', '110'",
"'100'"
]
] |
string_xor
|
MultiLineInfilling/HumanEval/11/L0_L4
|
Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
|
def xor(i, j):
if i == j:
return '0'
else:
return '1'
return ''.join(xor(x, y) for x, y in zip(a, b))
|
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] |
[
"from typing import List"
] |
[
[
"'010', '110'",
"'100'"
]
] |
string_xor
|
MultiLineInfilling/HumanEval/11/L0_L6
|
Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
def xor(i, j):
|
return '0'
else:
return '1'
return ''.join(xor(x, y) for x, y in zip(a, b))
|
if i == j:
|
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] |
[
"from typing import List"
] |
[
[
"'010', '110'",
"'100'"
]
] |
string_xor
|
MultiLineInfilling/HumanEval/11/L1_L1
|
Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
def xor(i, j):
|
else:
return '1'
return ''.join(xor(x, y) for x, y in zip(a, b))
|
if i == j:
return '0'
|
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] |
[
"from typing import List"
] |
[
[
"'010', '110'",
"'100'"
]
] |
string_xor
|
MultiLineInfilling/HumanEval/11/L1_L2
|
Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
def xor(i, j):
|
return '1'
return ''.join(xor(x, y) for x, y in zip(a, b))
|
if i == j:
return '0'
else:
|
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] |
[
"from typing import List"
] |
[
[
"'010', '110'",
"'100'"
]
] |
string_xor
|
MultiLineInfilling/HumanEval/11/L1_L3
|
Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
def xor(i, j):
|
return ''.join(xor(x, y) for x, y in zip(a, b))
|
if i == j:
return '0'
else:
return '1'
|
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] |
[
"from typing import List"
] |
[
[
"'010', '110'",
"'100'"
]
] |
string_xor
|
MultiLineInfilling/HumanEval/11/L1_L4
|
Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
def xor(i, j):
|
if i == j:
return '0'
else:
return '1'
return ''.join(xor(x, y) for x, y in zip(a, b))
|
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] |
[
"from typing import List"
] |
[
[
"'010', '110'",
"'100'"
]
] |
string_xor
|
MultiLineInfilling/HumanEval/11/L1_L6
|
Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
def xor(i, j):
if i == j:
|
else:
return '1'
return ''.join(xor(x, y) for x, y in zip(a, b))
|
return '0'
|
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] |
[
"from typing import List"
] |
[
[
"'010', '110'",
"'100'"
]
] |
string_xor
|
MultiLineInfilling/HumanEval/11/L2_L2
|
Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
def xor(i, j):
if i == j:
|
return '1'
return ''.join(xor(x, y) for x, y in zip(a, b))
|
return '0'
else:
|
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] |
[
"from typing import List"
] |
[
[
"'010', '110'",
"'100'"
]
] |
string_xor
|
MultiLineInfilling/HumanEval/11/L2_L3
|
Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
def xor(i, j):
if i == j:
|
return ''.join(xor(x, y) for x, y in zip(a, b))
|
return '0'
else:
return '1'
|
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] |
[
"from typing import List"
] |
[
[
"'010', '110'",
"'100'"
]
] |
string_xor
|
MultiLineInfilling/HumanEval/11/L2_L4
|
Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
def xor(i, j):
if i == j:
|
return '0'
else:
return '1'
return ''.join(xor(x, y) for x, y in zip(a, b))
|
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] |
[
"from typing import List"
] |
[
[
"'010', '110'",
"'100'"
]
] |
string_xor
|
MultiLineInfilling/HumanEval/11/L2_L6
|
Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
def xor(i, j):
if i == j:
return '0'
|
return '1'
return ''.join(xor(x, y) for x, y in zip(a, b))
|
else:
|
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] |
[
"from typing import List"
] |
[
[
"'010', '110'",
"'100'"
]
] |
string_xor
|
MultiLineInfilling/HumanEval/11/L3_L3
|
Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
def xor(i, j):
if i == j:
return '0'
|
return ''.join(xor(x, y) for x, y in zip(a, b))
|
else:
return '1'
|
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] |
[
"from typing import List"
] |
[
[
"'010', '110'",
"'100'"
]
] |
string_xor
|
MultiLineInfilling/HumanEval/11/L3_L4
|
Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
def xor(i, j):
if i == j:
return '0'
|
else:
return '1'
return ''.join(xor(x, y) for x, y in zip(a, b))
|
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] |
[
"from typing import List"
] |
[
[
"'010', '110'",
"'100'"
]
] |
string_xor
|
MultiLineInfilling/HumanEval/11/L3_L6
|
Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
def xor(i, j):
if i == j:
return '0'
else:
|
return ''.join(xor(x, y) for x, y in zip(a, b))
|
return '1'
|
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] |
[
"from typing import List"
] |
[
[
"'010', '110'",
"'100'"
]
] |
string_xor
|
MultiLineInfilling/HumanEval/11/L4_L4
|
Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
def xor(i, j):
if i == j:
return '0'
else:
|
return '1'
return ''.join(xor(x, y) for x, y in zip(a, b))
|
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] |
[
"from typing import List"
] |
[
[
"'010', '110'",
"'100'"
]
] |
string_xor
|
MultiLineInfilling/HumanEval/11/L4_L6
|
Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def string_xor(a: str, b: str) -> str:
""" Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
"""
def xor(i, j):
if i == j:
return '0'
else:
return '1'
|
return ''.join(xor(x, y) for x, y in zip(a, b))
|
[
[
"'111000', '101010'",
"'010010'"
],
[
"'1', '1'",
"'0'"
],
[
"'0101', '0000'",
"'0101'"
]
] |
[
"from typing import List"
] |
[
[
"'010', '110'",
"'100'"
]
] |
string_xor
|
MultiLineInfilling/HumanEval/11/L6_L6
|
Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
|
return None
maxlen = max(len(x) for x in strings)
for s in strings:
if len(s) == maxlen:
return s
|
if not strings:
|
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] |
[
"from typing import List, Optional"
] |
[
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] |
longest
|
MultiLineInfilling/HumanEval/12/L0_L0
|
Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
|
maxlen = max(len(x) for x in strings)
for s in strings:
if len(s) == maxlen:
return s
|
if not strings:
return None
|
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] |
[
"from typing import List, Optional"
] |
[
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] |
longest
|
MultiLineInfilling/HumanEval/12/L0_L1
|
Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
|
for s in strings:
if len(s) == maxlen:
return s
|
if not strings:
return None
maxlen = max(len(x) for x in strings)
|
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] |
[
"from typing import List, Optional"
] |
[
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] |
longest
|
MultiLineInfilling/HumanEval/12/L0_L3
|
Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
|
if len(s) == maxlen:
return s
|
if not strings:
return None
maxlen = max(len(x) for x in strings)
for s in strings:
|
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] |
[
"from typing import List, Optional"
] |
[
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] |
longest
|
MultiLineInfilling/HumanEval/12/L0_L4
|
Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
|
return s
|
if not strings:
return None
maxlen = max(len(x) for x in strings)
for s in strings:
if len(s) == maxlen:
|
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] |
[
"from typing import List, Optional"
] |
[
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] |
longest
|
MultiLineInfilling/HumanEval/12/L0_L5
|
Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
|
if not strings:
return None
maxlen = max(len(x) for x in strings)
for s in strings:
if len(s) == maxlen:
return s
|
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] |
[
"from typing import List, Optional"
] |
[
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] |
longest
|
MultiLineInfilling/HumanEval/12/L0_L6
|
Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
if not strings:
|
maxlen = max(len(x) for x in strings)
for s in strings:
if len(s) == maxlen:
return s
|
return None
|
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] |
[
"from typing import List, Optional"
] |
[
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] |
longest
|
MultiLineInfilling/HumanEval/12/L1_L1
|
Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
if not strings:
|
for s in strings:
if len(s) == maxlen:
return s
|
return None
maxlen = max(len(x) for x in strings)
|
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] |
[
"from typing import List, Optional"
] |
[
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] |
longest
|
MultiLineInfilling/HumanEval/12/L1_L3
|
Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
if not strings:
|
if len(s) == maxlen:
return s
|
return None
maxlen = max(len(x) for x in strings)
for s in strings:
|
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] |
[
"from typing import List, Optional"
] |
[
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] |
longest
|
MultiLineInfilling/HumanEval/12/L1_L4
|
Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
if not strings:
|
return s
|
return None
maxlen = max(len(x) for x in strings)
for s in strings:
if len(s) == maxlen:
|
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] |
[
"from typing import List, Optional"
] |
[
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] |
longest
|
MultiLineInfilling/HumanEval/12/L1_L5
|
Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
if not strings:
|
return None
maxlen = max(len(x) for x in strings)
for s in strings:
if len(s) == maxlen:
return s
|
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] |
[
"from typing import List, Optional"
] |
[
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] |
longest
|
MultiLineInfilling/HumanEval/12/L1_L6
|
Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
if not strings:
return None
|
for s in strings:
if len(s) == maxlen:
return s
|
maxlen = max(len(x) for x in strings)
|
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] |
[
"from typing import List, Optional"
] |
[
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] |
longest
|
MultiLineInfilling/HumanEval/12/L3_L3
|
Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
if not strings:
return None
|
if len(s) == maxlen:
return s
|
maxlen = max(len(x) for x in strings)
for s in strings:
|
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] |
[
"from typing import List, Optional"
] |
[
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] |
longest
|
MultiLineInfilling/HumanEval/12/L3_L4
|
Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
if not strings:
return None
|
return s
|
maxlen = max(len(x) for x in strings)
for s in strings:
if len(s) == maxlen:
|
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] |
[
"from typing import List, Optional"
] |
[
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] |
longest
|
MultiLineInfilling/HumanEval/12/L3_L5
|
Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
if not strings:
return None
|
maxlen = max(len(x) for x in strings)
for s in strings:
if len(s) == maxlen:
return s
|
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] |
[
"from typing import List, Optional"
] |
[
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] |
longest
|
MultiLineInfilling/HumanEval/12/L3_L6
|
Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
if not strings:
return None
maxlen = max(len(x) for x in strings)
|
if len(s) == maxlen:
return s
|
for s in strings:
|
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] |
[
"from typing import List, Optional"
] |
[
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] |
longest
|
MultiLineInfilling/HumanEval/12/L4_L4
|
Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
if not strings:
return None
maxlen = max(len(x) for x in strings)
|
return s
|
for s in strings:
if len(s) == maxlen:
|
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] |
[
"from typing import List, Optional"
] |
[
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] |
longest
|
MultiLineInfilling/HumanEval/12/L4_L5
|
Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
if not strings:
return None
maxlen = max(len(x) for x in strings)
|
for s in strings:
if len(s) == maxlen:
return s
|
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] |
[
"from typing import List, Optional"
] |
[
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] |
longest
|
MultiLineInfilling/HumanEval/12/L4_L6
|
Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
if not strings:
return None
maxlen = max(len(x) for x in strings)
for s in strings:
|
return s
|
if len(s) == maxlen:
|
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] |
[
"from typing import List, Optional"
] |
[
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] |
longest
|
MultiLineInfilling/HumanEval/12/L5_L5
|
Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
if not strings:
return None
maxlen = max(len(x) for x in strings)
for s in strings:
|
if len(s) == maxlen:
return s
|
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] |
[
"from typing import List, Optional"
] |
[
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] |
longest
|
MultiLineInfilling/HumanEval/12/L5_L6
|
Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List, Optional
def longest(strings: List[str]) -> Optional[str]:
""" Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
"""
if not strings:
return None
maxlen = max(len(x) for x in strings)
for s in strings:
if len(s) == maxlen:
|
return s
|
[
[
"[]",
"None"
],
[
"['x', 'y', 'z']",
"'x'"
],
[
"['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']",
"'zzzz'"
]
] |
[
"from typing import List, Optional"
] |
[
[
"[]",
""
],
[
"['a', 'b', 'c']",
"'a'"
],
[
"['a', 'bb', 'ccc']",
"'ccc'"
]
] |
longest
|
MultiLineInfilling/HumanEval/12/L6_L6
|
Out of list of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input list is empty.
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
def greatest_common_divisor(a: int, b: int) -> int:
""" Return a greatest common divisor of two integers a and b
"""
|
a, b = b, a % b
return a
|
while b:
|
[
[
"3, 7",
"1"
],
[
"10, 15",
"5"
],
[
"49, 14",
"7"
],
[
"144, 60",
"12"
]
] |
[] |
[
[
"3, 5",
"1"
],
[
"25, 15",
"5"
]
] |
greatest_common_divisor
|
MultiLineInfilling/HumanEval/13/L0_L0
|
Return a greatest common divisor of two integers a and b
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
def greatest_common_divisor(a: int, b: int) -> int:
""" Return a greatest common divisor of two integers a and b
"""
|
return a
|
while b:
a, b = b, a % b
|
[
[
"3, 7",
"1"
],
[
"10, 15",
"5"
],
[
"49, 14",
"7"
],
[
"144, 60",
"12"
]
] |
[] |
[
[
"3, 5",
"1"
],
[
"25, 15",
"5"
]
] |
greatest_common_divisor
|
MultiLineInfilling/HumanEval/13/L0_L1
|
Return a greatest common divisor of two integers a and b
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
def greatest_common_divisor(a: int, b: int) -> int:
""" Return a greatest common divisor of two integers a and b
"""
|
while b:
a, b = b, a % b
return a
|
[
[
"3, 7",
"1"
],
[
"10, 15",
"5"
],
[
"49, 14",
"7"
],
[
"144, 60",
"12"
]
] |
[] |
[
[
"3, 5",
"1"
],
[
"25, 15",
"5"
]
] |
greatest_common_divisor
|
MultiLineInfilling/HumanEval/13/L0_L2
|
Return a greatest common divisor of two integers a and b
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
def greatest_common_divisor(a: int, b: int) -> int:
""" Return a greatest common divisor of two integers a and b
"""
while b:
|
return a
|
a, b = b, a % b
|
[
[
"3, 7",
"1"
],
[
"10, 15",
"5"
],
[
"49, 14",
"7"
],
[
"144, 60",
"12"
]
] |
[] |
[
[
"3, 5",
"1"
],
[
"25, 15",
"5"
]
] |
greatest_common_divisor
|
MultiLineInfilling/HumanEval/13/L1_L1
|
Return a greatest common divisor of two integers a and b
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
def greatest_common_divisor(a: int, b: int) -> int:
""" Return a greatest common divisor of two integers a and b
"""
while b:
|
a, b = b, a % b
return a
|
[
[
"3, 7",
"1"
],
[
"10, 15",
"5"
],
[
"49, 14",
"7"
],
[
"144, 60",
"12"
]
] |
[] |
[
[
"3, 5",
"1"
],
[
"25, 15",
"5"
]
] |
greatest_common_divisor
|
MultiLineInfilling/HumanEval/13/L1_L2
|
Return a greatest common divisor of two integers a and b
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
def greatest_common_divisor(a: int, b: int) -> int:
""" Return a greatest common divisor of two integers a and b
"""
while b:
a, b = b, a % b
|
return a
|
[
[
"3, 7",
"1"
],
[
"10, 15",
"5"
],
[
"49, 14",
"7"
],
[
"144, 60",
"12"
]
] |
[] |
[
[
"3, 5",
"1"
],
[
"25, 15",
"5"
]
] |
greatest_common_divisor
|
MultiLineInfilling/HumanEval/13/L2_L2
|
Return a greatest common divisor of two integers a and b
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
|
from typing import List
def all_prefixes(string: str) -> List[str]:
""" Return list of all prefixes from shortest to longest of the input string
"""
|
for i in range(len(string)):
result.append(string[:i+1])
return result
|
result = []
|
[
[
"''",
"[]"
],
[
"'asdfgh'",
"['a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh']"
],
[
"'WWW'",
"['W', 'WW', 'WWW']"
]
] |
[
"from typing import List"
] |
[
[
"'abc'",
"['a', 'ab', 'abc']"
]
] |
all_prefixes
|
MultiLineInfilling/HumanEval/14/L0_L0
|
Return list of all prefixes from shortest to longest of the input string
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def all_prefixes(string: str) -> List[str]:
""" Return list of all prefixes from shortest to longest of the input string
"""
|
result.append(string[:i+1])
return result
|
result = []
for i in range(len(string)):
|
[
[
"''",
"[]"
],
[
"'asdfgh'",
"['a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh']"
],
[
"'WWW'",
"['W', 'WW', 'WWW']"
]
] |
[
"from typing import List"
] |
[
[
"'abc'",
"['a', 'ab', 'abc']"
]
] |
all_prefixes
|
MultiLineInfilling/HumanEval/14/L0_L2
|
Return list of all prefixes from shortest to longest of the input string
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def all_prefixes(string: str) -> List[str]:
""" Return list of all prefixes from shortest to longest of the input string
"""
|
return result
|
result = []
for i in range(len(string)):
result.append(string[:i+1])
|
[
[
"''",
"[]"
],
[
"'asdfgh'",
"['a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh']"
],
[
"'WWW'",
"['W', 'WW', 'WWW']"
]
] |
[
"from typing import List"
] |
[
[
"'abc'",
"['a', 'ab', 'abc']"
]
] |
all_prefixes
|
MultiLineInfilling/HumanEval/14/L0_L3
|
Return list of all prefixes from shortest to longest of the input string
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
from typing import List
def all_prefixes(string: str) -> List[str]:
""" Return list of all prefixes from shortest to longest of the input string
"""
|
result = []
for i in range(len(string)):
result.append(string[:i+1])
return result
|
[
[
"''",
"[]"
],
[
"'asdfgh'",
"['a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh']"
],
[
"'WWW'",
"['W', 'WW', 'WWW']"
]
] |
[
"from typing import List"
] |
[
[
"'abc'",
"['a', 'ab', 'abc']"
]
] |
all_prefixes
|
MultiLineInfilling/HumanEval/14/L0_L4
|
Return list of all prefixes from shortest to longest of the input string
|
HumanEval_MultiLineInfilling
|
code_infilling
|
[] |
python
|
python
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.