dataset_name
string
task_name
string
test_cases
list
compare_func
string
demos
list
src_lang
null
tgt_lang
string
data_id
string
prefix
string
suffix
string
import_str
list
doc_string
string
solution
string
entry_func
string
type
dict
HumanEval
code_generation
[ [ "3", "[3, 5, 7]" ], [ "4", "[4,6,8,10]" ], [ "5", "[5, 7, 9, 11, 13]" ], [ "6", "[6, 8, 10, 12, 14, 16]" ], [ "8", "[8, 10, 12, 14, 16, 18, 20, 22]" ] ]
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]" ] ]
null
python
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...
[]
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 in...
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...
make_a_pile
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "\"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...
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\"]" ] ]
null
python
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. """
[]
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.
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...
words_string
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "12, 15", "14" ], [ "13, 12", "-1" ], [ "33, 12354", "12354" ], [ "5234, 5233", "-1" ], [ "6, 29", "28" ], [ "27, 10", "-1" ], [ "7, 7", "-1" ], [ "546, 546", "546" ] ]
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" ] ]
null
python
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. """
[]
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.
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 """ ...
choose_num
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "1, 5", "\"0b11\"" ], [ "7, 13", "\"0b1010\"" ], [ "964, 977", "\"0b1111001010\"" ], [ "996, 997", "\"0b1111100100\"" ], [ "560, 851", "\"0b1011000010\"" ], [ "185, 546", "\"0b101101110\"" ], [ "362, 496", "\"0b110101101\"" ], [ ...
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\"" ] ]
null
python
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. """
[]
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.
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)...
rounded_avg
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "[15, 33, 1422, 1]", "[1, 15, 33]" ], [ "[152, 323, 1422, 10]", "[]" ], [ "[12345, 2033, 111, 151]", "[111, 151]" ], [ "[135, 103, 31]", "[31, 135]" ] ]
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]", "[]" ] ]
null
python
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. """
[]
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.
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...
unique_digits
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "[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\...
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\"]" ] ]
null
python
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". """
[]
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".
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, ...
by_length
{ "input": { "N": null, "S": null, "a": null, "arr": [ "list" ], "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensi...
HumanEval
code_generation
[ [ "5", "[1, 2, 6, 24, 15]" ], [ "7", "[1, 2, 6, 24, 15, 720, 28]" ], [ "1", "[1]" ], [ "3", "[1, 2, 6]" ] ]
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]" ] ]
null
python
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...
[]
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 * ...
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...
f
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "123", "(8, 13)" ], [ "12", "(4, 6)" ], [ "3", "(1, 2)" ], [ "63", "(6, 8)" ], [ "25", "(5, 6)" ], [ "19", "(4, 6)" ], [ "9", "(4, 5)" ], [ "1", "(0, 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 ...
[ [ "3", "(1, 2)" ], [ "12", "(4, 6)" ] ]
null
python
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. """
[]
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.
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...
even_odd_palindrome
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "[]", "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**0]", "1" ], [ "[1]", "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 ...
[ [ "[]", "0" ], [ "[-1, 11, -11]", "1" ], [ "[1, 1, 2]", "3" ] ]
null
python
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. """
[]
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.
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 >>...
count_nums
{ "input": { "N": null, "S": null, "a": null, "arr": [ "list" ], "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensi...
HumanEval
code_generation
[ [ "[3, 4, 5, 1, 2]", "True" ], [ "[3, 5, 10, 1, 2]", "True" ], [ "[4, 3, 1, 2]", "False" ], [ "[3, 5, 4, 1, 2]", "False" ], [ "[]", "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 ...
[ [ "[3, 4, 5, 1, 2]", ">True" ], [ "[3, 5, 4, 1, 2]", ">False" ] ]
null
python
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...
[]
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 s...
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...
move_one_ball
{ "input": { "N": null, "S": null, "a": null, "arr": [ "list" ], "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensi...
HumanEval
code_generation
[ [ "[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]...
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\"" ] ]
null
python
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...
[]
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 t...
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...
exchange
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "'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}" ], [ "'r t g'", "{'r': 1,'t': 1,'g': 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}" ], [ "''", "{}" ] ]
null
python
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. """
[]
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.
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, '...
histogram
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "\"abcde\", \"ae\"", "('bcd',False)" ], [ "\"abcdef\", \"b\"", "('acdef',False)" ], [ "\"abcdedcba\", \"ab\"", "('cdedc',True)" ], [ "\"dwik\", \"w\"", "('dik',False)" ], [ "\"a\", \"a\"", "('',True)" ], [ "\"abcdedcba\", \"\"", "('abcdedcba',Tru...
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)" ] ]
null
python
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...
[]
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/F...
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...
reverse_delete
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": [ "str" ], "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensio...
HumanEval
code_generation
[ [ "['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']", "[\n 'the n...
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.\"," ] ]
null
python
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. ...
[]
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.
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. ...
odd_count
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "[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]", ...
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" ] ]
null
python
HumanEval_114
def minSubArraySum(nums): """ Given an array of integers nums, find the minimum sum of any non-empty sub-array of nums. """
[]
Given an array of integers nums, find the minimum sum of any non-empty sub-array of nums.
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):...
minSubArraySum
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "[[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" ] ]
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" ] ]
null
python
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...
[ "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...
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...
max_fill
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": [ "int" ], "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensio...
HumanEval
code_generation
[ [ "[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,5]", "[32, 3, 5, 6, 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, 5, 2, 3, 4]", "[1, 2, 3, 4, 5]" ], [ "[-2, -3, -4, -5, -6]", "[-6, -5, -4, -3, -2]" ] ]
null
python
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. """
[]
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.
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]) ==...
sort_array
{ "input": { "N": null, "S": null, "a": null, "arr": [ "list" ], "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensi...
HumanEval
code_generation
[ [ "\"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", "[...
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\"]" ] ]
null
python
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...
[]
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 ass...
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...
select_words
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "\"yogurt\"", "\"u\"" ], [ "\"full\"", "\"u\"" ], [ "\"easy\"", "\"\"" ], [ "\"eAsy\"", "\"\"" ], [ "\"ali\"", "\"\"" ], [ "\"bad\"", "\"a\"" ], [ "\"most\"", "\"o\"" ], [ "\"ab\"", "\"\"" ], [ "\"ba\"", "\"\""...
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\"", "> \"\"" ] ]
null
python
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...
[]
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 gi...
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...
get_closest_vowel
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "['()(', ')']", "'Yes'" ], [ "[')', ')']", "'No'" ], [ "['(()(())', '())())']", "'No'" ], [ "[')())', '(()()(']", "'Yes'" ], [ "['(())))', '(()())((']", "'Yes'" ], [ "['()', '())']", "'No'" ], [ "['(()(', '()))()']", "'Yes'" ], [ ...
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'" ] ]
null
python
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...
[]
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 good if and only if all parentheses...
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...
match_parens
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "[-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", ...
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]" ] ]
null
python
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. """
[]
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.
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:...
maximum
{ "input": { "N": null, "S": null, "a": null, "arr": [ "list" ], "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensi...
HumanEval
code_generation
[ [ "[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" ] ]
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" ] ]
null
python
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. """
[]
Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.
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...
solution
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "[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" ] ]
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" ] ]
null
python
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. """
[]
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.
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: ...
add_elements
{ "input": { "N": null, "S": null, "a": null, "arr": [ "list" ], "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensi...
HumanEval
code_generation
[ [ "14", "[1, 5, 7, 11, 13, 17]" ], [ "5", "[1, 5]" ], [ "12", "[1, 3, 5]" ], [ "1", "[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 ...
[ [ "5", "[1, 5]" ] ]
null
python
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...
[]
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...
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...
get_odd_collatz
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "'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" ], [ ...
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" ] ]
null
python
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...
[]
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,...
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...
valid_date
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": [ "str" ], "decimal": null, "delimeter": null, "dict": null, "extensio...
HumanEval
code_generation
[ [ "\"Hello world!\"", "[\"Hello\",\"world!\"]" ], [ "\"Hello,world!\"", "[\"Hello\",\"world!\"]" ], [ "\"Hello world,!\"", "[\"Hello\",\"world,!\"]" ], [ "\"Hello,Hello,world !\"", "[\"Hello,Hello,world\",\"!\"]" ], [ "\"abcdef\"", "3" ], [ "\"aaabb\""...
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" ] ]
null
python
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('...
[]
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('z') = 25
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('...
split_words
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "[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"...
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" ], [ "...
null
python
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. '''
[]
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.
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 ...
is_sorted
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "(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\"" ]...
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\"" ] ]
null
python
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...
[]
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 assumed that its start is less or equal its end. ...
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...
intersection
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "[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" ] ]
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" ] ]
null
python
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. """
[]
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.
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 ...
prod_signs
{ "input": { "N": null, "S": null, "a": null, "arr": [ "list" ], "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensi...
HumanEval
code_generation
[ [ "[[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", "[...
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]" ] ]
null
python
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...
[]
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 i...
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...
minPath
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "3", "[1, 3, 2.0, 8.0]" ], [ "4", "[1, 3, 2.0, 8.0, 3.0]" ], [ "5", "[1, 3, 2.0, 8.0, 3.0, 15.0]" ], [ "6", "[1, 3, 2.0, 8.0, 3.0, 15.0, 4.0]" ], [ "7", "[1, 3, 2.0, 8.0, 3.0, 15.0, 4.0, 24.0]" ], [ "8", "[1, 3, 2.0, 8.0, 3.0, 15.0, 4.0, 24.0, 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", "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]" ] ]
null
python
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) + ...
[]
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 +...
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) + ...
tri
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "5", "5" ], [ "54", "5" ], [ "120", "1" ], [ "5014", "5" ], [ "98765", "315" ], [ "5576543", "2625" ], [ "2468", "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 ...
[ [ "1", "1" ], [ "4", "0" ], [ "235", "15" ] ]
null
python
HumanEval_131
def digits(n): """Given a positive integer n, return the product of the odd digits. Return 0 if all digits are even. """
[]
Given a positive integer n, return the product of the odd digits. Return 0 if all digits are even.
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...
digits
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "'[[]]'", "True" ], [ "'[]]]]]]][[[[[]'", "False" ], [ "'[][]'", "False" ], [ "'[]'", "False" ], [ "'[[[[]]]]'", "True" ], [ "'[]]]]]]]]]]'", "False" ], [ "'[][][[]]'", "True" ], [ "'[[]'", "False" ], [ "'[]]'", ...
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" ] ]
null
python
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. '''
[]
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.
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('[...
is_nested
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "[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" ], [ "[-1.4,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,2,3]", "14" ], [ "[1,4,9]", "98" ], [ "[1,3,5,7]", "84" ], [ "[1.4,4.2,0]", "29" ], [ "[-2.4,1,1]", "6" ] ]
null
python
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. """
[]
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.
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 =...
sum_squares
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "\"apple\"", "False" ], [ "\"apple pi e\"", "True" ], [ "\"eeeee\"", "False" ], [ "\"A\"", "True" ], [ "\"Pumpkin pie \"", "False" ], [ "\"Pumpkin pie 1\"", "False" ], [ "\"\"", "False" ], [ "\"eeeee e \"", "False" ], ...
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" ] ]
null
python
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. '''
[]
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.
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_...
check_if_last_char_is_a_letter
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "[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" ] ]
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" ] ]
null
python
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. """
[]
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.
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]) =...
can_arrange
{ "input": { "N": null, "S": null, "a": null, "arr": [ "list" ], "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensi...
HumanEval
code_generation
[ [ "[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]"...
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)" ] ]
null
python
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. '''
[]
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.
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...
largest_smallest_integers
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "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" ] ]
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" ] ]
null
python
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 , ...
[]
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 ,
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 , ...
compare_one
{ "input": { "N": null, "S": null, "a": [ "int" ], "arr": null, "array": null, "b": [ "int" ], "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null...
HumanEval
code_generation
[ [ "4", "False" ], [ "6", "False" ], [ "8", "True" ], [ "10", "True" ], [ "11", "False" ], [ "12", "True" ], [ "13", "False" ], [ "16", "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 ...
[ [ "4", "False" ], [ "6", "False" ], [ "8", "True" ] ]
null
python
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 """
[]
Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers
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
is_equal_to_sum_even
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "4", "288" ], [ "5", "34560" ], [ "7", "125411328000" ], [ "1", "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 ...
[ [ "4", "288" ] ]
null
python
HumanEval_139
def special_factorial(n): """The Brazilian factorial is defined as: brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1! where n > 0 The function will receive an integer as input and should return the special factorial of this integer. """
[]
The Brazilian factorial is defined as: brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1! where n > 0 The function will receive an integer as input and should return the special factorial of this integer.
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. ...
special_factorial
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "\"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\"" ] ]
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\"" ] ]
null
python
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 - """
[]
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 -
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")...
fix_spaces
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "\"example.txt\"", "'Yes'" ], [ "\"1example.dll\"", "'No'" ], [ "'s1sdf3.asd'", "'No'" ], [ "'K.dll'", "'Yes'" ], [ "'MY16FILE3.exe'", "'Yes'" ], [ "'His12FILE94.exe'", "'No'" ], [ "'_Y.txt'", "'No'" ], [ "'?aREYA.exe'", "...
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'" ] ]
null
python
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...
[]
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 fi...
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...
file_name_check
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "[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]", "3030" ], [ "[-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,2,3]", "6" ], [ "[]", "0" ], [ "[-1,-5,2,-1,-5]", "-126" ] ]
null
python
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...
[]
" 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...
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...
sum_squares
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "\"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\"", ...
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\"" ] ]
null
python
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...
[]
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. ...
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...
words_in_sentence
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "\"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" ], ...
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" ] ]
null
python
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 ...
[]
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 denominat...
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 ...
simplify
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "[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, 1, 2, 43, 54]"...
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]" ], [ "[]", "[]" ] ]
null
python
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. """
[]
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.
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...
order_by_points
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "[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" ] ]
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" ] ]
null
python
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). """
[]
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).
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(...
specialFilter
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "5", "1" ], [ "6", "4" ], [ "10", "36" ], [ "100", "53361" ] ]
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" ] ]
null
python
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. ...
[]
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.
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. ...
get_max_triples
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "\"Jupiter\", \"Neptune\"", "(\"Saturn\", \"Uranus\")" ], [ "\"Earth\", \"Mercury\"", "(\"Venus\",)" ], [ "\"Mercury\", \"Uranus\"", "(\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\")" ], [ "\"Neptune\", \"Venus\"", "(\"Earth\", \"Mars\", \"Jupiter\", \"Saturn\"...
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\")" ] ]
null
python
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 ...
[]
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 tuple containing all planets whose orbi...
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 ...
bf
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "[\"aa\", \"a\", \"aaa\"]", "[\"aa\"]" ], [ "[\"school\", \"AI\", \"asdf\", \"b\"]", "[\"AI\", \"asdf\", \"school\"]" ], [ "[\"d\", \"b\", \"c\", \"a\"]", "[]" ], [ "[\"d\", \"dcba\", \"abcd\", \"a\"]", "[\"abcd\", \"dcba\"]" ], [ "[\"AI\", \"ai\", \"au\"]", ...
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\"]" ] ]
null
python
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...
[]
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 asc...
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...
sorted_list_sum
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "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", ...
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" ] ]
null
python
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. """
[]
A simple program which should return the value of x if n is a prime number and should return the value of y otherwise.
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 ==...
x_or_y
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "[]", "0" ], [ "[5, 4]", "25" ], [ "[0.1, 0.2, 0.3]", "0" ], [ "[-10, -20, -30]", "0" ], [ "[-1, -2, 8]", "0" ], [ "[0.2, 3, 5]", "34" ] ]
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" ] ]
null
python
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. If the input list is empty, return 0. '''
[]
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. If the input list is empty, return 0.
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...
double_the_difference
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "[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]" ] ]
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]" ] ]
null
python
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...
[]
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 tw...
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...
compare
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "'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', ['...
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'" ] ]
null
python
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...
[]
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...
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...
Strongest_Extension
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": [ "str" ], "date": null, "decimal": null, "delimeter": null, "dict": null, "extensio...
HumanEval
code_generation
[ [ "\"xyzw\", \"xyw\"", "False" ], [ "\"yello\", \"ell\"", "True" ], [ "\"whattup\", \"ptut\"", "False" ], [ "\"efef\", \"fee\"", "True" ], [ "\"abab\", \"aabb\"", "False" ], [ "\"winemtt\", \"tinem\"", "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 ...
[ [ "\"abcd\",\"abd\"", "False" ], [ "\"hello\",\"ell\"", "True" ], [ "\"whassup\",\"psus\"", "False" ], [ "\"abab\",\"baa\"", "True" ], [ "\"efef\",\"eeff\"", "False" ], [ "\"himenss\",\"simen\"", "True" ] ]
null
python
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 """
[]
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
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...
cycpattern_check
{ "input": { "N": null, "S": null, "a": [ "str" ], "arr": null, "array": null, "b": [ "str" ], "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null...
HumanEval
code_generation
[ [ "7", "(0, 1)" ], [ "-78", "(1, 1)" ], [ "3452", "(2, 2)" ], [ "346211", "(3, 3)" ], [ "-345821", "(3, 3)" ], [ "-2", "(1, 0)" ], [ "-45347", "(2, 3)" ], [ "0", "(1, 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)" ] ]
null
python
HumanEval_155
def even_odd_count(num): """Given an integer. return a tuple that has the number of even and odd digits respectively. """
[]
Given an integer. return a tuple that has the number of even and odd digits respectively.
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: ...
even_odd_count
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "19", "'xix'" ], [ "152", "'clii'" ], [ "251", "'ccli'" ], [ "426", "'cdxxvi'" ], [ "500", "'d'" ], [ "1", "'i'" ], [ "4", "'iv'" ], [ "43", "'xliii'" ], [ "90", "'xc'" ], [ "94", "'xciv'" ], [ ...
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'" ] ]
null
python
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 """
[]
Given a positive integer, obtain its roman numeral equivalent as a string, and return it in lowercase. Restrictions: 1 <= num <= 1000
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...
int_to_mini_roman
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "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", "...
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" ] ]
null
python
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. '''
[]
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.
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,...
right_angle_triangle
{ "input": { "N": null, "S": null, "a": [ "int" ], "arr": null, "array": null, "b": [ "int" ], "base": null, "brackets": null, "c": [ "int" ], "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, ...
HumanEval
code_generation
[ [ "[\"name\", \"of\", \"string\"]", "\"string\"" ], [ "[\"name\", \"enam\", \"game\"]", "\"enam\"" ], [ "[\"aaaaaaa\", \"bb\", \"cc\"]", "\"aaaaaaa\"" ], [ "[\"abc\", \"cba\"]", "\"abc\"" ], [ "[\"play\", \"this\", \"game\", \"of\",\"footbott\"]", "\"footbott\...
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\"" ] ]
null
python
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. """
[]
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.
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(["...
find_max
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "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]" ] ]
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]" ] ]
null
python
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...
[]
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 ] ...
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...
eat
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "['**', '*', '+'], [2, 3, 4, 5]", "37" ], [ "['+', '*', '-'], [2, 3, 4, 5]", "9" ], [ "['//', '*'], [7, 3, 4]", "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 ...
[ [ "['+', '*', '-'], [2, 3, 4, 5]", "9" ] ]
null
python
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...
[]
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 ( - ) ...
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...
do_algebra
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "\"AsDf\"", "\"aSdF\"" ], [ "\"1234\"", "\"4321\"" ], [ "\"ab\"", "\"AB\"" ], [ "\"#a@C\"", "\"#A@c\"" ], [ "\"#AsdfW^45\"", "\"#aSDFw^45\"" ], [ "\"#6@2\"", "\"2@6#\"" ], [ "\"#$a^D\"", "\"#$A^d\"" ], [ "\"#ccc\"", "\"#CC...
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\"" ] ]
null
python
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. """
[]
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.
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("...
solve
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "'Hello world'", "'3e25960a79dbc69b674cd4ec67a72c62'" ], [ "''", "None" ], [ "'A B C'", "'0ef78513b0cb8cef12743f5aeb35f888'" ], [ "'password'", "'5f4dcc3b5aa765d61d8327deb882cf99'" ] ]
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'" ] ]
null
python
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. """
[]
Given a string 'text', return its md5 hash equivalent string. If 'text' is an empty string, return None.
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 ...
string_to_md5
{ "input": { "N": null, "S": null, "a": null, "arr": null, "array": null, "b": null, "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null, "extensions": null, ...
HumanEval
code_generation
[ [ "2, 10", "[2, 4, 6, 8]" ], [ "10, 2", "[2, 4, 6, 8]" ], [ "132, 2", "[2, 4, 6, 8]" ], [ "17, 89", "[]" ] ]
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", "[]" ] ]
null
python
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. """
[]
Given two positive integers a and b, return the even digits between a and b, in ascending order.
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...
generate_integers
{ "input": { "N": null, "S": null, "a": [ "int" ], "arr": null, "array": null, "b": [ "int" ], "base": null, "brackets": null, "c": null, "capacity": null, "class_name": null, "date": null, "decimal": null, "delimeter": null, "dict": null...