src_lang
null
solution
stringlengths
132
1.99k
compare_func
stringclasses
1 value
demos
listlengths
0
8
entry_func
stringlengths
1
30
suffix
stringclasses
1 value
import_str
listlengths
0
1
doc_string
stringlengths
0
1.07k
task_name
stringclasses
1 value
dataset_name
stringclasses
1 value
tgt_lang
stringclasses
1 value
test_cases
listlengths
12
1.1k
data_id
stringlengths
11
13
prefix
stringlengths
115
1.36k
null
def make_a_pile(n): """ 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. Return the number of stones in each lev...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "3", "[3, 5, 7]" ] ]
make_a_pile
[]
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. Return the number of stones in each level in a list, where element at index i represents the number ...
code_generation
HumanEval_plus
python
null
HumanEval/100
def make_a_pile(n): """ 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. Return the number of stones in each lev...
null
def words_string(s): """ You will be given a string of words separated by commas or spaces. Your task is to split the string into words and return an array of the words. For example: words_string("Hi, my name is John") == ["Hi", "my", "name", "is", "John"] words_string("One, two, three, fo...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "\"Hi, my name is John\"", "[\"Hi\", \"my\", \"name\", \"is\", \"John\"]" ], [ "\"One, two, three, four, five, six\"", "[\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]" ] ]
words_string
[]
You will be given a string of words separated by commas or spaces. Your task is to split the string into words and return an array of the words.
code_generation
HumanEval_plus
python
[ [ "Hi, my name is John", "['Hi', 'my', 'name', 'is', 'John']" ], [ "One, two, three, four, five, six", "['One', 'two', 'three', 'four', 'five', 'six']" ], [ "Hi, my name", "['Hi', 'my', 'name']" ], [ "One,, two, three, four, five, six,", "['One', 'two', 'three', 'four', '...
HumanEval/101
def words_string(s): """ You will be given a string of words separated by commas or spaces. Your task is to split the string into words and return an array of the words. For example: words_string("Hi, my name is John") == ["Hi", "my", "name", "is", "John"] words_string("One, two, three, fo...
null
def choose_num(x, y): """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(13, 12) = -1 """ ...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "12, 15", "14" ], [ "13, 12", "-1" ] ]
choose_num
[]
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.
code_generation
HumanEval_plus
python
[ [ "12, 15", "14" ], [ "13, 12", "-1" ], [ "33, 12354", "12354" ], [ "5234, 5233", "-1" ], [ "6, 29", "28" ], [ "27, 10", "-1" ], [ "7, 7", "-1" ], [ "546, 546", "546" ], [ "20, 30", "30" ], [ "30, 30", ...
HumanEval/102
def choose_num(x, y): """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(13, 12) = -1 """
null
def rounded_avg(n, m): """You are given two positive integers n and m, and your task is to compute the average of the integers from n through m (including n and m). Round the answer to the nearest integer and convert that to binary. If n is greater than m, return -1. Example: rounded_avg(1, 5)...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "1, 5", "\"0b11\"" ], [ "7, 5", "-1" ], [ "10, 20", "\"0b1111\"" ], [ "20, 33", "\"0b11010\"" ] ]
rounded_avg
[]
You are given two positive integers n and m, and your task is to compute the average of the integers from n through m (including n and m). Round the answer to the nearest integer and convert that to binary. If n is greater than m, return -1.
code_generation
HumanEval_plus
python
[ [ "1, 5", "0b11" ], [ "7, 13", "0b1010" ], [ "964, 977", "0b1111001010" ], [ "996, 997", "0b1111100100" ], [ "560, 851", "0b1011000010" ], [ "185, 546", "0b101101110" ], [ "362, 496", "0b110101101" ], [ "350, 902", "0b100111...
HumanEval/103
def rounded_avg(n, m): """You are given two positive integers n and m, and your task is to compute the average of the integers from n through m (including n and m). Round the answer to the nearest integer and convert that to binary. If n is greater than m, return -1. Example: rounded_avg(1, 5)...
null
def unique_digits(x): """Given a list of positive integers x. return a sorted list of all elements that hasn't any even digit. Note: Returned list should be sorted in increasing order. For example: >>> unique_digits([15, 33, 1422, 1]) [1, 15, 33] >>> unique_digits([152, 323, 1422, 10...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "[15, 33, 1422, 1]", "[1, 15, 33]" ], [ "[152, 323, 1422, 10]", "[]" ] ]
unique_digits
[]
Given a list of positive integers x. return a sorted list of all elements that hasn't any even digit. Note: Returned list should be sorted in increasing order.
code_generation
HumanEval_plus
python
[ [ "[15, 33, 1422, 1]", "[1, 15, 33]" ], [ "[152, 323, 1422, 10]", "[]" ], [ "[12345, 2033, 111, 151]", "[111, 151]" ], [ "[135, 103, 31]", "[31, 135]" ], [ "[257, 369, 781, 409]", "[]" ], [ "[1357, 79, 8642, 246]", "[79, 1357]" ], [ "[321, ...
HumanEval/104
def unique_digits(x): """Given a list of positive integers x. return a sorted list of all elements that hasn't any even digit. Note: Returned list should be sorted in increasing order. For example: >>> unique_digits([15, 33, 1422, 1]) [1, 15, 33] >>> unique_digits([152, 323, 1422, 10...
null
def by_length(arr): """ Given an array of integers, sort the integers that are between 1 and 9 inclusive, reverse the resulting array, and then replace each digit by its corresponding name from "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine". For example: arr = [2, 1, ...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "[2, 1, 1, 4, 5, 8, 2, 3]", "[\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]" ], [ "[]", "[]" ], [ "[1, -1 , 55]", "[\"One\"]" ] ]
by_length
[]
Given an array of integers, sort the integers that are between 1 and 9 inclusive, reverse the resulting array, and then replace each digit by its corresponding name from "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine".
code_generation
HumanEval_plus
python
[ [ "[2, 1, 1, 4, 5, 8, 2, 3]", "['Eight', 'Five', 'Four', 'Three', 'Two', 'Two', 'One', 'One']" ], [ "[]", "[]" ], [ "[1, -1, 55]", "['One']" ], [ "[1, -1, 3, 2]", "['Three', 'Two', 'One']" ], [ "[9, 4, 8]", "['Nine', 'Eight', 'Four']" ], [ "[9, 8, 7, 6...
HumanEval/105
def by_length(arr): """ Given an array of integers, sort the integers that are between 1 and 9 inclusive, reverse the resulting array, and then replace each digit by its corresponding name from "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine". For example: arr = [2, 1, ...
null
def f(n): """ Implement the function f that takes n as a parameter, and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even or the sum of numbers from 1 to i otherwise. i starts from 1. the factorial of i is the multiplication of the numbers fr...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "5", "[1, 2, 6, 24, 15]" ] ]
f
[]
Implement the function f that takes n as a parameter, and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even or the sum of numbers from 1 to i otherwise. i starts from 1. the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).
code_generation
HumanEval_plus
python
[ [ "5", "[1, 2, 6, 24, 15]" ], [ "7", "[1, 2, 6, 24, 15, 720, 28]" ], [ "1", "[1]" ], [ "3", "[1, 2, 6]" ], [ "0", "[]" ], [ "2", "[1, 2]" ], [ "4", "[1, 2, 6, 24]" ], [ "6", "[1, 2, 6, 24, 15, 720]" ], [ "8", "[1...
HumanEval/106
def f(n): """ Implement the function f that takes n as a parameter, and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even or the sum of numbers from 1 to i otherwise. i starts from 1. the factorial of i is the multiplication of the numbers fr...
null
def even_odd_palindrome(n): """ Given a positive integer n, return a tuple that has the number of even and odd integer palindromes that fall within the range(1, n), inclusive. Example 1: Input: 3 Output: (1, 2) Explanation: Integer palindrome are 1, 2, 3. one of them i...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "3", "(1, 2)" ], [ "12", "(4, 6)" ] ]
even_odd_palindrome
[]
Given a positive integer n, return a tuple that has the number of even and odd integer palindromes that fall within the range(1, n), inclusive.
code_generation
HumanEval_plus
python
[ [ "123", "(8, 13)" ], [ "12", "(4, 6)" ], [ "3", "(1, 2)" ], [ "63", "(6, 8)" ], [ "25", "(5, 6)" ], [ "19", "(4, 6)" ], [ "9", "(4, 5)" ], [ "1", "(0, 1)" ], [ "1000", "(48, 60)" ], [ "500", "(28, 30...
HumanEval/107
def even_odd_palindrome(n): """ Given a positive integer n, return a tuple that has the number of even and odd integer palindromes that fall within the range(1, n), inclusive. Example 1: Input: 3 Output: (1, 2) Explanation: Integer palindrome are 1, 2, 3. one of them i...
null
def count_nums(arr): """ Write a function count_nums which takes an array of integers and returns the number of elements which has a sum of digits > 0. If a number is negative, then its first signed digit will be negative: e.g. -123 has signed digits -1, 2, and 3. >>> count_nums([]) == 0 >>...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "[]", "0" ], [ "[-1, 11, -11]", "1" ], [ "[1, 1, 2]", "3" ] ]
count_nums
[]
Write a function count_nums which takes an array of integers and returns the number of elements which has a sum of digits > 0. If a number is negative, then its first signed digit will be negative: e.g. -123 has signed digits -1, 2, and 3.
code_generation
HumanEval_plus
python
[ [ "[]", "0" ], [ "[-1, -2, 0]", "0" ], [ "[1, 1, 2, -2, 3, 4, 5]", "6" ], [ "[1, 6, 9, -6, 0, 1, 5]", "5" ], [ "[1, 100, 98, -7, 1, -1]", "4" ], [ "[12, 23, 34, -45, -56, 0]", "5" ], [ "[0, 1]", "1" ], [ "[1]", "1" ], [ ...
HumanEval/108
def count_nums(arr): """ Write a function count_nums which takes an array of integers and returns the number of elements which has a sum of digits > 0. If a number is negative, then its first signed digit will be negative: e.g. -123 has signed digits -1, 2, and 3. >>> count_nums([]) == 0 >>...
null
def move_one_ball(arr): """We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The numbers in the array will be randomly ordered. Your task is to determine if it is possible to get an array sorted in non-decreasing order by performing the following operation on the given array: Yo...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "[3, 4, 5, 1, 2]", ">True" ], [ "[3, 5, 4, 1, 2]", ">False" ] ]
move_one_ball
[]
We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The numbers in the array will be randomly ordered. Your task is to determine if it is possible to get an array sorted in non-decreasing order by performing the following operation on the given array: You are allowed to perform right shift operation any nu...
code_generation
HumanEval_plus
python
[ [ "[3, 4, 5, 1, 2]", "True" ], [ "[3, 5, 10, 1, 2]", "True" ], [ "[4, 3, 1, 2]", "False" ], [ "[3, 5, 4, 1, 2]", "False" ], [ "[]", "True" ], [ "[1]", "True" ], [ "[5, 6, 7, 8, 1, 2, 3, 4]", "True" ], [ "[1, 2, 3, 4, 5, 6, 7, 8]...
HumanEval/109
def move_one_ball(arr): """We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The numbers in the array will be randomly ordered. Your task is to determine if it is possible to get an array sorted in non-decreasing order by performing the following operation on the given array: Yo...
null
def exchange(lst1, lst2): """In this problem, you will implement a function that takes two lists of numbers, and determines whether it is possible to perform an exchange of elements between them to make lst1 a list of only even numbers. There is no limit on the number of exchanged elements between lst1...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "[1, 2, 3, 4], [1, 2, 3, 4]", "\"YES\"" ], [ "[1, 2, 3, 4], [1, 5, 3, 4]", "\"NO\"" ] ]
exchange
[]
In this problem, you will implement a function that takes two lists of numbers, and determines whether it is possible to perform an exchange of elements between them to make lst1 a list of only even numbers. There is no limit on the number of exchanged elements between lst1 and lst2. If it is possible to exchange eleme...
code_generation
HumanEval_plus
python
[ [ "[1, 2, 3, 4], [1, 2, 3, 4]", "YES" ], [ "[1, 2, 3, 4], [1, 5, 3, 4]", "NO" ], [ "[1, 2, 3, 4], [2, 1, 4, 3]", "YES" ], [ "[5, 7, 3], [2, 6, 4]", "YES" ], [ "[5, 7, 3], [2, 6, 3]", "NO" ], [ "[3, 2, 6, 1, 8, 9], [3, 5, 5, 1, 1, 1]", "NO" ], [...
HumanEval/110
def exchange(lst1, lst2): """In this problem, you will implement a function that takes two lists of numbers, and determines whether it is possible to perform an exchange of elements between them to make lst1 a list of only even numbers. There is no limit on the number of exchanged elements between lst1...
null
def histogram(test): """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. Example: histogram('a b c') == {'a': 1, '...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "'a b c'", "{'a': 1, 'b': 1, 'c': 1}" ], [ "'a b b a'", "{'a': 2, 'b': 2}" ], [ "'a b c a b'", "{'a': 2, 'b': 2}" ], [ "'b b b b a'", "{'b': 4}" ], [ "''", "{}" ] ]
histogram
[]
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.
code_generation
HumanEval_plus
python
[ [ "a b b a", "{'a': 2, 'b': 2}" ], [ "a b c a b", "{'a': 2, 'b': 2}" ], [ "a b c d g", "{'a': 1, 'b': 1, 'c': 1, 'd': 1, 'g': 1}" ], [ "r t g", "{'r': 1, 't': 1, 'g': 1}" ], [ "b b b b a", "{'b': 4}" ], [ "", "{}" ], [ "a", "{'a': 1}" ...
HumanEval/111
def histogram(test): """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. Example: histogram('a b c') == {'a': 1, '...
null
def reverse_delete(s,c): """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 backward as forward. You should return a tuple contai...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "'abcde', 'ae'", "('bcd', False)" ], [ "'abcdef', 'b'", "('acdef',False)" ], [ "'abcdedcba', 'ab'", "('cdedc',True)" ] ]
reverse_delete
[]
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 backward as forward. You should return a tuple containing the result string and True/False for the che...
code_generation
HumanEval_plus
python
[ [ "abcde, ae", "('bcd', False)" ], [ "abcdef, b", "('acdef', False)" ], [ "abcdedcba, ab", "('cdedc', True)" ], [ "dwik, w", "('dik', False)" ], [ "a, a", "('', True)" ], [ "abcdedcba, ", "('abcdedcba', True)" ], [ "abcdedcba, v", "('ab...
HumanEval/112
def reverse_delete(s,c): """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 backward as forward. You should return a tuple contai...
null
def odd_count(lst): """Given a list of strings, where each string consists of only digits, return a list. Each element i of the output should be "the number of odd elements in the string i of the input." where all the i's should be replaced by the number of odd digits in the i'th string of the input. ...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "['1234567']", "[\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]" ], [ "['3',\"11111111\"]", "[\"the number of odd elements 1n the str1ng 1 of the 1nput.\"," ] ]
odd_count
[]
Given a list of strings, where each string consists of only digits, return a list. Each element i of the output should be "the number of odd elements in the string i of the input." where all the i's should be replaced by the number of odd digits in the i'th string of the input.
code_generation
HumanEval_plus
python
[ [ "['1234567']", "['the number of odd elements 4n the str4ng 4 of the 4nput.']" ], [ "['3', '11111111']", "['the number of odd elements 1n the str1ng 1 of the 1nput.', 'the number of odd elements 8n the str8ng 8 of the 8nput.']" ], [ "['271', '137', '314']", "['the number of odd elem...
HumanEval/113
def odd_count(lst): """Given a list of strings, where each string consists of only digits, return a list. Each element i of the output should be "the number of odd elements in the string i of the input." where all the i's should be replaced by the number of odd digits in the i'th string of the input. ...
null
def minSubArraySum(nums): """ 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 """ max_sum = 0 s = 0 for num in nums: s += -num if (s < 0):...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "[2, 3, 4, 1, 2, 4]", "1" ], [ "[-1, -2, -3]", "-6" ] ]
minSubArraySum
[]
Given an array of integers nums, find the minimum sum of any non-empty sub-array of nums.
code_generation
HumanEval_plus
python
[ [ "[2, 3, 4, 1, 2, 4]", "1" ], [ "[-1, -2, -3]", "-6" ], [ "[-1, -2, -3, 2, -10]", "-14" ], [ "[-9999999999999999]", "-9999999999999999" ], [ "[0, 10, 20, 1000000]", "0" ], [ "[-1, -2, -3, 10, -5]", "-6" ], [ "[100, -1, -2, -3, 10, -5]", ...
HumanEval/114
def minSubArraySum(nums): """ 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 """
null
def max_fill(grid, capacity): import math """ You are given a rectangular grid of wells. Each row represents a single well, and each 1 in a row represents a single unit of water. Each well has a corresponding bucket that can be used to extract water from it, and all buckets have the same capac...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "[[0,0,1,0], [0,1,0,0], [1,1,1,1]], 1", "6" ], [ "[[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]], 2", "5" ], [ "[[0,0,0], [0,0,0]], 5", "0" ] ]
max_fill
[ "import math" ]
You are given a rectangular grid of wells. Each row represents a single well, and each 1 in a row represents a single unit of water. Each well has a corresponding bucket that can be used to extract water from it, and all buckets have the same capacity. Your task is to use the buckets to empty the wells. Output the numb...
code_generation
HumanEval_plus
python
[ [ "[[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1", "6" ], [ "[[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2", "5" ], [ "[[0, 0, 0], [0, 0, 0]], 5", "0" ], [ "[[1, 1, 1, 1], [1, 1, 1, 1]], 2", "4" ], [ "[[1, 1, 1, 1], [1, 1, 1, 1]], 9", "2" ], ...
HumanEval/115
def max_fill(grid, capacity): import math """ You are given a rectangular grid of wells. Each row represents a single well, and each 1 in a row represents a single unit of water. Each well has a corresponding bucket that can be used to extract water from it, and all buckets have the same capac...
null
def sort_array(arr): """ 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 like this: >>> sort_array([1, 5, 2, 3, 4]) ==...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "[1, 5, 2, 3, 4]", "[1, 2, 3, 4, 5]" ], [ "[-2, -3, -4, -5, -6]", "[-6, -5, -4, -3, -2]" ] ]
sort_array
[]
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 like this:
code_generation
HumanEval_plus
python
[ [ "[1, 5, 2, 3, 4]", "[1, 2, 4, 3, 5]" ], [ "[-2, -3, -4, -5, -6]", "[-4, -2, -6, -5, -3]" ], [ "[1, 0, 2, 3, 4]", "[0, 1, 2, 4, 3]" ], [ "[]", "[]" ], [ "[2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]", "[2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77]" ], [ "[3, 6, 44, 12, 32...
HumanEval/116
def sort_array(arr): """ 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 like this: >>> sort_array([1, 5, 2, 3, 4]) ==...
null
def select_words(s, n): """Given a string s and a natural number n, you have been tasked to implement a function that returns a list of all words from string s that contain exactly n consonants, in order these words appear in the string s. If the string s is empty then the function should return an e...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "\"Mary had a little lamb\", 4", "> [\"little\"]" ], [ "\"Mary had a little lamb\", 3", "> [\"Mary\", \"lamb\"]" ], [ "\"simple white space\", 2", "> []" ], [ "\"Hello world\", 4", "> [\"world\"]" ], [ "\"Uncle sam\", 3", "> [\"Uncle\"]" ] ]
select_words
[]
Given a string s and a natural number n, you have been tasked to implement a function that returns a list of all words from string s that contain exactly n consonants, in order these words appear in the string s. If the string s is empty then the function should return an empty list. Note: you may assume the input stri...
code_generation
HumanEval_plus
python
[ [ "Mary had a little lamb, 4", "['little']" ], [ "Mary had a little lamb, 3", "['Mary', 'lamb']" ], [ "simple white space, 2", "[]" ], [ "Hello world, 4", "['world']" ], [ "Uncle sam, 3", "['Uncle']" ], [ ", 4", "[]" ], [ "a b c d e f, 1", ...
HumanEval/117
def select_words(s, n): """Given a string s and a natural number n, you have been tasked to implement a function that returns a list of all words from string s that contain exactly n consonants, in order these words appear in the string s. If the string s is empty then the function should return an e...
null
def get_closest_vowel(word): """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 above condit...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "\"yogurt\"", "> \"u\"" ], [ "\"FULL\"", "> \"U\"" ], [ "\"quick\"", "> \"\"" ], [ "\"ab\"", "> \"\"" ] ]
get_closest_vowel
[]
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 above condition. You may assume that the given string contains Engl...
code_generation
HumanEval_plus
python
[ [ "yogurt", "u" ], [ "full", "u" ], [ "easy", "" ], [ "eAsy", "" ], [ "ali", "" ], [ "bad", "a" ], [ "most", "o" ], [ "ab", "" ], [ "ba", "" ], [ "quick", "" ], [ "anime", "i" ], [ ...
HumanEval/118
def get_closest_vowel(word): """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 above condit...
null
def match_parens(lst): ''' You are given a list of two strings, both strings consist of open parentheses '(' or close parentheses ')' only. Your job is to check if it is possible to concatenate the two strings in some order, that the resulting string will be good. A string S is considered to be...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "['()(', ')']", "'Yes'" ], [ "[')', ')']", "'No'" ] ]
match_parens
[]
code_generation
HumanEval_plus
python
[ [ "['()(', ')']", "Yes" ], [ "[')', ')']", "No" ], [ "['(()(())', '())())']", "No" ], [ "[')())', '(()()(']", "Yes" ], [ "['(())))', '(()())((']", "Yes" ], [ "['()', '())']", "No" ], [ "['(()(', '()))()']", "Yes" ], [ "['((((', ...
HumanEval/119
def match_parens(lst): ''' You are given a list of two strings, both strings consist of open parentheses '(' or close parentheses ')' only. Your job is to check if it is possible to concatenate the two strings in some order, that the resulting string will be good. A string S is considered to be...
null
def maximum(arr, k): """ Given an array arr of integers and a positive integer k, return a sorted list of length k with the maximum k numbers in arr. Example 1: Input: arr = [-3, -4, 5], k = 3 Output: [-4, -3, 5] Example 2: Input: arr = [4, -4, 4], k = 2 Output:...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "[-3, -4, 5], 3", "[-4, -3, 5]" ], [ "[4, -4, 4], 2", "[4, 4]" ], [ "[-3, 2, 1, 2, -1, -2, 1], 1", "[2]" ] ]
maximum
[]
Given an array arr of integers and a positive integer k, return a sorted list of length k with the maximum k numbers in arr.
code_generation
HumanEval_plus
python
[ [ "[-3, -4, 5], 3", "[-4, -3, 5]" ], [ "[4, -4, 4], 2", "[4, 4]" ], [ "[-3, 2, 1, 2, -1, -2, 1], 1", "[2]" ], [ "[123, -123, 20, 0, 1, 2, -3], 3", "[2, 20, 123]" ], [ "[-123, 20, 0, 1, 2, -3], 4", "[0, 1, 2, 20]" ], [ "[5, 15, 0, 3, -13, -8, 0], 7", ...
HumanEval/120
def maximum(arr, k): """ Given an array arr of integers and a positive integer k, return a sorted list of length k with the maximum k numbers in arr. Example 1: Input: arr = [-3, -4, 5], k = 3 Output: [-4, -3, 5] Example 2: Input: arr = [4, -4, 4], k = 2 Output:...
null
def solution(lst): """Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions. Examples solution([5, 8, 7, 1]) ==> 12 solution([3, 3, 3, 3, 3]) ==> 9 solution([30, 13, 24, 321]) ==>0 """ return sum([x for idx, x in enumerate(lst) if idx...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "[5, 8, 7, 1]", "> 12" ], [ "[3, 3, 3, 3, 3]", "> 9" ], [ "[30, 13, 24, 321]", ">0" ] ]
solution
[]
Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.
code_generation
HumanEval_plus
python
[ [ "[5, 8, 7, 1]", "12" ], [ "[3, 3, 3, 3, 3]", "9" ], [ "[30, 13, 24, 321]", "0" ], [ "[5, 9]", "5" ], [ "[2, 4, 8]", "0" ], [ "[30, 13, 23, 32]", "23" ], [ "[3, 13, 2, 9]", "3" ], [ "[1, 2, 3, 4, 5, 6]", "9" ], [ "[...
HumanEval/121
def solution(lst): """Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions. Examples solution([5, 8, 7, 1]) ==> 12 solution([3, 3, 3, 3, 3]) ==> 9 solution([30, 13, 24, 321]) ==>0 """
null
def add_elements(arr, k): """ Given a non-empty array of integers arr and an integer k, return the sum of the elements with at most two digits from the first k elements of arr. Example: Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4 Output: 24 # sum of 21 + 3 Constraints: ...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "[111,21,3,4000,5,6,7,8,9], 4", "24" ] ]
add_elements
[]
Given a non-empty array of integers arr and an integer k, return the sum of the elements with at most two digits from the first k elements of arr.
code_generation
HumanEval_plus
python
[ [ "[1, -2, -3, 41, 57, 76, 87, 88, 99], 3", "-4" ], [ "[111, 121, 3, 4000, 5, 6], 2", "0" ], [ "[11, 21, 3, 90, 5, 6, 7, 8, 9], 4", "125" ], [ "[111, 21, 3, 4000, 5, 6, 7, 8, 9], 4", "24" ], [ "[1], 1", "1" ], [ "[98, 87, 76, 65, 54, 43, 32, 21, 10], 5...
HumanEval/122
def add_elements(arr, k): """ Given a non-empty array of integers arr and an integer k, return the sum of the elements with at most two digits from the first k elements of arr. Example: Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4 Output: 24 # sum of 21 + 3 Constraints: ...
null
def get_odd_collatz(n): """ 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. Then each term is obtained from the prev...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "5", "[1, 5]" ] ]
get_odd_collatz
[]
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. Then each term is obtained from the previous term as follows: if the previous term is even,...
code_generation
HumanEval_plus
python
[ [ "14", "[1, 5, 7, 11, 13, 17]" ], [ "5", "[1, 5]" ], [ "12", "[1, 3, 5]" ], [ "1", "[1]" ], [ "2", "[1]" ], [ "3", "[1, 3, 5]" ], [ "7", "[1, 5, 7, 11, 13, 17]" ], [ "10", "[1, 5]" ], [ "15", "[1, 5, 15, 23, 35,...
HumanEval/123
def get_odd_collatz(n): """ 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. Then each term is obtained from the prev...
null
def valid_date(date): """You have to write a function which validates a given date string and returns True if the date is valid otherwise False. The date is valid if all of the following rules are satisfied: 1. The date string is not empty. 2. The number of days is not less than 1 or higher than 31...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "'03-11-2000'", "True" ], [ "'15-01-2012'", "False" ], [ "'04-0-2040'", "False" ], [ "'06-04-2020'", "True" ], [ "'06/04/2020'", "False" ] ]
valid_date
[]
You have to write a function which validates a given date string and returns True if the date is valid otherwise False. The date is valid if all of the following rules are satisfied: 1. The date string is not empty. 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the numb...
code_generation
HumanEval_plus
python
[ [ "03-11-2000", "True" ], [ "15-01-2012", "False" ], [ "04-0-2040", "False" ], [ "06-04-2020", "True" ], [ "01-01-2007", "True" ], [ "03-32-2011", "False" ], [ "", "False" ], [ "04-31-3000", "False" ], [ "06-06-2005"...
HumanEval/124
def valid_date(date): """You have to write a function which validates a given date string and returns True if the date is valid otherwise False. The date is valid if all of the following rules are satisfied: 1. The date string is not empty. 2. The number of days is not less than 1 or higher than 31...
null
def split_words(txt): ''' 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 order in the alphabet, ord('a') = 0, ord('b') = 1, ... ord('...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "\"abcdef\"", "3" ] ]
split_words
[]
code_generation
HumanEval_plus
python
[ [ "Hello world!", "['Hello', 'world!']" ], [ "Hello,world!", "['Hello', 'world!']" ], [ "Hello world,!", "['Hello', 'world,!']" ], [ "Hello,Hello,world !", "['Hello,Hello,world', '!']" ], [ "abcdef", "3" ], [ "aaabb", "2" ], [ "aaaBb", ...
HumanEval/125
def split_words(txt): ''' 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 order in the alphabet, ord('a') = 0, ord('b') = 1, ... ord('...
null
def is_sorted(lst): ''' Given a list of numbers, return whether or not they are sorted in ascending order. If list has more than 1 duplicate of the same number, return False. Assume no negative numbers and only integers. Examples is_sorted([5]) ➞ True is_sorted([1, 2, 3, 4, 5]) ➞ True ...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "[5]", "True" ], [ "[1, 2, 3, 4, 5]", "True" ], [ "[1, 3, 2, 4, 5]", "False" ], [ "[1, 2, 3, 4, 5, 6]", "True" ], [ "[1, 2, 3, 4, 5, 6, 7]", "True" ], [ "[1, 3, 2, 4, 5, 6, 7]", "False" ], [ "[1, 2, 2, 3, 3, 4]", "True" ], [ "...
is_sorted
[]
code_generation
HumanEval_plus
python
[ [ "[5]", "True" ], [ "[1, 2, 3, 4, 5]", "True" ], [ "[1, 3, 2, 4, 5]", "False" ], [ "[1, 2, 3, 4, 5, 6]", "True" ], [ "[1, 2, 3, 4, 5, 6, 7]", "True" ], [ "[1, 3, 2, 4, 5, 6, 7]", "False" ], [ "[]", "True" ], [ "[1]", "True"...
HumanEval/126
def is_sorted(lst): ''' Given a list of numbers, return whether or not they are sorted in ascending order. If list has more than 1 duplicate of the same number, return False. Assume no negative numbers and only integers. Examples is_sorted([5]) ➞ True is_sorted([1, 2, 3, 4, 5]) ➞ True ...
null
def intersection(interval1, interval2): """You are given two intervals, where each interval is a pair of integers. For example, interval = (start, end) = (1, 2). The given intervals are closed which means that the interval (start, end) includes both start and end. For each given interval, it is ass...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "(1, 2), (2, 3)", "> \"NO\"" ], [ "(-1, 1), (0, 4)", "> \"NO\"" ], [ "(-3, -1), (-5, 5)", "> \"YES\"" ] ]
intersection
[]
You are given two intervals,
code_generation
HumanEval_plus
python
[ [ "[1, 2], [2, 3]", "NO" ], [ "[-1, 1], [0, 4]", "NO" ], [ "[-3, -1], [-5, 5]", "YES" ], [ "[-2, 2], [-4, 0]", "YES" ], [ "[-11, 2], [-1, -1]", "NO" ], [ "[1, 2], [3, 5]", "NO" ], [ "[1, 2], [1, 2]", "NO" ], [ "[-2, -2], [-3, -2...
HumanEval/127
def intersection(interval1, interval2): """You are given two intervals, where each interval is a pair of integers. For example, interval = (start, end) = (1, 2). The given intervals are closed which means that the interval (start, end) includes both start and end. For each given interval, it is ass...
null
def prod_signs(arr): """ 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 arr. Example: >>> prod_signs([1, 2, 2, -4]) == -9 ...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "[1, 2, 2, -4]", "-9" ], [ "[0, 1]", "0" ], [ "[]", "None" ] ]
prod_signs
[]
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 arr.
code_generation
HumanEval_plus
python
[ [ "[1, 2, 2, -4]", "-9" ], [ "[0, 1]", "0" ], [ "[1, 1, 1, 2, 3, -1, 1]", "-10" ], [ "[]", "None" ], [ "[2, 4, 1, 2, -1, -1, 9]", "20" ], [ "[-1, 1, -1, 1]", "4" ], [ "[-1, 1, 1, 1]", "-4" ], [ "[-1, 1, 1, 0]", "0" ], [ ...
HumanEval/128
def prod_signs(arr): """ 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 arr. Example: >>> prod_signs([1, 2, 2, -4]) == -9 ...
null
def minPath(grid, k): """ Given a grid with N rows and N columns (N >= 2) and a positive integer k, each cell of the grid contains a value. Every integer in the range [1, N * N] inclusive appears exactly once on the cells of the grid. You have to find the minimum path of length k in the grid. You...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "[[1,2,3], [4,5,6], [7,8,9]], 3", "[1, 2, 1]" ], [ "[[5,9,3], [4,1,6], [7,8,2]], 1", "[1]" ] ]
minPath
[]
Given a grid with N rows and N columns (N >= 2) and a positive integer k, each cell of the grid contains a value. Every integer in the range [1, N * N] inclusive appears exactly once on the cells of the grid. You have to find the minimum path of length k in the grid. You can start from any cell, and in each step you ca...
code_generation
HumanEval_plus
python
[ [ "[[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3", "[1, 2, 1]" ], [ "[[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1", "[1]" ], [ "[[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], 4", "[1, 2, 1, 2]" ], [ "[[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], 7", "[...
HumanEval/129
def minPath(grid, k): """ Given a grid with N rows and N columns (N >= 2) and a positive integer k, each cell of the grid contains a value. Every integer in the range [1, N * N] inclusive appears exactly once on the cells of the grid. You have to find the minimum path of length k in the grid. You...
null
def tri(n): """Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in the last couple centuries. However, what people don't know is Tribonacci sequence. Tribonacci sequence is defined by the recurrence: tri(1) = 3 tri(n) = 1 + n / 2, if n is even. tri(n) = tri(n - 1) + ...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "1", "3" ], [ "n", "1 + n / 2, if n is even." ], [ "n", "tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd." ], [ "2", "1 + (2 / 2) = 2" ], [ "4", "3" ], [ "3", "tri(2) + tri(1) + tri(4)" ], [ "3", "[1, 3, 2, 8]" ] ]
tri
[]
Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in the last couple centuries. However, what people don't know is Tribonacci sequence. Tribonacci sequence is defined by the recurrence: tri(1) = 3 tri(n) = 1 + n / 2, if n is even. tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.
code_generation
HumanEval_plus
python
null
HumanEval/130
def tri(n): """Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in the last couple centuries. However, what people don't know is Tribonacci sequence. Tribonacci sequence is defined by the recurrence: tri(1) = 3 tri(n) = 1 + n / 2, if n is even. tri(n) = tri(n - 1) + ...
null
def digits(n): """Given a positive integer n, return the product of the odd digits. Return 0 if all digits are even. For example: digits(1) == 1 digits(4) == 0 digits(235) == 15 """ product = 1 odd_count = 0 for digit in str(n): int_digit = int(digit) if int_di...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "1", "1" ], [ "4", "0" ], [ "235", "15" ] ]
digits
[]
Given a positive integer n, return the product of the odd digits. Return 0 if all digits are even.
code_generation
HumanEval_plus
python
[ [ "5", "5" ], [ "54", "5" ], [ "120", "1" ], [ "5014", "5" ], [ "98765", "315" ], [ "5576543", "2625" ], [ "2468", "0" ], [ "951", "45" ], [ "246", "0" ], [ "135797531", "99225" ], [ "888", ...
HumanEval/131
def digits(n): """Given a positive integer n, return the product of the odd digits. Return 0 if all digits are even. For example: digits(1) == 1 digits(4) == 0 digits(235) == 15 """
null
def is_nested(string): ''' Create a function that takes a string as input which contains only square brackets. The function should return True if and only if there is a valid subsequence of brackets where at least one bracket in the subsequence is nested. is_nested('[[]]') ➞ True is_nested('[...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "'[[]]'", "True" ], [ "'[]]]]]]][[[[[]'", "False" ], [ "'[][]'", "False" ], [ "'[]'", "False" ], [ "'[[][]]'", "True" ], [ "'[[]][['", "True" ] ]
is_nested
[]
code_generation
HumanEval_plus
python
[ [ "[[]]", "True" ], [ "[]]]]]]][[[[[]", "False" ], [ "[][]", "False" ], [ "[]", "False" ], [ "[[[[]]]]", "True" ], [ "[]]]]]]]]]]", "False" ], [ "[][][[]]", "True" ], [ "[[]", "False" ], [ "[]]", "False" ], [...
HumanEval/132
def is_nested(string): ''' Create a function that takes a string as input which contains only square brackets. The function should return True if and only if there is a valid subsequence of brackets where at least one bracket in the subsequence is nested. is_nested('[[]]') ➞ True is_nested('[...
null
def sum_squares(lst): """You are given a list of numbers. You need to return the sum of squared numbers in the given list, round each element in the list to the upper int(Ceiling) first. Examples: For lst = [1,2,3] the output should be 14 For lst = [1,4,9] the output should be 98 For lst =...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "[1,2,3]", "14" ], [ "[1,4,9]", "98" ], [ "[1,3,5,7]", "84" ], [ "[1.4,4.2,0]", "29" ], [ "[-2.4,1,1]", "6" ] ]
sum_squares
[]
You are given a list of numbers. You need to return the sum of squared numbers in the given list, round each element in the list to the upper int(Ceiling) first.
code_generation
HumanEval_plus
python
[ [ "[1, 2, 3]", "14" ], [ "[1.0, 2, 3]", "14" ], [ "[1, 3, 5, 7]", "84" ], [ "[1.4, 4.2, 0]", "29" ], [ "[-2.4, 1, 1]", "6" ], [ "[100, 1, 15, 2]", "10230" ], [ "[10000, 10000]", "200000000" ], [ "[-1.4, 4.6, 6.3]", "75" ],...
HumanEval/133
def sum_squares(lst): """You are given a list of numbers. You need to return the sum of squared numbers in the given list, round each element in the list to the upper int(Ceiling) first. Examples: For lst = [1,2,3] the output should be 14 For lst = [1,4,9] the output should be 98 For lst =...
null
def check_if_last_char_is_a_letter(txt): ''' Create a function that returns True if the last character of a given string is an alphabetical character and is not a part of a word, and False otherwise. Note: "word" is a group of characters separated by space. Examples: check_if_last_char_is_...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "\"apple pie\"", "False" ], [ "\"apple pi e\"", "True" ], [ "\"apple pi e \"", "False" ], [ "\"\"", "False" ] ]
check_if_last_char_is_a_letter
[]
code_generation
HumanEval_plus
python
[ [ "apple", "False" ], [ "apple pi e", "True" ], [ "eeeee", "False" ], [ "A", "True" ], [ "Pumpkin pie ", "False" ], [ "Pumpkin pie 1", "False" ], [ "", "False" ], [ "eeeee e ", "False" ], [ "apple pie", "False" ...
HumanEval/134
def check_if_last_char_is_a_letter(txt): ''' Create a function that returns True if the last character of a given string is an alphabetical character and is not a part of a word, and False otherwise. Note: "word" is a group of characters separated by space. Examples: check_if_last_char_is_...
null
def can_arrange(arr): """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. Examples: can_arrange([1,2,4,3,5]) =...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "[1,2,4,3,5]", "3" ], [ "[1,2,3]", "-1" ] ]
can_arrange
[]
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.
code_generation
HumanEval_plus
python
[ [ "[1, 2, 4, 3, 5]", "3" ], [ "[1, 2, 4, 5]", "-1" ], [ "[1, 4, 2, 5, 6, 7, 8, 9, 10]", "2" ], [ "[4, 8, 5, 7, 3]", "4" ], [ "[]", "-1" ], [ "[1]", "-1" ], [ "[1, 2, 3, 4, 5]", "-1" ], [ "[5, 4, 3, 2, 1]", "4" ], [ "...
HumanEval/135
def can_arrange(arr): """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. Examples: can_arrange([1,2,4,3,5]) =...
null
def largest_smallest_integers(lst): ''' 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 negative or positive integers, return them as None. Examples: largest_smallest_intege...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "[2, 4, 1, 3, 5, 7]", "(None, 1)" ], [ "[]", "(None, None)" ], [ "[0]", "(None, None)" ] ]
largest_smallest_integers
[]
code_generation
HumanEval_plus
python
[ [ "[2, 4, 1, 3, 5, 7]", "(None, 1)" ], [ "[2, 4, 1, 3, 5, 7, 0]", "(None, 1)" ], [ "[1, 3, 2, 4, 5, 6, -2]", "(-2, 1)" ], [ "[4, 5, 3, 6, 2, 7, -7]", "(-7, 2)" ], [ "[7, 3, 8, 4, 9, 2, 5, -9]", "(-9, 2)" ], [ "[]", "(None, None)" ], [ "[0]"...
HumanEval/136
def largest_smallest_integers(lst): ''' 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 negative or positive integers, return them as None. Examples: largest_smallest_intege...
null
def compare_one(a, b): """ Create a function that takes integers, floats, or strings representing real numbers, and returns the larger variable in its given variable type. Return None if the values are equal. Note: If a real number is represented as a string, the floating point might be . or , ...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "1, 2.5", "2.5" ], [ "1, \"2,3\"", "\"2,3\"" ], [ "\"5,1\", \"6\"", "\"6\"" ], [ "\"1\", 1", "None" ] ]
compare_one
[]
Create a function that takes integers, floats, or strings representing real numbers, and returns the larger variable in its given variable type. Return None if the values are equal. Note: If a real number is represented as a string, the floating point might be . or , compare_one(1, 2.5) ➞ 2.5 compare_one(1, "2,3") ➞ "2...
code_generation
HumanEval_plus
python
[ [ "1, 2", "2" ], [ "1, 2.5", "2.5" ], [ "2, 3", "3" ], [ "5, 6", "6" ], [ "1, 2,3", "2,3" ], [ "5,1, 6", "6" ], [ "1, 2", "2" ], [ "1, 1", "None" ], [ "3, 3", "None" ], [ "-1, -1", "None" ], [ ...
HumanEval/137
def compare_one(a, b): """ Create a function that takes integers, floats, or strings representing real numbers, and returns the larger variable in its given variable type. Return None if the values are equal. Note: If a real number is represented as a string, the floating point might be . or , ...
null
def is_equal_to_sum_even(n): """Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers Example is_equal_to_sum_even(4) == False is_equal_to_sum_even(6) == False is_equal_to_sum_even(8) == True """ return n%2 == 0 and n >= 8
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "4", "False" ], [ "6", "False" ], [ "8", "True" ] ]
is_equal_to_sum_even
[]
Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers
code_generation
HumanEval_plus
python
[ [ "4", "False" ], [ "6", "False" ], [ "8", "True" ], [ "10", "True" ], [ "11", "False" ], [ "12", "True" ], [ "13", "False" ], [ "16", "True" ], [ "20", "True" ], [ "22", "True" ], [ "24", ...
HumanEval/138
def is_equal_to_sum_even(n): """Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers Example is_equal_to_sum_even(4) == False is_equal_to_sum_even(6) == False is_equal_to_sum_even(8) == True """
null
def special_factorial(n): """The Brazilian factorial is defined as: brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1! where n > 0 For example: >>> special_factorial(4) 288 The function will receive an integer as input and should return the special factorial of this integer. ...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "4", "288" ] ]
special_factorial
[]
The Brazilian factorial is defined as: brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1! where n > 0
code_generation
HumanEval_plus
python
null
HumanEval/139
def special_factorial(n): """The Brazilian factorial is defined as: brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1! where n > 0 For example: >>> special_factorial(4) 288 The function will receive an integer as input and should return the special factorial of this integer. ...
null
def fix_spaces(text): """ Given a string text, replace all spaces in it with underscores, and if a string has more than 2 consecutive spaces, then replace all consecutive spaces with - fix_spaces("Example") == "Example" fix_spaces("Example 1") == "Example_1" fix_spaces(" Example 2")...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "\"Example\"", "\"Example\"" ], [ "\"Example 1\"", "\"Example_1\"" ], [ "\" Example 2\"", "\"_Example_2\"" ], [ "\" Example 3\"", "\"_Example-3\"" ] ]
fix_spaces
[]
Given a string text, replace all spaces in it with underscores, and if a string has more than 2 consecutive spaces, then replace all consecutive spaces with -
code_generation
HumanEval_plus
python
[ [ "Example", "Example" ], [ "Mudasir Hanif ", "Mudasir_Hanif_" ], [ "Yellow Yellow Dirty Fellow", "Yellow_Yellow__Dirty__Fellow" ], [ "Exa mple", "Exa-mple" ], [ " Exa 1 2 2 mple", "-Exa_1_2_2_mple" ], [ "Hello, world!", "Hello,-world!" ]...
HumanEval/140
def fix_spaces(text): """ Given a string text, replace all spaces in it with underscores, and if a string has more than 2 consecutive spaces, then replace all consecutive spaces with - fix_spaces("Example") == "Example" fix_spaces("Example 1") == "Example_1" fix_spaces(" Example 2")...
null
def file_name_check(file_name): """Create a function which takes a string representing a file's name, and returns 'Yes' if the the file's name is valid, and returns 'No' otherwise. A file's name is considered to be valid if and only if all the following conditions are met: - There should not be mo...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "\"example.txt\"", "'Yes'" ], [ "\"1example.dll\"", "'No'" ] ]
file_name_check
[]
Create a function which takes a string representing a file's name, and returns 'Yes' if the the file's name is valid, and returns 'No' otherwise. A file's name is considered to be valid if and only if all the following conditions are met: - There should not be more than three digits ('0'-'9') in the file's name. - The ...
code_generation
HumanEval_plus
python
[ [ "example.txt", "Yes" ], [ "1example.dll", "No" ], [ "s1sdf3.asd", "No" ], [ "K.dll", "Yes" ], [ "MY16FILE3.exe", "Yes" ], [ "His12FILE94.exe", "No" ], [ "_Y.txt", "No" ], [ "?aREYA.exe", "No" ], [ "/this_is_valid.d...
HumanEval/141
def file_name_check(file_name): """Create a function which takes a string representing a file's name, and returns 'Yes' if the the file's name is valid, and returns 'No' otherwise. A file's name is considered to be valid if and only if all the following conditions are met: - There should not be mo...
null
def sum_squares(lst): """" 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. The function will not change the e...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "[1,2,3]", "6" ], [ "[]", "0" ], [ "[-1,-5,2,-1,-5]", "-126" ] ]
sum_squares
[]
" 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. The function will not change the entries in the list whose indexes are not a mul...
code_generation
HumanEval_plus
python
[ [ "[1, 2, 3]", "6" ], [ "[1, 4, 9]", "14" ], [ "[]", "0" ], [ "[1, 1, 1, 1, 1, 1, 1, 1, 1]", "9" ], [ "[-1, -1, -1, -1, -1, -1, -1, -1, -1]", "-3" ], [ "[0]", "0" ], [ "[-1, -5, 2, -1, -5]", "-126" ], [ "[-56, -99, 1, 0, -2]", ...
HumanEval/142
def sum_squares(lst): """" 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. The function will not change the e...
null
def words_in_sentence(sentence): """ 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 the new stri...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "\"This is a test\"", "\"is\"" ], [ "\"lets go for swimming\"", "\"go for\"" ] ]
words_in_sentence
[]
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 the new string should be the same as the original one.
code_generation
HumanEval_plus
python
[ [ "This is a test", "is" ], [ "lets go for swimming", "go for" ], [ "there is no place available here", "there is no place" ], [ "Hi I am Hussein", "Hi am Hussein" ], [ "go for it", "go for it" ], [ "here", "" ], [ "here is", "is" ], ...
HumanEval/143
def words_in_sentence(sentence): """ 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 the new stri...
null
def simplify(x, n): """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>/<denominator> where ...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "\"1/5\", \"5/1\"", "True" ], [ "\"1/6\", \"2/1\"", "False" ], [ "\"7/10\", \"10/2\"", "False" ] ]
simplify
[]
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>/<denominator> where both numerator and denominator are posit...
code_generation
HumanEval_plus
python
[ [ "1/5, 5/1", "True" ], [ "1/6, 2/1", "False" ], [ "5/1, 3/1", "True" ], [ "7/10, 10/2", "False" ], [ "2/10, 50/10", "True" ], [ "7/2, 4/2", "True" ], [ "11/6, 6/1", "True" ], [ "2/3, 5/2", "False" ], [ "5/2, 3/5", ...
HumanEval/144
def simplify(x, n): """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>/<denominator> where ...
null
def order_by_points(nums): """ Write a function which sorts the given list of integers in ascending order according to the sum of their digits. Note: if there are several items with similar sum of their digits, order them based on their index in original list. For example: >>> order_by_poi...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "[1, 11, -1, -11, -12]", "[-1, -11, 1, -12, 11]" ], [ "[]", "[]" ] ]
order_by_points
[]
Write a function which sorts the given list of integers in ascending order according to the sum of their digits. Note: if there are several items with similar sum of their digits, order them based on their index in original list.
code_generation
HumanEval_plus
python
[ [ "[1, 11, -1, -11, -12]", "[-1, -11, 1, -12, 11]" ], [ "[1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]", "[0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457]" ], [ "[]", "[]" ], [ "[1, -11, -32, 43, 54, -98, 2, -3]", "[-3, -32, -98, -11, ...
HumanEval/145
def order_by_points(nums): """ Write a function which sorts the given list of integers in ascending order according to the sum of their digits. Note: if there are several items with similar sum of their digits, order them based on their index in original list. For example: >>> order_by_poi...
null
def specialFilter(nums): """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: specialFilter([15, -73, 14, -15]) => 1 specialFilter(...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "[15, -73, 14, -15]", "1" ], [ "[33, -2, -3, 45, 21, 109]", "2" ] ]
specialFilter
[]
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).
code_generation
HumanEval_plus
python
[ [ "[5, -2, 1, -5]", "0" ], [ "[15, -73, 14, -15]", "1" ], [ "[33, -2, -3, 45, 21, 109]", "2" ], [ "[43, -12, 93, 125, 121, 109]", "4" ], [ "[71, -2, -33, 75, 21, 19]", "3" ], [ "[1]", "0" ], [ "[]", "0" ], [ "[24, -25, 9, 37, -7...
HumanEval/146
def specialFilter(nums): """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: specialFilter([15, -73, 14, -15]) => 1 specialFilter(...
null
def get_max_triples(n): """ You are given a positive integer n. You have to create an integer array a of length n. For each i (1 ≤ i ≤ n), the value of a[i] = i * i - i + 1. Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, and a[i] + a[j] + a[k] is a multiple of 3. ...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "5", "1" ] ]
get_max_triples
[]
You are given a positive integer n. You have to create an integer array a of length n. For each i (1 ≤ i ≤ n), the value of a[i] = i * i - i + 1. Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, and a[i] + a[j] + a[k] is a multiple of 3.
code_generation
HumanEval_plus
python
[ [ "5", "1" ], [ "6", "4" ], [ "10", "36" ], [ "100", "53361" ], [ "1", "False" ], [ "2", "False" ], [ "3", "0" ], [ "4", "1" ], [ "7", "10" ], [ "12", "60" ], [ "15", "130" ], [ "2...
HumanEval/147
def get_max_triples(n): """ You are given a positive integer n. You have to create an integer array a of length n. For each i (1 ≤ i ≤ n), the value of a[i] = i * i - i + 1. Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, and a[i] + a[j] + a[k] is a multiple of 3. ...
null
def bf(planet1, planet2): ''' There are eight planets in our solar system: the closerst to the Sun is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, Uranus, Neptune. Write a function that takes two planet names as strings planet1 and planet2. The function should return a ...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "\"Jupiter\", \"Neptune\"", "> (\"Saturn\", \"Uranus\")" ], [ "\"Earth\", \"Mercury\"", "> (\"Venus\")" ], [ "\"Mercury\", \"Uranus\"", "> (\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\")" ] ]
bf
[]
code_generation
HumanEval_plus
python
[ [ "Jupiter, Neptune", "('Saturn', 'Uranus')" ], [ "Earth, Mercury", "('Venus',)" ], [ "Mercury, Uranus", "('Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn')" ], [ "Neptune, Venus", "('Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus')" ], [ "Earth, Earth", "()" ], ...
HumanEval/148
def bf(planet1, planet2): ''' There are eight planets in our solar system: the closerst to the Sun is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, Uranus, Neptune. Write a function that takes two planet names as strings planet1 and planet2. The function should return a ...
null
def sorted_list_sum(lst): """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 numbers, and it may contain duplicates. T...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "[\"aa\", \"a\", \"aaa\"]", "[\"aa\"]" ], [ "[\"ab\", \"a\", \"aaa\", \"cd\"]", "[\"ab\", \"cd\"]" ] ]
sorted_list_sum
[]
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 numbers, and it may contain duplicates. The order of the list should be ascending by length of ...
code_generation
HumanEval_plus
python
[ [ "['aa', 'a', 'aaa']", "['aa']" ], [ "['school', 'AI', 'asdf', 'b']", "['AI', 'asdf', 'school']" ], [ "['d', 'b', 'c', 'a']", "[]" ], [ "['d', 'dcba', 'abcd', 'a']", "['abcd', 'dcba']" ], [ "['AI', 'ai', 'au']", "['AI', 'ai', 'au']" ], [ "['a', 'b', '...
HumanEval/149
def sorted_list_sum(lst): """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 numbers, and it may contain duplicates. T...
null
def x_or_y(n, x, y): """A simple program which should return the value of x if n is a prime number and should return the value of y otherwise. Examples: for x_or_y(7, 34, 12) == 34 for x_or_y(15, 8, 5) == 5 """ if n == 1: return y for i in range(2, n): if n % i ==...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "7, 34, 12", "34" ], [ "15, 8, 5", "5" ] ]
x_or_y
[]
A simple program which should return the value of x if n is a prime number and should return the value of y otherwise.
code_generation
HumanEval_plus
python
[ [ "7, 34, 12", "34" ], [ "15, 8, 5", "5" ], [ "3, 33, 5212", "33" ], [ "1259, 3, 52", "3" ], [ "7919, -1, 12", "-1" ], [ "3609, 1245, 583", "583" ], [ "91, 56, 129", "129" ], [ "6, 34, 1234", "1234" ], [ "1, 2, 0", ...
HumanEval/150
def x_or_y(n, x, y): """A simple program which should return the value of x if n is a prime number and should return the value of y otherwise. Examples: for x_or_y(7, 34, 12) == 34 for x_or_y(15, 8, 5) == 5 """
null
def double_the_difference(lst): ''' Given a list of numbers, return the sum of squares of the numbers in the list that are odd. Ignore numbers that are negative or not integers. double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10 double_the_difference([-1, -2, 0]) == 0 double_the_dif...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "[1, 3, 2, 0]", "1 + 9 + 0 + 0 = 10" ], [ "[-1, -2, 0]", "0" ], [ "[9, -2]", "81" ], [ "[0]", "0" ] ]
double_the_difference
[]
code_generation
HumanEval_plus
python
[ [ "[]", "0" ], [ "[5, 4]", "25" ], [ "[0.1, 0.2, 0.3]", "0" ], [ "[-10, -20, -30]", "0" ], [ "[-1, -2, 8]", "0" ], [ "[0.2, 3, 5]", "34" ], [ "[-99, -97, -95, -93, -91, -89, -87, -85, -83, -81, -79, -77, -75, -73, -71, -69, -67, -65, -63, -...
HumanEval/151
def double_the_difference(lst): ''' Given a list of numbers, return the sum of squares of the numbers in the list that are odd. Ignore numbers that are negative or not integers. double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10 double_the_difference([-1, -2, 0]) == 0 double_the_dif...
null
def compare(game,guess): """I think we all remember that feeling when the result of some long-awaited event is finally known. The feelings and thoughts you have at that moment are definitely worth noting down and comparing. Your task is to determine if a person correctly guessed the results of a number...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "[1,2,3,4,5,1],[1,2,3,4,2,-2]", "[0,0,0,0,3,3]" ], [ "[0,5,0,0,0,4],[4,1,1,0,0,-2]", "[4,4,1,0,0,6]" ] ]
compare
[]
I think we all remember that feeling when the result of some long-awaited event is finally known. The feelings and thoughts you have at that moment are definitely worth noting down and comparing. Your task is to determine if a person correctly guessed the results of a number of matches. You are given two arrays of scor...
code_generation
HumanEval_plus
python
[ [ "[1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2]", "[0, 0, 0, 0, 3, 3]" ], [ "[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]", "[0, 0, 0, 0, 0, 0]" ], [ "[1, 2, 3], [-1, -2, -3]", "[2, 4, 6]" ], [ "[1, 2, 3, 5], [-1, 2, 3, 4]", "[2, 0, 0, 1]" ], [ "[1, 1, 1, 1, 1], [0, 0, 0, 0,...
HumanEval/152
def compare(game,guess): """I think we all remember that feeling when the result of some long-awaited event is finally known. The feelings and thoughts you have at that moment are definitely worth noting down and comparing. Your task is to determine if a person correctly guessed the results of a number...
null
def Strongest_Extension(class_name, extensions): """You will be given the name of a class (a string) and a list of extensions. The extensions are to be used to load additional classes to the class. The strength of the extension is as follows: Let CAP be the number of the uppercase letters in the extens...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "'my_class', ['AA', 'Be', 'CC']", "'my_class.AA'" ] ]
Strongest_Extension
[]
You will be given the name of a class (a string) and a list of extensions. The extensions are to be used to load additional classes to the class. The strength of the extension is as follows: Let CAP be the number of the uppercase letters in the extension's name, and let SM be the number of lowercase letters in the exte...
code_generation
HumanEval_plus
python
[ [ "Watashi, ['tEN', 'niNE', 'eIGHt8OKe']", "Watashi.eIGHt8OKe" ], [ "Boku123, ['nani', 'NazeDa', 'YEs.WeCaNe', '32145tggg']", "Boku123.YEs.WeCaNe" ], [ "__YESIMHERE, ['t', 'eMptY', 'nothing', 'zeR00', 'NuLl__', '123NoooneB321']", "__YESIMHERE.NuLl__" ], [ "K, ['Ta', 'TAR', 't...
HumanEval/153
def Strongest_Extension(class_name, extensions): """You will be given the name of a class (a string) and a list of extensions. The extensions are to be used to load additional classes to the class. The strength of the extension is as follows: Let CAP be the number of the uppercase letters in the extens...
null
def cycpattern_check(a , b): """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") => False cycpattern_check("ab...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "\"abcd\",\"abd\"", "False" ], [ "\"hello\",\"ell\"", "True" ], [ "\"whassup\",\"psus\"", "False" ], [ "\"abab\",\"baa\"", "True" ], [ "\"efef\",\"eeff\"", "False" ], [ "\"himenss\",\"simen\"", "True" ] ]
cycpattern_check
[]
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") => False cycpattern_check("abab","baa") => True cycpattern_check("efef","eeff") =>...
code_generation
HumanEval_plus
python
[ [ "xyzw, xyw", "False" ], [ "yello, ell", "True" ], [ "whattup, ptut", "False" ], [ "efef, fee", "True" ], [ "abab, aabb", "False" ], [ "winemtt, tinem", "True" ], [ "hello, olelh", "False" ], [ "abcdefg, cde", "True" ], ...
HumanEval/154
def cycpattern_check(a , b): """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") => False cycpattern_check("ab...
null
def even_odd_count(num): """Given an integer. return a tuple that has the number of even and odd digits respectively. Example: even_odd_count(-12) ==> (1, 1) even_odd_count(123) ==> (1, 2) """ even_count = 0 odd_count = 0 for i in str(abs(num)): if int(i)%2==0: ...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "-12", "> (1, 1)" ], [ "123", "> (1, 2)" ] ]
even_odd_count
[]
Given an integer. return a tuple that has the number of even and odd digits respectively.
code_generation
HumanEval_plus
python
[ [ "7", "(0, 1)" ], [ "-78", "(1, 1)" ], [ "3452", "(2, 2)" ], [ "346211", "(3, 3)" ], [ "-345821", "(3, 3)" ], [ "-2", "(1, 0)" ], [ "-45347", "(2, 3)" ], [ "0", "(1, 0)" ], [ "2368", "(3, 1)" ], [ "-111"...
HumanEval/155
def even_odd_count(num): """Given an integer. return a tuple that has the number of even and odd digits respectively. Example: even_odd_count(-12) ==> (1, 1) even_odd_count(123) ==> (1, 2) """
null
def int_to_mini_roman(number): """ 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(426) == 'cdxx...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "19", "'xix'" ], [ "152", "'clii'" ], [ "426", "'cdxxvi'" ] ]
int_to_mini_roman
[]
Given a positive integer, obtain its roman numeral equivalent as a string, and return it in lowercase. Restrictions: 1 <= num <= 1000
code_generation
HumanEval_plus
python
[ [ "19", "xix" ], [ "152", "clii" ], [ "251", "ccli" ], [ "426", "cdxxvi" ], [ "500", "d" ], [ "1", "i" ], [ "4", "iv" ], [ "43", "xliii" ], [ "90", "xc" ], [ "94", "xciv" ], [ "532", "dxxx...
HumanEval/156
def int_to_mini_roman(number): """ 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(426) == 'cdxx...
null
def right_angle_triangle(a, b, c): ''' 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: right_angle_triangle(3, 4,...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "3, 4, 5", "True" ], [ "1, 2, 3", "False" ] ]
right_angle_triangle
[]
code_generation
HumanEval_plus
python
[ [ "3, 4, 5", "True" ], [ "1, 2, 3", "False" ], [ "10, 6, 8", "True" ], [ "2, 2, 2", "False" ], [ "7, 24, 25", "True" ], [ "10, 5, 7", "False" ], [ "5, 12, 13", "True" ], [ "15, 8, 17", "True" ], [ "48, 55, 73", "...
HumanEval/157
def right_angle_triangle(a, b, c): ''' 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: right_angle_triangle(3, 4,...
null
def find_max(words): """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 in lexicographical order. find_max(["...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "[\"name\", \"of\", \"string\"]", "\"string\"" ], [ "[\"name\", \"enam\", \"game\"]", "\"enam\"" ], [ "[\"aaaaaaa\", \"bb\" ,\"cc\"]", "\"\"aaaaaaa\"" ] ]
find_max
[]
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 in lexicographical order. find_max(["name", "of", "string"]) == "string" find_max([...
code_generation
HumanEval_plus
python
[ [ "['name', 'of', 'string']", "string" ], [ "['name', 'enam', 'game']", "enam" ], [ "['aaaaaaa', 'bb', 'cc']", "aaaaaaa" ], [ "['abc', 'cba']", "abc" ], [ "['play', 'this', 'game', 'of', 'footbott']", "footbott" ], [ "['we', 'are', 'gonna', 'rock']", ...
HumanEval/158
def find_max(words): """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 in lexicographical order. find_max(["...
null
def eat(number, need, remaining): """ You're a hungry rabbit, and you already have eaten a certain number of carrots, but now you need to eat more carrots to complete the day's meals. you should return an array of [ total number of eaten carrots after your meals, the...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "5, 6, 10", "[11, 4]" ], [ "4, 8, 9", "[12, 1]" ], [ "1, 10, 10", "[11, 0]" ], [ "2, 11, 5", "[7, 0]" ] ]
eat
[]
You're a hungry rabbit, and you already have eaten a certain number of carrots, but now you need to eat more carrots to complete the day's meals. you should return an array of [ total number of eaten carrots after your meals, the number of carrots left after your meals ] if there are not enough remaining carrots, you w...
code_generation
HumanEval_plus
python
[ [ "5, 6, 10", "[11, 4]" ], [ "4, 8, 9", "[12, 1]" ], [ "1, 10, 10", "[11, 0]" ], [ "2, 11, 5", "[7, 0]" ], [ "4, 5, 7", "[9, 2]" ], [ "4, 5, 1", "[5, 0]" ], [ "0, 0, 0", "[0, 0]" ], [ "10, 0, 10", "[10, 10]" ], [ "0,...
HumanEval/159
def eat(number, need, remaining): """ You're a hungry rabbit, and you already have eaten a certain number of carrots, but now you need to eat more carrots to complete the day's meals. you should return an array of [ total number of eaten carrots after your meals, the...
null
def do_algebra(operator, operand): """ Given two lists operator, and operand. The first list has basic algebra operations, and the second list is a list of integers. Use the two given lists to build the algebric expression and return the evaluation of this expression. The basic algebra operation...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "['+', '*', '-'], [2, 3, 4, 5]", "9" ] ]
do_algebra
[]
Given two lists operator, and operand. The first list has basic algebra operations, and the second list is a list of integers. Use the two given lists to build the algebric expression and return the evaluation of this expression. The basic algebra operations: Addition ( + ) Subtraction ( - ) Multiplication ( * ) Floor ...
code_generation
HumanEval_plus
python
[ [ "['**', '*', '+'], [2, 3, 4, 5]", "37" ], [ "['+', '*', '-'], [2, 3, 4, 5]", "9" ], [ "['//', '*'], [7, 3, 4]", "8" ], [ "['+', '-', '*', '//'], [5, 2, 3, 4, 7]", "6" ], [ "['**', '-', '//'], [9, 2, 5, 3]", "80" ], [ "['*', '-', '*', '//'], [3, 6, 2,...
HumanEval/160
def do_algebra(operator, operand): """ Given two lists operator, and operand. The first list has basic algebra operations, and the second list is a list of integers. Use the two given lists to build the algebric expression and return the evaluation of this expression. The basic algebra operation...
null
def solve(s): """You are given a string s. if s[i] is a letter, reverse its case from lower to upper or vise versa, otherwise keep it as it is. If the string contains no letters, reverse the string. The function should return the resulted string. Examples solve("1234") = "4321" solve("...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "\"1234\"", "\"4321\"" ], [ "\"ab\"", "\"AB\"" ], [ "\"#a@C\"", "\"#A@c\"" ] ]
solve
[]
You are given a string s. if s[i] is a letter, reverse its case from lower to upper or vise versa, otherwise keep it as it is. If the string contains no letters, reverse the string. The function should return the resulted string.
code_generation
HumanEval_plus
python
[ [ "AsDf", "aSdF" ], [ "1234", "4321" ], [ "ab", "AB" ], [ "#a@C", "#A@c" ], [ "#AsdfW^45", "#aSDFw^45" ], [ "#6@2", "2@6#" ], [ "#$a^D", "#$A^d" ], [ "#ccc", "#CCC" ], [ "", "" ], [ "ABCDEFG", "abcdef...
HumanEval/161
def solve(s): """You are given a string s. if s[i] is a letter, reverse its case from lower to upper or vise versa, otherwise keep it as it is. If the string contains no letters, reverse the string. The function should return the resulted string. Examples solve("1234") = "4321" solve("...
null
def string_to_md5(text): """ Given a string 'text', return its md5 hash equivalent string. If 'text' is an empty string, return None. >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62' """ import hashlib return hashlib.md5(text.encode('ascii')).hexdigest() if text else ...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "'Hello world'", "'3e25960a79dbc69b674cd4ec67a72c62'" ] ]
string_to_md5
[]
Given a string 'text', return its md5 hash equivalent string. If 'text' is an empty string, return None.
code_generation
HumanEval_plus
python
[ [ "Hello world", "3e25960a79dbc69b674cd4ec67a72c62" ], [ "", "None" ], [ "A B C", "0ef78513b0cb8cef12743f5aeb35f888" ], [ "password", "5f4dcc3b5aa765d61d8327deb882cf99" ], [ "5873hajsdklh", "0dbb501bb9d84c751d2cf6394d9308c0" ], [ "This is a long string...
HumanEval/162
def string_to_md5(text): """ Given a string 'text', return its md5 hash equivalent string. If 'text' is an empty string, return None. >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62' """
null
def generate_integers(a, b): """ 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] generate_integers(10, 14) => [] """ lower = max(2, min(a, b...
import numpy as np def is_floats(x) -> bool: # check if it is float; List[float]; Tuple[float] if isinstance(x, float): return True if isinstance(x, (list, tuple)): return all(isinstance(i, float) for i in x) if isinstance(x, np.ndarray): return x.dtype == np.float64 or x.dtype...
[ [ "2, 8", "[2, 4, 6, 8]" ], [ "8, 2", "[2, 4, 6, 8]" ], [ "10, 14", "[]" ] ]
generate_integers
[]
Given two positive integers a and b, return the even digits between a and b, in ascending order.
code_generation
HumanEval_plus
python
[ [ "2, 10", "[2, 4, 6, 8]" ], [ "10, 2", "[2, 4, 6, 8]" ], [ "132, 2", "[2, 4, 6, 8]" ], [ "17, 89", "[]" ], [ "6, 12", "[6, 8]" ], [ "13, 25", "[]" ], [ "50, 60", "[]" ], [ "100, 200", "[]" ], [ "201, 299", "[]" ...
HumanEval/163
def generate_integers(a, b): """ 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] generate_integers(10, 14) => [] """