data_source stringclasses 1
value | prompt listlengths 2 2 | ability stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to find the longest chain which can be formed from the given set of pairs.\n\nYour implementation should pass ... | code | {
"ground_truth": "{\"assert_case\": [\"assert max_chain_length([Pair(5, 24), Pair(15, 25),Pair(27, 40), Pair(50, 60)], 4) == 3\", \"assert max_chain_length([Pair(1, 2), Pair(3, 4),Pair(5, 6), Pair(7, 8)], 4) == 4\", \"assert max_chain_length([Pair(19, 10), Pair(11, 12),Pair(13, 14), Pair(15, 16), Pair(31, 54)], 5) =... | {
"index": "601",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "601"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to find minimum possible value for the given periodic function.\n\nYour implementation should pass test... | code | {
"ground_truth": "{\"assert_case\": [\"assert floor_Min(10,20,30) == 15\", \"assert floor_Min(1,2,1) == 0\", \"assert floor_Min(11,10,9) == 9\"]}",
"style": "rule"
} | {
"index": "609",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "609"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to find the maximum value in record list as tuple attribute in the given tuple list.\n\nYour implementation sh... | code | {
"ground_truth": "{\"assert_case\": [\"assert maximum_value([('key1', [3, 4, 5]), ('key2', [1, 4, 2]), ('key3', [9, 3])]) == [('key1', 5), ('key2', 4), ('key3', 9)]\", \"assert maximum_value([('key1', [4, 5, 6]), ('key2', [2, 5, 3]), ('key3', [10, 4])]) == [('key1', 6), ('key2', 5), ('key3', 10)]\", \"assert maximum... | {
"index": "613",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "613"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to check for the number of jumps required of given length to reach a point of form (d, 0) from origin in a 2d ... | code | {
"ground_truth": "{\"assert_case\": [\"assert min_Jumps((3,4),11)==3.5\", \"assert min_Jumps((3,4),0)==0\", \"assert min_Jumps((11,14),11)==1\"]}",
"style": "rule"
} | {
"index": "617",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "617"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to increment the numeric values in the given strings by k.\n\nYour implementation should pass tests like the f... | code | {
"ground_truth": "{\"assert_case\": [\"assert increment_numerics([\\\"MSM\\\", \\\"234\\\", \\\"is\\\", \\\"98\\\", \\\"123\\\", \\\"best\\\", \\\"4\\\"] , 6) == ['MSM', '240', 'is', '104', '129', 'best', '10']\", \"assert increment_numerics([\\\"Dart\\\", \\\"356\\\", \\\"is\\\", \\\"88\\\", \\\"169\\\", \\\"Super\... | {
"index": "621",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "621"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to interchange the first and last element in a given list.\n\nYour implementation should pass tests lik... | code | {
"ground_truth": "{\"assert_case\": [\"assert swap_List([1,2,3]) == [3,2,1]\", \"assert swap_List([1,2,3,4,4]) == [4,2,3,4,1]\", \"assert swap_List([4,5,6]) == [6,5,4]\"]}",
"style": "rule"
} | {
"index": "625",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "625"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to find the smallest missing number from a sorted list of natural numbers.\n\nYour implementation shoul... | code | {
"ground_truth": "{\"assert_case\": [\"assert find_First_Missing([0,1,2,3]) == 4\", \"assert find_First_Missing([0,1,2,6,9]) == 3\", \"assert find_First_Missing([2,3,5,8,9]) == 0\"]}",
"style": "rule"
} | {
"index": "627",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "627"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to find the sum of fourth power of first n even natural numbers.\n\nYour implementation should pass tes... | code | {
"ground_truth": "{\"assert_case\": [\"assert even_Power_Sum(2) == 272\", \"assert even_Power_Sum(3) == 1568\", \"assert even_Power_Sum(4) == 5664\"]}",
"style": "rule"
} | {
"index": "634",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "634"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to check if roots of a quadratic equation are reciprocal of each other or not.\n\nYour implementation s... | code | {
"ground_truth": "{\"assert_case\": [\"assert Check_Solution(2,0,2) == \\\"Yes\\\"\", \"assert Check_Solution(2,-5,2) == \\\"Yes\\\"\", \"assert Check_Solution(1,2,3) == \\\"No\\\"\"]}",
"style": "rule"
} | {
"index": "636",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "636"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to remove the parenthesis and what is inbetween them from a string.\n\nYour implementation should pass tests l... | code | {
"ground_truth": "{\"assert_case\": [\"assert remove_parenthesis([\\\"python (chrome)\\\"])==(\\\"python\\\")\", \"assert remove_parenthesis([\\\"string(.abc)\\\"])==(\\\"string\\\")\", \"assert remove_parenthesis([\\\"alpha(num)\\\"])==(\\\"alpha\\\")\"]}",
"style": "rule"
} | {
"index": "640",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "640"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to remove similar rows from the given tuple matrix.\n\nYour implementation should pass tests like the followin... | code | {
"ground_truth": "{\"assert_case\": [\"assert remove_similar_row([[(4, 5), (3, 2)], [(2, 2), (4, 6)], [(3, 2), (4, 5)]] ) == {((2, 2), (4, 6)), ((3, 2), (4, 5))}\", \"assert remove_similar_row([[(5, 6), (4, 3)], [(3, 3), (5, 7)], [(4, 3), (5, 6)]] ) == {((4, 3), (5, 6)), ((3, 3), (5, 7))}\", \"assert remove_similar_... | {
"index": "642",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "642"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to find the product of it’s kth index in the given tuples.\n\nYour implementation should pass tests like the f... | code | {
"ground_truth": "{\"assert_case\": [\"assert find_k_product([(5, 6, 7), (1, 3, 5), (8, 9, 19)], 2) == 665\", \"assert find_k_product([(6, 7, 8), (2, 4, 6), (9, 10, 20)], 1) == 280\", \"assert find_k_product([(7, 8, 9), (3, 5, 7), (10, 11, 21)], 0) == 210\"]}",
"style": "rule"
} | {
"index": "645",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "645"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to count number of cubes of size k in a cube of size n.\n\nYour implementation should pass tests like t... | code | {
"ground_truth": "{\"assert_case\": [\"assert No_of_cubes(2,1) == 8\", \"assert No_of_cubes(5,2) == 64\", \"assert No_of_cubes(1,1) == 1\"]}",
"style": "rule"
} | {
"index": "646",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "646"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to split a string at uppercase letters.\n\nYour implementation should pass tests like the following (more test... | code | {
"ground_truth": "{\"assert_case\": [\"assert split_upperstring(\\\"PythonProgramLanguage\\\")==['Python','Program','Language']\", \"assert split_upperstring(\\\"PythonProgram\\\")==['Python','Program']\", \"assert split_upperstring(\\\"ProgrammingLanguage\\\")==['Programming','Language']\"]}",
"style": "rule"
} | {
"index": "647",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "647"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to exchange the position of every n-th value with (n+1)th value and (n+1)th value with n-th value in a given l... | code | {
"ground_truth": "{\"assert_case\": [\"assert exchange_elements([0,1,2,3,4,5])==[1, 0, 3, 2, 5, 4] \", \"assert exchange_elements([5,6,7,8,9,10])==[6,5,8,7,10,9] \", \"assert exchange_elements([25,35,45,55,75,95])==[35,25,55,45,95,75] \"]}",
"style": "rule"
} | {
"index": "648",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "648"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to calculate the sum of the numbers in a list between the indices of a specified range.\n\nYour impleme... | code | {
"ground_truth": "{\"assert_case\": [\"assert sum_Range_list([2, 1, 5, 6, 8, 3, 4, 9, 10, 11, 8, 12],8,10) == 29\", \"assert sum_Range_list([1,2,3,4,5],1,2) == 5\", \"assert sum_Range_list([1,0,1,2,5,6],4,5) == 11\"]}",
"style": "rule"
} | {
"index": "649",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "649"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to check whether the given two arrays are equal or not.\n\nYour implementation should pass tests like t... | code | {
"ground_truth": "{\"assert_case\": [\"assert are_Equal([1,2,3],[3,2,1],3,3) == True\", \"assert are_Equal([1,1,1],[2,2,2],3,3) == False\", \"assert are_Equal([8,9],[4,5,6],2,3) == False\"]}",
"style": "rule"
} | {
"index": "650",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "650"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to check if one tuple is a subset of another tuple.\n\nYour implementation should pass tests like the followin... | code | {
"ground_truth": "{\"assert_case\": [\"assert check_subset((10, 4, 5, 6), (5, 10)) == True\", \"assert check_subset((1, 2, 3, 4), (5, 6)) == False\", \"assert check_subset((7, 8, 9, 10), (10, 8)) == True\"]}",
"style": "rule"
} | {
"index": "651",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "651"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to flatten the given tuple matrix into the tuple list with each tuple representing each column.\n\nYour implem... | code | {
"ground_truth": "{\"assert_case\": [\"assert matrix_to_list([[(4, 5), (7, 8)], [(10, 13), (18, 17)], [(0, 4), (10, 1)]]) == '[(4, 7, 10, 18, 0, 10), (5, 8, 13, 17, 4, 1)]'\", \"assert matrix_to_list([[(5, 6), (8, 9)], [(11, 14), (19, 18)], [(1, 5), (11, 2)]]) == '[(5, 8, 11, 19, 1, 11), (6, 9, 14, 18, 5, 2)]'\", \"... | {
"index": "652",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "652"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to group a sequence of key-value pairs into a dictionary of lists using collections module.\n\nYour implementa... | code | {
"ground_truth": "{\"assert_case\": [\"assert grouping_dictionary([('yellow', 1), ('blue', 2), ('yellow', 3), ('blue', 4), ('red', 1)])== ({'yellow': [1, 3], 'blue': [2, 4], 'red': [1]})\", \"assert grouping_dictionary([('yellow', 10), ('blue', 20), ('yellow', 30), ('blue', 40), ('red', 10)])== ({'yellow': [10, 30],... | {
"index": "653",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "653"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to find the perimeter of a rectangle.\n\nYour implementation should pass tests like the following (more tests ... | code | {
"ground_truth": "{\"assert_case\": [\"assert rectangle_perimeter(10,20)==60\", \"assert rectangle_perimeter(10,5)==30\", \"assert rectangle_perimeter(4,2)==12\"]}",
"style": "rule"
} | {
"index": "654",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "654"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to find the sum of fifth power of n natural numbers.\n\nYour implementation should pass tests like the ... | code | {
"ground_truth": "{\"assert_case\": [\"assert fifth_Power_Sum(2) == 33\", \"assert fifth_Power_Sum(4) == 1300\", \"assert fifth_Power_Sum(3) == 276\"]}",
"style": "rule"
} | {
"index": "655",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "655"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to find the minimum sum of absolute differences of two arrays.\n\nYour implementation should pass tests... | code | {
"ground_truth": "{\"assert_case\": [\"assert find_Min_Sum([3,2,1],[2,1,3],3) == 0\", \"assert find_Min_Sum([1,2,3],[4,5,6],3) == 9\", \"assert find_Min_Sum([4,1,8,7],[2,3,6,5],4) == 6\"]}",
"style": "rule"
} | {
"index": "656",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "656"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to find the first digit in factorial of a given number.\n\nYour implementation should pass tests like t... | code | {
"ground_truth": "{\"assert_case\": [\"assert first_Digit(5) == 1\", \"assert first_Digit(10) == 3\", \"assert first_Digit(7) == 5\"]}",
"style": "rule"
} | {
"index": "657",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "657"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to find the item with maximum occurrences in a given list.\n\nYour implementation should pass tests like the f... | code | {
"ground_truth": "{\"assert_case\": [\"assert max_occurrences([2,3,8,4,7,9,8,2,6,5,1,6,1,2,3,4,6,9,1,2])==2\", \"assert max_occurrences([1, 3,5, 7,1, 3,13, 15, 17,5, 7,9,1, 11])==1\", \"assert max_occurrences([1, 2, 3,2, 4, 5,1, 1, 1])==1\"]}",
"style": "rule"
} | {
"index": "658",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "658"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to print duplicants from a list of integers.\n\nYour implementation should pass tests like the followin... | code | {
"ground_truth": "{\"assert_case\": [\"assert Repeat([10, 20, 30, 20, 20, 30, 40, 50, -20, 60, 60, -20, -20]) == [20, 30, -20, 60]\", \"assert Repeat([-1, 1, -1, 8]) == [-1]\", \"assert Repeat([1, 2, 3, 1, 2,]) == [1, 2]\"]}",
"style": "rule"
} | {
"index": "659",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "659"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to choose points from two ranges such that no point lies in both the ranges.\n\nYour implementation sho... | code | {
"ground_truth": "{\"assert_case\": [\"assert find_Points(5,10,1,5) == (1,10)\", \"assert find_Points(3,5,7,9) == (3,9)\", \"assert find_Points(1,5,2,8) == (1,8)\"]}",
"style": "rule"
} | {
"index": "660",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "660"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to find the maximum sum that can be formed which has no three consecutive elements present.\n\nYour implementa... | code | {
"ground_truth": "{\"assert_case\": [\"assert max_sum_of_three_consecutive([100, 1000, 100, 1000, 1], 5) == 2101\", \"assert max_sum_of_three_consecutive([3000, 2000, 1000, 3, 10], 5) == 5013\", \"assert max_sum_of_three_consecutive([1, 2, 3, 4, 5, 6, 7, 8], 8) == 27\"]}",
"style": "rule"
} | {
"index": "661",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "661"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to sort a list in a dictionary.\n\nYour implementation should pass tests like the following (more tests will b... | code | {
"ground_truth": "{\"assert_case\": [\"assert sorted_dict({'n1': [2, 3, 1], 'n2': [5, 1, 2], 'n3': [3, 2, 4]})=={'n1': [1, 2, 3], 'n2': [1, 2, 5], 'n3': [2, 3, 4]}\", \"assert sorted_dict({'n1': [25,37,41], 'n2': [41,54,63], 'n3': [29,38,93]})=={'n1': [25, 37, 41], 'n2': [41, 54, 63], 'n3': [29, 38, 93]}\", \"assert... | {
"index": "662",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "662"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to find the largest possible value of k such that k modulo x is y.\n\nYour implementation should pass tests li... | code | {
"ground_truth": "{\"assert_case\": [\"assert find_max_val(15, 10, 5) == 15\", \"assert find_max_val(187, 10, 5) == 185\", \"assert find_max_val(16, 11, 1) == 12\"]}",
"style": "rule"
} | {
"index": "663",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "663"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to find the average of even numbers till a given even number.\n\nYour implementation should pass tests ... | code | {
"ground_truth": "{\"assert_case\": [\"assert average_Even(2) == 2\", \"assert average_Even(4) == 3\", \"assert average_Even(100) == 51\"]}",
"style": "rule"
} | {
"index": "664",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "664"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to shift first element to the end of given list.\n\nYour implementation should pass tests like the foll... | code | {
"ground_truth": "{\"assert_case\": [\"assert move_last([1,2,3,4]) == [2,3,4,1]\", \"assert move_last([2,3,4,1,5,0]) == [3,4,1,5,0,2]\", \"assert move_last([5,4,3,2,1]) == [4,3,2,1,5]\"]}",
"style": "rule"
} | {
"index": "665",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "665"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to count occurrence of a character in a string.\n\nYour implementation should pass tests like the following (m... | code | {
"ground_truth": "{\"assert_case\": [\"assert count_char(\\\"Python\\\",'o')==1\", \"assert count_char(\\\"little\\\",'t')==2\", \"assert count_char(\\\"assert\\\",'s')==2\"]}",
"style": "rule"
} | {
"index": "666",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "666"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to count number of vowels in the string.\n\nYour implementation should pass tests like the following (m... | code | {
"ground_truth": "{\"assert_case\": [\"assert Check_Vow('corner','AaEeIiOoUu') == 2\", \"assert Check_Vow('valid','AaEeIiOoUu') == 2\", \"assert Check_Vow('true','AaEeIiOoUu') ==2\"]}",
"style": "rule"
} | {
"index": "667",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "667"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to replace multiple occurence of character by single.\n\nYour implementation should pass tests like the... | code | {
"ground_truth": "{\"assert_case\": [\"assert replace('peep','e') == 'pep'\", \"assert replace('Greek','e') == 'Grek'\", \"assert replace('Moon','o') == 'Mon'\"]}",
"style": "rule"
} | {
"index": "668",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "668"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to check whether the given ip address is valid or not using regex.\n\nYour implementation should pass tests li... | code | {
"ground_truth": "{\"assert_case\": [\"assert check_IP(\\\"192.168.0.1\\\") == 'Valid IP address'\", \"assert check_IP(\\\"110.234.52.124\\\") == 'Valid IP address'\", \"assert check_IP(\\\"366.1.2.2\\\") == 'Invalid IP address'\"]}",
"style": "rule"
} | {
"index": "669",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "669"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to check whether a sequence of numbers has a decreasing trend or not.\n\nYour implementation should pas... | code | {
"ground_truth": "{\"assert_case\": [\"assert decreasing_trend([-4,-3,-2,-1]) == True\", \"assert decreasing_trend([1,2,3]) == True\", \"assert decreasing_trend([3,2,1]) == False\"]}",
"style": "rule"
} | {
"index": "670",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "670"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to set the right most unset bit.\n\nYour implementation should pass tests like the following (more test... | code | {
"ground_truth": "{\"assert_case\": [\"assert set_Right_most_Unset_Bit(21) == 23\", \"assert set_Right_most_Unset_Bit(11) == 15\", \"assert set_Right_most_Unset_Bit(15) == 15\"]}",
"style": "rule"
} | {
"index": "671",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "671"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to find maximum of three numbers.\n\nYour implementation should pass tests like the following (more tests will... | code | {
"ground_truth": "{\"assert_case\": [\"assert max_of_three(10,20,30)==30\", \"assert max_of_three(55,47,39)==55\", \"assert max_of_three(10,49,30)==49\"]}",
"style": "rule"
} | {
"index": "672",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "672"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to convert a list of multiple integers into a single integer.\n\nYour implementation should pass tests ... | code | {
"ground_truth": "{\"assert_case\": [\"assert convert([1,2,3]) == 123\", \"assert convert([4,5,6]) == 456\", \"assert convert([7,8,9]) == 789\"]}",
"style": "rule"
} | {
"index": "673",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "673"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to remove duplicate words from a given string using collections module.\n\nYour implementation should pass tes... | code | {
"ground_truth": "{\"assert_case\": [\"assert remove_duplicate(\\\"Python Exercises Practice Solution Exercises\\\")==(\\\"Python Exercises Practice Solution\\\")\", \"assert remove_duplicate(\\\"Python Exercises Practice Solution Python\\\")==(\\\"Python Exercises Practice Solution\\\")\", \"assert remove_duplicate... | {
"index": "674",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "674"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to add two integers. however, if the sum is between the given range it will return 20.\n\nYour implementation ... | code | {
"ground_truth": "{\"assert_case\": [\"assert sum_nums(2,10,11,20)==20\", \"assert sum_nums(15,17,1,10)==32\", \"assert sum_nums(10,15,5,30)==20\"]}",
"style": "rule"
} | {
"index": "675",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "675"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to remove everything except alphanumeric characters from the given string by using regex.\n\nYour implementati... | code | {
"ground_truth": "{\"assert_case\": [\"assert remove_extra_char('**//Google Android// - 12. ') == 'GoogleAndroid12'\", \"assert remove_extra_char('****//Google Flutter//*** - 36. ') == 'GoogleFlutter36'\", \"assert remove_extra_char('**//Google Firebase// - 478. ') == 'GoogleFirebase478'\"]}",
"style": "rule"
} | {
"index": "676",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "676"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to check if the triangle is valid or not.\n\nYour implementation should pass tests like the following (more te... | code | {
"ground_truth": "{\"assert_case\": [\"assert validity_triangle(60,50,90)==False\", \"assert validity_triangle(45,75,60)==True\", \"assert validity_triangle(30,50,100)==True\"]}",
"style": "rule"
} | {
"index": "677",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "677"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to remove spaces from a given string.\n\nYour implementation should pass tests like the following (more... | code | {
"ground_truth": "{\"assert_case\": [\"assert remove_spaces(\\\"a b c\\\") == \\\"abc\\\"\", \"assert remove_spaces(\\\"1 2 3\\\") == \\\"123\\\"\", \"assert remove_spaces(\\\" b c\\\") == \\\"bc\\\"\"]}",
"style": "rule"
} | {
"index": "678",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "678"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to access dictionary key’s element by index.\n\nYour implementation should pass tests like the following (more... | code | {
"ground_truth": "{\"assert_case\": [\"assert access_key({'physics': 80, 'math': 90, 'chemistry': 86},0)== 'physics'\", \"assert access_key({'python':10, 'java': 20, 'C++':30},2)== 'C++'\", \"assert access_key({'program':15,'computer':45},1)== 'computer'\"]}",
"style": "rule"
} | {
"index": "679",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "679"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to check whether a sequence of numbers has an increasing trend or not.\n\nYour implementation should pa... | code | {
"ground_truth": "{\"assert_case\": [\"assert increasing_trend([1,2,3,4]) == True\", \"assert increasing_trend([4,3,2,1]) == False\", \"assert increasing_trend([0,1,4,9]) == True\"]}",
"style": "rule"
} | {
"index": "680",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "680"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to find the smallest prime divisor of a number.\n\nYour implementation should pass tests like the follo... | code | {
"ground_truth": "{\"assert_case\": [\"assert smallest_Divisor(10) == 2\", \"assert smallest_Divisor(25) == 5\", \"assert smallest_Divisor(31) == 31\"]}",
"style": "rule"
} | {
"index": "681",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "681"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to multiply two lists using map and lambda function.\n\nYour implementation should pass tests like the followi... | code | {
"ground_truth": "{\"assert_case\": [\"assert mul_list([1, 2, 3],[4,5,6])==[4,10,18]\", \"assert mul_list([1,2],[3,4])==[3,8]\", \"assert mul_list([90,120],[50,70])==[4500,8400]\"]}",
"style": "rule"
} | {
"index": "682",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "682"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to check whether the given number can be represented by sum of two squares or not.\n\nYour implementati... | code | {
"ground_truth": "{\"assert_case\": [\"assert sum_Square(25) == True\", \"assert sum_Square(24) == False\", \"assert sum_Square(17) == True\"]}",
"style": "rule"
} | {
"index": "683",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "683"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to count occurences of a character in a repeated string.\n\nYour implementation should pass tests like ... | code | {
"ground_truth": "{\"assert_case\": [\"assert count_Char(\\\"abcac\\\",'a') == 4\", \"assert count_Char(\\\"abca\\\",'c') == 2\", \"assert count_Char(\\\"aba\\\",'a') == 7\"]}",
"style": "rule"
} | {
"index": "684",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "684"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to find sum of prime numbers between 1 to n.\n\nYour implementation should pass tests like the followin... | code | {
"ground_truth": "{\"assert_case\": [\"assert sum_Of_Primes(10) == 17\", \"assert sum_Of_Primes(20) == 77\", \"assert sum_Of_Primes(5) == 10\"]}",
"style": "rule"
} | {
"index": "685",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "685"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to find the frequency of each element in the given list.\n\nYour implementation should pass tests like the fol... | code | {
"ground_truth": "{\"assert_case\": [\"assert freq_element((4, 5, 4, 5, 6, 6, 5, 5, 4) ) == '{4: 3, 5: 4, 6: 2}'\", \"assert freq_element((7, 8, 8, 9, 4, 7, 6, 5, 4) ) == '{7: 2, 8: 2, 9: 1, 4: 2, 6: 1, 5: 1}'\", \"assert freq_element((1, 4, 3, 1, 4, 5, 2, 6, 2, 7) ) == '{1: 2, 4: 2, 3: 1, 5: 1, 2: 2, 6: 1, 7: 1}'\"... | {
"index": "686",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "686"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to find the greatest common divisor (gcd) of two integers by using recursion.\n\nYour implementation should pa... | code | {
"ground_truth": "{\"assert_case\": [\"assert recur_gcd(12,14) == 2\", \"assert recur_gcd(13,17) == 1\", \"assert recur_gcd(9, 3) == 3\"]}",
"style": "rule"
} | {
"index": "687",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "687"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to get the length of a complex number.\n\nYour implementation should pass tests like the following (more tests... | code | {
"ground_truth": "{\"assert_case\": [\"assert len_complex(3,4)==5.0\", \"assert len_complex(9,10)==13.45362404707371\", \"assert len_complex(7,9)==11.40175425099138\"]}",
"style": "rule"
} | {
"index": "688",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "688"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "## write a function to find the minimum number of jumps to reach the end of the array for the given array of integers where eac... | code | {
"ground_truth": "{\"assert_case\": [\"assert min_jumps([1, 3, 6, 1, 0, 9], 6) == 3\", \"assert min_jumps([1, 3, 5, 8, 9, 2, 6, 7, 6, 8, 9], 11) == 3\", \"assert min_jumps([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 11) == 10\"]}",
"style": "rule"
} | {
"index": "689",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "689"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to multiply consecutive numbers of a given list.\n\nYour implementation should pass tests like the following (... | code | {
"ground_truth": "{\"assert_case\": [\"assert mul_consecutive_nums([1, 1, 3, 4, 4, 5, 6, 7])==[1, 3, 12, 16, 20, 30, 42]\", \"assert mul_consecutive_nums([4, 5, 8, 9, 6, 10])==[20, 40, 72, 54, 60]\", \"assert mul_consecutive_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])==[2, 6, 12, 20, 30, 42, 56, 72, 90]\"]}",
"style": "... | {
"index": "690",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "690"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to group the 1st elements on the basis of 2nd elements in the given tuple list.\n\nYour implementation should ... | code | {
"ground_truth": "{\"assert_case\": [\"assert group_element([(6, 5), (2, 7), (2, 5), (8, 7), (9, 8), (3, 7)]) == {5: [6, 2], 7: [2, 8, 3], 8: [9]}\", \"assert group_element([(7, 6), (3, 8), (3, 6), (9, 8), (10, 9), (4, 8)]) == {6: [7, 3], 8: [3, 9, 4], 9: [10]}\", \"assert group_element([(8, 7), (4, 9), (4, 7), (10,... | {
"index": "691",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "691"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to find the last two digits in factorial of a given number.\n\nYour implementation should pass tests li... | code | {
"ground_truth": "{\"assert_case\": [\"assert last_Two_Digits(7) == 40\", \"assert last_Two_Digits(5) == 20\", \"assert last_Two_Digits(2) == 2\"]}",
"style": "rule"
} | {
"index": "692",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "692"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to remove multiple spaces in a string by using regex.\n\nYour implementation should pass tests like the follow... | code | {
"ground_truth": "{\"assert_case\": [\"assert remove_multiple_spaces('Google Assistant') == 'Google Assistant'\", \"assert remove_multiple_spaces('Quad Core') == 'Quad Core'\", \"assert remove_multiple_spaces('ChromeCast Built-in') == 'ChromeCast Built-in'\"]}",
"style": "rule"
} | {
"index": "693",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "693"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to extract unique values from the given dictionary values.\n\nYour implementation should pass tests like the f... | code | {
"ground_truth": "{\"assert_case\": [\"assert extract_unique({'msm' : [5, 6, 7, 8],'is' : [10, 11, 7, 5],'best' : [6, 12, 10, 8],'for' : [1, 2, 5]} ) == [1, 2, 5, 6, 7, 8, 10, 11, 12]\", \"assert extract_unique({'Built' : [7, 1, 9, 4],'for' : [11, 21, 36, 14, 9],'ISP' : [4, 1, 21, 39, 47],'TV' : [1, 32, 38]} ) == [1... | {
"index": "694",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "694"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to check if each element of the second tuple is greater than its corresponding index in the first tuple.\n\nYo... | code | {
"ground_truth": "{\"assert_case\": [\"assert check_greater((10, 4, 5), (13, 5, 18)) == True\", \"assert check_greater((1, 2, 3), (2, 1, 4)) == False\", \"assert check_greater((4, 5, 6), (5, 6, 7)) == True\"]}",
"style": "rule"
} | {
"index": "695",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "695"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to zip two given lists of lists.\n\nYour implementation should pass tests like the following (more tests will ... | code | {
"ground_truth": "{\"assert_case\": [\"assert zip_list([[1, 3], [5, 7], [9, 11]] ,[[2, 4], [6, 8], [10, 12, 14]] )==[[1, 3, 2, 4], [5, 7, 6, 8], [9, 11, 10, 12, 14]]\", \"assert zip_list([[1, 2], [3, 4], [5, 6]] ,[[7, 8], [9, 10], [11, 12]] )==[[1, 2, 7, 8], [3, 4, 9, 10], [5, 6, 11, 12]]\", \"assert zip_list([['a',... | {
"index": "696",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "696"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to find number of even elements in the given list using lambda function.\n\nYour implementation should pass te... | code | {
"ground_truth": "{\"assert_case\": [\"assert count_even([1, 2, 3, 5, 7, 8, 9, 10])==3\", \"assert count_even([10,15,14,13,-18,12,-20])==5\", \"assert count_even([1, 2, 4, 8, 9])==3\"]}",
"style": "rule"
} | {
"index": "697",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "697"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to sort dictionary items by tuple product of keys for the given dictionary with tuple keys.\n\nYour implementa... | code | {
"ground_truth": "{\"assert_case\": [\"assert sort_dict_item({(5, 6) : 3, (2, 3) : 9, (8, 4): 10, (6, 4): 12} ) == {(2, 3): 9, (6, 4): 12, (5, 6): 3, (8, 4): 10}\", \"assert sort_dict_item({(6, 7) : 4, (3, 4) : 10, (9, 5): 11, (7, 5): 13} ) == {(3, 4): 10, (7, 5): 13, (6, 7): 4, (9, 5): 11}\", \"assert sort_dict_ite... | {
"index": "698",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "698"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to find the minimum number of swaps required to convert one binary string to another.\n\nYour implement... | code | {
"ground_truth": "{\"assert_case\": [\"assert min_Swaps(\\\"1101\\\",\\\"1110\\\") == 1\", \"assert min_Swaps(\\\"1111\\\",\\\"0100\\\") == \\\"Not Possible\\\"\", \"assert min_Swaps(\\\"1110000\\\",\\\"0001101\\\") == 3\"]}",
"style": "rule"
} | {
"index": "699",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "699"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to count the number of elements in a list which are within a specific range.\n\nYour implementation should pas... | code | {
"ground_truth": "{\"assert_case\": [\"assert count_range_in_list([10,20,30,40,40,40,70,80,99],40,100)==6\", \"assert count_range_in_list(['a','b','c','d','e','f'],'a','e')==5\", \"assert count_range_in_list([7,8,9,15,17,19,45],15,20)==3\"]}",
"style": "rule"
} | {
"index": "700",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "700"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to find the equilibrium index of the given array.\n\nYour implementation should pass tests like the following ... | code | {
"ground_truth": "{\"assert_case\": [\"assert equilibrium_index([1, 2, 3, 4, 1, 2, 3]) == 3\", \"assert equilibrium_index([-7, 1, 5, 2, -4, 3, 0]) == 3\", \"assert equilibrium_index([1, 2, 3]) == -1\"]}",
"style": "rule"
} | {
"index": "701",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "701"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to find the minimum number of elements that should be removed such that amax-amin<=k.\n\nYour implementation s... | code | {
"ground_truth": "{\"assert_case\": [\"assert removals([1, 3, 4, 9, 10,11, 12, 17, 20], 9, 4) == 5\", \"assert removals([1, 5, 6, 2, 8], 5, 2) == 3\", \"assert removals([1, 2, 3 ,4, 5, 6], 6, 3) == 2\"]}",
"style": "rule"
} | {
"index": "702",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "702"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to check whether the given key is present in the dictionary or not.\n\nYour implementation should pass tests l... | code | {
"ground_truth": "{\"assert_case\": [\"assert is_key_present({1: 10, 2: 20, 3: 30, 4: 40, 5: 50, 6: 60},5)==True\", \"assert is_key_present({1: 10, 2: 20, 3: 30, 4: 40, 5: 50, 6: 60},6)==True\", \"assert is_key_present({1: 10, 2: 20, 3: 30, 4: 40, 5: 50, 6: 60},10)==False\"]}",
"style": "rule"
} | {
"index": "703",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "703"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to calculate the harmonic sum of n-1.\n\nYour implementation should pass tests like the following (more tests ... | code | {
"ground_truth": "{\"assert_case\": [\"assert harmonic_sum(10)==2.9289682539682538\", \"assert harmonic_sum(4)==2.083333333333333\", \"assert harmonic_sum(7)==2.5928571428571425 \"]}",
"style": "rule"
} | {
"index": "704",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "704"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to sort a list of lists by length and value.\n\nYour implementation should pass tests like the following (more... | code | {
"ground_truth": "{\"assert_case\": [\"assert sort_sublists([[2], [0], [1, 3], [0, 7], [9, 11], [13, 15, 17]])==[[0], [2], [0, 7], [1, 3], [9, 11], [13, 15, 17]]\", \"assert sort_sublists([[1], [2, 3], [4, 5, 6], [7], [10, 11]])==[[1], [7], [2, 3], [10, 11], [4, 5, 6]]\", \"assert sort_sublists([[\\\"python\\\"],[\\... | {
"index": "705",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "705"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to find whether an array is subset of another array.\n\nYour implementation should pass tests like the followi... | code | {
"ground_truth": "{\"assert_case\": [\"assert is_subset([11, 1, 13, 21, 3, 7], 6, [11, 3, 7, 1], 4) == True\", \"assert is_subset([1, 2, 3, 4, 5, 6], 6, [1, 2, 4], 3) == True\", \"assert is_subset([10, 5, 2, 23, 19], 5, [19, 5, 3], 3) == False\"]}",
"style": "rule"
} | {
"index": "706",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "706"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to count the total set bits from 1 to n.\n\nYour implementation should pass tests like the following (m... | code | {
"ground_truth": "{\"assert_case\": [\"assert count_Set_Bits(16) == 33\", \"assert count_Set_Bits(2) == 2\", \"assert count_Set_Bits(14) == 28\"]}",
"style": "rule"
} | {
"index": "707",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "707"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to convert a string to a list.\n\nYour implementation should pass tests like the following (more tests ... | code | {
"ground_truth": "{\"assert_case\": [\"assert Convert('python program') == ['python','program']\", \"assert Convert('Data Analysis') ==['Data','Analysis']\", \"assert Convert('Hadoop Training') == ['Hadoop','Training']\"]}",
"style": "rule"
} | {
"index": "708",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "708"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to count unique keys for each value present in the tuple.\n\nYour implementation should pass tests like the fo... | code | {
"ground_truth": "{\"assert_case\": [\"assert get_unique([(3, 4), (1, 2), (2, 4), (8, 2), (7, 2), (8, 1), (9, 1), (8, 4), (10, 4)] ) == '{4: 4, 2: 3, 1: 2}'\", \"assert get_unique([(4, 5), (2, 3), (3, 5), (9, 3), (8, 3), (9, 2), (10, 2), (9, 5), (11, 5)] ) == '{5: 4, 3: 3, 2: 2}'\", \"assert get_unique([(6, 5), (3, ... | {
"index": "709",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "709"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to access the initial and last data of the given tuple record.\n\nYour implementation should pass tests like t... | code | {
"ground_truth": "{\"assert_case\": [\"assert front_and_rear((10, 4, 5, 6, 7)) == (10, 7)\", \"assert front_and_rear((1, 2, 3, 4, 5)) == (1, 5)\", \"assert front_and_rear((6, 7, 8, 9, 10)) == (6, 10)\"]}",
"style": "rule"
} | {
"index": "710",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "710"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to check whether the product of digits of a number at even and odd places is equal or not.\n\nYour impl... | code | {
"ground_truth": "{\"assert_case\": [\"assert product_Equal(2841) == True\", \"assert product_Equal(1234) == False\", \"assert product_Equal(1212) == False\"]}",
"style": "rule"
} | {
"index": "711",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "711"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to remove duplicates from a list of lists.\n\nYour implementation should pass tests like the following (more t... | code | {
"ground_truth": "{\"assert_case\": [\"assert remove_duplicate([[10, 20], [40], [30, 56, 25], [10, 20], [33], [40]])==[[10, 20], [30, 56, 25], [33], [40]] \", \"assert remove_duplicate([\\\"a\\\", \\\"b\\\", \\\"a\\\", \\\"c\\\", \\\"c\\\"] )==[\\\"a\\\", \\\"b\\\", \\\"c\\\"]\", \"assert remove_duplicate([1, 3, 5, ... | {
"index": "712",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "712"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to check if the given tuple contains all valid values or not.\n\nYour implementation should pass tests like th... | code | {
"ground_truth": "{\"assert_case\": [\"assert check_valid((True, True, True, True) ) == True\", \"assert check_valid((True, False, True, True) ) == False\", \"assert check_valid((True, True, True, True) ) == True\"]}",
"style": "rule"
} | {
"index": "713",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "713"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to count the number of distinct power of prime factor of given number.\n\nYour implementation should pa... | code | {
"ground_truth": "{\"assert_case\": [\"assert count_Fac(24) == 3\", \"assert count_Fac(12) == 2\", \"assert count_Fac(4) == 1\"]}",
"style": "rule"
} | {
"index": "714",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "714"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to convert the given string of integers into a tuple.\n\nYour implementation should pass tests like the follow... | code | {
"ground_truth": "{\"assert_case\": [\"assert str_to_tuple(\\\"1, -5, 4, 6, 7\\\") == (1, -5, 4, 6, 7)\", \"assert str_to_tuple(\\\"1, 2, 3, 4, 5\\\") == (1, 2, 3, 4, 5)\", \"assert str_to_tuple(\\\"4, 6, 9, 11, 13, 14\\\") == (4, 6, 9, 11, 13, 14)\"]}",
"style": "rule"
} | {
"index": "715",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "715"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to find the perimeter of a rombus.\n\nYour implementation should pass tests like the following (more tests wil... | code | {
"ground_truth": "{\"assert_case\": [\"assert rombus_perimeter(10)==40\", \"assert rombus_perimeter(5)==20\", \"assert rombus_perimeter(4)==16\"]}",
"style": "rule"
} | {
"index": "716",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "716"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to calculate the standard deviation.\n\nYour implementation should pass tests like the following (more tests w... | code | {
"ground_truth": "{\"assert_case\": [\"assert sd_calc([4, 2, 5, 8, 6])== 2.23606797749979\", \"assert sd_calc([1,2,3,4,5,6,7])==2.160246899469287\", \"assert sd_calc([5,9,10,15,6,4])==4.070217029430577\"]}",
"style": "rule"
} | {
"index": "717",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "717"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to create a list taking alternate elements from another given list.\n\nYour implementation should pass tests l... | code | {
"ground_truth": "{\"assert_case\": [\"assert alternate_elements([\\\"red\\\", \\\"black\\\", \\\"white\\\", \\\"green\\\", \\\"orange\\\"])==['red', 'white', 'orange']\", \"assert alternate_elements([2, 0, 3, 4, 0, 2, 8, 3, 4, 2])==[2, 3, 0, 8, 4]\", \"assert alternate_elements([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])==[1,... | {
"index": "718",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "718"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function that matches a string that has an a followed by zero or more b's.\n\nYour implementation should pass tests lik... | code | {
"ground_truth": "{\"assert_case\": [\"assert text_match(\\\"ac\\\")==('Found a match!')\", \"assert text_match(\\\"dc\\\")==('Not matched!')\", \"assert text_match(\\\"abba\\\")==('Found a match!')\"]}",
"style": "rule"
} | {
"index": "719",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "719"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to remove all characters except letters and numbers using regex\n\nYour implementation should pass tests like ... | code | {
"ground_truth": "{\"assert_case\": [\"assert remove_char(\\\"123abcjw:, .@! eiw\\\") == '123abcjweiw'\", \"assert remove_char(\\\"Hello1234:, ! Howare33u\\\") == 'Hello1234Howare33u'\", \"assert remove_char(\\\"Cool543Triks@:, Make@987Trips\\\") == 'Cool543TriksMake987Trips' \"]}",
"style": "rule"
} | {
"index": "727",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "727"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to add two lists using map and lambda function.\n\nYour implementation should pass tests like the following (m... | code | {
"ground_truth": "{\"assert_case\": [\"assert add_list([1, 2, 3],[4,5,6])==[5, 7, 9]\", \"assert add_list([1,2],[3,4])==[4,6]\", \"assert add_list([10,20],[50,70])==[60,90]\"]}",
"style": "rule"
} | {
"index": "729",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "729"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to calculate the geometric sum of n-1. https://www.w3resource.com/python-exercises/data-structures-and-algorit... | code | {
"ground_truth": "{\"assert_case\": [\"assert geometric_sum(7) == 1.9921875\", \"assert geometric_sum(4) == 1.9375\", \"assert geometric_sum(8) == 1.99609375\"]}",
"style": "rule"
} | {
"index": "738",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "738"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to find area of a sector. The function takes the radius and angle as inputs. Function should return None if th... | code | {
"ground_truth": "{\"assert_case\": [\"assert sector_area(4,45)==6.283185307179586\", \"assert sector_area(9,45)==31.808625617596654\", \"assert sector_area(9,361)==None\"]}",
"style": "rule"
} | {
"index": "746",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "746"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to find the longest common subsequence for the given three string sequence. https://www.geeksforgeeks.org/lcs-... | code | {
"ground_truth": "{\"assert_case\": [\"assert lcs_of_three('AGGT12', '12TXAYB', '12XBA') == 2\", \"assert lcs_of_three('Reels', 'Reelsfor', 'ReelsforReels') == 5\", \"assert lcs_of_three('abcd1e2', 'bc12ea', 'bd1ea') == 3\"]}",
"style": "rule"
} | {
"index": "747",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "747"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function that matches a string that has an 'a' followed by one or more 'b's. https://www.w3resource.com/python-exercise... | code | {
"ground_truth": "{\"assert_case\": [\"assert text_match_zero_one(\\\"ac\\\")==False\", \"assert text_match_zero_one(\\\"dc\\\")==False\", \"assert text_match_zero_one(\\\"abbbba\\\")==True\", \"assert text_match_zero_one(\\\"dsabbbba\\\")==True\", \"assert text_match_zero_one(\\\"asbbbba\\\")==False\", \"assert tex... | {
"index": "756",
"mbpp_split": "train",
"n_tests": "6",
"task_id": "756"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to caluclate arc length of an angle.\n\nYour implementation should pass tests like the following (more tests w... | code | {
"ground_truth": "{\"assert_case\": [\"assert arc_length(9,45)==3.5357142857142856\", \"assert arc_length(9,480)==None\", \"assert arc_length(5,270)==11.785714285714285\"]}",
"style": "rule"
} | {
"index": "761",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "761"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a python function to check for odd parity of a given number.\n\nYour implementation should pass tests like the following ... | code | {
"ground_truth": "{\"assert_case\": [\"assert check_Odd_Parity(13) == True\", \"assert check_Odd_Parity(21) == True\", \"assert check_Odd_Parity(18) == False\"]}",
"style": "rule"
} | {
"index": "768",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "768"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to check if the string is a valid email address or not using regex.\n\nYour implementation should pass tests l... | code | {
"ground_truth": "{\"assert_case\": [\"assert check_email(\\\"ankitrai326@gmail.com\\\") == 'Valid Email'\", \"assert check_email(\\\"my.ownsite@ourearth.org\\\") == 'Valid Email'\", \"assert check_email(\\\"ankitaoie326.com\\\") == 'Invalid Email'\"]}",
"style": "rule"
} | {
"index": "774",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "774"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to count those characters which have vowels as their neighbors in the given string.\n\nYour implementation sho... | code | {
"ground_truth": "{\"assert_case\": [\"assert count_vowels('bestinstareels') == 7\", \"assert count_vowels('partofthejourneyistheend') == 12\", \"assert count_vowels('amazonprime') == 5\"]}",
"style": "rule"
} | {
"index": "776",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "776"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to count the number of lists within a list. The function should return a dictionary, where every list is turne... | code | {
"ground_truth": "{\"assert_case\": [\"assert unique_sublists([[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]])=={(1, 3): 2, (5, 7): 2, (13, 15, 17): 1, (9, 11): 1}\", \"assert unique_sublists([['green', 'orange'], ['black'], ['green', 'orange'], ['white']])=={('green', 'orange'): 2, ('black',): 1, ('white',)... | {
"index": "779",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "779"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to convert rgb color to hsv color. https://www.geeksforgeeks.org/program-change-rgb-color-model-hsv-color-mode... | code | {
"ground_truth": "{\"assert_case\": [\"assert rgb_to_hsv(255, 255, 255)==(0, 0.0, 100.0)\", \"assert rgb_to_hsv(0, 215, 0)==(120.0, 100.0, 84.31372549019608)\", \"assert rgb_to_hsv(10, 215, 110)==(149.26829268292684, 95.34883720930233, 84.31372549019608)\"]}",
"style": "rule"
} | {
"index": "783",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "783"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to calculate the perimeter of a regular polygon.\n\nYour implementation should pass tests like the following (... | code | {
"ground_truth": "{\"assert_case\": [\"assert perimeter_polygon(4,20)==80\", \"assert perimeter_polygon(10,15)==150\", \"assert perimeter_polygon(9,7)==63\"]}",
"style": "rule"
} | {
"index": "789",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "789"
} |
mbpp | [
{
"content": "Please reason step by step inside a <think> </think> block, then put your final solution in a single ```python code block.",
"role": "system"
},
{
"content": "Write a function to find the n - cheap price items from a given dataset using heap queue algorithm.\n\nYour implementation shou... | code | {
"ground_truth": "{\"assert_case\": [\"assert cheap_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-1', 'price': 101.1}]\", \"assert cheap_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],2)==[{'name': 'Item-1', 'price': 101.1},{'name':... | {
"index": "795",
"mbpp_split": "train",
"n_tests": "3",
"task_id": "795"
} |
MBPP for code RL (deduplicated against MBPP+)
MBPP prepared for RLVR training in verl, with two independent hold-outs so both MBPP+ and MBPP's own canonical test split stay reportable after training on this data.
| split | rows | contents |
|---|---|---|
train |
320 | MBPP canonical train + validation + prompt, minus everything in MBPP+ |
test |
378 | exactly the problems in evalplus/mbppplus |
heldout_mbpp_test |
276 | MBPP's canonical test split (task_id 11-510) that is not in MBPP+ |
Prompt
Each row is a two-turn chat asking for reasoning inside an explicit
<think></think> region, then a fenced Python block:
system: Please reason step by step inside a <think> </think> block, then put
your final solution in a single ```python code block.
user: <task>
Your implementation should pass tests like the following ...
First reason step by step inside <think> and </think>. Then write your
complete solution in a single markdown fenced code block ...
The delimiter is deliberate. Without it, reasoning is unmarked prose and the only signal about it is total response length, which conflates "stopped reasoning" with "wrote shorter code". Measured on Qwen2.5-3B during RL on this data, mean response length fell from ~446 tokens at step 9 to 54 by step 95 while training reward held at 0.83: MBPP is easy enough that reasoning earns no extra reward, so GRPO strips it. The tag does not prevent that collapse, but it makes the think region separately measurable.
Half the tests (floor(N/2)) are shown so the model can infer the function name
and signature; all tests are used for reward.
Why 320 and not 974
MBPP full is 974 problems across four canonical splits (prompt 10, test 500,
validation 90, train 374). Two things are removed from the training pool:
- Everything in MBPP+ (378). MBPP+ is derived from MBPP-sanitized and consumes 378 of that config's 427 problems.
- MBPP's canonical test split. Deduplicating against MBPP+ alone would leave 596 training problems, but 276 of those are canonical MBPP test -- fine if MBPP+ is your only benchmark, fatal if you ever want standard MBPP numbers.
Deduplicating MBPP-sanitized against MBPP+ leaves only 49 problems, which is why the sanitized config alone is not viable for training. Each problem here uses its sanitized text and corrected tests where one exists (427 of 974), keeping the other 547 -- sanitized quality at usable size.
Leakage is asserted at build time: no train task_id appears in MBPP+, and no
train row comes from a withheld split.
Format
verl RLHF layout: data_source, prompt, ability, reward_model, extra_info.
reward_model.ground_truth is a JSON string:
{"assert_case": ["assert floor_Min(10,20,30) == 15", "..."]}
The verifier dispatches on the keys of that dict, so one reward path handles
MBPP asserts and competitive-programming stdin/stdout with no dataset-specific
routing. Setup imports (test_setup_code / test_imports) are folded into each
assert string, because every test runs as a standalone script:
solution + "\n" + assert_case[i].
Validation
All 974 MBPP reference solutions score 1.0 through the verifier.
Sources
google-research-datasets/mbpp(configsfullandsanitized)evalplus/mbppplus
- Downloads last month
- 73