id string | task_id int64 | prompt string | entry_point string | test_imports list | test_list list | test string |
|---|---|---|---|---|---|---|
Mbpp/2 | 2 | Write a function to find the shared elements from the given two lists. | similar_elements | [] | [
"assert set(similar_elements((3, 4, 5, 6),(5, 7, 4, 10))) == set((4, 5))",
"assert set(similar_elements((1, 2, 3, 4),(5, 4, 3, 7))) == set((3, 4))",
"assert set(similar_elements((11, 12, 14, 13),(17, 15, 14, 13))) == set((13, 14))"
] | import numpy as np
from math import inf
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 == n... |
Mbpp/3 | 3 | Write a python function to identify non-prime numbers. | is_not_prime | [] | [
"assert is_not_prime(2) == False",
"assert is_not_prime(10) == True",
"assert is_not_prime(35) == True",
"assert is_not_prime(37) == False"
] | import numpy as np
from math import inf
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 == n... |
Mbpp/4 | 4 | Write a function to find the n largest integers from a given list of numbers, returned in descending order. | heap_queue_largest | [] | [
"assert heap_queue_largest( [25, 35, 22, 85, 14, 65, 75, 22, 58],3)==[85, 75, 65]",
"assert heap_queue_largest( [25, 35, 22, 85, 14, 65, 75, 22, 58],2)==[85, 75]",
"assert heap_queue_largest( [25, 35, 22, 85, 14, 65, 75, 22, 58],5)==[85, 75, 65, 58, 35]"
] | import numpy as np
from math import inf
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 == n... |
Mbpp/6 | 6 | Write a python function to check whether the two numbers differ at one bit position only or not. | is_Power_Of_Two | [] | [
"assert differ_At_One_Bit_Pos(13,9) == True",
"assert differ_At_One_Bit_Pos(15,8) == False",
"assert differ_At_One_Bit_Pos(2,4) == False",
"assert differ_At_One_Bit_Pos(2, 3) == True",
"assert differ_At_One_Bit_Pos(5, 1) == True",
"assert differ_At_One_Bit_Pos(1, 5) == True"
] | import numpy as np
from math import inf
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 == n... |
Mbpp/7 | 7 | Write a function to find all words which are at least 4 characters long in a string. | find_char_long | [] | [
"assert set(find_char_long('Please move back to stream')) == set(['Please', 'move', 'back', 'stream'])",
"assert set(find_char_long('Jing Eco and Tech')) == set(['Jing', 'Tech'])",
"assert set(find_char_long('Jhingai wulu road Zone 3')) == set(['Jhingai', 'wulu', 'road', 'Zone'])"
] | import numpy as np
from math import inf
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 == n... |
Mbpp/8 | 8 | Write a function to find squares of individual elements in a list. | square_nums | [] | [
"assert square_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])==[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]",
"assert square_nums([10,20,30])==([100,400,900])",
"assert square_nums([12,15])==([144,225])"
] | import numpy as np
from math import inf
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 == n... |
Mbpp/9 | 9 | Write a python function to find the minimum number of rotations (greater than 0) required to get the same string. | find_Rotations | [] | [
"assert find_Rotations(\"aaaa\") == 1",
"assert find_Rotations(\"ab\") == 2",
"assert find_Rotations(\"abc\") == 3"
] | import numpy as np
from math import inf
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 == n... |
Mbpp/11 | 11 | Write a python function to remove first and last occurrence of a given character from the string. | remove_Occ | [] | [
"assert remove_Occ(\"hello\",\"l\") == \"heo\"",
"assert remove_Occ(\"abcda\",\"a\") == \"bcd\"",
"assert remove_Occ(\"PHP\",\"P\") == \"H\""
] | import numpy as np
from math import inf
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 == n... |
Mbpp/12 | 12 | Write a function to sort a given matrix in ascending order according to the sum of its rows. | sort_matrix | [] | [
"assert sort_matrix([[1, 2, 3], [2, 4, 5], [1, 1, 1]])==[[1, 1, 1], [1, 2, 3], [2, 4, 5]]",
"assert sort_matrix([[1, 2, 3], [-2, 4, -5], [1, -1, 1]])==[[-2, 4, -5], [1, -1, 1], [1, 2, 3]]",
"assert sort_matrix([[5,8,9],[6,4,3],[2,1,4]])==[[2, 1, 4], [6, 4, 3], [5, 8, 9]]"
] | import numpy as np
from math import inf
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 == n... |
Mbpp/14 | 14 | Write a python function to find the volume of a triangular prism. | find_Volume | [] | [
"assert find_Volume(10,8,6) == 240",
"assert find_Volume(3,2,2) == 6",
"assert find_Volume(1,2,1) == 1"
] | import numpy as np
from math import inf
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 == n... |
Mbpp/16 | 16 | Write a function to that returns true if the input string contains sequences of lowercase letters joined with an underscore and false otherwise. | text_lowercase_underscore | [] | [
"assert text_lowercase_underscore(\"aab_cbbbc\")==(True)",
"assert text_lowercase_underscore(\"aab_Abbbc\")==(False)",
"assert text_lowercase_underscore(\"Aaab_abbbc\")==(False)"
] | import numpy as np
from math import inf
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 == n... |
Mbpp/17 | 17 | Write a function that returns the perimeter of a square given its side length as input. | square_perimeter | [] | [
"assert square_perimeter(10)==40",
"assert square_perimeter(5)==20",
"assert square_perimeter(4)==16"
] | import numpy as np
from math import inf
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 == n... |
Mbpp/18 | 18 | Write a function to remove characters from the first string which are present in the second string. | remove_dirty_chars | [] | [
"assert remove_dirty_chars(\"probasscurve\", \"pros\") == 'bacuve'",
"assert remove_dirty_chars(\"digitalindia\", \"talent\") == 'digiidi'",
"assert remove_dirty_chars(\"exoticmiles\", \"toxic\") == 'emles'"
] | import numpy as np
from math import inf
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 == n... |
Mbpp/19 | 19 | Write a function to find whether a given array of integers contains any duplicate element. | test_duplicate | [] | [
"assert test_duplicate(([1,2,3,4,5]))==False",
"assert test_duplicate(([1,2,3,4, 4]))==True",
"assert test_duplicate([1,1,2,2,3,3,4,4,5])==True"
] | import numpy as np
from math import inf
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 == n... |
Mbpp/20 | 20 | Write a function to check if the given number is woodball or not. | is_woodall | [] | [
"assert is_woodall(383) == True",
"assert is_woodall(254) == False",
"assert is_woodall(200) == False"
] | import numpy as np
from math import inf
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 == n... |
Mbpp/56 | 56 | Write a python function to check if a given number is one less than twice its reverse. | check | [] | [
"assert check(70) == False",
"assert check(23) == False",
"assert check(73) == True"
] | import numpy as np
from math import inf
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 == n... |
Mbpp/57 | 57 | Write a python function to find the largest number that can be formed with the given list of digits. | find_Max_Num | [] | [
"assert find_Max_Num([1,2,3]) == 321",
"assert find_Max_Num([4,5,6,1]) == 6541",
"assert find_Max_Num([1,2,3,9]) == 9321"
] | import numpy as np
from math import inf
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 == n... |
Mbpp/58 | 58 | Write a python function to check whether the given two integers have opposite sign or not. | opposite_Signs | [] | [
"assert opposite_Signs(1,-2) == True",
"assert opposite_Signs(3,2) == False",
"assert opposite_Signs(-10,-10) == False",
"assert opposite_Signs(-2,2) == True"
] | import numpy as np
from math import inf
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 == n... |
Mbpp/59 | 59 | Write a function to find the nth octagonal number. | is_octagonal | [] | [
"assert is_octagonal(5) == 65",
"assert is_octagonal(10) == 280",
"assert is_octagonal(15) == 645"
] | import numpy as np
from math import inf
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 == n... |
Mbpp/61 | 61 | Write a python function to count the number of substrings with the sum of digits equal to their length. | count_Substrings | [] | [
"assert count_Substrings('112112') == 6",
"assert count_Substrings('111') == 6",
"assert count_Substrings('1101112') == 12"
] | import numpy as np
from math import inf
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 == n... |
Mbpp/62 | 62 | Write a python function to find smallest number in a list. | smallest_num | [] | [
"assert smallest_num([10, 20, 1, 45, 99]) == 1",
"assert smallest_num([1, 2, 3]) == 1",
"assert smallest_num([45, 46, 50, 60]) == 45"
] | import numpy as np
from math import inf
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 == n... |
Mbpp/63 | 63 | Write a function to find the maximum difference between available pairs in the given tuple list. | max_difference | [] | [
"assert max_difference([(3, 5), (1, 7), (10, 3), (1, 2)]) == 7",
"assert max_difference([(4, 6), (2, 17), (9, 13), (11, 12)]) == 15",
"assert max_difference([(12, 35), (21, 27), (13, 23), (41, 22)]) == 23"
] | import numpy as np
from math import inf
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 == n... |
Mbpp/64 | 64 | Write a function to sort a list of tuples using the second value of each tuple. | subject_marks | [] | [
"assert subject_marks([('English', 88), ('Science', 90), ('Maths', 97), ('Social sciences', 82)])==[('Social sciences', 82), ('English', 88), ('Science', 90), ('Maths', 97)]",
"assert subject_marks([('Telugu',49),('Hindhi',54),('Social',33)])==([('Social',33),('Telugu',49),('Hindhi',54)])",
"assert subject_mark... | import numpy as np
from math import inf
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 == n... |
End of preview. Expand in Data Studio
MBPP+ 378 independent val for zero-code-l1. Source evalplus/mbppplus. Gold code dropped. See also Tommysha/zero-code-l1-val.
- Downloads last month
- 71