idx
int64
0
160
task_id
stringlengths
15
44
prompt_complete
stringlengths
120
1.39k
prompt_chat
stringlengths
286
1.56k
function_signature
stringlengths
23
102
name
stringlengths
15
44
language
stringclasses
1 value
prompt
stringlengths
120
1.39k
doctests
stringclasses
1 value
original
stringlengths
105
134
prompt_terminology
stringclasses
1 value
tests
stringlengths
149
1.79k
stop_tokens
listlengths
4
4
100
HumanEval_118_get_closest_vowel
def get_closest_vowel(word: str) -> str: """You are given a word. Your task is to find the closest vowel that stands between two consonants from the right side of the word (case sensitive). Vowels in the beginning and ending doesn't count. Return empty string if you didn't find any vowel met the a...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python def get_closest_vowel(word: str) -> str: """You are given a word. Your task is to find the closest vowel that stands between two consonants from the r...
def get_closest_vowel(word: str) -> str:
HumanEval_118_get_closest_vowel
py
def get_closest_vowel(word: str) -> str: """You are given a word. Your task is to find the closest vowel that stands between two consonants from the right side of the word (case sensitive). Vowels in the beginning and ending doesn't count. Return empty string if you didn't find any vowel met the a...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py
reworded
def check(candidate): assert candidate('yogurt') == 'u' assert candidate('full') == 'u' assert candidate('easy') == '' assert candidate('eAsy') == '' assert candidate('ali') == '' assert candidate('bad') == 'a' assert candidate('most') == 'o' assert candidate('ab') == '' assert candi...
[ "\ndef", "\n#", "\nif", "\nclass" ]
101
HumanEval_31_is_prime
def is_prime(n: int) -> bool: """Return true if a given number is prime, and false otherwise. >>> is_prime(6) False >>> is_prime(101) True >>> is_prime(11) True >>> is_prime(13441) True >>> is_prime(61) True >>> is_prime(4) False >>> is_prime(1) False """
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python def is_prime(n: int) -> bool: """Return true if a given number is prime, and false otherwise. >>> is_prime(6) False >>> is_prime(101) True ...
def is_prime(n: int) -> bool:
HumanEval_31_is_prime
py
def is_prime(n: int) -> bool: """Return true if a given number is prime, and false otherwise. >>> is_prime(6) False >>> is_prime(101) True >>> is_prime(11) True >>> is_prime(13441) True >>> is_prime(61) True >>> is_prime(4) False >>> is_prime(1) False """
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py
reworded
def check(candidate): assert candidate(6) == False assert candidate(101) == True assert candidate(11) == True assert candidate(13441) == True assert candidate(61) == True assert candidate(4) == False assert candidate(1) == False assert candidate(5) == True assert candidate(11) == Tru...
[ "\ndef", "\n#", "\nif", "\nclass" ]
102
HumanEval_144_simplify
def simplify(x: str, n: str) -> bool: """Your task is to implement a function that will simplify the expression x * n. The function returns True if x * n evaluates to a whole number and False otherwise. Both x and n, are string representation of a fraction, and have the following format, <numerator>/<de...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python def simplify(x: str, n: str) -> bool: """Your task is to implement a function that will simplify the expression x * n. The function returns True if x *...
def simplify(x: str, n: str) -> bool:
HumanEval_144_simplify
py
def simplify(x: str, n: str) -> bool: """Your task is to implement a function that will simplify the expression x * n. The function returns True if x * n evaluates to a whole number and False otherwise. Both x and n, are string representation of a fraction, and have the following format, <numerator>/<de...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py
reworded
def check(candidate): assert candidate('1/5', '5/1') == True assert candidate('1/6', '2/1') == False assert candidate('5/1', '3/1') == True assert candidate('7/10', '10/2') == False assert candidate('2/10', '50/10') == True assert candidate('7/2', '4/2') == True assert candidate('11/6', '6/1...
[ "\ndef", "\n#", "\nif", "\nclass" ]
103
HumanEval_78_hex_key
def hex_key(num: str) -> int: """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). ...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python def hex_key(num: str) -> int: """You have been tasked to write a function that receives a hexadecimal number as a string and counts the number of hexa...
def hex_key(num: str) -> int:
HumanEval_78_hex_key
py
def hex_key(num: str) -> int: """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). ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py
reworded
def check(candidate): assert candidate('AB') == 1 assert candidate('1077E') == 2 assert candidate('ABED1A33') == 4 assert candidate('2020') == 2 assert candidate('123456789ABCDEF0') == 6 assert candidate('112233445566778899AABBCCDDEEFF00') == 12 def test_check(): check(hex_key) test_check(...
[ "\ndef", "\n#", "\nif", "\nclass" ]
104
HumanEval_143_words_in_sentence
def words_in_sentence(sentence: str) -> str: """ You are given a string representing a sentence, the sentence contains some words separated by a space, and you have to return a string that contains the words from the original sentence, whose lengths are prime numbers, the order of the words in t...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python def words_in_sentence(sentence: str) -> str: """ You are given a string representing a sentence, the sentence contains some words separated by a sp...
def words_in_sentence(sentence: str) -> str:
HumanEval_143_words_in_sentence
py
def words_in_sentence(sentence: str) -> str: """ You are given a string representing a sentence, the sentence contains some words separated by a space, and you have to return a string that contains the words from the original sentence, whose lengths are prime numbers, the order of the words in t...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py
reworded
def check(candidate): assert candidate('This is a test') == 'is' assert candidate('lets go for swimming') == 'go for' assert candidate('there is no place available here') == 'there is no place' assert candidate('Hi I am Hussein') == 'Hi am Hussein' assert candidate('go for it') == 'go for it' as...
[ "\ndef", "\n#", "\nif", "\nclass" ]
105
HumanEval_111_histogram
from typing import Dict def histogram(test: str) -> Dict[str, int]: """Given a string representing a space separated lowercase letters, return a dictionary of the letter with the most repetition and containing the corresponding count. If several letters have the same occurrence, return all of them. ...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import Dict def histogram(test: str) -> Dict[str, int]: """Given a string representing a space separated lowercase letters, return a dictionar...
def histogram(test: str) -> Dict[str, int]:
HumanEval_111_histogram
py
from typing import Dict def histogram(test: str) -> Dict[str, int]: """Given a string representing a space separated lowercase letters, return a dictionary of the letter with the most repetition and containing the corresponding count. If several letters have the same occurrence, return all of them. ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py
reworded
def check(candidate): assert candidate('a b b a') == { 'a': 2, 'b': 2 } assert candidate('a b c a b') == { 'a': 2, 'b': 2 } assert candidate('a b c d g') == { 'a': 1, 'b': 1, 'c': 1, 'd': 1, 'g': 1 } assert candidate('r t g') == { 'r': 1, 't': 1, 'g': 1 } assert candidate('b b b b a') == { 'b': 4 } ...
[ "\ndef", "\n#", "\nif", "\nclass" ]
106
HumanEval_87_get_row
from typing import List, Tuple def get_row(lst: List[List[int]], x: int) -> List[Tuple[int, int]]: """ You are given a 2 dimensional data, as a nested lists, which is similar to matrix, however, unlike matrices, each row may contain a different number of columns. Given lst, and integer x, find inte...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List, Tuple def get_row(lst: List[List[int]], x: int) -> List[Tuple[int, int]]: """ You are given a 2 dimensional data, as a nested...
def get_row(lst: List[List[int]], x: int) -> List[Tuple[int, int]]:
HumanEval_87_get_row
py
from typing import List, Tuple def get_row(lst: List[List[int]], x: int) -> List[Tuple[int, int]]: """ You are given a 2 dimensional data, as a nested lists, which is similar to matrix, however, unlike matrices, each row may contain a different number of columns. Given lst, and integer x, find inte...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py
reworded
def check(candidate): assert candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)] assert candidate([[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], 2) == [(0, 1), (1, 1), (2...
[ "\ndef", "\n#", "\nif", "\nclass" ]
107
HumanEval_123_get_odd_collatz
from typing import List def get_odd_collatz(n: int) -> List[int]: """ Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence. The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined as follows: start with any positive integer n. The...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List def get_odd_collatz(n: int) -> List[int]: """ Given a positive integer n, return a sorted list that has the odd numbers in col...
def get_odd_collatz(n: int) -> List[int]:
HumanEval_123_get_odd_collatz
py
from typing import List def get_odd_collatz(n: int) -> List[int]: """ Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence. The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined as follows: start with any positive integer n. The...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py
reworded
def check(candidate): assert candidate(14) == [1, 5, 7, 11, 13, 17] assert candidate(5) == [1, 5] assert candidate(12) == [1, 3, 5] assert candidate(1) == [1] def test_check(): check(get_odd_collatz) test_check()
[ "\ndef", "\n#", "\nif", "\nclass" ]
108
HumanEval_135_can_arrange
from typing import List def can_arrange(arr: List[int]) -> int: """Create a function which returns the largest index of an element which is not greater than or equal to the element immediately preceding it. If no such element exists then return -1. The given array will not contain duplicate values. ...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List def can_arrange(arr: List[int]) -> int: """Create a function which returns the largest index of an element which is not greate...
def can_arrange(arr: List[int]) -> int:
HumanEval_135_can_arrange
py
from typing import List def can_arrange(arr: List[int]) -> int: """Create a function which returns the largest index of an element which is not greater than or equal to the element immediately preceding it. If no such element exists then return -1. The given array will not contain duplicate values. ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py
reworded
def check(candidate): assert candidate([1, 2, 4, 3, 5]) == 3 assert candidate([1, 2, 4, 5]) == -1 assert candidate([1, 4, 2, 5, 6, 7, 8, 9, 10]) == 2 assert candidate([4, 8, 5, 7, 3]) == 4 assert candidate([]) == -1 def test_check(): check(can_arrange) test_check()
[ "\ndef", "\n#", "\nif", "\nclass" ]
109
HumanEval_19_sort_numbers
def sort_numbers(numbers: str) -> str: """ Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest >>> sort_numbers('three one...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python def sort_numbers(numbers: str) -> str: """ Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two'...
def sort_numbers(numbers: str) -> str:
HumanEval_19_sort_numbers
py
def sort_numbers(numbers: str) -> str: """ Input is a space-delimited string of numberals from 'zero' to 'nine'. Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'. Return the string with numbers sorted from smallest to largest >>> sort_numbers('three one...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py
reworded
def check(candidate): assert candidate('') == '' assert candidate('three') == 'three' assert candidate('three five nine') == 'three five nine' assert candidate('five zero four seven nine eight') == 'zero four five seven eight nine' assert candidate('six five four three two one zero') == 'zero one tw...
[ "\ndef", "\n#", "\nif", "\nclass" ]
110
HumanEval_65_circular_shift
def circular_shift(x: int, shift: int) -> str: """Circular shift the digits of the integer x, shift the digits right by shift and return the result as a string. If shift > number of digits, return digits reversed. >>> circular_shift(12, 1) '21' >>> circular_shift(12, 2) '12' """
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python def circular_shift(x: int, shift: int) -> str: """Circular shift the digits of the integer x, shift the digits right by shift and return the result as ...
def circular_shift(x: int, shift: int) -> str:
HumanEval_65_circular_shift
py
def circular_shift(x: int, shift: int) -> str: """Circular shift the digits of the integer x, shift the digits right by shift and return the result as a string. If shift > number of digits, return digits reversed. >>> circular_shift(12, 1) '21' >>> circular_shift(12, 2) '12' """
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py
reworded
def check(candidate): assert candidate(100, 2) == '001' assert candidate(12, 2) == '12' assert candidate(97, 8) == '79' assert candidate(12, 1) == '21' assert candidate(11, 101) == '11' def test_check(): check(circular_shift) test_check()
[ "\ndef", "\n#", "\nif", "\nclass" ]
111
HumanEval_142_sum_squares
from typing import List def sum_squares(lst: List[int]) -> int: """" This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3....
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List def sum_squares(lst: List[int]) -> int: """" This function will take a list of integers. For all entries in the list, the func...
def sum_squares(lst: List[int]) -> int:
HumanEval_142_sum_squares
py
from typing import List def sum_squares(lst: List[int]) -> int: """" This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3....
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py
reworded
def check(candidate): assert candidate([1, 2, 3]) == 6 assert candidate([1, 4, 9]) == 14 assert candidate([]) == 0 assert candidate([1, 1, 1, 1, 1, 1, 1, 1, 1]) == 9 assert candidate([-1, -1, -1, -1, -1, -1, -1, -1, -1]) == -3 assert candidate([0]) == 0 assert candidate([-1, -5, 2, -1, -5]) ...
[ "\ndef", "\n#", "\nif", "\nclass" ]
112
HumanEval_94_skjkasdkd
from typing import List def skjkasdkd(lst: List[int]) -> int: """You are given a list of integers. You need to find the largest prime value and return the sum of its digits. Examples: >>> skjkasdkd([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]) 10 >>> skjkasdkd([1, ...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List def skjkasdkd(lst: List[int]) -> int: """You are given a list of integers. You need to find the largest prime value and return...
def skjkasdkd(lst: List[int]) -> int:
HumanEval_94_skjkasdkd
py
from typing import List def skjkasdkd(lst: List[int]) -> int: """You are given a list of integers. You need to find the largest prime value and return the sum of its digits. Examples: >>> skjkasdkd([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]) 10 >>> skjkasdkd([1, ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py
reworded
def check(candidate): assert candidate([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]) == 10 assert candidate([1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1]) == 25 assert candidate([1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3]) == 13 assert ca...
[ "\ndef", "\n#", "\nif", "\nclass" ]
113
HumanEval_8_sum_product
from typing import List, Tuple def sum_product(numbers: List[int]) -> Tuple[int, int]: """ For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. >>> sum_product([]) (0, 1) ...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List, Tuple def sum_product(numbers: List[int]) -> Tuple[int, int]: """ For a given list of integers, return a tuple consisting of a su...
def sum_product(numbers: List[int]) -> Tuple[int, int]:
HumanEval_8_sum_product
py
from typing import List, Tuple def sum_product(numbers: List[int]) -> Tuple[int, int]: """ For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. Empty sum should be equal to 0 and empty product should be equal to 1. >>> sum_product([]) (0, 1) ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py
reworded
def check(candidate): assert candidate([]) == (0, 1) assert candidate([1, 1, 1]) == (3, 1) assert candidate([100, 0]) == (100, 0) assert candidate([3, 5, 7]) == (15, 105) assert candidate([10]) == (10, 10) def test_check(): check(sum_product) test_check()
[ "\ndef", "\n#", "\nif", "\nclass" ]
114
HumanEval_102_choose_num
def choose_num(x: int, y: int) -> int: """This function takes two positive numbers x and y and returns the biggest even integer number that is in the range [x, y] inclusive. If there's no such number, then the function should return -1. For example: >>> choose_num(12, 15) 14 >>> choose_num...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python def choose_num(x: int, y: int) -> int: """This function takes two positive numbers x and y and returns the biggest even integer number that is in the r...
def choose_num(x: int, y: int) -> int:
HumanEval_102_choose_num
py
def choose_num(x: int, y: int) -> int: """This function takes two positive numbers x and y and returns the biggest even integer number that is in the range [x, y] inclusive. If there's no such number, then the function should return -1. For example: >>> choose_num(12, 15) 14 >>> choose_num...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py
reworded
def check(candidate): assert candidate(12, 15) == 14 assert candidate(13, 12) == -1 assert candidate(33, 12354) == 12354 assert candidate(5234, 5233) == -1 assert candidate(6, 29) == 28 assert candidate(27, 10) == -1 assert candidate(7, 7) == -1 assert candidate(546, 546) == 546 def tes...
[ "\ndef", "\n#", "\nif", "\nclass" ]
115
HumanEval_136_largest_smallest_integers
from typing import List, Tuple, Optional def largest_smallest_integers(lst: List[int]) -> Tuple[Optional[int], Optional[int]]: """ Create a function that returns a tuple (a, b), where 'a' is the largest of negative integers, and 'b' is the smallest of positive integers in a list. If there is no neg...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List, Tuple, Optional def largest_smallest_integers(lst: List[int]) -> Tuple[Optional[int], Optional[int]]: """ Create a function t...
def largest_smallest_integers(lst: List[int]) -> Tuple[Optional[int], Optional[int]]:
HumanEval_136_largest_smallest_integers
py
from typing import List, Tuple, Optional def largest_smallest_integers(lst: List[int]) -> Tuple[Optional[int], Optional[int]]: """ Create a function that returns a tuple (a, b), where 'a' is the largest of negative integers, and 'b' is the smallest of positive integers in a list. If there is no neg...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py
reworded
def check(candidate): assert candidate([2, 4, 1, 3, 5, 7]) == (None, 1) assert candidate([2, 4, 1, 3, 5, 7, 0]) == (None, 1) assert candidate([1, 3, 2, 4, 5, 6, -2]) == (-2, 1) assert candidate([4, 5, 3, 6, 2, 7, -7]) == (-7, 2) assert candidate([7, 3, 8, 4, 9, 2, 5, -9]) == (-9, 2) assert candi...
[ "\ndef", "\n#", "\nif", "\nclass" ]
116
HumanEval_16_count_distinct_characters
def count_distinct_characters(string: str) -> int: """ Given a string, find out how many distinct characters (regardless of case) does it consist of >>> count_distinct_characters('xyzXYZ') 3 >>> count_distinct_characters('Jerry') 4 """
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python def count_distinct_characters(string: str) -> int: """ Given a string, find out how many distinct characters (regardless of case) does it consist of >>...
def count_distinct_characters(string: str) -> int:
HumanEval_16_count_distinct_characters
py
def count_distinct_characters(string: str) -> int: """ Given a string, find out how many distinct characters (regardless of case) does it consist of >>> count_distinct_characters('xyzXYZ') 3 >>> count_distinct_characters('Jerry') 4 """
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py
reworded
def check(candidate): assert candidate('') == 0 assert candidate('abcde') == 5 assert candidate('abcdecadeCADE') == 5 assert candidate('aaaaAAAAaaaa') == 1 assert candidate('Jerry jERRY JeRRRY') == 5 def test_check(): check(count_distinct_characters) test_check()
[ "\ndef", "\n#", "\nif", "\nclass" ]
117
HumanEval_100_make_a_pile
from typing import List def make_a_pile(n: int) -> List[int]: """ Given a positive integer n, you have to make a pile of n levels of stones. The first level has n stones. The number of stones in the next level is: - the next odd number if n is odd. - the next even number if n is even. ...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List def make_a_pile(n: int) -> List[int]: """ Given a positive integer n, you have to make a pile of n levels of stones. The f...
def make_a_pile(n: int) -> List[int]:
HumanEval_100_make_a_pile
py
from typing import List def make_a_pile(n: int) -> List[int]: """ Given a positive integer n, you have to make a pile of n levels of stones. The first level has n stones. The number of stones in the next level is: - the next odd number if n is odd. - the next even number if n is even. ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py
reworded
def check(candidate): assert candidate(3) == [3, 5, 7] assert candidate(4) == [4, 6, 8, 10] assert candidate(5) == [5, 7, 9, 11, 13] assert candidate(6) == [6, 8, 10, 12, 14, 16] assert candidate(8) == [8, 10, 12, 14, 16, 18, 20, 22] def test_check(): check(make_a_pile) test_check()
[ "\ndef", "\n#", "\nif", "\nclass" ]
118
HumanEval_128_prod_signs
from typing import List, Optional def prod_signs(arr: List[int]) -> Optional[int]: """ You are given an array arr of integers and you need to return sum of magnitudes of integers multiplied by product of all signs of each number in the array, represented by 1, -1 or 0. Note: return None for empty a...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List, Optional def prod_signs(arr: List[int]) -> Optional[int]: """ You are given an array arr of integers and you need to return ...
def prod_signs(arr: List[int]) -> Optional[int]:
HumanEval_128_prod_signs
py
from typing import List, Optional def prod_signs(arr: List[int]) -> Optional[int]: """ You are given an array arr of integers and you need to return sum of magnitudes of integers multiplied by product of all signs of each number in the array, represented by 1, -1 or 0. Note: return None for empty a...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py
reworded
def check(candidate): assert candidate([1, 2, 2, -4]) == -9 assert candidate([0, 1]) == 0 assert candidate([1, 1, 1, 2, 3, -1, 1]) == -10 assert candidate([]) == None assert candidate([2, 4, 1, 2, -1, -1, 9]) == 20 assert candidate([-1, 1, -1, 1]) == 4 assert candidate([-1, 1, 1, 1]) == -4 ...
[ "\ndef", "\n#", "\nif", "\nclass" ]
119
HumanEval_114_minSubArraySum
from typing import List def minSubArraySum(nums: List[int]) -> int: """ Given an array of integers nums, find the minimum sum of any non-empty sub-array of nums. Example >>> minSubArraySum([2, 3, 4, 1, 2, 4]) 1 >>> minSubArraySum([-1, -2, -3]) -6 """
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List def minSubArraySum(nums: List[int]) -> int: """ Given an array of integers nums, find the minimum sum of any non-empty sub-arr...
def minSubArraySum(nums: List[int]) -> int:
HumanEval_114_minSubArraySum
py
from typing import List def minSubArraySum(nums: List[int]) -> int: """ Given an array of integers nums, find the minimum sum of any non-empty sub-array of nums. Example >>> minSubArraySum([2, 3, 4, 1, 2, 4]) 1 >>> minSubArraySum([-1, -2, -3]) -6 """
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py
reworded
def check(candidate): assert candidate([2, 3, 4, 1, 2, 4]) == 1 assert candidate([-1, -2, -3]) == -6 assert candidate([-1, -2, -3, 2, -10]) == -14 assert candidate([-9999999999999999]) == -9999999999999999 assert candidate([0, 10, 20, 1000000]) == 0 assert candidate([-1, -2, -3, 10, -5]) == -6 ...
[ "\ndef", "\n#", "\nif", "\nclass" ]
120
HumanEval_15_string_sequence
def string_sequence(n: int) -> str: """ Return a string containing space-delimited numbers starting from 0 upto n inclusive. >>> string_sequence(0) '0' >>> string_sequence(5) '0 1 2 3 4 5' """
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python def string_sequence(n: int) -> str: """ Return a string containing space-delimited numbers starting from 0 upto n inclusive. >>> string_sequence(0) ...
def string_sequence(n: int) -> str:
HumanEval_15_string_sequence
py
def string_sequence(n: int) -> str: """ Return a string containing space-delimited numbers starting from 0 upto n inclusive. >>> string_sequence(0) '0' >>> string_sequence(5) '0 1 2 3 4 5' """
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py
reworded
def check(candidate): assert candidate(0) == '0' assert candidate(3) == '0 1 2 3' assert candidate(10) == '0 1 2 3 4 5 6 7 8 9 10' def test_check(): check(string_sequence) test_check()
[ "\ndef", "\n#", "\nif", "\nclass" ]
121
HumanEval_154_cycpattern_check
def cycpattern_check(a: str, b: str) -> bool: """You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word >>> cycpattern_check('abcd', 'abd') False >>> cycpattern_check('hello', 'ell') True >>> cycpattern_check('whassup', 'psus') ...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python def cycpattern_check(a: str, b: str) -> bool: """You are given 2 words. You need to return True if the second word or any of its rotations is a substring i...
def cycpattern_check(a: str, b: str) -> bool:
HumanEval_154_cycpattern_check
py
def cycpattern_check(a: str, b: str) -> bool: """You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word >>> cycpattern_check('abcd', 'abd') False >>> cycpattern_check('hello', 'ell') True >>> cycpattern_check('whassup', 'psus') ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py
reworded
def check(candidate): assert candidate('xyzw', 'xyw') == False assert candidate('yello', 'ell') == True assert candidate('whattup', 'ptut') == False assert candidate('efef', 'fee') == True assert candidate('abab', 'aabb') == False assert candidate('winemtt', 'tinem') == True def test_check(): ...
[ "\ndef", "\n#", "\nif", "\nclass" ]
122
HumanEval_57_monotonic
from typing import List def monotonic(l: List[int]) -> bool: """Return True is list elements are monotonically increasing or decreasing. >>> monotonic([1, 2, 4, 20]) True >>> monotonic([1, 20, 4, 10]) False >>> monotonic([4, 1, 0, -10]) True """
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List def monotonic(l: List[int]) -> bool: """Return True is list elements are monotonically increasing or decreasing. >>> monotonic...
def monotonic(l: List[int]) -> bool:
HumanEval_57_monotonic
py
from typing import List def monotonic(l: List[int]) -> bool: """Return True is list elements are monotonically increasing or decreasing. >>> monotonic([1, 2, 4, 20]) True >>> monotonic([1, 20, 4, 10]) False >>> monotonic([4, 1, 0, -10]) True """
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py
reworded
def check(candidate): assert candidate([1, 2, 4, 10]) == True assert candidate([1, 2, 4, 20]) == True assert candidate([1, 20, 4, 10]) == False assert candidate([4, 1, 0, -10]) == True assert candidate([4, 1, 1, 0]) == True assert candidate([1, 2, 3, 2, 5, 60]) == False assert candidate([1, ...
[ "\ndef", "\n#", "\nif", "\nclass" ]
123
HumanEval_12_longest
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. >>> longest([]) None >>> longest(['a', 'b', 'c'])...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```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 o...
def longest(strings: List[str]) -> Optional[str]:
HumanEval_12_longest
py
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. >>> longest([]) None >>> longest(['a', 'b', 'c'])...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py
reworded
def check(candidate): assert candidate([]) == None assert candidate(['x', 'y', 'z']) == 'x' assert candidate(['x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc']) == 'zzzz' def test_check(): check(longest) test_check()
[ "\ndef", "\n#", "\nif", "\nclass" ]
124
HumanEval_52_below_threshold
from typing import List def below_threshold(l: List[int], t: int) -> bool: """Return True if all numbers in the list l are below threshold t. >>> below_threshold([1, 2, 4, 10], 100) True >>> below_threshold([1, 20, 4, 10], 5) False """
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List def below_threshold(l: List[int], t: int) -> bool: """Return True if all numbers in the list l are below threshold t. >>> belo...
def below_threshold(l: List[int], t: int) -> bool:
HumanEval_52_below_threshold
py
from typing import List def below_threshold(l: List[int], t: int) -> bool: """Return True if all numbers in the list l are below threshold t. >>> below_threshold([1, 2, 4, 10], 100) True >>> below_threshold([1, 20, 4, 10], 5) False """
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py
reworded
def check(candidate): assert candidate([1, 2, 4, 10], 100) == True assert candidate([1, 20, 4, 10], 5) == False assert candidate([1, 20, 4, 10], 21) == True assert candidate([1, 20, 4, 10], 22) == True assert candidate([1, 8, 4, 10], 11) == True assert candidate([1, 8, 4, 10], 10) == False def ...
[ "\ndef", "\n#", "\nif", "\nclass" ]
125
HumanEval_75_is_multiply_prime
def is_multiply_prime(a: int) -> bool: """Write a function that returns true if the given number is the multiplication of 3 prime numbers and false otherwise. Knowing that (a) is less then 100. Example: >>> is_multiply_prime(30) True 30 = 2 * 3 * 5 """
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python def is_multiply_prime(a: int) -> bool: """Write a function that returns true if the given number is the multiplication of 3 prime numbers and false oth...
def is_multiply_prime(a: int) -> bool:
HumanEval_75_is_multiply_prime
py
def is_multiply_prime(a: int) -> bool: """Write a function that returns true if the given number is the multiplication of 3 prime numbers and false otherwise. Knowing that (a) is less then 100. Example: >>> is_multiply_prime(30) True 30 = 2 * 3 * 5 """
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py
reworded
def check(candidate): assert candidate(5) == False assert candidate(30) == True assert candidate(8) == True assert candidate(10) == False assert candidate(125) == True assert candidate(105) == True assert candidate(126) == False assert candidate(729) == False assert candidate(891) ==...
[ "\ndef", "\n#", "\nif", "\nclass" ]
126
HumanEval_30_get_positive
from typing import List def get_positive(l: List[int]) -> List[int]: """Return only positive numbers in the list. >>> get_positive([-1, 2, -4, 5, 6]) [2, 5, 6] >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) [5, 3, 2, 3, 9, 123, 1] """
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List def get_positive(l: List[int]) -> List[int]: """Return only positive numbers in the list. >>> get_positive([-1, 2, -4, 5, 6]) ...
def get_positive(l: List[int]) -> List[int]:
HumanEval_30_get_positive
py
from typing import List def get_positive(l: List[int]) -> List[int]: """Return only positive numbers in the list. >>> get_positive([-1, 2, -4, 5, 6]) [2, 5, 6] >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) [5, 3, 2, 3, 9, 123, 1] """
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py
reworded
def check(candidate): assert candidate([-1, -2, 4, 5, 6]) == [4, 5, 6] assert candidate([5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]) == [5, 3, 2, 3, 3, 9, 123, 1] assert candidate([-1, -2]) == [] assert candidate([]) == [] def test_check(): check(get_positive) test_check()
[ "\ndef", "\n#", "\nif", "\nclass" ]
127
HumanEval_33_sort_third
from typing import List def sort_third(l: List[int]) -> List[int]: """This function takes a list l and returns a list l' such that l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal to the values of the corresponding ...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List def sort_third(l: List[int]) -> List[int]: """This function takes a list l and returns a list l' such that l' is identical to ...
def sort_third(l: List[int]) -> List[int]:
HumanEval_33_sort_third
py
from typing import List def sort_third(l: List[int]) -> List[int]: """This function takes a list l and returns a list l' such that l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal to the values of the corresponding ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py
reworded
def check(candidate): assert candidate([5, 6, 3, 4, 8, 9, 2]) == [2, 6, 3, 4, 8, 9, 5] assert candidate([5, 8, 3, 4, 6, 9, 2]) == [2, 8, 3, 4, 6, 9, 5] assert candidate([5, 6, 9, 4, 8, 3, 2]) == [2, 6, 9, 4, 8, 3, 5] assert candidate([5, 6, 3, 4, 8, 9, 2, 1]) == [2, 6, 3, 4, 8, 9, 5, 1] def test_check(...
[ "\ndef", "\n#", "\nif", "\nclass" ]
128
HumanEval_6_parse_nested_parens
from typing import List def parse_nested_parens(paren_string: str) -> List[int]: """ Input to this function is a string represented multiple groups for nested parentheses separated by spaces. For each of the group, output the deepest level of nesting of parentheses. E.g. (()()) has maximum two levels of ne...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List def parse_nested_parens(paren_string: str) -> List[int]: """ Input to this function is a string represented multiple groups for ne...
def parse_nested_parens(paren_string: str) -> List[int]:
HumanEval_6_parse_nested_parens
py
from typing import List def parse_nested_parens(paren_string: str) -> List[int]: """ Input to this function is a string represented multiple groups for nested parentheses separated by spaces. For each of the group, output the deepest level of nesting of parentheses. E.g. (()()) has maximum two levels of ne...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py
reworded
def check(candidate): assert candidate('(()()) ((())) () ((())()())') == [2, 3, 1, 3] assert candidate('() (()) ((())) (((())))') == [1, 2, 3, 4] assert candidate('(()(())((())))') == [4] def test_check(): check(parse_nested_parens) test_check()
[ "\ndef", "\n#", "\nif", "\nclass" ]
129
HumanEval_45_triangle_area
def triangle_area(a: int, h: int) -> float: """Given length of a side and high return area for a triangle. >>> triangle_area(5, 3) 7.5 """
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python def triangle_area(a: int, h: int) -> float: """Given length of a side and high return area for a triangle. >>> triangle_area(5, 3) 7.5 """ ```...
def triangle_area(a: int, h: int) -> float:
HumanEval_45_triangle_area
py
def triangle_area(a: int, h: int) -> float: """Given length of a side and high return area for a triangle. >>> triangle_area(5, 3) 7.5 """
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py
reworded
def check(candidate): assert candidate(5, 3) == 7.5 assert candidate(2, 2) == 2.0 assert candidate(10, 8) == 40.0 def test_check(): check(triangle_area) test_check()
[ "\ndef", "\n#", "\nif", "\nclass" ]
130
HumanEval_97_multiply
def multiply(a: int, b: int) -> int: """Complete the function that takes two integers and returns the product of their unit digits. Assume the input is always valid. Examples: >>> multiply(148, 412) 16 >>> multiply(19, 28) 72 >>> multiply(2020, 1851) 0 >>> multiply(14, -15) ...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python def multiply(a: int, b: int) -> int: """Complete the function that takes two integers and returns the product of their unit digits. Assume the inp...
def multiply(a: int, b: int) -> int:
HumanEval_97_multiply
py
def multiply(a: int, b: int) -> int: """Complete the function that takes two integers and returns the product of their unit digits. Assume the input is always valid. Examples: >>> multiply(148, 412) 16 >>> multiply(19, 28) 72 >>> multiply(2020, 1851) 0 >>> multiply(14, -15) ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py
reworded
def check(candidate): assert candidate(148, 412) == 16 assert candidate(19, 28) == 72 assert candidate(2020, 1851) == 0 assert candidate(14, -15) == 20 assert candidate(76, 67) == 42 assert candidate(17, 27) == 49 assert candidate(0, 1) == 0 assert candidate(0, 0) == 0 def test_check():...
[ "\ndef", "\n#", "\nif", "\nclass" ]
131
HumanEval_4_mean_absolute_deviation
from typing import List def mean_absolute_deviation(numbers: List[float]) -> float: """ For a given list of input numbers, calculate Mean Absolute Deviation around the mean of this dataset. Mean Absolute Deviation is the average absolute difference between each element and a centerpoint (mean in this c...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List def mean_absolute_deviation(numbers: List[float]) -> float: """ For a given list of input numbers, calculate Mean Absolute Deviati...
def mean_absolute_deviation(numbers: List[float]) -> float:
HumanEval_4_mean_absolute_deviation
py
from typing import List def mean_absolute_deviation(numbers: List[float]) -> float: """ For a given list of input numbers, calculate Mean Absolute Deviation around the mean of this dataset. Mean Absolute Deviation is the average absolute difference between each element and a centerpoint (mean in this c...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py
reworded
def check(candidate): assert candidate([1.0, 2.0]) == 0.5 assert candidate([1.0, 2.0, 3.0, 4.0]) == 1.0 assert candidate([1.0, 2.0, 3.0, 4.0, 5.0]) == 1.2 def test_check(): check(mean_absolute_deviation) test_check()
[ "\ndef", "\n#", "\nif", "\nclass" ]
132
HumanEval_58_common
from typing import List def common(l1: List[int], l2: List[int]) -> List[int]: """Return sorted unique common elements for two lists. >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]) [1, 5, 653] >>> common([5, 3, 2, 8], [3, 2]) [2, 3] """
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List def common(l1: List[int], l2: List[int]) -> List[int]: """Return sorted unique common elements for two lists. >>> common([1, 4...
def common(l1: List[int], l2: List[int]) -> List[int]:
HumanEval_58_common
py
from typing import List def common(l1: List[int], l2: List[int]) -> List[int]: """Return sorted unique common elements for two lists. >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]) [1, 5, 653] >>> common([5, 3, 2, 8], [3, 2]) [2, 3] """
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py
reworded
def check(candidate): assert candidate([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]) == [1, 5, 653] assert candidate([5, 3, 2, 8], [3, 2]) == [2, 3] assert candidate([4, 3, 2, 8], [3, 2, 4]) == [2, 3, 4] assert candidate([4, 3, 2, 8], []) == [] def test_check(): check(common) test_check()
[ "\ndef", "\n#", "\nif", "\nclass" ]
133
HumanEval_156_int_to_mini_roman
def int_to_mini_roman(number: int) -> str: """ Given a positive integer, obtain its roman numeral equivalent as a string, and return it in lowercase. Restrictions: 1 <= num <= 1000 Examples: >>> int_to_mini_roman(19) 'xix' >>> int_to_mini_roman(152) 'clii' >>> int_to_mini_roman(...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python def int_to_mini_roman(number: int) -> str: """ Given a positive integer, obtain its roman numeral equivalent as a string, and return it in lowercas...
def int_to_mini_roman(number: int) -> str:
HumanEval_156_int_to_mini_roman
py
def int_to_mini_roman(number: int) -> str: """ Given a positive integer, obtain its roman numeral equivalent as a string, and return it in lowercase. Restrictions: 1 <= num <= 1000 Examples: >>> int_to_mini_roman(19) 'xix' >>> int_to_mini_roman(152) 'clii' >>> int_to_mini_roman(...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py
reworded
def check(candidate): assert candidate(19) == 'xix' assert candidate(152) == 'clii' assert candidate(251) == 'ccli' assert candidate(426) == 'cdxxvi' assert candidate(500) == 'd' assert candidate(1) == 'i' assert candidate(4) == 'iv' assert candidate(43) == 'xliii' assert candidate(9...
[ "\ndef", "\n#", "\nif", "\nclass" ]
134
HumanEval_67_fruit_distribution
def fruit_distribution(s: str, n: int) -> int: """ In this task, you will be given a string that represents a number of apples and oranges that are distributed in a basket of fruit this basket contains apples, oranges, and mango fruits. Given the string that represents the total number of the ora...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python def fruit_distribution(s: str, n: int) -> int: """ In this task, you will be given a string that represents a number of apples and oranges that ar...
def fruit_distribution(s: str, n: int) -> int:
HumanEval_67_fruit_distribution
py
def fruit_distribution(s: str, n: int) -> int: """ In this task, you will be given a string that represents a number of apples and oranges that are distributed in a basket of fruit this basket contains apples, oranges, and mango fruits. Given the string that represents the total number of the ora...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py
reworded
def check(candidate): assert candidate('5 apples and 6 oranges', 19) == 8 assert candidate('5 apples and 6 oranges', 21) == 10 assert candidate('0 apples and 1 oranges', 3) == 2 assert candidate('1 apples and 0 oranges', 3) == 2 assert candidate('2 apples and 3 oranges', 100) == 95 assert candid...
[ "\ndef", "\n#", "\nif", "\nclass" ]
135
HumanEval_112_reverse_delete
from typing import Tuple def reverse_delete(s: str, c: str) -> Tuple[str, bool]: """Task We are given two strings s and c, you have to deleted all the characters in s that are equal to any character in c then check if the result string is palindrome. A string is called palindrome if it reads the same b...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import Tuple def reverse_delete(s: str, c: str) -> Tuple[str, bool]: """Task We are given two strings s and c, you have to deleted all the...
def reverse_delete(s: str, c: str) -> Tuple[str, bool]:
HumanEval_112_reverse_delete
py
from typing import Tuple def reverse_delete(s: str, c: str) -> Tuple[str, bool]: """Task We are given two strings s and c, you have to deleted all the characters in s that are equal to any character in c then check if the result string is palindrome. A string is called palindrome if it reads the same b...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py
reworded
def check(candidate): assert candidate('abcde', 'ae') == ('bcd', False) assert candidate('abcdef', 'b') == ('acdef', False) assert candidate('abcdedcba', 'ab') == ('cdedc', True) assert candidate('dwik', 'w') == ('dik', False) assert candidate('a', 'a') == ('', True) assert candidate('abcdedcba'...
[ "\ndef", "\n#", "\nif", "\nclass" ]
136
HumanEval_13_greatest_common_divisor
def greatest_common_divisor(a: int, b: int) -> int: """ Return a greatest common divisor of two integers a and b >>> greatest_common_divisor(3, 5) 1 >>> greatest_common_divisor(25, 15) 5 """
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python def greatest_common_divisor(a: int, b: int) -> int: """ Return a greatest common divisor of two integers a and b >>> greatest_common_divisor(3, 5) ...
def greatest_common_divisor(a: int, b: int) -> int:
HumanEval_13_greatest_common_divisor
py
def greatest_common_divisor(a: int, b: int) -> int: """ Return a greatest common divisor of two integers a and b >>> greatest_common_divisor(3, 5) 1 >>> greatest_common_divisor(25, 15) 5 """
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py
reworded
def check(candidate): assert candidate(3, 7) == 1 assert candidate(10, 15) == 5 assert candidate(49, 14) == 7 assert candidate(144, 60) == 12 def test_check(): check(greatest_common_divisor) test_check()
[ "\ndef", "\n#", "\nif", "\nclass" ]
137
HumanEval_125_split_words
from typing import Union, List def split_words(txt: str) -> Union[List[str], int]: """ Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you should split on commas ',' if no commas exists you should return the number of lower-case letters with odd ord...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import Union, List def split_words(txt: str) -> Union[List[str], int]: """ Given a string of words, return a list of words split on whites...
def split_words(txt: str) -> Union[List[str], int]:
HumanEval_125_split_words
py
from typing import Union, List def split_words(txt: str) -> Union[List[str], int]: """ Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you should split on commas ',' if no commas exists you should return the number of lower-case letters with odd ord...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py
reworded
def check(candidate): assert candidate('Hello world!') == ['Hello', 'world!'] assert candidate('Hello,world!') == ['Hello', 'world!'] assert candidate('Hello world,!') == ['Hello', 'world,!'] assert candidate('Hello,Hello,world !') == ['Hello,Hello,world', '!'] assert candidate('abcdef') == 3 as...
[ "\ndef", "\n#", "\nif", "\nclass" ]
138
HumanEval_116_sort_array
from typing import List def sort_array(arr: List[int]) -> List[int]: """ In this Kata, you have to sort an array of non-negative integers according to number of ones in their binary representation in ascending order. For similar number of ones, sort based on decimal value. It must be implemented l...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List def sort_array(arr: List[int]) -> List[int]: """ In this Kata, you have to sort an array of non-negative integers according to...
def sort_array(arr: List[int]) -> List[int]:
HumanEval_116_sort_array
py
from typing import List def sort_array(arr: List[int]) -> List[int]: """ In this Kata, you have to sort an array of non-negative integers according to number of ones in their binary representation in ascending order. For similar number of ones, sort based on decimal value. It must be implemented l...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py
reworded
def check(candidate): assert candidate([1, 5, 2, 3, 4]) == [1, 2, 4, 3, 5] assert candidate([-2, -3, -4, -5, -6]) == [-4, -2, -6, -5, -3] assert candidate([1, 0, 2, 3, 4]) == [0, 1, 2, 4, 3] assert candidate([]) == [] assert candidate([2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]) == [2, 2, 4, 4, 3, 3, 5, 5, 5...
[ "\ndef", "\n#", "\nif", "\nclass" ]
139
HumanEval_28_concatenate
from typing import List def concatenate(strings: List[str]) -> str: """ Concatenate list of strings into a single string >>> concatenate([]) '' >>> concatenate(['a', 'b', 'c']) 'abc' """
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List def concatenate(strings: List[str]) -> str: """ Concatenate list of strings into a single string >>> concatenate([]) '' ...
def concatenate(strings: List[str]) -> str:
HumanEval_28_concatenate
py
from typing import List def concatenate(strings: List[str]) -> str: """ Concatenate list of strings into a single string >>> concatenate([]) '' >>> concatenate(['a', 'b', 'c']) 'abc' """
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py
reworded
def check(candidate): assert candidate([]) == '' assert candidate(['x', 'y', 'z']) == 'xyz' assert candidate(['x', 'y', 'z', 'w', 'k']) == 'xyzwk' def test_check(): check(concatenate) test_check()
[ "\ndef", "\n#", "\nif", "\nclass" ]
140
HumanEval_149_sorted_list_sum
from typing import List def sorted_list_sum(lst: List[str]) -> List[str]: """Write a function that accepts a list of strings as a parameter, deletes the strings that have odd lengths from it, and returns the resulted list with a sorted order, The list is always a list of strings and never an array of n...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List def sorted_list_sum(lst: List[str]) -> List[str]: """Write a function that accepts a list of strings as a parameter, deletes t...
def sorted_list_sum(lst: List[str]) -> List[str]:
HumanEval_149_sorted_list_sum
py
from typing import List def sorted_list_sum(lst: List[str]) -> List[str]: """Write a function that accepts a list of strings as a parameter, deletes the strings that have odd lengths from it, and returns the resulted list with a sorted order, The list is always a list of strings and never an array of n...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py
reworded
def check(candidate): assert candidate(['aa', 'a', 'aaa']) == ['aa'] assert candidate(['school', 'AI', 'asdf', 'b']) == ['AI', 'asdf', 'school'] assert candidate(['d', 'b', 'c', 'a']) == [] assert candidate(['d', 'dcba', 'abcd', 'a']) == ['abcd', 'dcba'] assert candidate(['AI', 'ai', 'au']) == ['AI'...
[ "\ndef", "\n#", "\nif", "\nclass" ]
141
HumanEval_7_filter_by_substring
from typing import List def filter_by_substring(strings: List[str], substring: str) -> List[str]: """ Filter an input list of strings only for ones that contain given substring >>> filter_by_substring([], 'a') [] >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a') ['abc', 'bacd', 'array']...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List def filter_by_substring(strings: List[str], substring: str) -> List[str]: """ Filter an input list of strings only for ones that c...
def filter_by_substring(strings: List[str], substring: str) -> List[str]:
HumanEval_7_filter_by_substring
py
from typing import List def filter_by_substring(strings: List[str], substring: str) -> List[str]: """ Filter an input list of strings only for ones that contain given substring >>> filter_by_substring([], 'a') [] >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a') ['abc', 'bacd', 'array']...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py
reworded
def check(candidate): assert candidate([], 'john') == [] assert candidate(['xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'], 'xxx') == ['xxx', 'xxxAAA', 'xxx'] assert candidate(['xxx', 'asd', 'aaaxxy', 'john doe', 'xxxAAA', 'xxx'], 'xx') == ['xxx', 'aaaxxy', 'xxxAAA', 'xxx'] assert candidate(['grunt', ...
[ "\ndef", "\n#", "\nif", "\nclass" ]
142
HumanEval_99_closest_integer
def closest_integer(value: str) -> int: """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer('10') 10 >>> closest_integer('15.3...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python def closest_integer(value: str) -> int: """ Create a function that takes a value (string) representing a number and returns the closest integer to ...
def closest_integer(value: str) -> int:
HumanEval_99_closest_integer
py
def closest_integer(value: str) -> int: """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer('10') 10 >>> closest_integer('15.3...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py
reworded
def check(candidate): assert candidate('10') == 10 assert candidate('14.5') == 15 assert candidate('-15.5') == -16 assert candidate('15.3') == 15 assert candidate('0') == 0 def test_check(): check(closest_integer) test_check()
[ "\ndef", "\n#", "\nif", "\nclass" ]
143
HumanEval_64_vowels_count
def vowels_count(s: str) -> int: """Write a function vowels_count which takes a string representing a word as input and returns the number of vowels in the string. Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a vowel, but only when it is at the end of the given word. Example: ...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python def vowels_count(s: str) -> int: """Write a function vowels_count which takes a string representing a word as input and returns the number of vowels in...
def vowels_count(s: str) -> int:
HumanEval_64_vowels_count
py
def vowels_count(s: str) -> int: """Write a function vowels_count which takes a string representing a word as input and returns the number of vowels in the string. Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a vowel, but only when it is at the end of the given word. Example: ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py
reworded
def check(candidate): assert candidate('abcde') == 2 assert candidate('Alone') == 3 assert candidate('key') == 2 assert candidate('bye') == 1 assert candidate('keY') == 2 assert candidate('bYe') == 1 assert candidate('ACEDY') == 3 def test_check(): check(vowels_count) test_check()
[ "\ndef", "\n#", "\nif", "\nclass" ]
144
HumanEval_158_find_max
from typing import List def find_max(words: List[str]) -> str: """Write a function that accepts a list of strings. The list contains different words. Return the word with maximum number of unique characters. If multiple strings have maximum number of unique characters, return the one which comes first ...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List def find_max(words: List[str]) -> str: """Write a function that accepts a list of strings. The list contains different words. ...
def find_max(words: List[str]) -> str:
HumanEval_158_find_max
py
from typing import List def find_max(words: List[str]) -> str: """Write a function that accepts a list of strings. The list contains different words. Return the word with maximum number of unique characters. If multiple strings have maximum number of unique characters, return the one which comes first ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py
reworded
def check(candidate): assert candidate(['name', 'of', 'string']) == 'string' assert candidate(['name', 'enam', 'game']) == 'enam' assert candidate(['aaaaaaa', 'bb', 'cc']) == 'aaaaaaa' assert candidate(['abc', 'cba']) == 'abc' assert candidate(['play', 'this', 'game', 'of', 'footbott']) == 'footbott...
[ "\ndef", "\n#", "\nif", "\nclass" ]
145
HumanEval_162_string_to_md5
from typing import Optional def string_to_md5(text: str) -> Optional[str]: """ Given a string 'text', return its md5 hash equivalent string. If 'text' is an empty string, return None. >>> string_to_md5('Hello world') '3e25960a79dbc69b674cd4ec67a72c62' """
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import Optional def string_to_md5(text: str) -> Optional[str]: """ Given a string 'text', return its md5 hash equivalent string. If 't...
def string_to_md5(text: str) -> Optional[str]:
HumanEval_162_string_to_md5
py
from typing import Optional def string_to_md5(text: str) -> Optional[str]: """ Given a string 'text', return its md5 hash equivalent string. If 'text' is an empty string, return None. >>> string_to_md5('Hello world') '3e25960a79dbc69b674cd4ec67a72c62' """
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py
reworded
def check(candidate): assert candidate('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62' assert candidate('') == None assert candidate('A B C') == '0ef78513b0cb8cef12743f5aeb35f888' assert candidate('password') == '5f4dcc3b5aa765d61d8327deb882cf99' def test_check(): check(string_to_md5) test_ch...
[ "\ndef", "\n#", "\nif", "\nclass" ]
146
HumanEval_44_change_base
def change_base(x: int, base: int) -> str: """Change numerical base of input number x to base. return string representation after the conversion. base numbers are less than 10. >>> change_base(8, 3) '22' >>> change_base(8, 2) '1000' >>> change_base(7, 2) '111' """
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python def change_base(x: int, base: int) -> str: """Change numerical base of input number x to base. return string representation after the conversion. b...
def change_base(x: int, base: int) -> str:
HumanEval_44_change_base
py
def change_base(x: int, base: int) -> str: """Change numerical base of input number x to base. return string representation after the conversion. base numbers are less than 10. >>> change_base(8, 3) '22' >>> change_base(8, 2) '1000' >>> change_base(7, 2) '111' """
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py
reworded
def check(candidate): assert candidate(8, 3) == '22' assert candidate(9, 3) == '100' assert candidate(234, 2) == '11101010' assert candidate(16, 2) == '10000' assert candidate(8, 2) == '1000' assert candidate(7, 2) == '111' assert candidate(2, 3) == '2' assert candidate(3, 4) == '3' ...
[ "\ndef", "\n#", "\nif", "\nclass" ]
147
HumanEval_157_right_angle_triangle
def right_angle_triangle(a: int, b: int, c: int) -> bool: """ Given the lengths of the three sides of a triangle. Return True if the three sides form a right-angled triangle, False otherwise. A right-angled triangle is a triangle in which one angle is right angle or 90 degree. Example: >>> ...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python def right_angle_triangle(a: int, b: int, c: int) -> bool: """ Given the lengths of the three sides of a triangle. Return True if the three sides fo...
def right_angle_triangle(a: int, b: int, c: int) -> bool:
HumanEval_157_right_angle_triangle
py
def right_angle_triangle(a: int, b: int, c: int) -> bool: """ Given the lengths of the three sides of a triangle. Return True if the three sides form a right-angled triangle, False otherwise. A right-angled triangle is a triangle in which one angle is right angle or 90 degree. Example: >>> ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py
reworded
def check(candidate): assert candidate(3, 4, 5) == True assert candidate(1, 2, 3) == False assert candidate(10, 6, 8) == True assert candidate(2, 2, 2) == False assert candidate(7, 24, 25) == True assert candidate(10, 5, 7) == False assert candidate(5, 12, 13) == True assert candidate(15...
[ "\ndef", "\n#", "\nif", "\nclass" ]
148
HumanEval_81_numerical_letter_grade
from typing import List def numerical_letter_grade(grades: List[float]) -> List[str]: """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. Sh...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List def numerical_letter_grade(grades: List[float]) -> List[str]: """It is the last week of the semester and the teacher has to give t...
def numerical_letter_grade(grades: List[float]) -> List[str]:
HumanEval_81_numerical_letter_grade
py
from typing import List def numerical_letter_grade(grades: List[float]) -> List[str]: """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. Sh...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py
reworded
def check(candidate): assert candidate([4.0, 3, 1.7, 2, 3.5]) == ['A+', 'B', 'C-', 'C', 'A-'] assert candidate([1.2]) == ['D+'] assert candidate([0.5]) == ['D-'] assert candidate([0.0]) == ['E'] assert candidate([1.0, 0.3, 1.5, 2.8, 3.3]) == ['D', 'D-', 'C-', 'B', 'B+'] assert candidate([0.0, 0....
[ "\ndef", "\n#", "\nif", "\nclass" ]
149
HumanEval_5_intersperse
from typing import List def intersperse(numbers: List[int], delimeter: int) -> List[int]: """ Insert a number 'delimeter' between every two consecutive elements of input list `numbers' >>> intersperse([], 4) [] >>> intersperse([1, 2, 3], 4) [1, 4, 2, 4, 3] """
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List def intersperse(numbers: List[int], delimeter: int) -> List[int]: """ Insert a number 'delimeter' between every two consecutive el...
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
HumanEval_5_intersperse
py
from typing import List def intersperse(numbers: List[int], delimeter: int) -> List[int]: """ Insert a number 'delimeter' between every two consecutive elements of input list `numbers' >>> intersperse([], 4) [] >>> intersperse([1, 2, 3], 4) [1, 4, 2, 4, 3] """
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py
reworded
def check(candidate): assert candidate([], 7) == [] assert candidate([5, 6, 3, 2], 8) == [5, 8, 6, 8, 3, 8, 2] assert candidate([2, 2, 2], 2) == [2, 2, 2, 2, 2] def test_check(): check(intersperse) test_check()
[ "\ndef", "\n#", "\nif", "\nclass" ]
150
HumanEval_146_specialFilter
from typing import List def specialFilter(nums: List[int]) -> int: """Write a function that takes an array of numbers as input and returns the number of elements in the array that are greater than 10 and both first and last digits of a number are odd (1, 3, 5, 7, 9). For example: >>> specialFilte...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List def specialFilter(nums: List[int]) -> int: """Write a function that takes an array of numbers as input and returns the number...
def specialFilter(nums: List[int]) -> int:
HumanEval_146_specialFilter
py
from typing import List def specialFilter(nums: List[int]) -> int: """Write a function that takes an array of numbers as input and returns the number of elements in the array that are greater than 10 and both first and last digits of a number are odd (1, 3, 5, 7, 9). For example: >>> specialFilte...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py
reworded
def check(candidate): assert candidate([5, -2, 1, -5]) == 0 assert candidate([15, -73, 14, -15]) == 1 assert candidate([33, -2, -3, 45, 21, 109]) == 2 assert candidate([43, -12, 93, 125, 121, 109]) == 4 assert candidate([71, -2, -33, 75, 21, 19]) == 3 assert candidate([1]) == 0 assert candid...
[ "\ndef", "\n#", "\nif", "\nclass" ]
151
HumanEval_60_sum_to_n
def sum_to_n(n: int) -> int: """sum_to_n is a function that sums numbers from 1 to n. >>> sum_to_n(30) 465 >>> sum_to_n(100) 5050 >>> sum_to_n(5) 15 >>> sum_to_n(10) 55 >>> sum_to_n(1) 1 """
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python def sum_to_n(n: int) -> int: """sum_to_n is a function that sums numbers from 1 to n. >>> sum_to_n(30) 465 >>> sum_to_n(100) 5050 >>> s...
def sum_to_n(n: int) -> int:
HumanEval_60_sum_to_n
py
def sum_to_n(n: int) -> int: """sum_to_n is a function that sums numbers from 1 to n. >>> sum_to_n(30) 465 >>> sum_to_n(100) 5050 >>> sum_to_n(5) 15 >>> sum_to_n(10) 55 >>> sum_to_n(1) 1 """
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py
reworded
def check(candidate): assert candidate(1) == 1 assert candidate(6) == 21 assert candidate(11) == 66 assert candidate(30) == 465 assert candidate(100) == 5050 def test_check(): check(sum_to_n) test_check()
[ "\ndef", "\n#", "\nif", "\nclass" ]
152
HumanEval_26_remove_duplicates
from typing import List def remove_duplicates(numbers: List[int]) -> List[int]: """ From a list of integers, remove all elements that occur more than once. Keep order of elements left the same as in the input. >>> remove_duplicates([1, 2, 3, 2, 4]) [1, 3, 4] """
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List def remove_duplicates(numbers: List[int]) -> List[int]: """ From a list of integers, remove all elements that occur more than once...
def remove_duplicates(numbers: List[int]) -> List[int]:
HumanEval_26_remove_duplicates
py
from typing import List def remove_duplicates(numbers: List[int]) -> List[int]: """ From a list of integers, remove all elements that occur more than once. Keep order of elements left the same as in the input. >>> remove_duplicates([1, 2, 3, 2, 4]) [1, 3, 4] """
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py
reworded
def check(candidate): assert candidate([]) == [] assert candidate([1, 2, 3, 4]) == [1, 2, 3, 4] assert candidate([1, 2, 3, 2, 4, 3, 5]) == [1, 4, 5] def test_check(): check(remove_duplicates) test_check()
[ "\ndef", "\n#", "\nif", "\nclass" ]
153
HumanEval_163_generate_integers
from typing import List def generate_integers(a: int, b: int) -> List[int]: """ Given two positive integers a and b, return the even digits between a and b, in ascending order. For example: >>> generate_integers(2, 8) [2, 4, 6, 8] >>> generate_integers(8, 2) [2, 4, 6, 8] >>> genera...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List def generate_integers(a: int, b: int) -> List[int]: """ Given two positive integers a and b, return the even digits between a ...
def generate_integers(a: int, b: int) -> List[int]:
HumanEval_163_generate_integers
py
from typing import List def generate_integers(a: int, b: int) -> List[int]: """ Given two positive integers a and b, return the even digits between a and b, in ascending order. For example: >>> generate_integers(2, 8) [2, 4, 6, 8] >>> generate_integers(8, 2) [2, 4, 6, 8] >>> genera...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py
reworded
def check(candidate): assert candidate(2, 10) == [2, 4, 6, 8] assert candidate(10, 2) == [2, 4, 6, 8] assert candidate(132, 2) == [2, 4, 6, 8] assert candidate(17, 89) == [] def test_check(): check(generate_integers) test_check()
[ "\ndef", "\n#", "\nif", "\nclass" ]
154
HumanEval_9_rolling_max
from typing import List 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. >>> rolling_max([1, 2, 3, 2, 3, 4, 2]) [1, 2, 3, 3, 3, 4, 4] """
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List def rolling_max(numbers: List[int]) -> List[int]: """ From a given list of integers, generate a list of rolling maximum element fo...
def rolling_max(numbers: List[int]) -> List[int]:
HumanEval_9_rolling_max
py
from typing import List 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. >>> rolling_max([1, 2, 3, 2, 3, 4, 2]) [1, 2, 3, 3, 3, 4, 4] """
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py
reworded
def check(candidate): assert candidate([]) == [] assert candidate([1, 2, 3, 4]) == [1, 2, 3, 4] assert candidate([4, 3, 2, 1]) == [4, 4, 4, 4] assert candidate([3, 2, 3, 100, 3]) == [3, 3, 3, 100, 100] def test_check(): check(rolling_max) test_check()
[ "\ndef", "\n#", "\nif", "\nclass" ]
155
HumanEval_3_below_zero
from typing import List def below_zero(operations: List[int]) -> bool: """ You're given a list of deposit and withdrawal operations on a bank account that starts with zero balance. Your task is to detect if at any point the balance of account fallls below zero, and at that point function should return True...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List def below_zero(operations: List[int]) -> bool: """ You're given a list of deposit and withdrawal operations on a bank account that...
def below_zero(operations: List[int]) -> bool:
HumanEval_3_below_zero
py
from typing import List def below_zero(operations: List[int]) -> bool: """ You're given a list of deposit and withdrawal operations on a bank account that starts with zero balance. Your task is to detect if at any point the balance of account fallls below zero, and at that point function should return True...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py
reworded
def check(candidate): assert candidate([]) == False assert candidate([1, 2, -3, 1, 2, -3]) == False assert candidate([1, 2, -4, 5, 6]) == True assert candidate([1, -1, 2, -2, 5, -5, 4, -4]) == False assert candidate([1, -1, 2, -2, 5, -5, 4, -5]) == True assert candidate([1, -2, 2, -2, 5, -5, 4, ...
[ "\ndef", "\n#", "\nif", "\nclass" ]
156
HumanEval_69_search
from typing import List def search(lst: List[int]) -> int: """ You are given a non-empty list of positive integers. Return the greatest integer that is greater than zero, and has a frequency greater than or equal to the value of the integer itself. The frequency of an integer is the number of times i...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List def search(lst: List[int]) -> int: """ You are given a non-empty list of positive integers. Return the greatest integer that i...
def search(lst: List[int]) -> int:
HumanEval_69_search
py
from typing import List def search(lst: List[int]) -> int: """ You are given a non-empty list of positive integers. Return the greatest integer that is greater than zero, and has a frequency greater than or equal to the value of the integer itself. The frequency of an integer is the number of times i...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py
reworded
def check(candidate): assert candidate([5, 5, 5, 5, 1]) == 1 assert candidate([4, 1, 4, 1, 4, 4]) == 4 assert candidate([3, 3]) == -1 assert candidate([8, 8, 8, 8, 8, 8, 8, 8]) == 8 assert candidate([2, 3, 3, 2, 2]) == 2 assert candidate([2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4,...
[ "\ndef", "\n#", "\nif", "\nclass" ]
157
HumanEval_61_correct_bracketing
def correct_bracketing(brackets: str) -> bool: """ brackets is a string of "(" and ")". return True if every opening bracket has a corresponding closing bracket. >>> correct_bracketing('(') False >>> correct_bracketing('()') True >>> correct_bracketing('(()())') True >>> correct_bra...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python def correct_bracketing(brackets: str) -> bool: """ brackets is a string of "(" and ")". return True if every opening bracket has a corresponding closin...
def correct_bracketing(brackets: str) -> bool:
HumanEval_61_correct_bracketing
py
def correct_bracketing(brackets: str) -> bool: """ brackets is a string of "(" and ")". return True if every opening bracket has a corresponding closing bracket. >>> correct_bracketing('(') False >>> correct_bracketing('()') True >>> correct_bracketing('(()())') True >>> correct_bra...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py
reworded
def check(candidate): assert candidate('()') == True assert candidate('(()())') == True assert candidate('()()(()())()') == True assert candidate('()()((()()())())(()()(()))') == True assert candidate('((()())))') == False assert candidate(')(()') == False assert candidate('(') == False ...
[ "\ndef", "\n#", "\nif", "\nclass" ]
158
HumanEval_37_sort_even
from typing import List def sort_even(l: List[int]) -> List[int]: """This function takes a list l and returns a list l' such that l' is identical to l in the odd indicies, while its values at the even indicies are equal to the values of the even indicies of l, but sorted. >>> sort_even([1, 2, 3]) [...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python from typing import List def sort_even(l: List[int]) -> List[int]: """This function takes a list l and returns a list l' such that l' is identical to l...
def sort_even(l: List[int]) -> List[int]:
HumanEval_37_sort_even
py
from typing import List def sort_even(l: List[int]) -> List[int]: """This function takes a list l and returns a list l' such that l' is identical to l in the odd indicies, while its values at the even indicies are equal to the values of the even indicies of l, but sorted. >>> sort_even([1, 2, 3]) [...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py
reworded
def check(candidate): assert candidate([1, 2, 3]) == [1, 2, 3] assert candidate([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) == [-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123] assert candidate([5, 8, -12, 4, 23, 2, 3, 11, 12, -10]) == [-12, 8, 3, 4, 5, 2, 12, 11, 23, -10] def test_check(): check(sort_even) test_c...
[ "\ndef", "\n#", "\nif", "\nclass" ]
159
HumanEval_54_same_chars
def same_chars(s0: str, s1: str) -> bool: """ Check if two words have the same characters. >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc') True >>> same_chars('abcd', 'dddddddabc') True >>> same_chars('dddddddabc', 'abcd') True >>> same_chars('eabcd', 'dddddddabc') False >>...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python def same_chars(s0: str, s1: str) -> bool: """ Check if two words have the same characters. >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc') Tr...
def same_chars(s0: str, s1: str) -> bool:
HumanEval_54_same_chars
py
def same_chars(s0: str, s1: str) -> bool: """ Check if two words have the same characters. >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc') True >>> same_chars('abcd', 'dddddddabc') True >>> same_chars('dddddddabc', 'abcd') True >>> same_chars('eabcd', 'dddddddabc') False >>...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py
reworded
def check(candidate): assert candidate('eabcdzzzz', 'dddzzzzzzzddeddabc') == True assert candidate('abcd', 'dddddddabc') == True assert candidate('dddddddabc', 'abcd') == True assert candidate('eabcd', 'dddddddabc') == False assert candidate('abcd', 'dddddddabcf') == False assert candidate('eabc...
[ "\ndef", "\n#", "\nif", "\nclass" ]
160
HumanEval_56_correct_bracketing
def correct_bracketing(brackets: str) -> bool: """ brackets is a string of "<" and ">". return True if every opening bracket has a corresponding closing bracket. >>> correct_bracketing('<') False >>> correct_bracketing('<>') True >>> correct_bracketing('<<><>>') True >>> correct_bra...
You are a professional Python programmer, please create a Python function based on the following function signature and natural language annotations. ```python def correct_bracketing(brackets: str) -> bool: """ brackets is a string of "<" and ">". return True if every opening bracket has a corresponding closin...
def correct_bracketing(brackets: str) -> bool:
HumanEval_56_correct_bracketing
py
def correct_bracketing(brackets: str) -> bool: """ brackets is a string of "<" and ">". return True if every opening bracket has a corresponding closing bracket. >>> correct_bracketing('<') False >>> correct_bracketing('<>') True >>> correct_bracketing('<<><>>') True >>> correct_bra...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py
reworded
def check(candidate): assert candidate('<>') == True assert candidate('<<><>>') == True assert candidate('<><><<><>><>') == True assert candidate('<><><<<><><>><>><<><><<>>>') == True assert candidate('<<<><>>>>') == False assert candidate('><<>') == False assert candidate('<') == False ...
[ "\ndef", "\n#", "\nif", "\nclass" ]