"{\"inputs\":\"Write a function to calculate the geometric sum of n-1. https:\\/\\/www.w3resource.com\\/python-exercises\\/data-structures-and-algorithms\\/python-recursion-exercise-9.php Here is a solution in Python:\",\"targets\":\"def geometric_sum(n):\\n if n < 0:\\n return 0\\n else:\\n return 1 \\/ (pow(2, n)) + geometric_sum(n - 1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to replace whitespaces with an underscore and vice versa in a given string. Here is a solution in Python:\",\"targets\":\"def replace_spaces(text):\\n return \\\"\\\".join(\\\" \\\" if c == \\\"_\\\" else (\\\"_\\\" if c == \\\" \\\" else c) for c in text)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check if the given array represents min heap or not. https:\\/\\/www.geeksforgeeks.org\\/how-to-check-if-a-given-array-represents-a-binary-heap\\/ This can be solved in Python with the following code:\",\"targets\":\"def check_min_heap_helper(arr, i):\\n if 2 * i + 2 > len(arr):\\n return True\\n left_child = (arr[i] <= arr[2 * i + 1]) and check_min_heap_helper(arr, 2 * i + 1)\\n right_child = (2 * i + 2 == len(arr)) or (arr[i] <= arr[2 * i + 2] \\n and check_min_heap_helper(arr, 2 * i + 2))\\n return left_child and right_child\\n\\ndef check_min_heap(arr):\\n return check_min_heap_helper(arr, 0)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether the given month number contains 30 days or not. Months are given as number from 1 to 12. This can be solved in Python with the following code:\",\"targets\":\"def check_monthnumber_number(monthnum3):\\n return monthnum3==4 or monthnum3==6 or monthnum3==9 or monthnum3==11\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find minimum k records from tuple list. https:\\/\\/www.geeksforgeeks.org\\/python-find-minimum-k-records-from-tuple-list\\/ - in this case a verbatim copy of test cases This can be solved in Python with the following code:\",\"targets\":\"def min_k(test_list, K):\\n res = sorted(test_list, key = lambda x: x[1])[:K]\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to join a list of multiple integers into a single integer. Here is a solution in Python:\",\"targets\":\"def multiple_to_single(L):\\n x = int(\\\"\\\".join(map(str, L)))\\n return x\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find element at a given index after number of rotations. Here is a solution in Python:\",\"targets\":\"def find_Element(arr,ranges,rotations,index) : \\n for i in range(rotations - 1,-1,-1 ) : \\n left = ranges[i][0] \\n right = ranges[i][1] \\n if (left <= index and right >= index) : \\n if (index == left) : \\n index = right \\n else : \\n index = index - 1 \\n return arr[index]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find minimum k records from tuple list. https:\\/\\/www.geeksforgeeks.org\\/python-find-minimum-k-records-from-tuple-list\\/ - in this case a verbatim copy of test cases Here is a solution in Python:\",\"targets\":\"def min_k(test_list, K):\\n res = sorted(test_list, key = lambda x: x[1])[:K]\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the length of the longest sublists. This can be solved in Python with the following code:\",\"targets\":\"def Find_Max_Length(lst): \\n maxLength = max(len(x) for x in lst )\\n return maxLength\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the size in bytes of the given tuple. Here is a solution in Python:\",\"targets\":\"import sys \\ndef tuple_size(tuple_list):\\n return (sys.getsizeof(tuple_list))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function for computing square roots using the babylonian method. This can be solved in Python with the following code:\",\"targets\":\"def babylonian_squareroot(number):\\n if(number == 0):\\n return 0;\\n g = number\\/2.0;\\n g2 = g + 1;\\n while(g != g2):\\n n = number\\/ g;\\n g2 = g;\\n g = (g + n)\\/2;\\n return g;\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find frequency of each element in a flattened list of lists, returned in a dictionary. This can be solved in Python with the following code:\",\"targets\":\"def frequency_lists(list1):\\n list1 = [item for sublist in list1 for item in sublist]\\n dic_data = {}\\n for num in list1:\\n if num in dic_data.keys():\\n dic_data[num] += 1\\n else:\\n key = num\\n value = 1\\n dic_data[key] = value\\n return dic_data\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that returns integers x and y that satisfy ax + by = n as a tuple, or return None if no solution exists. Here is a solution in Python:\",\"targets\":\"def find_solution(a, b, n):\\n\\ti = 0\\n\\twhile i * a <= n:\\n\\t\\tif (n - (i * a)) % b == 0: \\n\\t\\t\\treturn (i, (n - (i * a)) \\/\\/ b)\\n\\t\\ti = i + 1\\n\\treturn None\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the first adverb and their positions in a given sentence. Here is a solution in Python:\",\"targets\":\"import re\\ndef find_adverb_position(text):\\n for m in re.finditer(r\\\"\\\\w+ly\\\", text):\\n return (m.start(), m.end(), m.group(0))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to rotate a given list by specified number of items to the right direction. https:\\/\\/www.geeksforgeeks.org\\/python-program-right-rotate-list-n\\/ Here is a solution in Python:\",\"targets\":\"def rotate_right(list, m):\\n result = list[-m:] + list[:-m]\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function which takes a list and returns a list with the same elements, but the k'th element removed. This can be solved in Python with the following code:\",\"targets\":\"def remove_kth_element(list1, L):\\n return list1[:L-1] + list1[L:]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function that returns the number of integer elements in a given list. This can be solved in Python with the following code:\",\"targets\":\"def count_integer(list1):\\n ctr = 0\\n for i in list1:\\n if isinstance(i, int):\\n ctr = ctr + 1\\n return ctr\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function which returns nth catalan number. This can be solved in Python with the following code:\",\"targets\":\"def catalan_number(num):\\n if num <=1:\\n return 1 \\n res_num = 0\\n for i in range(num):\\n res_num += catalan_number(i) * catalan_number(num-i-1)\\n return res_num\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find nth centered hexagonal number. Here is a solution in Python:\",\"targets\":\"def centered_hexagonal_number(n):\\n return 3 * n * (n - 1) + 1\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in an integer n and calculates the harmonic sum of n-1. This can be solved in Python with the following code:\",\"targets\":\"def harmonic_sum(n):\\n if n < 2:\\n return 1\\n else:\\n return 1 \\/ n + (harmonic_sum(n - 1))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in an array and an integer n, and re-arranges the first n elements of the given array so that all negative elements appear before positive ones, and where the relative order among negative and positive elements is preserved. This can be solved in Python with the following code:\",\"targets\":\"def re_arrange_array(arr, n):\\n j=0\\n for i in range(0, n):\\n if (arr[i] < 0):\\n temp = arr[i]\\n arr[i] = arr[j]\\n arr[j] = temp\\n j = j + 1\\n return arr\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find cubes of individual elements in a list. Here is a solution in Python:\",\"targets\":\"def cube_nums(nums):\\n cube_nums = list(map(lambda x: x ** 3, nums))\\n return cube_nums\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function which takes a list of integers and counts the number of possible unordered pairs where both elements are unequal. Here is a solution in Python:\",\"targets\":\"def count_Pairs(arr,n): \\n cnt = 0; \\n for i in range(n): \\n for j in range(i + 1,n): \\n if (arr[i] != arr[j]): \\n cnt += 1; \\n return cnt;\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the closest smaller number than n. This can be solved in Python with the following code:\",\"targets\":\"def closest_num(N):\\n return (N - 1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in two lists and replaces the last element of the first list with the elements of the second list. This can be solved in Python with the following code:\",\"targets\":\"def replace_list(list1,list2):\\n list1[-1:] = list2\\n replace_list=list1\\n return replace_list\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that matches a word containing 'z'. Here is a solution in Python:\",\"targets\":\"import re\\ndef text_match_wordz(text):\\n patterns = '\\\\w*z.\\\\w*'\\n if re.search(patterns, text):\\n return True\\n else:\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the maximum of two numbers. This can be solved in Python with the following code:\",\"targets\":\"def maximum(a,b): \\n if a >= b: \\n return a \\n else: \\n return b\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to merge three dictionaries into a single dictionary. This can be solved in Python with the following code:\",\"targets\":\"import collections as ct\\ndef merge_dictionaries_three(dict1,dict2, dict3):\\n merged_dict = dict(ct.ChainMap({},dict1,dict2,dict3))\\n return merged_dict\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the next perfect square greater than a given number. Here is a solution in Python:\",\"targets\":\"import math \\ndef next_Perfect_Square(N): \\n nextN = math.floor(math.sqrt(N)) + 1\\n return nextN * nextN\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Given a square matrix of size N*N given as a list of lists, where each cell is associated with a specific cost. A path is defined as a specific sequence of cells that starts from the top-left cell move only right or down and ends on bottom right cell. We want to find a path with the maximum average over all existing paths. Average is computed as total cost divided by the number of cells visited in the path. This can be solved in Python with the following code:\",\"targets\":\"def maxAverageOfPath(cost):\\n N = len(cost)\\n dp = [[0 for i in range(N + 1)] for j in range(N + 1)]\\n dp[0][0] = cost[0][0]\\n for i in range(1, N):\\n dp[i][0] = dp[i - 1][0] + cost[i][0]\\n for j in range(1, N):\\n dp[0][j] = dp[0][j - 1] + cost[0][j]\\n for i in range(1, N):\\n for j in range(1, N):\\n dp[i][j] = max(dp[i - 1][j],\\n dp[i][j - 1]) + cost[i][j]\\n return dp[N - 1][N - 1] \\/ (2 * N - 1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to remove all whitespaces from a string. This can be solved in Python with the following code:\",\"targets\":\"import re\\ndef remove_all_spaces(text):\\n return (re.sub(r'\\\\s+', '',text))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that counts the number of pairs of integers in a list that xor to an even number. This can be solved in Python with the following code:\",\"targets\":\"def find_even_pair(A): \\n count = 0\\n for i in range(0, len(A)): \\n for j in range(i+1, len(A)): \\n if ((A[i] ^ A[j]) % 2 == 0): \\n count += 1\\n\\n return count\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check if given tuple contains no duplicates. Here is a solution in Python:\",\"targets\":\"def check_distinct(test_tup):\\n res = True\\n temp = set()\\n for ele in test_tup:\\n if ele in temp:\\n res = False\\n break\\n temp.add(ele)\\n return res\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to sort a given list of strings of numbers numerically. https:\\/\\/www.geeksforgeeks.org\\/python-sort-numeric-strings-in-a-list\\/ This can be solved in Python with the following code:\",\"targets\":\"def sort_numeric_strings(nums_str):\\n result = [int(x) for x in nums_str]\\n result.sort()\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to round every number of a given list of numbers and print the total sum multiplied by the length of the list. Here is a solution in Python:\",\"targets\":\"def round_and_sum(list1):\\n lenght=len(list1)\\n round_and_sum=sum(list(map(round,list1))* lenght)\\n return round_and_sum\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to get the first element of each sublist. This can be solved in Python with the following code:\",\"targets\":\"def Extract(lst): \\n return [item[0] for item in lst]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes two lists and returns true if they have at least one common element. Here is a solution in Python:\",\"targets\":\"def common_element(list1, list2):\\n result = False\\n for x in list1:\\n for y in list2:\\n if x == y:\\n result = True\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function which takes a tuple of tuples and returns the average value for each tuple as a list. This can be solved in Python with the following code:\",\"targets\":\"def average_tuple(nums):\\n result = [sum(x) \\/ len(x) for x in zip(*nums)]\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find nth bell number. Here is a solution in Python:\",\"targets\":\"def bell_Number(n): \\n bell = [[0 for i in range(n+1)] for j in range(n+1)] \\n bell[0][0] = 1\\n for i in range(1, n+1):\\n bell[i][0] = bell[i-1][i-1]\\n for j in range(1, i+1): \\n bell[i][j] = bell[i-1][j-1] + bell[i][j-1] \\n return bell[n][0]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the largest sum of a contiguous array in the modified array which is formed by repeating the given array k times. Here is a solution in Python:\",\"targets\":\"def max_sub_array_sum_repeated(a, n, k): \\n\\tmax_so_far = -2147483648\\n\\tmax_ending_here = 0\\n\\tfor i in range(n*k): \\n\\t\\tmax_ending_here = max_ending_here + a[i%n] \\n\\t\\tif (max_so_far < max_ending_here): \\n\\t\\t\\tmax_so_far = max_ending_here \\n\\t\\tif (max_ending_here < 0): \\n\\t\\t\\tmax_ending_here = 0\\n\\treturn max_so_far\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert polar coordinates to rectangular coordinates. This can be solved in Python with the following code:\",\"targets\":\"import cmath\\ndef polar_rect(x,y):\\n cn = complex(x,y)\\n cn=cmath.polar(cn)\\n cn1 = cmath.rect(2, cmath.pi)\\n return (cn,cn1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the median length of a trapezium. Here is a solution in Python:\",\"targets\":\"def median_trapezium(base1,base2,height):\\n median = 0.5 * (base1+ base2)\\n return median\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the nth octagonal number. This can be solved in Python with the following code:\",\"targets\":\"def is_octagonal(n): \\n\\treturn 3 * n * n - 2 * n\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether it follows the sequence given in the patterns array. This can be solved in Python with the following code:\",\"targets\":\"def is_samepatterns(colors, patterns): \\n if len(colors) != len(patterns):\\n return False \\n sdict = {}\\n pset = set()\\n sset = set() \\n for i in range(len(patterns)):\\n pset.add(patterns[i])\\n sset.add(colors[i])\\n if patterns[i] not in sdict.keys():\\n sdict[patterns[i]] = []\\n\\n keys = sdict[patterns[i]]\\n keys.append(colors[i])\\n sdict[patterns[i]] = keys\\n\\n if len(pset) != len(sset):\\n return False \\n\\n for values in sdict.values():\\n\\n for i in range(len(values) - 1):\\n if values[i] != values[i+1]:\\n return False\\n\\n return True\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to divide two lists element wise. Here is a solution in Python:\",\"targets\":\"def div_list(nums1,nums2):\\n result = map(lambda x, y: x \\/ y, nums1, nums2)\\n return list(result)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to drop empty items from a given dictionary. Here is a solution in Python:\",\"targets\":\"def drop_empty(dict1):\\n dict1 = {key:value for (key, value) in dict1.items() if value is not None}\\n return dict1\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the list with maximum length. This can be solved in Python with the following code:\",\"targets\":\"def max_length_list(input_list):\\n max_length = max(len(x) for x in input_list ) \\n max_list = max(input_list, key = lambda i: len(i)) \\n return(max_length, max_list)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find all words which are at least 4 characters long in a string. This can be solved in Python with the following code:\",\"targets\":\"import re\\ndef find_char_long(text):\\n return (re.findall(r\\\"\\\\b\\\\w{4,}\\\\b\\\", text))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the directrix of a parabola. Here is a solution in Python:\",\"targets\":\"def parabola_directrix(a, b, c): \\n directrix=((int)(c - ((b * b) + 1) * 4 * a ))\\n return directrix\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function which takes a list of lists, where each sublist has two elements, and returns a list of two lists where the first list has the first element of each sublist and the second one has the second. Here is a solution in Python:\",\"targets\":\"def merge(lst): \\n return [list(ele) for ele in list(zip(*lst))]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to trim each tuple by k in the given tuple list. This can be solved in Python with the following code:\",\"targets\":\"def trim_tuple(test_list, K):\\n res = []\\n for ele in test_list:\\n N = len(ele)\\n res.append(tuple(list(ele)[K: N - K]))\\n return (str(res))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count the number of rotations required to generate a sorted array. https:\\/\\/www.geeksforgeeks.org\\/count-of-rotations-required-to-generate-a-sorted-array\\/ Here is a solution in Python:\",\"targets\":\"def count_rotation(arr): \\n for i in range (1,len(arr)): \\n if (arr[i] < arr[i - 1]): \\n return i \\n return 0\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to subtract two lists element-wise. Here is a solution in Python:\",\"targets\":\"def sub_list(nums1,nums2):\\n result = map(lambda x, y: x - y, nums1, nums2)\\n return list(result)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find sum and average of first n natural numbers. This can be solved in Python with the following code:\",\"targets\":\"def sum_average(number):\\n total = 0\\n for value in range(1, number + 1):\\n total = total + value\\n average = total \\/ number\\n return (total,average)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to sum the length of the names of a given list of names after removing the names that start with a lowercase letter. This can be solved in Python with the following code:\",\"targets\":\"def sample_nam(sample_names):\\n sample_names=list(filter(lambda el:el[0].isupper() and el[1:].islower(),sample_names))\\n return len(''.join(sample_names))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the surface area of a cylinder. This can be solved in Python with the following code:\",\"targets\":\"def surfacearea_cylinder(r,h):\\n surfacearea=((2*3.1415*r*r) +(2*3.1415*r*h))\\n return surfacearea\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether a specified list is sorted or not. This can be solved in Python with the following code:\",\"targets\":\"def issort_list(list1):\\n result = all(list1[i] <= list1[i+1] for i in range(len(list1)-1))\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the cumulative sum of all the values that are present in the given tuple list. Here is a solution in Python:\",\"targets\":\"def cummulative_sum(test_list):\\n res = sum(map(sum, test_list))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the nth jacobsthal number. https:\\/\\/www.geeksforgeeks.org\\/jacobsthal-and-jacobsthal-lucas-numbers\\/ 0, 1, 1, 3, 5, 11, 21, 43, 85, 171, 341, 683, 1365, 2731, ... Here is a solution in Python:\",\"targets\":\"def jacobsthal_num(n): \\n\\tdp = [0] * (n + 1) \\n\\tdp[0] = 0\\n\\tdp[1] = 1\\n\\tfor i in range(2, n+1): \\n\\t\\tdp[i] = dp[i - 1] + 2 * dp[i - 2] \\n\\treturn dp[n]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that counts the number of pairs of integers in a list that xor to an even number. Here is a solution in Python:\",\"targets\":\"def find_even_pair(A): \\n count = 0\\n for i in range(0, len(A)): \\n for j in range(i+1, len(A)): \\n if ((A[i] ^ A[j]) % 2 == 0): \\n count += 1\\n\\n return count\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the next smallest palindrome of a specified integer, returned as an integer. This can be solved in Python with the following code:\",\"targets\":\"import sys\\ndef next_smallest_palindrome(num):\\n numstr = str(num)\\n for i in range(num+1,sys.maxsize):\\n if str(i) == str(i)[::-1]:\\n return i\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to remove odd numbers from a given list. This can be solved in Python with the following code:\",\"targets\":\"def remove_odd(l):\\n for i in l:\\n if i % 2 != 0:\\n l.remove(i)\\n return l\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to locate the left insertion point for a specified value in sorted order. https:\\/\\/www.w3resource.com\\/python-exercises\\/data-structures-and-algorithms\\/python-data-structure-exercise-24.php Here is a solution in Python:\",\"targets\":\"import bisect\\ndef left_insertion(a, x):\\n i = bisect.bisect_left(a, x)\\n return i\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check if a string represents an integer or not. Here is a solution in Python:\",\"targets\":\"def check_integer(text):\\n text = text.strip()\\n if len(text) < 1:\\n return None\\n else:\\n if all(text[i] in \\\"0123456789\\\" for i in range(len(text))):\\n return True\\n elif (text[0] in \\\"+-\\\") and \\\\\\n all(text[i] in \\\"0123456789\\\" for i in range(1,len(text))):\\n return True\\n else:\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the nth tetrahedral number. This can be solved in Python with the following code:\",\"targets\":\"def tetrahedral_number(n): \\n\\treturn (n * (n + 1) * (n + 2)) \\/ 6\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to sort a list of elements. This can be solved in Python with the following code:\",\"targets\":\"def comb_sort(nums):\\n shrink_fact = 1.3\\n gaps = len(nums)\\n swapped = True\\n i = 0\\n while gaps > 1 or swapped:\\n gaps = int(float(gaps) \\/ shrink_fact)\\n swapped = False\\n i = 0\\n while gaps + i < len(nums):\\n if nums[i] > nums[i+gaps]:\\n nums[i], nums[i+gaps] = nums[i+gaps], nums[i]\\n swapped = True\\n i += 1\\n return nums\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to calculate the area of a regular polygon given the length and number of its sides. This can be solved in Python with the following code:\",\"targets\":\"from math import tan, pi\\ndef area_polygon(s, l):\\n area = s * (l ** 2) \\/ (4 * tan(pi \\/ s))\\n return area\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to reverse only the vowels of a given string (where y is not a vowel). This can be solved in Python with the following code:\",\"targets\":\"def reverse_vowels(str1):\\n\\tvowels = \\\"\\\"\\n\\tfor char in str1:\\n\\t\\tif char in \\\"aeiouAEIOU\\\":\\n\\t\\t\\tvowels += char\\n\\tresult_string = \\\"\\\"\\n\\tfor char in str1:\\n\\t\\tif char in \\\"aeiouAEIOU\\\":\\n\\t\\t\\tresult_string += vowels[-1]\\n\\t\\t\\tvowels = vowels[:-1]\\n\\t\\telse:\\n\\t\\t\\tresult_string += char\\n\\treturn result_string\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that gives loss amount on a sale if the given amount has loss else return 0. Here is a solution in Python:\",\"targets\":\"def loss_amount(actual_cost,sale_amount): \\n if(sale_amount > actual_cost):\\n amount = sale_amount - actual_cost\\n return amount\\n else:\\n return 0\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to calculate the sum of the negative numbers of a given list of numbers. This can be solved in Python with the following code:\",\"targets\":\"def sum_negativenum(nums):\\n sum_negativenum = list(filter(lambda nums:nums<0,nums))\\n return sum(sum_negativenum)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the length of the longest word. This can be solved in Python with the following code:\",\"targets\":\"def len_log(list1):\\n max=len(list1[0])\\n for i in list1:\\n if len(i)>max:\\n max=len(i)\\n return max\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in a list and element and checks whether all items in the list are equal to the given element. Here is a solution in Python:\",\"targets\":\"def check_element(list,element):\\n check_element=all(v== element for v in list)\\n return check_element\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find kth element from the given two sorted arrays. Here is a solution in Python:\",\"targets\":\"def find_kth(arr1, arr2, k):\\n\\tm = len(arr1)\\n\\tn = len(arr2)\\n\\tsorted1 = [0] * (m + n)\\n\\ti = 0\\n\\tj = 0\\n\\td = 0\\n\\twhile (i < m and j < n):\\n\\t\\tif (arr1[i] < arr2[j]):\\n\\t\\t\\tsorted1[d] = arr1[i]\\n\\t\\t\\ti += 1\\n\\t\\telse:\\n\\t\\t\\tsorted1[d] = arr2[j]\\n\\t\\t\\tj += 1\\n\\t\\td += 1\\n\\twhile (i < m):\\n\\t\\tsorted1[d] = arr1[i]\\n\\t\\td += 1\\n\\t\\ti += 1\\n\\twhile (j < n):\\n\\t\\tsorted1[d] = arr2[j]\\n\\t\\td += 1\\n\\t\\tj += 1\\n\\treturn sorted1[k - 1]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to apply a given format string to all of the elements in a list. Here is a solution in Python:\",\"targets\":\"def add_string(list_, string):\\n add_string=[string.format(i) for i in list_]\\n return add_string\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the first odd number in a given list of numbers. Here is a solution in Python:\",\"targets\":\"def first_odd(nums):\\n first_odd = next((el for el in nums if el%2!=0),-1)\\n return first_odd\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the maximum product subarray of the given array. Here is a solution in Python:\",\"targets\":\"def max_subarray_product(arr):\\n\\tn = len(arr)\\n\\tmax_ending_here = 1\\n\\tmin_ending_here = 1\\n\\tmax_so_far = 0\\n\\tflag = 0\\n\\tfor i in range(0, n):\\n\\t\\tif arr[i] > 0:\\n\\t\\t\\tmax_ending_here = max_ending_here * arr[i]\\n\\t\\t\\tmin_ending_here = min (min_ending_here * arr[i], 1)\\n\\t\\t\\tflag = 1\\n\\t\\telif arr[i] == 0:\\n\\t\\t\\tmax_ending_here = 1\\n\\t\\t\\tmin_ending_here = 1\\n\\t\\telse:\\n\\t\\t\\ttemp = max_ending_here\\n\\t\\t\\tmax_ending_here = max (min_ending_here * arr[i], 1)\\n\\t\\t\\tmin_ending_here = temp * arr[i]\\n\\t\\tif (max_so_far < max_ending_here):\\n\\t\\t\\tmax_so_far = max_ending_here\\n\\tif flag == 0 and max_so_far == 0:\\n\\t\\treturn 0\\n\\treturn max_so_far\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find k number of smallest pairs which consist of one element from the first array and one element from the second array. This can be solved in Python with the following code:\",\"targets\":\"import heapq\\ndef k_smallest_pairs(nums1, nums2, k):\\n queue = []\\n def push(i, j):\\n if i < len(nums1) and j < len(nums2):\\n heapq.heappush(queue, [nums1[i] + nums2[j], i, j])\\n push(0, 0)\\n pairs = []\\n while queue and len(pairs) < k:\\n _, i, j = heapq.heappop(queue)\\n pairs.append([nums1[i], nums2[j]])\\n push(i, j + 1)\\n if j == 0:\\n push(i + 1, 0)\\n return pairs\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether any value in a sequence exists in a sequence or not. This can be solved in Python with the following code:\",\"targets\":\"def overlapping(list1,list2): \\n for i in range(len(list1)): \\n for j in range(len(list2)): \\n if(list1[i]==list2[j]): \\n return True\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether a list contains the given sublist or not. Here is a solution in Python:\",\"targets\":\"def is_sublist(l, s):\\n\\tsub_set = False\\n\\tif s == []:\\n\\t\\tsub_set = True\\n\\telif s == l:\\n\\t\\tsub_set = True\\n\\telif len(s) > len(l):\\n\\t\\tsub_set = False\\n\\telse:\\n\\t\\tfor i in range(len(l)):\\n\\t\\t\\tif l[i] == s[0]:\\n\\t\\t\\t\\tn = 1\\n\\t\\t\\t\\twhile (n < len(s)) and (l[i+n] == s[n]):\\n\\t\\t\\t\\t\\tn += 1\\t\\t\\t\\t\\n\\t\\t\\t\\tif n == len(s):\\n\\t\\t\\t\\t\\tsub_set = True\\n\\treturn sub_set\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether the given two integers have opposite sign or not. Here is a solution in Python:\",\"targets\":\"def opposite_Signs(x,y): \\n return ((x ^ y) < 0);\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to return the negative numbers in a list. This can be solved in Python with the following code:\",\"targets\":\"def neg_nos(list1):\\n out = []\\n for num in list1: \\n if num < 0: \\n out.append(num)\\n return out\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to pack consecutive duplicates of a given list elements into sublists. Here is a solution in Python:\",\"targets\":\"from itertools import groupby\\ndef pack_consecutive_duplicates(list1):\\n return [list(group) for key, group in groupby(list1)]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in a dictionary and integer n and filters the dictionary to only include entries with values greater than or equal to n. Here is a solution in Python:\",\"targets\":\"def dict_filter(dict,n):\\n result = {key:value for (key, value) in dict.items() if value >=n}\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert the given tuple to a key-value dictionary using adjacent elements. https:\\/\\/www.geeksforgeeks.org\\/python-convert-tuple-to-adjacent-pair-dictionary\\/ This can be solved in Python with the following code:\",\"targets\":\"def tuple_to_dict(test_tup):\\n res = dict(test_tup[idx : idx + 2] for idx in range(0, len(test_tup), 2))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to flatten a given nested list structure. This can be solved in Python with the following code:\",\"targets\":\"def flatten_list(list1):\\n result_list = []\\n if not list1: return result_list\\n stack = [list(list1)]\\n while stack:\\n c_num = stack.pop()\\n next = c_num.pop()\\n if c_num: stack.append(c_num)\\n if isinstance(next, list):\\n if next: stack.append(list(next))\\n else: result_list.append(next)\\n result_list.reverse()\\n return result_list\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to remove lowercase substrings from a given string. This can be solved in Python with the following code:\",\"targets\":\"import re\\ndef remove_lowercase(str1):\\n return re.sub('[a-z]', '', str1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to set the left most unset bit. This can be solved in Python with the following code:\",\"targets\":\"def set_left_most_unset_bit(n): \\n if not (n & (n + 1)): \\n return n \\n pos, temp, count = 0, n, 0 \\n while temp: \\n if not (temp & 1): \\n pos = count \\n count += 1; temp>>=1\\n return (n | (1 << (pos)))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the number of divisors of a given integer. This can be solved in Python with the following code:\",\"targets\":\"def divisor(n):\\n for i in range(n):\\n x = len([i for i in range(1,n+1) if not n % i])\\n return x\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the second smallest number in a list. Here is a solution in Python:\",\"targets\":\"def second_smallest(numbers):\\n unique_numbers = list(set(numbers))\\n unique_numbers.sort()\\n if len(unique_numbers) < 2:\\n return None\\n else:\\n return unique_numbers[1]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the union of the elements of two given tuples and output them in sorted order. Here is a solution in Python:\",\"targets\":\"def union_elements(test_tup1, test_tup2):\\n res = tuple(set(test_tup1 + test_tup2))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the Eulerian number a(n, m). Here is a solution in Python:\",\"targets\":\"def eulerian_num(n, m): \\n\\tif (m >= n or n == 0): \\n\\t\\treturn 0 \\n\\tif (m == 0): \\n\\t\\treturn 1 \\n\\treturn ((n - m) * eulerian_num(n - 1, m - 1) +(m + 1) * eulerian_num(n - 1, m))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Given a list of tuples, write a function that returns the first value of the tuple with the smallest second value. Here is a solution in Python:\",\"targets\":\"from operator import itemgetter \\ndef index_minimum(test_list):\\n res = min(test_list, key = itemgetter(1))[0]\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find whether a given array of integers contains any duplicate element. This can be solved in Python with the following code:\",\"targets\":\"def test_duplicate(arraynums):\\n nums_set = set(arraynums) \\n return len(arraynums) != len(nums_set)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count the number of rotations required to generate a sorted array. https:\\/\\/www.geeksforgeeks.org\\/count-of-rotations-required-to-generate-a-sorted-array\\/ This can be solved in Python with the following code:\",\"targets\":\"def count_rotation(arr): \\n for i in range (1,len(arr)): \\n if (arr[i] < arr[i - 1]): \\n return i \\n return 0\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to count the number of lists within a list. The function should return a dictionary, where every list is turned to a tuple, and the value of the tuple is the number of its occurrences. This can be solved in Python with the following code:\",\"targets\":\"def unique_sublists(list1):\\n result ={}\\n for l in list1: \\n result.setdefault(tuple(l), list()).append(1) \\n for a, b in result.items(): \\n result[a] = sum(b)\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to count the number of occurrences of a number in a given list. This can be solved in Python with the following code:\",\"targets\":\"def frequency(a,x): \\n count = 0 \\n for i in a: \\n if i == x: \\n count += 1\\n\\n return count\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to reverse each string in a given list of string values. Here is a solution in Python:\",\"targets\":\"def reverse_string_list(stringlist):\\n result = [x[::-1] for x in stringlist]\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function that takes in a tuple and an element and counts the occcurences of the element in the tuple. This can be solved in Python with the following code:\",\"targets\":\"def count_X(tup, x): \\n count = 0\\n for ele in tup: \\n if (ele == x): \\n count = count + 1\\n return count\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the difference between the sum of cubes of the first n natural numbers and the sum of the first n natural numbers. This can be solved in Python with the following code:\",\"targets\":\"def difference(n) : \\n S = (n*(n + 1))\\/\\/2; \\n res = S*(S-1); \\n return res;\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to compute the n-th power of each number in a list. This can be solved in Python with the following code:\",\"targets\":\"def nth_nums(nums,n):\\n nth_nums = list(map(lambda x: x ** n, nums))\\n return nth_nums\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find k number of smallest pairs which consist of one element from the first array and one element from the second array. Here is a solution in Python:\",\"targets\":\"import heapq\\ndef k_smallest_pairs(nums1, nums2, k):\\n queue = []\\n def push(i, j):\\n if i < len(nums1) and j < len(nums2):\\n heapq.heappush(queue, [nums1[i] + nums2[j], i, j])\\n push(0, 0)\\n pairs = []\\n while queue and len(pairs) < k:\\n _, i, j = heapq.heappop(queue)\\n pairs.append([nums1[i], nums2[j]])\\n push(i, j + 1)\\n if j == 0:\\n push(i + 1, 0)\\n return pairs\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find element at a given index after number of rotations. This can be solved in Python with the following code:\",\"targets\":\"def find_Element(arr,ranges,rotations,index) : \\n for i in range(rotations - 1,-1,-1 ) : \\n left = ranges[i][0] \\n right = ranges[i][1] \\n if (left <= index and right >= index) : \\n if (index == left) : \\n index = right \\n else : \\n index = index - 1 \\n return arr[index]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to replace characters in a string. Here is a solution in Python:\",\"targets\":\"def replace_char(str1,ch,newch):\\n str2 = str1.replace(ch, newch)\\n return str2\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to flatten a list and sum all of its elements. This can be solved in Python with the following code:\",\"targets\":\"def recursive_list_sum(data_list):\\n\\ttotal = 0\\n\\tfor element in data_list:\\n\\t\\tif type(element) == type([]):\\n\\t\\t\\ttotal = total + recursive_list_sum(element)\\n\\t\\telse:\\n\\t\\t\\ttotal = total + element\\n\\treturn total\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the sum of the largest and smallest value in a given array. This can be solved in Python with the following code:\",\"targets\":\"def big_sum(nums):\\n sum= max(nums)+min(nums)\\n return sum\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find maximum run of uppercase characters in the given string. Here is a solution in Python:\",\"targets\":\"def max_run_uppercase(test_str):\\n cnt = 0\\n res = 0\\n for idx in range(0, len(test_str)):\\n if test_str[idx].isupper():\\n cnt += 1\\n else:\\n res = cnt\\n cnt = 0\\n if test_str[len(test_str) - 1].isupper():\\n res = cnt\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether the two numbers differ at one bit position only or not. Here is a solution in Python:\",\"targets\":\"def is_Power_Of_Two (x): \\n return x and (not(x & (x - 1))) \\ndef differ_At_One_Bit_Pos(a,b): \\n return is_Power_Of_Two(a ^ b)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to extract specified size of strings from a given list of string values. This can be solved in Python with the following code:\",\"targets\":\"def extract_string(str, l):\\n result = [e for e in str if len(e) == l] \\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the n'th lucas number. This can be solved in Python with the following code:\",\"targets\":\"def find_lucas(n): \\n\\tif (n == 0): \\n\\t\\treturn 2\\n\\tif (n == 1): \\n\\t\\treturn 1\\n\\treturn find_lucas(n - 1) + find_lucas(n - 2)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to remove all whitespaces from the given string. Here is a solution in Python:\",\"targets\":\"import re\\ndef remove_whitespaces(text1):\\n return (re.sub(r'\\\\s+', '',text1))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to apply a given format string to all of the elements in a list. This can be solved in Python with the following code:\",\"targets\":\"def add_string(list_, string):\\n add_string=[string.format(i) for i in list_]\\n return add_string\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find whether a number is divisible by 11. This can be solved in Python with the following code:\",\"targets\":\"def is_Diff(n): \\n return (n % 11 == 0)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to sum all amicable numbers from 1 to a specified number. This can be solved in Python with the following code:\",\"targets\":\"def amicable_numbers_sum(limit):\\n if not isinstance(limit, int):\\n return \\\"Input is not an integer!\\\"\\n if limit < 1:\\n return \\\"Input must be bigger than 0!\\\"\\n amicables = set()\\n for num in range(2, limit+1):\\n if num in amicables:\\n continue\\n sum_fact = sum([fact for fact in range(1, num) if num % fact == 0])\\n sum_fact2 = sum([fact for fact in range(1, sum_fact) if sum_fact % fact == 0])\\n if num == sum_fact2 and num != sum_fact:\\n amicables.add(num)\\n amicables.add(sum_fact2)\\n return sum(amicables)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert rgb color to hsv color. https:\\/\\/www.geeksforgeeks.org\\/program-change-rgb-color-model-hsv-color-model\\/ Here is a solution in Python:\",\"targets\":\"def rgb_to_hsv(r, g, b):\\n r, g, b = r\\/255.0, g\\/255.0, b\\/255.0\\n mx = max(r, g, b)\\n mn = min(r, g, b)\\n df = mx-mn\\n if mx == mn:\\n h = 0\\n elif mx == r:\\n h = (60 * ((g-b)\\/df) + 360) % 360\\n elif mx == g:\\n h = (60 * ((b-r)\\/df) + 120) % 360\\n elif mx == b:\\n h = (60 * ((r-g)\\/df) + 240) % 360\\n if mx == 0:\\n s = 0\\n else:\\n s = (df\\/mx)*100\\n v = mx*100\\n return h, s, v\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in a list and an integer n and splits a list for every nth element, returning a list of the resulting lists. Here is a solution in Python:\",\"targets\":\"def list_split(S, step):\\n return [S[i::step] for i in range(step)]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether the given number is a perfect square or not. https:\\/\\/www.geeksforgeeks.org\\/check-if-given-number-is-perfect-square-in-cpp\\/ This can be solved in Python with the following code:\",\"targets\":\"def is_perfect_square(n) :\\n i = 1\\n while (i * i<= n):\\n if ((n % i == 0) and (n \\/ i == i)):\\n return True \\n i = i + 1\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the sum of non-repeated elements in a given list. This can be solved in Python with the following code:\",\"targets\":\"def find_sum(arr): \\n arr.sort() \\n sum = arr[0] \\n for i in range(len(arr)-1): \\n if (arr[i] != arr[i+1]): \\n sum = sum + arr[i+1] \\n return sum\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to count bidirectional tuple pairs. Here is a solution in Python:\",\"targets\":\"def count_bidirectional(test_list):\\n res = 0\\n for idx in range(0, len(test_list)):\\n for iidx in range(idx + 1, len(test_list)):\\n if test_list[iidx][0] == test_list[idx][1] and test_list[idx][1] == test_list[iidx][0]:\\n res += 1\\n return res\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count minimum number of swaps required to convert one binary number represented as a string to another. This can be solved in Python with the following code:\",\"targets\":\"def min_Swaps(str1,str2) : \\n count = 0\\n for i in range(len(str1)) : \\n if str1[i] != str2[i] : \\n count += 1\\n if count % 2 == 0 : \\n return (count \\/\\/ 2) \\n else : \\n return (\\\"Not Possible\\\")\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function that takes in a positive integer n and finds the sum of even index binomial coefficients. Here is a solution in Python:\",\"targets\":\"import math \\ndef even_binomial_Coeff_Sum( n): \\n return (1 << (n - 1))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count the number of non-empty substrings of a given string. This can be solved in Python with the following code:\",\"targets\":\"def number_of_substrings(str): \\n\\tstr_len = len(str); \\n\\treturn int(str_len * (str_len + 1) \\/ 2);\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to remove all whitespaces from a string. Here is a solution in Python:\",\"targets\":\"import re\\ndef remove_all_spaces(text):\\n return (re.sub(r'\\\\s+', '',text))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check if the elements of a given list are unique or not. This can be solved in Python with the following code:\",\"targets\":\"def all_unique(test_list):\\n if len(test_list) > len(set(test_list)):\\n return False\\n return True\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the maximum difference between any two elements in a given array. Here is a solution in Python:\",\"targets\":\"def max_Abs_Diff(arr): \\n n = len(arr)\\n minEle = arr[0] \\n maxEle = arr[0] \\n for i in range(1, n): \\n minEle = min(minEle,arr[i]) \\n maxEle = max(maxEle,arr[i]) \\n return (maxEle - minEle)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to return the sum of all divisors of a number. This can be solved in Python with the following code:\",\"targets\":\"def sum_div(number):\\n divisors = [1]\\n for i in range(2, number):\\n if (number % i)==0:\\n divisors.append(i)\\n return sum(divisors)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether the given array is monotonic or not. This can be solved in Python with the following code:\",\"targets\":\"def is_Monotonic(A): \\n return (all(A[i] <= A[i + 1] for i in range(len(A) - 1)) or\\n all(A[i] >= A[i + 1] for i in range(len(A) - 1)))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in a list of tuples and returns a dictionary mapping each unique tuple to the number of times it occurs in the list. This can be solved in Python with the following code:\",\"targets\":\"from collections import Counter \\ndef check_occurences(test_list):\\n res = dict(Counter(tuple(ele) for ele in map(sorted, test_list)))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find cubes of individual elements in a list. This can be solved in Python with the following code:\",\"targets\":\"def cube_nums(nums):\\n cube_nums = list(map(lambda x: x ** 3, nums))\\n return cube_nums\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count number of digits in a given string. This can be solved in Python with the following code:\",\"targets\":\"def number_ctr(str):\\n number_ctr= 0\\n for i in range(len(str)):\\n if str[i] >= '0' and str[i] <= '9': number_ctr += 1 \\n return number_ctr\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the first adverb ending with ly and its positions in a given string. This can be solved in Python with the following code:\",\"targets\":\"import re\\ndef find_adverbs(text):\\n for m in re.finditer(r\\\"\\\\w+ly\\\", text):\\n return ('%d-%d: %s' % (m.start(), m.end(), m.group(0)))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to sort a dictionary by value. This can be solved in Python with the following code:\",\"targets\":\"from collections import Counter\\ndef sort_counter(dict1):\\n x = Counter(dict1)\\n sort_counter=x.most_common()\\n return sort_counter\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the volume of a sphere. Here is a solution in Python:\",\"targets\":\"import math\\ndef volume_sphere(r):\\n volume=(4\\/3)*math.pi*r*r*r\\n return volume\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the number of elements that occurs before the tuple element in the given tuple. This can be solved in Python with the following code:\",\"targets\":\"def count_first_elements(test_tup):\\n for count, ele in enumerate(test_tup):\\n if isinstance(ele, tuple):\\n break\\n return (count)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to sort a given matrix in ascending order according to the sum of its rows. This can be solved in Python with the following code:\",\"targets\":\"def sort_matrix(M):\\n result = sorted(M, key=sum)\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert a given tuple of positive integers into a single integer. This can be solved in Python with the following code:\",\"targets\":\"def tuple_to_int(nums):\\n result = int(''.join(map(str,nums)))\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert a tuple to a string. This can be solved in Python with the following code:\",\"targets\":\"def tup_string(tup1):\\n str = ''.join(tup1)\\n return str\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the product of the array multiplication modulo n. Here is a solution in Python:\",\"targets\":\"def find_remainder(arr, n): \\n mul = 1\\n for i in range(len(arr)): \\n mul = (mul * (arr[i] % n)) % n \\n return mul % n\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to identify non-prime numbers. This can be solved in Python with the following code:\",\"targets\":\"import math\\ndef is_not_prime(n):\\n result = False\\n for i in range(2,int(math.sqrt(n)) + 1):\\n if n % i == 0:\\n result = True\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the lateral surface area of a cylinder. This can be solved in Python with the following code:\",\"targets\":\"def lateralsuface_cylinder(r,h):\\n lateralsurface= 2*3.1415*r*h\\n return lateralsurface\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to sort the given list. This can be solved in Python with the following code:\",\"targets\":\"import heapq as hq\\ndef heap_sort(iterable):\\n h = []\\n for value in iterable:\\n hq.heappush(h, value)\\n return [hq.heappop(h) for i in range(len(h))]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to get the sum of the digits of a non-negative integer. Here is a solution in Python:\",\"targets\":\"def sum_digits(n):\\n if n == 0:\\n return 0\\n else:\\n return n % 10 + sum_digits(int(n \\/ 10))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check if the given number is woodball or not. This can be solved in Python with the following code:\",\"targets\":\"def is_woodall(x): \\n\\tif (x % 2 == 0): \\n\\t\\treturn False\\n\\tif (x == 1): \\n\\t\\treturn True\\n\\tx = x + 1 \\n\\tp = 0\\n\\twhile (x % 2 == 0): \\n\\t\\tx = x\\/2\\n\\t\\tp = p + 1\\n\\t\\tif (p == x): \\n\\t\\t\\treturn True\\n\\treturn False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the length of the longest palindromic subsequence in the given string. Here is a solution in Python:\",\"targets\":\"def lps(str): \\n\\tn = len(str) \\n\\tL = [[0 for x in range(n)] for x in range(n)] \\n\\tfor i in range(n): \\n\\t\\tL[i][i] = 1\\n\\tfor cl in range(2, n+1): \\n\\t\\tfor i in range(n-cl+1): \\n\\t\\t\\tj = i+cl-1\\n\\t\\t\\tif str[i] == str[j] and cl == 2: \\n\\t\\t\\t\\tL[i][j] = 2\\n\\t\\t\\telif str[i] == str[j]: \\n\\t\\t\\t\\tL[i][j] = L[i+1][j-1] + 2\\n\\t\\t\\telse: \\n\\t\\t\\t\\tL[i][j] = max(L[i][j-1], L[i+1][j]); \\n\\treturn L[0][n-1]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether any value in a sequence exists in a sequence or not. Here is a solution in Python:\",\"targets\":\"def overlapping(list1,list2): \\n for i in range(len(list1)): \\n for j in range(len(list2)): \\n if(list1[i]==list2[j]): \\n return True\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to calculate the sum of perrin numbers. Here is a solution in Python:\",\"targets\":\"def cal_sum(n): \\n\\ta = 3\\n\\tb = 0\\n\\tc = 2\\n\\tif (n == 0): \\n\\t\\treturn 3\\n\\tif (n == 1): \\n\\t\\treturn 3\\n\\tif (n == 2): \\n\\t\\treturn 5\\n\\tsum = 5\\n\\twhile (n > 2): \\n\\t\\td = a + b \\n\\t\\tsum = sum + d \\n\\t\\ta = b \\n\\t\\tb = c \\n\\t\\tc = d \\n\\t\\tn = n-1\\n\\treturn sum\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that returns the list in a list of lists whose sum of elements is the highest. Here is a solution in Python:\",\"targets\":\"def max_sum_list(lists):\\n return max(lists, key=sum)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check if all values are same in a dictionary. Here is a solution in Python:\",\"targets\":\"def check_value(dict, n):\\n result = all(x == n for x in dict.values()) \\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function takes as input two lists [a_1,...,a_n], [b_1,...,b_n] and returns [a_1+b_1,...,a_n+b_n]. Here is a solution in Python:\",\"targets\":\"def sum_list(lst1,lst2):\\n res_list = [lst1[i] + lst2[i] for i in range(len(lst1))] \\n return res_list\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find smallest number in a list. This can be solved in Python with the following code:\",\"targets\":\"def smallest_num(xs):\\n return min(xs)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to count the pairs of reverse strings in the given string list. https:\\/\\/www.geeksforgeeks.org\\/python-program-to-count-the-pairs-of-reverse-strings\\/ Here is a solution in Python:\",\"targets\":\"def count_reverse_pairs(test_list):\\n res = sum([1 for idx in range(0, len(test_list)) for idxn in range(idx, len( \\n\\ttest_list)) if test_list[idxn] == str(''.join(list(reversed(test_list[idx]))))]) \\n return res\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the sum of common divisors of two given numbers. Here is a solution in Python:\",\"targets\":\"def sum(a,b): \\n sum = 0\\n for i in range (1,min(a,b)): \\n if (a % i == 0 and b % i == 0): \\n sum += i \\n return sum\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether the given month number contains 31 days or not. Here is a solution in Python:\",\"targets\":\"def check_monthnumb_number(monthnum2):\\n if(monthnum2==1 or monthnum2==3 or monthnum2==5 or monthnum2==7 or monthnum2==8 or monthnum2==10 or monthnum2==12):\\n return True\\n else:\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the maximum difference between any two elements in a given array. This can be solved in Python with the following code:\",\"targets\":\"def max_Abs_Diff(arr): \\n n = len(arr)\\n minEle = arr[0] \\n maxEle = arr[0] \\n for i in range(1, n): \\n minEle = min(minEle,arr[i]) \\n maxEle = max(maxEle,arr[i]) \\n return (maxEle - minEle)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to concatenate each element of tuple by the delimiter. This can be solved in Python with the following code:\",\"targets\":\"def concatenate_tuple(test_tup):\\n delim = \\\"-\\\"\\n res = ''.join([str(ele) + delim for ele in test_tup])\\n res = res[ : len(res) - len(delim)]\\n return (str(res))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the sum of the largest and smallest value in a given array. Here is a solution in Python:\",\"targets\":\"def big_sum(nums):\\n sum= max(nums)+min(nums)\\n return sum\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check if the given number is woodball or not. Here is a solution in Python:\",\"targets\":\"def is_woodall(x): \\n\\tif (x % 2 == 0): \\n\\t\\treturn False\\n\\tif (x == 1): \\n\\t\\treturn True\\n\\tx = x + 1 \\n\\tp = 0\\n\\twhile (x % 2 == 0): \\n\\t\\tx = x\\/2\\n\\t\\tp = p + 1\\n\\t\\tif (p == x): \\n\\t\\t\\treturn True\\n\\treturn False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the length of the longest sublists. Here is a solution in Python:\",\"targets\":\"def Find_Max_Length(lst): \\n maxLength = max(len(x) for x in lst )\\n return maxLength\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to perform index wise multiplication of tuple elements in the given two tuples. Here is a solution in Python:\",\"targets\":\"def index_multiplication(test_tup1, test_tup2):\\n res = tuple(tuple(a * b for a, b in zip(tup1, tup2))\\n for tup1, tup2 in zip(test_tup1, test_tup2))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the pairwise addition of the neighboring elements of the given tuple. This can be solved in Python with the following code:\",\"targets\":\"def add_pairwise(test_tup):\\n res = tuple(i + j for i, j in zip(test_tup, test_tup[1:]))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the shared elements from the given two lists. This can be solved in Python with the following code:\",\"targets\":\"def similar_elements(test_tup1, test_tup2):\\n res = tuple(set(test_tup1) & set(test_tup2))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to that returns true if the input string contains sequences of lowercase letters joined with an underscore and false otherwise. Here is a solution in Python:\",\"targets\":\"import re\\ndef text_lowercase_underscore(text):\\n patterns = '^[a-z]+_[a-z]+$'\\n if re.search(patterns, text):\\n return True\\n else:\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to sort the given array by using shell sort. Here is a solution in Python:\",\"targets\":\"def shell_sort(my_list):\\n gap = len(my_list) \\/\\/ 2\\n while gap > 0:\\n for i in range(gap, len(my_list)):\\n current_item = my_list[i]\\n j = i\\n while j >= gap and my_list[j - gap] > current_item:\\n my_list[j] = my_list[j - gap]\\n j -= gap\\n my_list[j] = current_item\\n gap \\/\\/= 2\\n\\n return my_list\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to remove the parenthesis and what is inbetween them from a string. This can be solved in Python with the following code:\",\"targets\":\"import re\\ndef remove_parenthesis(items):\\n for item in items:\\n return (re.sub(r\\\" ?\\\\([^)]+\\\\)\\\", \\\"\\\", item))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to add a dictionary to the tuple. The output should be a tuple. Here is a solution in Python:\",\"targets\":\"def add_dict_to_tuple(test_tup, test_dict):\\n test_tup = list(test_tup)\\n test_tup.append(test_dict)\\n test_tup = tuple(test_tup)\\n return (test_tup)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to that rotate left bits by d bits a given number. We assume that the number is 32 bit. This can be solved in Python with the following code:\",\"targets\":\"def left_rotate(n,d): \\n INT_BITS = 32\\n return (n << d)|(n >> (INT_BITS - d))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the index of smallest triangular number with n digits. https:\\/\\/www.geeksforgeeks.org\\/index-of-smallest-triangular-number-with-n-digits\\/ Here is a solution in Python:\",\"targets\":\"import math \\ndef find_Index(n): \\n x = math.sqrt(2 * math.pow(10,(n - 1)))\\n return round(x)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the n most expensive items in a given dataset. This can be solved in Python with the following code:\",\"targets\":\"import heapq\\ndef expensive_items(items,n):\\n expensive_items = heapq.nlargest(n, items, key=lambda s: s['price'])\\n return expensive_items\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the number of elements that occurs before the tuple element in the given tuple. Here is a solution in Python:\",\"targets\":\"def count_first_elements(test_tup):\\n for count, ele in enumerate(test_tup):\\n if isinstance(ele, tuple):\\n break\\n return (count)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the ratio of zeroes to non-zeroes in an array of integers. This can be solved in Python with the following code:\",\"targets\":\"from array import array\\ndef zero_count(nums):\\n n = len(nums)\\n n1 = 0\\n for x in nums:\\n if x == 0:\\n n1 += 1\\n else:\\n None\\n return n1\\/(n-n1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to trim each tuple by k in the given tuple list. Here is a solution in Python:\",\"targets\":\"def trim_tuple(test_list, K):\\n res = []\\n for ele in test_list:\\n N = len(ele)\\n res.append(tuple(list(ele)[K: N - K]))\\n return (str(res))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the length of the longest word. Here is a solution in Python:\",\"targets\":\"def len_log(list1):\\n max=len(list1[0])\\n for i in list1:\\n if len(i)>max:\\n max=len(i)\\n return max\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in a list and length n, and generates all combinations (with repetition) of the elements of the list and returns a list with a tuple for each combination. Here is a solution in Python:\",\"targets\":\"from itertools import combinations_with_replacement \\ndef combinations_colors(l, n):\\n return list(combinations_with_replacement(l,n))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to drop empty items from a given dictionary. This can be solved in Python with the following code:\",\"targets\":\"def drop_empty(dict1):\\n dict1 = {key:value for (key, value) in dict1.items() if value is not None}\\n return dict1\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to extract values between quotation marks \\\" \\\" of the given string. This can be solved in Python with the following code:\",\"targets\":\"import re\\ndef extract_quotation(text1):\\n return (re.findall(r'\\\"(.*?)\\\"', text1))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the character made by adding the ASCII value of all the characters of the given string modulo 26. Here is a solution in Python:\",\"targets\":\"def get_Char(strr): \\n summ = 0\\n for i in range(len(strr)): \\n summ += (ord(strr[i]) - ord('a') + 1) \\n if (summ % 26 == 0): \\n return ord('z') \\n else: \\n summ = summ % 26\\n return chr(ord('a') + summ - 1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the highest power of 2 that is less than or equal to n. Here is a solution in Python:\",\"targets\":\"def highest_Power_of_2(n): \\n res = 0 \\n for i in range(n, 0, -1): \\n if ((i & (i - 1)) == 0): \\n res = i \\n break \\n return res\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the first digit of a given number. Here is a solution in Python:\",\"targets\":\"def first_Digit(n) : \\n while n >= 10: \\n n = n \\/ 10 \\n return int(n)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to extract values between quotation marks \\\" \\\" of the given string. Here is a solution in Python:\",\"targets\":\"import re\\ndef extract_quotation(text1):\\n return (re.findall(r'\\\"(.*?)\\\"', text1))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the nth number in the newman conway sequence. Here is a solution in Python:\",\"targets\":\"def sequence(n): \\n\\tif n == 1 or n == 2: \\n\\t\\treturn 1\\n\\telse: \\n\\t\\treturn sequence(sequence(n-1)) + sequence(n-sequence(n-1))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check if a string represents an integer or not. This can be solved in Python with the following code:\",\"targets\":\"def check_integer(text):\\n text = text.strip()\\n if len(text) < 1:\\n return None\\n else:\\n if all(text[i] in \\\"0123456789\\\" for i in range(len(text))):\\n return True\\n elif (text[0] in \\\"+-\\\") and \\\\\\n all(text[i] in \\\"0123456789\\\" for i in range(1,len(text))):\\n return True\\n else:\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert a string to a list of strings split on the space character. Here is a solution in Python:\",\"targets\":\"def string_to_list(string): \\n lst = list(string.split(\\\" \\\")) \\n return lst\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count the occurence of all elements of list in a tuple. Here is a solution in Python:\",\"targets\":\"from collections import Counter \\ndef count_Occurrence(tup, lst): \\n count = 0\\n for item in tup: \\n if item in lst: \\n count+= 1 \\n return count\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the maximum of two numbers. Here is a solution in Python:\",\"targets\":\"def maximum(a,b): \\n if a >= b: \\n return a \\n else: \\n return b\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that returns the perimeter of a square given its side length as input. Here is a solution in Python:\",\"targets\":\"def square_perimeter(a):\\n perimeter=4*a\\n return perimeter\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether the given number is armstrong or not. Here is a solution in Python:\",\"targets\":\"def armstrong_number(number):\\n sum = 0\\n times = 0\\n temp = number\\n while temp > 0:\\n times = times + 1\\n temp = temp \\/\\/ 10\\n temp = number\\n while temp > 0:\\n reminder = temp % 10\\n sum = sum + (reminder ** times)\\n temp \\/\\/= 10\\n if number == sum:\\n return True\\n else:\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check if a dictionary is empty This can be solved in Python with the following code:\",\"targets\":\"def my_dict(dict1):\\n if bool(dict1):\\n return False\\n else:\\n return True\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the difference between largest and smallest value in a given list. Here is a solution in Python:\",\"targets\":\"def big_diff(nums):\\n diff= max(nums)-min(nums)\\n return diff\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to replace all spaces in the given string with '%20'. Here is a solution in Python:\",\"targets\":\"def replace_spaces(string):\\n return string.replace(\\\" \\\", \\\"%20\\\")\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to remove first and last occurrence of a given character from the string. This can be solved in Python with the following code:\",\"targets\":\"def remove_Occ(s,ch): \\n for i in range(len(s)): \\n if (s[i] == ch): \\n s = s[0 : i] + s[i + 1:] \\n break\\n for i in range(len(s) - 1,-1,-1): \\n if (s[i] == ch): \\n s = s[0 : i] + s[i + 1:] \\n break\\n return s\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function that takes in a non-negative number and returns the number of prime numbers less than the given non-negative number. This can be solved in Python with the following code:\",\"targets\":\"def count_Primes_nums(n):\\n ctr = 0\\n for num in range(n):\\n if num <= 1:\\n continue\\n for i in range(2,num):\\n if (num % i) == 0:\\n break\\n else:\\n ctr += 1\\n return ctr\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the longest common subsequence for the given three string sequence. https:\\/\\/www.geeksforgeeks.org\\/lcs-longest-common-subsequence-three-strings\\/ Here is a solution in Python:\",\"targets\":\"def lcs_of_three(X, Y, Z): \\n m = len(X)\\n n = len(Y)\\n o = len(Z)\\n L = [[[0 for i in range(o+1)] for j in range(n+1)] for k in range(m+1)]\\n for i in range(m+1): \\n\\t for j in range(n+1): \\n\\t\\t for k in range(o+1): \\n\\t\\t\\t if (i == 0 or j == 0 or k == 0): \\n\\t\\t\\t\\t L[i][j][k] = 0\\n\\t\\t\\t elif (X[i-1] == Y[j-1] and X[i-1] == Z[k-1]): \\n\\t\\t\\t\\t L[i][j][k] = L[i-1][j-1][k-1] + 1\\n\\t\\t\\t else: \\n\\t\\t\\t\\t L[i][j][k] = max(max(L[i-1][j][k], L[i][j-1][k]), L[i][j][k-1]) \\n return L[m][n][o]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to reverse each string in a given list of string values. This can be solved in Python with the following code:\",\"targets\":\"def reverse_string_list(stringlist):\\n result = [x[::-1] for x in stringlist]\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find a pair with highest product from a given array of integers. This can be solved in Python with the following code:\",\"targets\":\"def max_Product(arr): \\n arr_len = len(arr) \\n if (arr_len < 2): \\n return (\\\"No pairs exists\\\") \\n x = arr[0]; y = arr[1] \\n for i in range(0,arr_len): \\n for j in range(i + 1,arr_len): \\n if (arr[i] * arr[j] > x * y): \\n x = arr[i]; y = arr[j] \\n return x,y\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check if the given integer is a prime number. Here is a solution in Python:\",\"targets\":\"def prime_num(num):\\n if num >=1:\\n for i in range(2, num\\/\\/2):\\n if (num % i) == 0:\\n return False\\n else:\\n return True\\n else:\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to sort each sublist of strings in a given list of lists. Here is a solution in Python:\",\"targets\":\"def sort_sublists(list1):\\n result = list(map(sorted,list1)) \\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check if the given tuple has any none value or not. This can be solved in Python with the following code:\",\"targets\":\"def check_none(test_tup):\\n res = any(map(lambda ele: ele is None, test_tup))\\n return res\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether the entered number is greater than the elements of the given array. This can be solved in Python with the following code:\",\"targets\":\"def check_greater(arr, number):\\n arr.sort()\\n return number > arr[-1]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that returns integers x and y that satisfy ax + by = n as a tuple, or return None if no solution exists. This can be solved in Python with the following code:\",\"targets\":\"def find_solution(a, b, n):\\n\\ti = 0\\n\\twhile i * a <= n:\\n\\t\\tif (n - (i * a)) % b == 0: \\n\\t\\t\\treturn (i, (n - (i * a)) \\/\\/ b)\\n\\t\\ti = i + 1\\n\\treturn None\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the sum of numbers in a list within a range specified by two indices. This can be solved in Python with the following code:\",\"targets\":\"def sum_range_list(list1, m, n): \\n sum_range = 0 \\n for i in range(m, n+1, 1): \\n sum_range += list1[i] \\n return sum_range\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the difference between the sum of cubes of the first n natural numbers and the sum of the first n natural numbers. Here is a solution in Python:\",\"targets\":\"def difference(n) : \\n S = (n*(n + 1))\\/\\/2; \\n res = S*(S-1); \\n return res;\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to calculate the value of 'a' to the power 'b'. Here is a solution in Python:\",\"targets\":\"def power(a,b):\\n\\tif b==0:\\n\\t\\treturn 1\\n\\telif a==0:\\n\\t\\treturn 0\\n\\telif b==1:\\n\\t\\treturn a\\n\\telse:\\n\\t\\treturn a*power(a,b-1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in two tuples and performs mathematical division operation element-wise across the given tuples. This can be solved in Python with the following code:\",\"targets\":\"def division_elements(test_tup1, test_tup2):\\n res = tuple(ele1 \\/\\/ ele2 for ele1, ele2 in zip(test_tup1, test_tup2))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert a snake case string to camel case string. This can be solved in Python with the following code:\",\"targets\":\"def snake_to_camel(word):\\n import re\\n return ''.join(x.capitalize() or '_' for x in word.split('_'))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the maximum sum of increasing subsequence from prefix until ith index and also including a given kth element which is after i, i.e., k > i . This can be solved in Python with the following code:\",\"targets\":\"def max_sum_increasing_subseq(a, n, index, k):\\n\\tdp = [[0 for i in range(n)] \\n\\t\\t\\tfor i in range(n)]\\n\\tfor i in range(n):\\n\\t\\tif a[i] > a[0]:\\n\\t\\t\\tdp[0][i] = a[i] + a[0]\\n\\t\\telse:\\n\\t\\t\\tdp[0][i] = a[i]\\n\\tfor i in range(1, n):\\n\\t\\tfor j in range(n):\\n\\t\\t\\tif a[j] > a[i] and j > i:\\n\\t\\t\\t\\tif dp[i - 1][i] + a[j] > dp[i - 1][j]:\\n\\t\\t\\t\\t\\tdp[i][j] = dp[i - 1][i] + a[j]\\n\\t\\t\\t\\telse:\\n\\t\\t\\t\\t\\tdp[i][j] = dp[i - 1][j]\\n\\t\\t\\telse:\\n\\t\\t\\t\\tdp[i][j] = dp[i - 1][j]\\n\\treturn dp[index][k]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to remove duplicate numbers from a given number of lists. This can be solved in Python with the following code:\",\"targets\":\"def two_unique_nums(nums):\\n return [i for i in nums if nums.count(i)==1]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the area of the largest triangle that can be inscribed in a semicircle with a given radius. This can be solved in Python with the following code:\",\"targets\":\"def triangle_area(r) : \\n if r < 0 : \\n return None\\n return r * r\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the lateral surface area of a cube given its side length. Here is a solution in Python:\",\"targets\":\"def lateralsurface_cube(l):\\n LSA = 4 * (l * l)\\n return LSA\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether the length of the word is odd or not. This can be solved in Python with the following code:\",\"targets\":\"def word_len(s): \\n s = s.split(' ') \\n for word in s: \\n if len(word)%2!=0: \\n return True \\n else:\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the nth jacobsthal number. https:\\/\\/www.geeksforgeeks.org\\/jacobsthal-and-jacobsthal-lucas-numbers\\/ 0, 1, 1, 3, 5, 11, 21, 43, 85, 171, 341, 683, 1365, 2731, ... This can be solved in Python with the following code:\",\"targets\":\"def jacobsthal_num(n): \\n\\tdp = [0] * (n + 1) \\n\\tdp[0] = 0\\n\\tdp[1] = 1\\n\\tfor i in range(2, n+1): \\n\\t\\tdp[i] = dp[i - 1] + 2 * dp[i - 2] \\n\\treturn dp[n]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count the occurence of all elements of list in a tuple. This can be solved in Python with the following code:\",\"targets\":\"from collections import Counter \\ndef count_Occurrence(tup, lst): \\n count = 0\\n for item in tup: \\n if item in lst: \\n count+= 1 \\n return count\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the maximum sum possible by using the given equation f(n) = max( (f(n\\/2) + f(n\\/3) + f(n\\/4) + f(n\\/5)), n). This can be solved in Python with the following code:\",\"targets\":\"def get_max_sum (n):\\n\\tres = list()\\n\\tres.append(0)\\n\\tres.append(1)\\n\\ti = 2\\n\\twhile i 0): \\n rev_num = (rev_num * 10 + num % 10) \\n num = num \\/\\/ 10 \\n return rev_num \\ndef check(n): \\n return (2 * rev(n) == n + 1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find common first element in given list of tuple. This can be solved in Python with the following code:\",\"targets\":\"def group_tuples(Input): \\n\\tout = {} \\n\\tfor elem in Input: \\n\\t\\ttry: \\n\\t\\t\\tout[elem[0]].extend(elem[1:]) \\n\\t\\texcept KeyError: \\n\\t\\t\\tout[elem[0]] = list(elem) \\n\\treturn [tuple(values) for values in out.values()]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to calculate the area of a regular polygon given the length and number of its sides. Here is a solution in Python:\",\"targets\":\"from math import tan, pi\\ndef area_polygon(s, l):\\n area = s * (l ** 2) \\/ (4 * tan(pi \\/ s))\\n return area\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find squares of individual elements in a list. This can be solved in Python with the following code:\",\"targets\":\"def square_nums(nums):\\n square_nums = list(map(lambda x: x ** 2, nums))\\n return square_nums\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the largest negative number from the given list. This can be solved in Python with the following code:\",\"targets\":\"def largest_neg(list1): \\n max = list1[0] \\n for x in list1: \\n if x < max : \\n max = x \\n return max\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in a string and character, replaces blank spaces in the string with the character, and returns the string. Here is a solution in Python:\",\"targets\":\"def replace_blank(str1,char):\\n str2 = str1.replace(' ', char)\\n return str2\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in two tuples and performs mathematical division operation element-wise across the given tuples. Here is a solution in Python:\",\"targets\":\"def division_elements(test_tup1, test_tup2):\\n res = tuple(ele1 \\/\\/ ele2 for ele1, ele2 in zip(test_tup1, test_tup2))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to calculate a dog's age in dog's years. Here is a solution in Python:\",\"targets\":\"def dog_age(h_age):\\n if h_age < 0:\\n \\texit()\\n elif h_age <= 2:\\n\\t d_age = h_age * 10.5\\n else:\\n\\t d_age = 21 + (h_age - 2)*4\\n return d_age\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count number of digits in a given string. Here is a solution in Python:\",\"targets\":\"def number_ctr(str):\\n number_ctr= 0\\n for i in range(len(str)):\\n if str[i] >= '0' and str[i] <= '9': number_ctr += 1 \\n return number_ctr\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find perfect squares between two given numbers. Here is a solution in Python:\",\"targets\":\"def perfect_squares(a, b):\\n lists=[]\\n for i in range (a,b+1):\\n j = 1;\\n while j*j <= i:\\n if j*j == i:\\n lists.append(i) \\n j = j+1\\n i = i+1\\n return lists\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the first non-repeated character in a given string. Here is a solution in Python:\",\"targets\":\"def first_non_repeating_character(str1):\\n char_order = []\\n ctr = {}\\n for c in str1:\\n if c in ctr:\\n ctr[c] += 1\\n else:\\n ctr[c] = 1 \\n char_order.append(c)\\n for c in char_order:\\n if ctr[c] == 1:\\n return c\\n return None\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to sort a list of elements. Here is a solution in Python:\",\"targets\":\"def pancake_sort(nums):\\n arr_len = len(nums)\\n while arr_len > 1:\\n mi = nums.index(max(nums[0:arr_len]))\\n nums = nums[mi::-1] + nums[mi+1:len(nums)]\\n nums = nums[arr_len-1::-1] + nums[arr_len:len(nums)]\\n arr_len -= 1\\n return nums\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert degrees to radians. This can be solved in Python with the following code:\",\"targets\":\"import math\\ndef radian_degree(degree):\\n radian = degree*(math.pi\\/180)\\n return radian\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check if each element of second tuple is smaller than its corresponding element in the first tuple. Here is a solution in Python:\",\"targets\":\"def check_smaller(test_tup1, test_tup2):\\n return all(x > y for x, y in zip(test_tup1, test_tup2))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the nth decagonal number. Here is a solution in Python:\",\"targets\":\"def is_num_decagonal(n): \\n\\treturn 4 * n * n - 3 * n\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the common elements in given nested lists. This can be solved in Python with the following code:\",\"targets\":\"def common_in_nested_lists(nestedlist):\\n result = list(set.intersection(*map(set, nestedlist)))\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to calculate whether the matrix is a magic square. Here is a solution in Python:\",\"targets\":\"def magic_square_test(my_matrix):\\n iSize = len(my_matrix[0])\\n sum_list = []\\n sum_list.extend([sum (lines) for lines in my_matrix]) \\n for col in range(iSize):\\n sum_list.append(sum(row[col] for row in my_matrix))\\n result1 = 0\\n for i in range(0,iSize):\\n result1 +=my_matrix[i][i]\\n sum_list.append(result1) \\n result2 = 0\\n for i in range(iSize-1,-1,-1):\\n result2 +=my_matrix[i][i]\\n sum_list.append(result2)\\n if len(set(sum_list))>1:\\n return False\\n return True\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"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 plane. Here is a solution in Python:\",\"targets\":\"def min_Jumps(steps, d): \\n (a, b) = steps\\n temp = a \\n a = min(a, b) \\n b = max(temp, b) \\n if (d >= b): \\n return (d + b - 1) \\/ b \\n if (d == 0): \\n return 0\\n if (d == a): \\n return 1\\n else:\\n return 2\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find kth element from the given two sorted arrays. This can be solved in Python with the following code:\",\"targets\":\"def find_kth(arr1, arr2, k):\\n\\tm = len(arr1)\\n\\tn = len(arr2)\\n\\tsorted1 = [0] * (m + n)\\n\\ti = 0\\n\\tj = 0\\n\\td = 0\\n\\twhile (i < m and j < n):\\n\\t\\tif (arr1[i] < arr2[j]):\\n\\t\\t\\tsorted1[d] = arr1[i]\\n\\t\\t\\ti += 1\\n\\t\\telse:\\n\\t\\t\\tsorted1[d] = arr2[j]\\n\\t\\t\\tj += 1\\n\\t\\td += 1\\n\\twhile (i < m):\\n\\t\\tsorted1[d] = arr1[i]\\n\\t\\td += 1\\n\\t\\ti += 1\\n\\twhile (j < n):\\n\\t\\tsorted1[d] = arr2[j]\\n\\t\\td += 1\\n\\t\\tj += 1\\n\\treturn sorted1[k - 1]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count the number of substrings with the sum of digits equal to their length. Here is a solution in Python:\",\"targets\":\"from collections import defaultdict\\ndef count_Substrings(s):\\n n = len(s)\\n count,sum = 0,0\\n mp = defaultdict(lambda : 0)\\n mp[0] += 1\\n for i in range(n):\\n sum += ord(s[i]) - ord('0')\\n count += mp[sum - (i + 1)]\\n mp[sum - (i + 1)] += 1\\n return count\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to sort a list of tuples using the second value of each tuple. Here is a solution in Python:\",\"targets\":\"def subject_marks(subjectmarks):\\n#subject_marks = [('English', 88), ('Science', 90), ('Maths', 97), ('Social sciences', 82)])\\n subjectmarks.sort(key = lambda x: x[1])\\n return subjectmarks\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the average of cubes of first n natural numbers. Here is a solution in Python:\",\"targets\":\"def find_Average_Of_Cube(n): \\n sum = 0\\n for i in range(1, n + 1): \\n sum += i * i * i \\n return round(sum \\/ n, 6)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"The input is given as - a dictionary with a student name as a key and a tuple of float (student_height, student_weight) as a value, - minimal height, - minimal weight. Write a function to filter students that have height and weight above the minimum. Here is a solution in Python:\",\"targets\":\"def filter_data(students,h,w):\\n result = {k: s for k, s in students.items() if s[0] >=h and s[1] >=w}\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count the number of positive numbers in a list. Here is a solution in Python:\",\"targets\":\"def pos_count(list):\\n pos_count= 0\\n for num in list: \\n if num >= 0: \\n pos_count += 1\\n return pos_count\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to toggle bits of the number except the first and the last bit. https:\\/\\/www.geeksforgeeks.org\\/toggle-bits-number-expect-first-last-bits\\/ This can be solved in Python with the following code:\",\"targets\":\"def set_middle_bits(n): \\n n |= n >> 1; \\n n |= n >> 2; \\n n |= n >> 4; \\n n |= n >> 8; \\n n |= n >> 16; \\n return (n >> 1) ^ 1\\ndef toggle_middle_bits(n): \\n if (n == 1): \\n return 1\\n return n ^ set_middle_bits(n)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether a given string is a decimal number with a precision of 2. This can be solved in Python with the following code:\",\"targets\":\"def is_decimal(num):\\n import re\\n dnumre = re.compile(r\\\"\\\"\\\"^[0-9]+(\\\\.[0-9]{1,2})?$\\\"\\\"\\\")\\n result = dnumre.search(num)\\n return bool(result)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to convert a given string to uppercase. Here is a solution in Python:\",\"targets\":\"def is_upper(string):\\n return (string.upper())\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to extract the nth element from a given list of tuples. Here is a solution in Python:\",\"targets\":\"def extract_nth_element(list1, n):\\n result = [x[n] for x in list1]\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to filter odd numbers. Here is a solution in Python:\",\"targets\":\"def filter_oddnumbers(nums):\\n odd_nums = list(filter(lambda x: x%2 != 0, nums))\\n return odd_nums\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in two numbers and returns a tuple with the second number and then the first number. This can be solved in Python with the following code:\",\"targets\":\"def swap_numbers(a,b):\\n temp = a\\n a = b\\n b = temp\\n return (a,b)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find area of a sector. The function takes the radius and angle as inputs. Function should return None if the angle is larger than 360 degrees. Here is a solution in Python:\",\"targets\":\"import math\\ndef sector_area(r,a):\\n if a > 360:\\n return None\\n return (math.pi*r**2) * (a\\/360)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether the given number is even or not. This can be solved in Python with the following code:\",\"targets\":\"def is_Even(n) : \\n if (n^1 == n+1) :\\n return True; \\n else :\\n return False;\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in a list and length n, and generates all combinations (with repetition) of the elements of the list and returns a list with a tuple for each combination. This can be solved in Python with the following code:\",\"targets\":\"from itertools import combinations_with_replacement \\ndef combinations_colors(l, n):\\n return list(combinations_with_replacement(l,n))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to join a list of multiple integers into a single integer. This can be solved in Python with the following code:\",\"targets\":\"def multiple_to_single(L):\\n x = int(\\\"\\\".join(map(str, L)))\\n return x\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the closest smaller number than n. Here is a solution in Python:\",\"targets\":\"def closest_num(N):\\n return (N - 1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the nth hexagonal number. This can be solved in Python with the following code:\",\"targets\":\"def hexagonal_num(n): \\n\\treturn n*(2*n - 1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to merge three dictionaries into a single dictionary. Here is a solution in Python:\",\"targets\":\"import collections as ct\\ndef merge_dictionaries_three(dict1,dict2, dict3):\\n merged_dict = dict(ct.ChainMap({},dict1,dict2,dict3))\\n return merged_dict\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the smallest power of 2 greater than or equal to n. This can be solved in Python with the following code:\",\"targets\":\"def next_power_of_2(n): \\n if n and not n & (n - 1):\\n return n\\n\\n count = 0\\n while n != 0: \\n n >>= 1\\n count += 1\\n\\n return 1 << count;\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to reverse words seperated by spaces in a given string. Here is a solution in Python:\",\"targets\":\"def reverse_words(s):\\n return ' '.join(reversed(s.split()))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the minimum value in a given heterogeneous list. This can be solved in Python with the following code:\",\"targets\":\"def min_val(listval):\\n min_val = min(i for i in listval if isinstance(i, int))\\n return min_val\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the sum of xor of all pairs of numbers in the given list. Here is a solution in Python:\",\"targets\":\"def pair_xor_Sum(arr,n) : \\n ans = 0 \\n for i in range(0,n) : \\n for j in range(i + 1,n) : \\n ans = ans + (arr[i] ^ arr[j]) \\n return ans\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the n most expensive items in a given dataset. Here is a solution in Python:\",\"targets\":\"import heapq\\ndef expensive_items(items,n):\\n expensive_items = heapq.nlargest(n, items, key=lambda s: s['price'])\\n return expensive_items\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the sum of xor of all pairs of numbers in the given list. This can be solved in Python with the following code:\",\"targets\":\"def pair_xor_Sum(arr,n) : \\n ans = 0 \\n for i in range(0,n) : \\n for j in range(i + 1,n) : \\n ans = ans + (arr[i] ^ arr[j]) \\n return ans\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the sum of all odd length subarrays. https:\\/\\/www.geeksforgeeks.org\\/sum-of-all-odd-length-subarrays\\/ Here is a solution in Python:\",\"targets\":\"def odd_length_sum(arr):\\n Sum = 0\\n l = len(arr)\\n for i in range(l):\\n Sum += ((((i + 1) *(l - i) + 1) \\/\\/ 2) * arr[i])\\n return Sum\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the n largest integers from a given list of numbers, returned in descending order. This can be solved in Python with the following code:\",\"targets\":\"import heapq as hq\\ndef heap_queue_largest(nums,n):\\n largest_nums = hq.nlargest(n, nums)\\n return largest_nums\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that matches a string that has an 'a' followed by one or more 'b's. https:\\/\\/www.w3resource.com\\/python-exercises\\/re\\/python-re-exercise-3.php Here is a solution in Python:\",\"targets\":\"import re\\ndef text_match_zero_one(text):\\n patterns = 'ab+?'\\n if re.search(patterns, text):\\n return True\\n else:\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count true booleans in the given list. This can be solved in Python with the following code:\",\"targets\":\"def count(lst): \\n return sum(lst)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the lateral surface area of a cone given radius r and the height h. Here is a solution in Python:\",\"targets\":\"import math\\ndef lateralsurface_cone(r,h):\\n l = math.sqrt(r * r + h * h)\\n LSA = math.pi * r * l\\n return LSA\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check if the given expression is balanced or not. https:\\/\\/www.geeksforgeeks.org\\/check-for-balanced-parentheses-in-an-expression\\/ Here is a solution in Python:\",\"targets\":\"from collections import deque\\ndef check_expression(exp):\\n if len(exp) & 1:\\n return False\\n stack = deque()\\n for ch in exp:\\n if ch == '(' or ch == '{' or ch == '[':\\n stack.append(ch)\\n if ch == ')' or ch == '}' or ch == ']':\\n if not stack:\\n return False\\n top = stack.pop()\\n if (top == '(' and ch != ')') or (top == '{' and ch != '}' or (top == '[' and ch != ']')):\\n return False\\n return not stack\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to subtract two lists element-wise. This can be solved in Python with the following code:\",\"targets\":\"def sub_list(nums1,nums2):\\n result = map(lambda x, y: x - y, nums1, nums2)\\n return list(result)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to interleave 3 lists of the same length into a single flat list. Here is a solution in Python:\",\"targets\":\"def interleave_lists(list1,list2,list3):\\n result = [el for pair in zip(list1, list2, list3) for el in pair]\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in a list and an integer n and splits a list for every nth element, returning a list of the resulting lists. This can be solved in Python with the following code:\",\"targets\":\"def list_split(S, step):\\n return [S[i::step] for i in range(step)]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to get a colon of a tuple. Here is a solution in Python:\",\"targets\":\"from copy import deepcopy\\ndef colon_tuplex(tuplex,m,n):\\n tuplex_colon = deepcopy(tuplex)\\n tuplex_colon[m].append(n)\\n return tuplex_colon\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the nth newman–shanks–williams prime number. Here is a solution in Python:\",\"targets\":\"def newman_prime(n): \\n\\tif n == 0 or n == 1: \\n\\t\\treturn 1\\n\\treturn 2 * newman_prime(n - 1) + newman_prime(n - 2)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the nth nonagonal number. This can be solved in Python with the following code:\",\"targets\":\"def is_nonagonal(n): \\n\\treturn int(n * (7 * n - 5) \\/ 2)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to calculate the maximum aggregate from the list of tuples. Here is a solution in Python:\",\"targets\":\"from collections import defaultdict\\ndef max_aggregate(stdata):\\n temp = defaultdict(int)\\n for name, marks in stdata:\\n temp[name] += marks\\n return max(temp.items(), key=lambda x: x[1])\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find out the number of ways of painting the fence such that at most 2 adjacent posts have the same color for the given fence with n posts and k colors. This can be solved in Python with the following code:\",\"targets\":\"def count_no_of_ways(n, k): \\n\\tdp = [0] * (n + 1) \\n\\ttotal = k \\n\\tmod = 1000000007\\n\\tdp[1] = k \\n\\tdp[2] = k * k\\t \\n\\tfor i in range(3,n+1): \\n\\t\\tdp[i] = ((k - 1) * (dp[i - 1] + dp[i - 2])) % mod \\n\\treturn dp[n]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that matches a string that has an a followed by three 'b'. Here is a solution in Python:\",\"targets\":\"import re\\ndef text_match_three(text):\\n patterns = 'ab{3}?'\\n return re.search(patterns, text)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find common first element in given list of tuple. Here is a solution in Python:\",\"targets\":\"def group_tuples(Input): \\n\\tout = {} \\n\\tfor elem in Input: \\n\\t\\ttry: \\n\\t\\t\\tout[elem[0]].extend(elem[1:]) \\n\\t\\texcept KeyError: \\n\\t\\t\\tout[elem[0]] = list(elem) \\n\\treturn [tuple(values) for values in out.values()]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to return two words from a list of words starting with letter 'p'. This can be solved in Python with the following code:\",\"targets\":\"import re\\ndef start_withp(words):\\n for w in words:\\n m = re.match(\\\"(P\\\\w+)\\\\W(P\\\\w+)\\\", w)\\n if m:\\n return m.groups()\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find a pair with highest product from a given array of integers. Here is a solution in Python:\",\"targets\":\"def max_Product(arr): \\n arr_len = len(arr) \\n if (arr_len < 2): \\n return (\\\"No pairs exists\\\") \\n x = arr[0]; y = arr[1] \\n for i in range(0,arr_len): \\n for j in range(i + 1,arr_len): \\n if (arr[i] * arr[j] > x * y): \\n x = arr[i]; y = arr[j] \\n return x,y\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the Eulerian number a(n, m). This can be solved in Python with the following code:\",\"targets\":\"def eulerian_num(n, m): \\n\\tif (m >= n or n == 0): \\n\\t\\treturn 0 \\n\\tif (m == 0): \\n\\t\\treturn 1 \\n\\treturn ((n - m) * eulerian_num(n - 1, m - 1) +(m + 1) * eulerian_num(n - 1, m))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether the given number is armstrong or not. This can be solved in Python with the following code:\",\"targets\":\"def armstrong_number(number):\\n sum = 0\\n times = 0\\n temp = number\\n while temp > 0:\\n times = times + 1\\n temp = temp \\/\\/ 10\\n temp = number\\n while temp > 0:\\n reminder = temp % 10\\n sum = sum + (reminder ** times)\\n temp \\/\\/= 10\\n if number == sum:\\n return True\\n else:\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that matches a string that has an a followed by one or more b's. Here is a solution in Python:\",\"targets\":\"import re\\ndef text_match_one(text):\\n patterns = 'ab+?'\\n if re.search(patterns, text):\\n return True\\n else:\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the kth element in the given array using 1-based indexing. This can be solved in Python with the following code:\",\"targets\":\"def kth_element(arr, k):\\n n = len(arr)\\n for i in range(n):\\n for j in range(0, n-i-1):\\n if arr[j] > arr[j+1]:\\n arr[j], arr[j+1] == arr[j+1], arr[j]\\n return arr[k-1]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to extract the elementwise and tuples from the given two tuples. This can be solved in Python with the following code:\",\"targets\":\"def and_tuples(test_tup1, test_tup2):\\n res = tuple(ele1 & ele2 for ele1, ele2 in zip(test_tup1, test_tup2))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to maximize the given two tuples. Here is a solution in Python:\",\"targets\":\"def maximize_elements(test_tup1, test_tup2):\\n res = tuple(tuple(max(a, b) for a, b in zip(tup1, tup2))\\n for tup1, tup2 in zip(test_tup1, test_tup2))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count the number of set bits (binary digits with value 1) in a given number. This can be solved in Python with the following code:\",\"targets\":\"def count_Set_Bits(n): \\n count = 0\\n while (n): \\n count += n & 1\\n n >>= 1\\n return count\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to count lists within a list. The function should return a dictionary where every list is converted to a tuple and the value of such tuple is the number of its occurencies in the original list. This can be solved in Python with the following code:\",\"targets\":\"def unique_sublists(list1):\\n result ={}\\n for l in list1: \\n result.setdefault(tuple(l), list()).append(1) \\n for a, b in result.items(): \\n result[a] = sum(b)\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes two lists and returns true if they have at least one common element. This can be solved in Python with the following code:\",\"targets\":\"def common_element(list1, list2):\\n result = False\\n for x in list1:\\n for y in list2:\\n if x == y:\\n result = True\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to count the number of lists within a list. The function should return a dictionary, where every list is turned to a tuple, and the value of the tuple is the number of its occurrences. Here is a solution in Python:\",\"targets\":\"def unique_sublists(list1):\\n result ={}\\n for l in list1: \\n result.setdefault(tuple(l), list()).append(1) \\n for a, b in result.items(): \\n result[a] = sum(b)\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to calculate the wind chill index rounded to the next integer given the wind velocity in km\\/h and a temperature in celsius. This can be solved in Python with the following code:\",\"targets\":\"import math\\ndef wind_chill(v,t):\\n windchill = 13.12 + 0.6215*t - 11.37*math.pow(v, 0.16) + 0.3965*t*math.pow(v, 0.16)\\n return int(round(windchill, 0))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to count the number of occurrences of a number in a given list. Here is a solution in Python:\",\"targets\":\"def frequency(a,x): \\n count = 0 \\n for i in a: \\n if i == x: \\n count += 1\\n\\n return count\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to perform index wise addition of tuple elements in the given two nested tuples. This can be solved in Python with the following code:\",\"targets\":\"def add_nested_tuples(test_tup1, test_tup2):\\n res = tuple(tuple(a + b for a, b in zip(tup1, tup2))\\n for tup1, tup2 in zip(test_tup1, test_tup2))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the sum of fourth power of first n odd natural numbers. This can be solved in Python with the following code:\",\"targets\":\"def odd_num_sum(n) : \\n j = 0\\n sm = 0\\n for i in range(1,n + 1) : \\n j = (2*i-1) \\n sm = sm + (j*j*j*j) \\n return sm\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the largest negative number from the given list. Here is a solution in Python:\",\"targets\":\"def largest_neg(list1): \\n max = list1[0] \\n for x in list1: \\n if x < max : \\n max = x \\n return max\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the list of maximum length in a list of lists. Here is a solution in Python:\",\"targets\":\"def max_length(list1):\\n max_length = max(len(x) for x in list1 ) \\n max_list = max((x) for x in list1)\\n return(max_length, max_list)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to calculate the wind chill index rounded to the next integer given the wind velocity in km\\/h and a temperature in celsius. Here is a solution in Python:\",\"targets\":\"import math\\ndef wind_chill(v,t):\\n windchill = 13.12 + 0.6215*t - 11.37*math.pow(v, 0.16) + 0.3965*t*math.pow(v, 0.16)\\n return int(round(windchill, 0))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert the given decimal number to its binary equivalent, represented as a string with no leading zeros. Here is a solution in Python:\",\"targets\":\"def decimal_to_binary(n): \\n return bin(n).replace(\\\"0b\\\",\\\"\\\")\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find sum of products of all possible sublists of a given list. https:\\/\\/www.geeksforgeeks.org\\/sum-of-products-of-all-possible-subarrays\\/ This can be solved in Python with the following code:\",\"targets\":\"def sum_Of_Subarray_Prod(arr):\\n ans = 0\\n res = 0\\n i = len(arr) - 1\\n while (i >= 0):\\n incr = arr[i]*(1 + res)\\n ans += incr\\n res = incr\\n i -= 1\\n return (ans)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether a list contains the given sublist or not. This can be solved in Python with the following code:\",\"targets\":\"def is_sublist(l, s):\\n\\tsub_set = False\\n\\tif s == []:\\n\\t\\tsub_set = True\\n\\telif s == l:\\n\\t\\tsub_set = True\\n\\telif len(s) > len(l):\\n\\t\\tsub_set = False\\n\\telse:\\n\\t\\tfor i in range(len(l)):\\n\\t\\t\\tif l[i] == s[0]:\\n\\t\\t\\t\\tn = 1\\n\\t\\t\\t\\twhile (n < len(s)) and (l[i+n] == s[n]):\\n\\t\\t\\t\\t\\tn += 1\\t\\t\\t\\t\\n\\t\\t\\t\\tif n == len(s):\\n\\t\\t\\t\\t\\tsub_set = True\\n\\treturn sub_set\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes as input a tuple of numbers (t_1,...,t_{N+1}) and returns a tuple of length N where the i-th element of the tuple is equal to t_i * t_{i+1}. Here is a solution in Python:\",\"targets\":\"def multiply_elements(test_tup):\\n res = tuple(i * j for i, j in zip(test_tup, test_tup[1:]))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether the product of numbers in a list is even or not. Here is a solution in Python:\",\"targets\":\"def is_product_even(arr): \\n for i in range(len(arr)): \\n if (arr[i] & 1) == 0: \\n return True\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the depth of a dictionary. This can be solved in Python with the following code:\",\"targets\":\"def dict_depth(d):\\n if isinstance(d, dict):\\n return 1 + (max(map(dict_depth, d.values())) if d else 0)\\n return 0\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the circumference of a circle. This can be solved in Python with the following code:\",\"targets\":\"def circle_circumference(r):\\n perimeter=2*3.1415*r\\n return perimeter\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the ratio of zeroes to non-zeroes in an array of integers. Here is a solution in Python:\",\"targets\":\"from array import array\\ndef zero_count(nums):\\n n = len(nums)\\n n1 = 0\\n for x in nums:\\n if x == 0:\\n n1 += 1\\n else:\\n None\\n return n1\\/(n-n1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to filter odd numbers. This can be solved in Python with the following code:\",\"targets\":\"def filter_oddnumbers(nums):\\n odd_nums = list(filter(lambda x: x%2 != 0, nums))\\n return odd_nums\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the n largest integers from a given list of numbers, returned in descending order. Here is a solution in Python:\",\"targets\":\"import heapq as hq\\ndef heap_queue_largest(nums,n):\\n largest_nums = hq.nlargest(n, nums)\\n return largest_nums\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert the given tuple to a key-value dictionary using adjacent elements. https:\\/\\/www.geeksforgeeks.org\\/python-convert-tuple-to-adjacent-pair-dictionary\\/ Here is a solution in Python:\",\"targets\":\"def tuple_to_dict(test_tup):\\n res = dict(test_tup[idx : idx + 2] for idx in range(0, len(test_tup), 2))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the first repeated character in a given string. This can be solved in Python with the following code:\",\"targets\":\"def first_repeated_char(str1):\\n for index,c in enumerate(str1):\\n if str1[:index+1].count(c) > 1:\\n return c\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to count the total number of characters in a string. This can be solved in Python with the following code:\",\"targets\":\"def count_charac(str1):\\n total = 0\\n for i in str1:\\n total = total + 1\\n return total\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to flatten a list and sum all of its elements. Here is a solution in Python:\",\"targets\":\"def recursive_list_sum(data_list):\\n\\ttotal = 0\\n\\tfor element in data_list:\\n\\t\\tif type(element) == type([]):\\n\\t\\t\\ttotal = total + recursive_list_sum(element)\\n\\t\\telse:\\n\\t\\t\\ttotal = total + element\\n\\treturn total\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function which given a matrix represented as a list of lists returns the max of the n'th column. This can be solved in Python with the following code:\",\"targets\":\"def max_of_nth(test_list, N):\\n res = max([sub[N] for sub in test_list])\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to sort a given matrix in ascending order according to the sum of its rows. Here is a solution in Python:\",\"targets\":\"def sort_matrix(M):\\n result = sorted(M, key=sum)\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes as input a tuple of numbers (t_1,...,t_{N+1}) and returns a tuple of length N where the i-th element of the tuple is equal to t_i * t_{i+1}. This can be solved in Python with the following code:\",\"targets\":\"def multiply_elements(test_tup):\\n res = tuple(i * j for i, j in zip(test_tup, test_tup[1:]))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert a tuple to a string. Here is a solution in Python:\",\"targets\":\"def tup_string(tup1):\\n str = ''.join(tup1)\\n return str\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count the number of set bits (binary digits with value 1) in a given number. Here is a solution in Python:\",\"targets\":\"def count_Set_Bits(n): \\n count = 0\\n while (n): \\n count += n & 1\\n n >>= 1\\n return count\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to count the pairs of reverse strings in the given string list. https:\\/\\/www.geeksforgeeks.org\\/python-program-to-count-the-pairs-of-reverse-strings\\/ This can be solved in Python with the following code:\",\"targets\":\"def count_reverse_pairs(test_list):\\n res = sum([1 for idx in range(0, len(test_list)) for idxn in range(idx, len( \\n\\ttest_list)) if test_list[idxn] == str(''.join(list(reversed(test_list[idx]))))]) \\n return res\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to remove odd characters in a string. This can be solved in Python with the following code:\",\"targets\":\"def remove_odd(str1):\\n str2 = ''\\n for i in range(1, len(str1) + 1):\\n if(i % 2 == 0):\\n str2 = str2 + str1[i - 1]\\n return str2\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the cumulative sum of all the values that are present in the given tuple list. This can be solved in Python with the following code:\",\"targets\":\"def cummulative_sum(test_list):\\n res = sum(map(sum, test_list))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to add a dictionary to the tuple. The output should be a tuple. This can be solved in Python with the following code:\",\"targets\":\"def add_dict_to_tuple(test_tup, test_dict):\\n test_tup = list(test_tup)\\n test_tup.append(test_dict)\\n test_tup = tuple(test_tup)\\n return (test_tup)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the n'th star number. This can be solved in Python with the following code:\",\"targets\":\"def find_star_num(n): \\n\\treturn (6 * n * (n - 1) + 1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find whether a given array of integers contains any duplicate element. Here is a solution in Python:\",\"targets\":\"def test_duplicate(arraynums):\\n nums_set = set(arraynums) \\n return len(arraynums) != len(nums_set)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find words that are longer than n characters from a given list of words. This can be solved in Python with the following code:\",\"targets\":\"def long_words(n, str):\\n word_len = []\\n txt = str.split(\\\" \\\")\\n for x in txt:\\n if len(x) > n:\\n word_len.append(x)\\n return word_len\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count the number of positive numbers in a list. This can be solved in Python with the following code:\",\"targets\":\"def pos_count(list):\\n pos_count= 0\\n for num in list: \\n if num >= 0: \\n pos_count += 1\\n return pos_count\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find quotient of two numbers (rounded down to the nearest integer). Here is a solution in Python:\",\"targets\":\"def find(n,m): \\n q = n\\/\\/m \\n return (q)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the maximum product subarray of the given array. This can be solved in Python with the following code:\",\"targets\":\"def max_subarray_product(arr):\\n\\tn = len(arr)\\n\\tmax_ending_here = 1\\n\\tmin_ending_here = 1\\n\\tmax_so_far = 0\\n\\tflag = 0\\n\\tfor i in range(0, n):\\n\\t\\tif arr[i] > 0:\\n\\t\\t\\tmax_ending_here = max_ending_here * arr[i]\\n\\t\\t\\tmin_ending_here = min (min_ending_here * arr[i], 1)\\n\\t\\t\\tflag = 1\\n\\t\\telif arr[i] == 0:\\n\\t\\t\\tmax_ending_here = 1\\n\\t\\t\\tmin_ending_here = 1\\n\\t\\telse:\\n\\t\\t\\ttemp = max_ending_here\\n\\t\\t\\tmax_ending_here = max (min_ending_here * arr[i], 1)\\n\\t\\t\\tmin_ending_here = temp * arr[i]\\n\\t\\tif (max_so_far < max_ending_here):\\n\\t\\t\\tmax_so_far = max_ending_here\\n\\tif flag == 0 and max_so_far == 0:\\n\\t\\treturn 0\\n\\treturn max_so_far\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the volume of a cube given its side length. This can be solved in Python with the following code:\",\"targets\":\"def volume_cube(l):\\n volume = l * l * l\\n return volume\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to sort a list of tuples using the second value of each tuple. This can be solved in Python with the following code:\",\"targets\":\"def subject_marks(subjectmarks):\\n#subject_marks = [('English', 88), ('Science', 90), ('Maths', 97), ('Social sciences', 82)])\\n subjectmarks.sort(key = lambda x: x[1])\\n return subjectmarks\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find out the number of ways of painting the fence such that at most 2 adjacent posts have the same color for the given fence with n posts and k colors. Here is a solution in Python:\",\"targets\":\"def count_no_of_ways(n, k): \\n\\tdp = [0] * (n + 1) \\n\\ttotal = k \\n\\tmod = 1000000007\\n\\tdp[1] = k \\n\\tdp[2] = k * k\\t \\n\\tfor i in range(3,n+1): \\n\\t\\tdp[i] = ((k - 1) * (dp[i - 1] + dp[i - 2])) % mod \\n\\treturn dp[n]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function which takes a list of integers and counts the number of possible unordered pairs where both elements are unequal. This can be solved in Python with the following code:\",\"targets\":\"def count_Pairs(arr,n): \\n cnt = 0; \\n for i in range(n): \\n for j in range(i + 1,n): \\n if (arr[i] != arr[j]): \\n cnt += 1; \\n return cnt;\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to search a string for a regex pattern. The function should return the matching subtring, a start index and an end index. This can be solved in Python with the following code:\",\"targets\":\"import re\\n\\ndef find_literals(text, pattern):\\n match = re.search(pattern, text)\\n s = match.start()\\n e = match.end()\\n return (match.re.pattern, s, e)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the median of two sorted lists of same size. This can be solved in Python with the following code:\",\"targets\":\"def get_median(arr1, arr2, n):\\n i = 0\\n j = 0\\n m1 = -1\\n m2 = -1\\n count = 0\\n while count < n + 1:\\n count += 1\\n if i == n:\\n m1 = m2\\n m2 = arr2[0]\\n break\\n elif j == n:\\n m1 = m2\\n m2 = arr1[0]\\n break\\n if arr1[i] <= arr2[j]:\\n m1 = m2\\n m2 = arr1[i]\\n i += 1\\n else:\\n m1 = m2\\n m2 = arr2[j]\\n j += 1\\n return (m1 + m2)\\/2\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to calculate the sum of perrin numbers. This can be solved in Python with the following code:\",\"targets\":\"def cal_sum(n): \\n\\ta = 3\\n\\tb = 0\\n\\tc = 2\\n\\tif (n == 0): \\n\\t\\treturn 3\\n\\tif (n == 1): \\n\\t\\treturn 3\\n\\tif (n == 2): \\n\\t\\treturn 5\\n\\tsum = 5\\n\\twhile (n > 2): \\n\\t\\td = a + b \\n\\t\\tsum = sum + d \\n\\t\\ta = b \\n\\t\\tb = c \\n\\t\\tc = d \\n\\t\\tn = n-1\\n\\treturn sum\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to calculate the product of the unique numbers in a given list. This can be solved in Python with the following code:\",\"targets\":\"def unique_product(list_data):\\n temp = list(set(list_data))\\n p = 1\\n for i in temp:\\n p *= i\\n return p\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find number of lists present in the given tuple. Here is a solution in Python:\",\"targets\":\"def find_lists(Input): \\n\\tif isinstance(Input, list): \\n\\t\\treturn 1\\n\\telse: \\n\\t\\treturn len(Input)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the dissimilar elements in the given two tuples. This can be solved in Python with the following code:\",\"targets\":\"def find_dissimilar(test_tup1, test_tup2):\\n res = tuple(set(test_tup1) ^ set(test_tup2))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write function to find the sum of all items in the given dictionary. Here is a solution in Python:\",\"targets\":\"def return_sum(dict):\\n sum = 0\\n for i in dict.values():\\n sum = sum + i\\n return sum\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the nth octagonal number. Here is a solution in Python:\",\"targets\":\"def is_octagonal(n): \\n\\treturn 3 * n * n - 2 * n\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert a given string to a tuple of characters. Here is a solution in Python:\",\"targets\":\"def string_to_tuple(str1):\\n result = tuple(x for x in str1 if not x.isspace()) \\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find maximum run of uppercase characters in the given string. This can be solved in Python with the following code:\",\"targets\":\"def max_run_uppercase(test_str):\\n cnt = 0\\n res = 0\\n for idx in range(0, len(test_str)):\\n if test_str[idx].isupper():\\n cnt += 1\\n else:\\n res = cnt\\n cnt = 0\\n if test_str[len(test_str) - 1].isupper():\\n res = cnt\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in a list and an integer L and splits the given list into two parts where the length of the first part of the list is L, and returns the resulting lists in a tuple. This can be solved in Python with the following code:\",\"targets\":\"def split_two_parts(list1, L):\\n return list1[:L], list1[L:]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to extract values between quotation marks from a string. Here is a solution in Python:\",\"targets\":\"import re\\ndef extract_values(text):\\n return (re.findall(r'\\\"(.*?)\\\"', text))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count the upper case characters in a given string. Here is a solution in Python:\",\"targets\":\"def upper_ctr(str):\\n upper_ctr = 0\\n for i in range(len(str)):\\n if str[i] >= 'A' and str[i] <= 'Z': upper_ctr += 1\\n return upper_ctr\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the smallest power of 2 greater than or equal to n. Here is a solution in Python:\",\"targets\":\"def next_power_of_2(n): \\n if n and not n & (n - 1):\\n return n\\n\\n count = 0\\n while n != 0: \\n n >>= 1\\n count += 1\\n\\n return 1 << count;\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the depth of a dictionary. Here is a solution in Python:\",\"targets\":\"def dict_depth(d):\\n if isinstance(d, dict):\\n return 1 + (max(map(dict_depth, d.values())) if d else 0)\\n return 0\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the sum of even factors of a number. Here is a solution in Python:\",\"targets\":\"import math \\ndef sumofFactors(n) : \\n if (n % 2 != 0) : \\n return 0\\n res = 1\\n for i in range(2, (int)(math.sqrt(n)) + 1) : \\n count = 0\\n curr_sum = 1\\n curr_term = 1\\n while (n % i == 0) : \\n count= count + 1\\n n = n \\/\\/ i \\n if (i == 2 and count == 1) : \\n curr_sum = 0\\n curr_term = curr_term * i \\n curr_sum = curr_sum + curr_term \\n res = res * curr_sum \\n if (n >= 2) : \\n res = res * (1 + n) \\n return res\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the maximum difference between the number of 0s and number of 1s in any sub-string of the given binary string. Here is a solution in Python:\",\"targets\":\"def find_length(string): \\n\\tn = len(string)\\n\\tcurrent_sum = 0\\n\\tmax_sum = 0\\n\\tfor i in range(n): \\n\\t\\tcurrent_sum += (1 if string[i] == '0' else -1) \\n\\t\\tif current_sum < 0: \\n\\t\\t\\tcurrent_sum = 0\\n\\t\\tmax_sum = max(current_sum, max_sum) \\n\\treturn max_sum if max_sum else 0\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to count the number of sublists containing a particular element. This can be solved in Python with the following code:\",\"targets\":\"def count_element_in_list(list1, x): \\n ctr = 0\\n for i in range(len(list1)): \\n if x in list1[i]: \\n ctr+= 1 \\n return ctr\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in a dictionary and integer n and filters the dictionary to only include entries with values greater than or equal to n. This can be solved in Python with the following code:\",\"targets\":\"def dict_filter(dict,n):\\n result = {key:value for (key, value) in dict.items() if value >=n}\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count true booleans in the given list. Here is a solution in Python:\",\"targets\":\"def count(lst): \\n return sum(lst)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to return a list of all pairs of consecutive items in a given list. This can be solved in Python with the following code:\",\"targets\":\"def pair_wise(l1):\\n temp = []\\n for i in range(len(l1) - 1):\\n current_element, next_element = l1[i], l1[i + 1]\\n x = (current_element, next_element)\\n temp.append(x)\\n return temp\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the specified number of largest products from two given lists, selecting one factor from each list. Here is a solution in Python:\",\"targets\":\"def large_product(nums1, nums2, N):\\n result = sorted([x*y for x in nums1 for y in nums2], reverse=True)[:N]\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to perform index wise multiplication of tuple elements in the given two tuples. This can be solved in Python with the following code:\",\"targets\":\"def index_multiplication(test_tup1, test_tup2):\\n res = tuple(tuple(a * b for a, b in zip(tup1, tup2))\\n for tup1, tup2 in zip(test_tup1, test_tup2))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to split a string into characters. This can be solved in Python with the following code:\",\"targets\":\"def split(word): \\n return [char for char in word]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the largest number that can be formed with the given list of digits. This can be solved in Python with the following code:\",\"targets\":\"def find_Max_Num(arr) : \\n n = len(arr)\\n arr.sort(reverse = True) \\n num = arr[0] \\n for i in range(1,n) : \\n num = num * 10 + arr[i] \\n return num\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to move all zeroes to the end of the given list. This can be solved in Python with the following code:\",\"targets\":\"def move_zero(num_list):\\n a = [0 for i in range(num_list.count(0))]\\n x = [i for i in num_list if i != 0]\\n return x + a\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether the given month number contains 31 days or not. This can be solved in Python with the following code:\",\"targets\":\"def check_monthnumb_number(monthnum2):\\n if(monthnum2==1 or monthnum2==3 or monthnum2==5 or monthnum2==7 or monthnum2==8 or monthnum2==10 or monthnum2==12):\\n return True\\n else:\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the last digit of a given number. Here is a solution in Python:\",\"targets\":\"def last_Digit(n) :\\n return (n % 10)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert a list to a tuple. This can be solved in Python with the following code:\",\"targets\":\"def list_tuple(listx):\\n tuplex = tuple(listx)\\n return tuplex\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find all possible combinations of the elements of a given list. Here is a solution in Python:\",\"targets\":\"def combinations_list(list1):\\n if len(list1) == 0:\\n return [[]]\\n result = []\\n for el in combinations_list(list1[1:]):\\n result += [el, el+[list1[0]]]\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the first adverb ending with ly and its positions in a given string. Here is a solution in Python:\",\"targets\":\"import re\\ndef find_adverbs(text):\\n for m in re.finditer(r\\\"\\\\w+ly\\\", text):\\n return ('%d-%d: %s' % (m.start(), m.end(), m.group(0)))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the specified number of largest products from two given lists, selecting one factor from each list. This can be solved in Python with the following code:\",\"targets\":\"def large_product(nums1, nums2, N):\\n result = sorted([x*y for x in nums1 for y in nums2], reverse=True)[:N]\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to rotate a given list by specified number of items to the right direction. https:\\/\\/www.geeksforgeeks.org\\/python-program-right-rotate-list-n\\/ This can be solved in Python with the following code:\",\"targets\":\"def rotate_right(list, m):\\n result = list[-m:] + list[:-m]\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the directrix of a parabola. This can be solved in Python with the following code:\",\"targets\":\"def parabola_directrix(a, b, c): \\n directrix=((int)(c - ((b * b) + 1) * 4 * a ))\\n return directrix\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the ascii value of a character. This can be solved in Python with the following code:\",\"targets\":\"def ascii_value(k):\\n ch=k\\n return ord(ch)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to that returns true if the input string contains sequences of lowercase letters joined with an underscore and false otherwise. This can be solved in Python with the following code:\",\"targets\":\"import re\\ndef text_lowercase_underscore(text):\\n patterns = '^[a-z]+_[a-z]+$'\\n if re.search(patterns, text):\\n return True\\n else:\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function that takes in an integer n and returns the sum of the squares of the first n odd natural numbers. Here is a solution in Python:\",\"targets\":\"def square_Sum(n): \\n return int(n*(4*n*n-1)\\/3)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether the given list contains consecutive numbers or not. This can be solved in Python with the following code:\",\"targets\":\"def check_Consecutive(l): \\n return sorted(l) == list(range(min(l),max(l)+1))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in a sorted array, its length (n), and an element and returns whether the element is the majority element in the given sorted array. (The majority element is the element that occurs more than n\\/2 times.) Here is a solution in Python:\",\"targets\":\"def is_majority(arr, n, x):\\n\\ti = binary_search(arr, 0, n-1, x)\\n\\tif i == -1:\\n\\t\\treturn False\\n\\tif ((i + n\\/\\/2) <= (n -1)) and arr[i + n\\/\\/2] == x:\\n\\t\\treturn True\\n\\telse:\\n\\t\\treturn False\\ndef binary_search(arr, low, high, x):\\n\\tif high >= low:\\n\\t\\tmid = (low + high)\\/\\/2 \\n\\t\\tif (mid == 0 or x > arr[mid-1]) and (arr[mid] == x):\\n\\t\\t\\treturn mid\\n\\t\\telif x > arr[mid]:\\n\\t\\t\\treturn binary_search(arr, (mid + 1), high, x)\\n\\t\\telse:\\n\\t\\t\\treturn binary_search(arr, low, (mid -1), x)\\n\\treturn -1\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that checks whether a string contains the 'a' character followed by two or three 'b' characters. Here is a solution in Python:\",\"targets\":\"import re\\ndef text_match_two_three(text):\\n patterns = 'ab{2,3}'\\n if re.search(patterns, text):\\n return True\\n else:\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to remove uneven elements in the nested mixed tuple. Here is a solution in Python:\",\"targets\":\"def even_ele(test_tuple, even_fnc): \\n\\tres = tuple() \\n\\tfor ele in test_tuple: \\n\\t\\tif isinstance(ele, tuple): \\n\\t\\t\\tres += (even_ele(ele, even_fnc), ) \\n\\t\\telif even_fnc(ele): \\n\\t\\t\\tres += (ele, ) \\n\\treturn res \\ndef extract_even(test_tuple):\\n res = even_ele(test_tuple, lambda x: x % 2 == 0)\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function which takes two tuples of the same length and performs the element wise modulo. Here is a solution in Python:\",\"targets\":\"def tuple_modulo(test_tup1, test_tup2):\\n res = tuple(ele1 % ele2 for ele1, ele2 in zip(test_tup1, test_tup2)) \\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count the number of lists in a given number of lists. This can be solved in Python with the following code:\",\"targets\":\"def count_list(input_list): \\n return len(input_list)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to remove all the words with k length in the given string. This can be solved in Python with the following code:\",\"targets\":\"def remove_length(test_str, K):\\n temp = test_str.split()\\n res = [ele for ele in temp if len(ele) != K]\\n res = ' '.join(res)\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function that takes in a non-negative number and returns the number of prime numbers less than the given non-negative number. Here is a solution in Python:\",\"targets\":\"def count_Primes_nums(n):\\n ctr = 0\\n for num in range(n):\\n if num <= 1:\\n continue\\n for i in range(2,num):\\n if (num % i) == 0:\\n break\\n else:\\n ctr += 1\\n return ctr\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to extract the elementwise and tuples from the given two tuples. Here is a solution in Python:\",\"targets\":\"def and_tuples(test_tup1, test_tup2):\\n res = tuple(ele1 & ele2 for ele1, ele2 in zip(test_tup1, test_tup2))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the lateral surface area of a cube given its side length. This can be solved in Python with the following code:\",\"targets\":\"def lateralsurface_cube(l):\\n LSA = 4 * (l * l)\\n return LSA\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function which takes a list of integers and only returns the odd ones. This can be solved in Python with the following code:\",\"targets\":\"def Split(list): \\n od_li = [] \\n for i in list: \\n if (i % 2 != 0): \\n od_li.append(i) \\n return od_li\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check if all values are same in a dictionary. This can be solved in Python with the following code:\",\"targets\":\"def check_value(dict, n):\\n result = all(x == n for x in dict.values()) \\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the circumference of a circle. Here is a solution in Python:\",\"targets\":\"def circle_circumference(r):\\n perimeter=2*3.1415*r\\n return perimeter\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to remove all elements from a given list present in another list. Here is a solution in Python:\",\"targets\":\"def remove_elements(list1, list2):\\n result = [x for x in list1 if x not in list2]\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether the given string is starting with a vowel or not using regex. Here is a solution in Python:\",\"targets\":\"import re \\nregex = '^[aeiouAEIOU][A-Za-z0-9_]*'\\ndef check_str(string): \\n\\treturn re.search(regex, string)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert polar coordinates to rectangular coordinates. Here is a solution in Python:\",\"targets\":\"import cmath\\ndef polar_rect(x,y):\\n cn = complex(x,y)\\n cn=cmath.polar(cn)\\n cn1 = cmath.rect(2, cmath.pi)\\n return (cn,cn1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the index of the first occurrence of a given number in a sorted array. This can be solved in Python with the following code:\",\"targets\":\"def find_first_occurrence(A, x):\\n (left, right) = (0, len(A) - 1)\\n result = -1\\n while left <= right:\\n mid = (left + right) \\/\\/ 2\\n if x == A[mid]:\\n result = mid\\n right = mid - 1\\n elif x < A[mid]:\\n right = mid - 1\\n else:\\n left = mid + 1\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the surface area of a cylinder. Here is a solution in Python:\",\"targets\":\"def surfacearea_cylinder(r,h):\\n surfacearea=((2*3.1415*r*r) +(2*3.1415*r*h))\\n return surfacearea\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check if the elements of a given list are unique or not. Here is a solution in Python:\",\"targets\":\"def all_unique(test_list):\\n if len(test_list) > len(set(test_list)):\\n return False\\n return True\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to concatenate each element of tuple by the delimiter. Here is a solution in Python:\",\"targets\":\"def concatenate_tuple(test_tup):\\n delim = \\\"-\\\"\\n res = ''.join([str(ele) + delim for ele in test_tup])\\n res = res[ : len(res) - len(delim)]\\n return (str(res))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the surface area of a sphere. Here is a solution in Python:\",\"targets\":\"import math\\ndef surfacearea_sphere(r):\\n surfacearea=4*math.pi*r*r\\n return surfacearea\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to extract the nth element from a given list of tuples. This can be solved in Python with the following code:\",\"targets\":\"def extract_nth_element(list1, n):\\n result = [x[n] for x in list1]\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function that returns the number of integer elements in a given list. Here is a solution in Python:\",\"targets\":\"def count_integer(list1):\\n ctr = 0\\n for i in list1:\\n if isinstance(i, int):\\n ctr = ctr + 1\\n return ctr\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to count lists within a list. The function should return a dictionary where every list is converted to a tuple and the value of such tuple is the number of its occurencies in the original list. Here is a solution in Python:\",\"targets\":\"def unique_sublists(list1):\\n result ={}\\n for l in list1: \\n result.setdefault(tuple(l), list()).append(1) \\n for a, b in result.items(): \\n result[a] = sum(b)\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to append the given list to the given tuples. This can be solved in Python with the following code:\",\"targets\":\"def add_lists(test_list, test_tup):\\n res = tuple(list(test_tup) + test_list)\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the minimum value in a given heterogeneous list. Here is a solution in Python:\",\"targets\":\"def min_val(listval):\\n min_val = min(i for i in listval if isinstance(i, int))\\n return min_val\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to return the negative numbers in a list. Here is a solution in Python:\",\"targets\":\"def neg_nos(list1):\\n out = []\\n for num in list1: \\n if num < 0: \\n out.append(num)\\n return out\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the volume of a cone. Here is a solution in Python:\",\"targets\":\"import math\\ndef volume_cone(r,h):\\n volume = (1.0\\/3) * math.pi * r * r * h\\n return volume\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether the count of divisors is even. https:\\/\\/www.w3resource.com\\/python-exercises\\/basic\\/python-basic-1-exercise-24.php Here is a solution in Python:\",\"targets\":\"import math \\ndef count_divisors(n) : \\n count = 0\\n for i in range(1, (int)(math.sqrt(n)) + 2) : \\n if (n % i == 0) : \\n if( n \\/\\/ i == i) : \\n count = count + 1\\n else : \\n count = count + 2\\n return count % 2 == 0\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to interleave 3 lists of the same length into a single flat list. This can be solved in Python with the following code:\",\"targets\":\"def interleave_lists(list1,list2,list3):\\n result = [el for pair in zip(list1, list2, list3) for el in pair]\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the combinations of sums with tuples in the given tuple list. https:\\/\\/www.geeksforgeeks.org\\/python-combinations-of-sum-with-tuples-in-tuple-list\\/ Here is a solution in Python:\",\"targets\":\"from itertools import combinations \\ndef find_combinations(test_list):\\n res = [(b1 + a1, b2 + a2) for (a1, a2), (b1, b2) in combinations(test_list, 2)]\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that returns the list in a list of lists whose sum of elements is the highest. This can be solved in Python with the following code:\",\"targets\":\"def max_sum_list(lists):\\n return max(lists, key=sum)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the tuple intersection of elements in the given tuple list irrespective of their order. Here is a solution in Python:\",\"targets\":\"def tuple_intersection(test_list1, test_list2):\\n res = set([tuple(sorted(ele)) for ele in test_list1]) & set([tuple(sorted(ele)) for ele in test_list2])\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to remove uppercase substrings from a given string. This can be solved in Python with the following code:\",\"targets\":\"import re\\ndef remove_uppercase(str1):\\n return re.sub('[A-Z]', '', str1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to interchange the first and last elements in a list. Here is a solution in Python:\",\"targets\":\"def swap_List(newList): \\n size = len(newList) \\n temp = newList[0] \\n newList[0] = newList[size - 1] \\n newList[size - 1] = temp \\n return newList\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in a list and an integer n and returns a list containing the n largest items from the list. This can be solved in Python with the following code:\",\"targets\":\"import heapq\\ndef larg_nnum(list1,n):\\n largest=heapq.nlargest(n,list1)\\n return largest\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the item with maximum frequency in a given list. This can be solved in Python with the following code:\",\"targets\":\"from collections import defaultdict\\ndef max_occurrences(nums):\\n dict = defaultdict(int)\\n for i in nums:\\n dict[i] += 1\\n result = max(dict.items(), key=lambda x: x[1]) \\n return result[0]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find numbers within a given range from startnum ti endnum where every number is divisible by every digit it contains. https:\\/\\/www.w3resource.com\\/python-exercises\\/lambda\\/python-lambda-exercise-24.php This can be solved in Python with the following code:\",\"targets\":\"def divisible_by_digits(startnum, endnum):\\n return [n for n in range(startnum, endnum+1) \\\\\\n if not any(map(lambda x: int(x) == 0 or n%int(x) != 0, str(n)))]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find even numbers from a list of numbers. Here is a solution in Python:\",\"targets\":\"def Split(list): \\n return [num for num in list if num % 2 == 0]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to remove all the words with k length in the given string. Here is a solution in Python:\",\"targets\":\"def remove_length(test_str, K):\\n temp = test_str.split()\\n res = [ele for ele in temp if len(ele) != K]\\n res = ' '.join(res)\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to extract specified size of strings from a given list of string values. Here is a solution in Python:\",\"targets\":\"def extract_string(str, l):\\n result = [e for e in str if len(e) == l] \\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether every odd index contains odd numbers of a given list. This can be solved in Python with the following code:\",\"targets\":\"def odd_position(nums):\\n\\treturn all(nums[i]%2==i%2 for i in range(len(nums)))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether an element exists within a tuple. Here is a solution in Python:\",\"targets\":\"def check_tuplex(tuplex,tuple1): \\n if tuple1 in tuplex:\\n return True\\n else:\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to perform the mathematical bitwise xor operation across the given tuples. This can be solved in Python with the following code:\",\"targets\":\"def bitwise_xor(test_tup1, test_tup2):\\n res = tuple(ele1 ^ ele2 for ele1, ele2 in zip(test_tup1, test_tup2))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find sum of products of all possible sublists of a given list. https:\\/\\/www.geeksforgeeks.org\\/sum-of-products-of-all-possible-subarrays\\/ Here is a solution in Python:\",\"targets\":\"def sum_Of_Subarray_Prod(arr):\\n ans = 0\\n res = 0\\n i = len(arr) - 1\\n while (i >= 0):\\n incr = arr[i]*(1 + res)\\n ans += incr\\n res = incr\\n i -= 1\\n return (ans)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to compute the n-th power of each number in a list. Here is a solution in Python:\",\"targets\":\"def nth_nums(nums,n):\\n nth_nums = list(map(lambda x: x ** n, nums))\\n return nth_nums\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find minimum of three numbers. Here is a solution in Python:\",\"targets\":\"def min_of_three(a,b,c): \\n if (a <= b) and (a <= c): \\n smallest = a \\n elif (b <= a) and (b <= c): \\n smallest = b \\n else: \\n smallest = c \\n return smallest\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether the given number can be represented as sum of non-zero powers of 2 or not. This can be solved in Python with the following code:\",\"targets\":\"def is_Sum_Of_Powers_Of_Two(n): \\n if (n % 2 == 1): \\n return False\\n else: \\n return True\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the median of three numbers. This can be solved in Python with the following code:\",\"targets\":\"def median_numbers(a,b,c):\\n if a > b:\\n if a < c:\\n median = a\\n elif b > c:\\n median = b\\n else:\\n median = c\\n else:\\n if a > c:\\n median = a\\n elif b < c:\\n median = b\\n else:\\n median = c\\n return median\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count inversions in an array. Here is a solution in Python:\",\"targets\":\"def get_Inv_Count(arr): \\n inv_count = 0\\n for i in range(len(arr)): \\n for j in range(i + 1, len(arr)): \\n if (arr[i] > arr[j]): \\n inv_count += 1\\n return inv_count\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that checks if a strings contains 'z', except at the start and end of the word. This can be solved in Python with the following code:\",\"targets\":\"import re\\ndef text_match_wordz_middle(text):\\n return bool(re.search(r'\\\\Bz\\\\B', text))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the area of the largest triangle that can be inscribed in a semicircle with a given radius. Here is a solution in Python:\",\"targets\":\"def triangle_area(r) : \\n if r < 0 : \\n return None\\n return r * r\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to get the frequency of all the elements in a list, returned as a dictionary. Here is a solution in Python:\",\"targets\":\"import collections\\ndef freq_count(list1):\\n freq_count= collections.Counter(list1)\\n return freq_count\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to multiply all the numbers in a list and divide with the length of the list. Here is a solution in Python:\",\"targets\":\"def multiply_num(numbers): \\n total = 1\\n for x in numbers:\\n total *= x \\n return total\\/len(numbers)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether all the characters are same or not. Here is a solution in Python:\",\"targets\":\"def all_Characters_Same(s) :\\n n = len(s)\\n for i in range(1,n) :\\n if s[i] != s[0] :\\n return False\\n return True\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether a specified list is sorted or not. Here is a solution in Python:\",\"targets\":\"def issort_list(list1):\\n result = all(list1[i] <= list1[i+1] for i in range(len(list1)-1))\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to merge three lists into a single sorted list. This can be solved in Python with the following code:\",\"targets\":\"import heapq\\ndef merge_sorted_list(num1,num2,num3):\\n num1=sorted(num1)\\n num2=sorted(num2)\\n num3=sorted(num3)\\n result = heapq.merge(num1,num2,num3)\\n return list(result)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to count the number of characters in a string that occur at the same position in the string as in the English alphabet (case insensitive). This can be solved in Python with the following code:\",\"targets\":\"def count_char_position(str1): \\n count_chars = 0\\n for i in range(len(str1)):\\n if ((i == ord(str1[i]) - ord('A')) or \\n (i == ord(str1[i]) - ord('a'))): \\n count_chars += 1\\n return count_chars\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to remove characters from the first string which are present in the second string. Here is a solution in Python:\",\"targets\":\"NO_OF_CHARS = 256\\ndef str_to_list(string): \\n\\ttemp = [] \\n\\tfor x in string: \\n\\t\\ttemp.append(x) \\n\\treturn temp \\ndef lst_to_string(List): \\n\\treturn ''.join(List) \\ndef get_char_count_array(string): \\n\\tcount = [0] * NO_OF_CHARS \\n\\tfor i in string: \\n\\t\\tcount[ord(i)] += 1\\n\\treturn count \\ndef remove_dirty_chars(string, second_string): \\n\\tcount = get_char_count_array(second_string) \\n\\tip_ind = 0\\n\\tres_ind = 0\\n\\ttemp = '' \\n\\tstr_list = str_to_list(string) \\n\\twhile ip_ind != len(str_list): \\n\\t\\ttemp = str_list[ip_ind] \\n\\t\\tif count[ord(temp)] == 0: \\n\\t\\t\\tstr_list[res_ind] = str_list[ip_ind] \\n\\t\\t\\tres_ind += 1\\n\\t\\tip_ind+=1\\n\\treturn lst_to_string(str_list[0:res_ind])\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to remove the characters which have odd index values of a given string. Here is a solution in Python:\",\"targets\":\"def odd_values_string(str):\\n result = \\\"\\\" \\n for i in range(len(str)):\\n if i % 2 == 0:\\n result = result + str[i]\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"The input is defined as two lists of the same length. Write a function to count indices where the lists have the same values. This can be solved in Python with the following code:\",\"targets\":\"from operator import eq\\ndef count_same_pair(nums1, nums2):\\n result = sum(map(eq, nums1, nums2))\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to calculate the sum of the negative numbers of a given list of numbers. Here is a solution in Python:\",\"targets\":\"def sum_negativenum(nums):\\n sum_negativenum = list(filter(lambda nums:nums<0,nums))\\n return sum(sum_negativenum)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to remove first and last occurrence of a given character from the string. Here is a solution in Python:\",\"targets\":\"def remove_Occ(s,ch): \\n for i in range(len(s)): \\n if (s[i] == ch): \\n s = s[0 : i] + s[i + 1:] \\n break\\n for i in range(len(s) - 1,-1,-1): \\n if (s[i] == ch): \\n s = s[0 : i] + s[i + 1:] \\n break\\n return s\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the volume of a triangular prism. This can be solved in Python with the following code:\",\"targets\":\"def find_Volume(l,b,h) : \\n return ((l * b * h) \\/ 2)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the surface area of a square pyramid with a given base edge and height. This can be solved in Python with the following code:\",\"targets\":\"def surface_Area(b,s): \\n return 2 * b * s + pow(b,2)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find minimum of three numbers. This can be solved in Python with the following code:\",\"targets\":\"def min_of_three(a,b,c): \\n if (a <= b) and (a <= c): \\n smallest = a \\n elif (b <= a) and (b <= c): \\n smallest = b \\n else: \\n smallest = c \\n return smallest\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether the given string starts and ends with the same character or not. Here is a solution in Python:\",\"targets\":\"import re \\nregex = r'^[a-z]$|^([a-z]).*\\\\1$'\\ndef check_char(string): \\n\\tif(re.search(regex, string)): \\n\\t\\treturn \\\"Valid\\\" \\n\\telse: \\n\\t\\treturn \\\"Invalid\\\"\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to extract only the rear index element of each string in the given tuple. Here is a solution in Python:\",\"targets\":\"def extract_rear(test_tuple):\\n res = list(sub[len(sub) - 1] for sub in test_tuple)\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to reverse an array upto a given position. Here is a solution in Python:\",\"targets\":\"def reverse_Array_Upto_K(input, k): \\n return (input[k-1::-1] + input[k:])\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in a string and character, replaces blank spaces in the string with the character, and returns the string. This can be solved in Python with the following code:\",\"targets\":\"def replace_blank(str1,char):\\n str2 = str1.replace(' ', char)\\n return str2\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the first repeated character in a given string. Here is a solution in Python:\",\"targets\":\"def first_repeated_char(str1):\\n for index,c in enumerate(str1):\\n if str1[:index+1].count(c) > 1:\\n return c\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count inversions in an array. This can be solved in Python with the following code:\",\"targets\":\"def get_Inv_Count(arr): \\n inv_count = 0\\n for i in range(len(arr)): \\n for j in range(i + 1, len(arr)): \\n if (arr[i] > arr[j]): \\n inv_count += 1\\n return inv_count\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to sort the given list. Here is a solution in Python:\",\"targets\":\"import heapq as hq\\ndef heap_sort(iterable):\\n h = []\\n for value in iterable:\\n hq.heappush(h, value)\\n return [hq.heappop(h) for i in range(len(h))]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function that takes in a tuple and an element and counts the occcurences of the element in the tuple. Here is a solution in Python:\",\"targets\":\"def count_X(tup, x): \\n count = 0\\n for ele in tup: \\n if (ele == x): \\n count = count + 1\\n return count\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the last position of an element in a sorted array. Here is a solution in Python:\",\"targets\":\"def last(arr,x):\\n n = len(arr)\\n low = 0\\n high = n - 1\\n res = -1 \\n while (low <= high):\\n mid = (low + high) \\/\\/ 2 \\n if arr[mid] > x:\\n high = mid - 1\\n elif arr[mid] < x:\\n low = mid + 1\\n else:\\n res = mid\\n low = mid + 1\\n return res\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the sum of the per-digit difference between two integers. This can be solved in Python with the following code:\",\"targets\":\"def digit_distance_nums(n1, n2):\\n return sum(map(int,str(abs(n1-n2))))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the count of all binary sequences of length 2n such that sum of first n bits is same as sum of last n bits. Here is a solution in Python:\",\"targets\":\"def count_binary_seq(n): \\n\\tnCr = 1\\n\\tres = 1\\n\\tfor r in range(1, n + 1): \\n\\t\\tnCr = (nCr * (n + 1 - r)) \\/ r \\n\\t\\tres += nCr * nCr \\n\\treturn res\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to interchange the first and last element in a given list. This can be solved in Python with the following code:\",\"targets\":\"def swap_List(newList): \\n size = len(newList) \\n temp = newList[0] \\n newList[0] = newList[size - 1] \\n newList[size - 1] = temp \\n return newList\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to determine if the sum of the divisors of two integers are the same. This can be solved in Python with the following code:\",\"targets\":\"import math \\ndef div_sum(n): \\n total = 1\\n i = 2\\n\\n while i * i <= n:\\n if (n % i == 0):\\n total = (total + i + math.floor(n \\/ i))\\n i += 1\\n\\n return total\\n\\ndef are_equivalent(num1, num2): \\n return div_sum(num1) == div_sum(num2);\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether the two numbers differ at one bit position only or not. This can be solved in Python with the following code:\",\"targets\":\"def is_Power_Of_Two (x): \\n return x and (not(x & (x - 1))) \\ndef differ_At_One_Bit_Pos(a,b): \\n return is_Power_Of_Two(a ^ b)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find perfect squares between two given numbers. This can be solved in Python with the following code:\",\"targets\":\"def perfect_squares(a, b):\\n lists=[]\\n for i in range (a,b+1):\\n j = 1;\\n while j*j <= i:\\n if j*j == i:\\n lists.append(i) \\n j = j+1\\n i = i+1\\n return lists\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the combinations of sums with tuples in the given tuple list. https:\\/\\/www.geeksforgeeks.org\\/python-combinations-of-sum-with-tuples-in-tuple-list\\/ This can be solved in Python with the following code:\",\"targets\":\"from itertools import combinations \\ndef find_combinations(test_list):\\n res = [(b1 + a1, b2 + a2) for (a1, a2), (b1, b2) in combinations(test_list, 2)]\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to search a string for a regex pattern. The function should return the matching subtring, a start index and an end index. Here is a solution in Python:\",\"targets\":\"import re\\n\\ndef find_literals(text, pattern):\\n match = re.search(pattern, text)\\n s = match.start()\\n e = match.end()\\n return (match.re.pattern, s, e)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the cube sum of first n even natural numbers. Here is a solution in Python:\",\"targets\":\"def cube_Sum(n): \\n sum = 0\\n for i in range(1,n + 1): \\n sum += (2*i)*(2*i)*(2*i) \\n return sum\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to compute the sum of digits of each number of a given list. Here is a solution in Python:\",\"targets\":\"def sum_of_digits(nums):\\n return sum(int(el) for n in nums for el in str(n) if el.isdigit())\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the maximum value in a given heterogeneous list. This can be solved in Python with the following code:\",\"targets\":\"def max_val(listval):\\n max_val = max(i for i in listval if isinstance(i, int)) \\n return(max_val)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to interchange the first and last elements in a list. This can be solved in Python with the following code:\",\"targets\":\"def swap_List(newList): \\n size = len(newList) \\n temp = newList[0] \\n newList[0] = newList[size - 1] \\n newList[size - 1] = temp \\n return newList\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether all the bits are unset in the given range or not. This can be solved in Python with the following code:\",\"targets\":\"def all_Bits_Set_In_The_Given_Range(n,l,r): \\n num = (((1 << r) - 1) ^ ((1 << (l - 1)) - 1)) \\n new_num = n & num\\n if (new_num == 0): \\n return True\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to interchange the first and last element in a given list. Here is a solution in Python:\",\"targets\":\"def swap_List(newList): \\n size = len(newList) \\n temp = newList[0] \\n newList[0] = newList[size - 1] \\n newList[size - 1] = temp \\n return newList\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to caluclate the area of a tetrahedron. Here is a solution in Python:\",\"targets\":\"import math\\ndef area_tetrahedron(side):\\n area = math.sqrt(3)*(side*side)\\n return area\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"The input is given as - a dictionary with a student name as a key and a tuple of float (student_height, student_weight) as a value, - minimal height, - minimal weight. Write a function to filter students that have height and weight above the minimum. This can be solved in Python with the following code:\",\"targets\":\"def filter_data(students,h,w):\\n result = {k: s for k, s in students.items() if s[0] >=h and s[1] >=w}\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check if given tuple contains no duplicates. This can be solved in Python with the following code:\",\"targets\":\"def check_distinct(test_tup):\\n res = True\\n temp = set()\\n for ele in test_tup:\\n if ele in temp:\\n res = False\\n break\\n temp.add(ele)\\n return res\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"The input is defined as two lists of the same length. Write a function to count indices where the lists have the same values. Here is a solution in Python:\",\"targets\":\"from operator import eq\\ndef count_same_pair(nums1, nums2):\\n result = sum(map(eq, nums1, nums2))\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the index of the first occurrence of a given number in a sorted array. Here is a solution in Python:\",\"targets\":\"def find_first_occurrence(A, x):\\n (left, right) = (0, len(A) - 1)\\n result = -1\\n while left <= right:\\n mid = (left + right) \\/\\/ 2\\n if x == A[mid]:\\n result = mid\\n right = mid - 1\\n elif x < A[mid]:\\n right = mid - 1\\n else:\\n left = mid + 1\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to extract all the adjacent coordinates of the given coordinate tuple. This can be solved in Python with the following code:\",\"targets\":\"def adjac(ele, sub = []): \\n if not ele: \\n yield sub \\n else: \\n yield from [idx for j in range(ele[0] - 1, ele[0] + 2) \\n for idx in adjac(ele[1:], sub + [j])] \\ndef get_coordinates(test_tup):\\n return list(adjac(test_tup))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to calculate the product of the unique numbers in a given list. Here is a solution in Python:\",\"targets\":\"def unique_product(list_data):\\n temp = list(set(list_data))\\n p = 1\\n for i in temp:\\n p *= i\\n return p\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to remove leading zeroes from an ip address. This can be solved in Python with the following code:\",\"targets\":\"import re\\ndef removezero_ip(ip):\\n string = re.sub('\\\\.[0]*', '.', ip)\\n return string\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to remove tuples from the given tuple. Here is a solution in Python:\",\"targets\":\"def remove_nested(test_tup):\\n res = tuple()\\n for count, ele in enumerate(test_tup):\\n if not isinstance(ele, tuple):\\n res = res + (ele, )\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in a list of tuples and returns a dictionary mapping each unique tuple to the number of times it occurs in the list. Here is a solution in Python:\",\"targets\":\"from collections import Counter \\ndef check_occurences(test_list):\\n res = dict(Counter(tuple(ele) for ele in map(sorted, test_list)))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to toggle the case of all characters in a string. This can be solved in Python with the following code:\",\"targets\":\"def toggle_string(string):\\n string1 = string.swapcase()\\n return string1\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the difference between largest and smallest value in a given list. This can be solved in Python with the following code:\",\"targets\":\"def big_diff(nums):\\n diff= max(nums)-min(nums)\\n return diff\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to extract the number of unique tuples in the given list. Here is a solution in Python:\",\"targets\":\"def extract_freq(test_list):\\n res = len(list(set(tuple(sorted(sub)) for sub in test_list)))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to count bidirectional tuple pairs. This can be solved in Python with the following code:\",\"targets\":\"def count_bidirectional(test_list):\\n res = 0\\n for idx in range(0, len(test_list)):\\n for iidx in range(idx + 1, len(test_list)):\\n if test_list[iidx][0] == test_list[idx][1] and test_list[idx][1] == test_list[iidx][0]:\\n res += 1\\n return res\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to split a string into characters. Here is a solution in Python:\",\"targets\":\"def split(word): \\n return [char for char in word]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to append the given list to the given tuples. Here is a solution in Python:\",\"targets\":\"def add_lists(test_list, test_tup):\\n res = tuple(list(test_tup) + test_list)\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to caluclate the area of a tetrahedron. This can be solved in Python with the following code:\",\"targets\":\"import math\\ndef area_tetrahedron(side):\\n area = math.sqrt(3)*(side*side)\\n return area\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to remove lowercase substrings from a given string. Here is a solution in Python:\",\"targets\":\"import re\\ndef remove_lowercase(str1):\\n return re.sub('[a-z]', '', str1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find nth polite number. geeksforgeeks.org\\/n-th-polite-number\\/ Here is a solution in Python:\",\"targets\":\"import math \\ndef is_polite(n): \\n\\tn = n + 1\\n\\treturn (int)(n+(math.log((n + math.log(n, 2)), 2)))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the volume of a cone. This can be solved in Python with the following code:\",\"targets\":\"import math\\ndef volume_cone(r,h):\\n volume = (1.0\\/3) * math.pi * r * r * h\\n return volume\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check if a string is present as a substring in a given list of string values. This can be solved in Python with the following code:\",\"targets\":\"def find_substring(str1, sub_str):\\n if any(sub_str in s for s in str1):\\n return True\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the sum of the per-digit difference between two integers. Here is a solution in Python:\",\"targets\":\"def digit_distance_nums(n1, n2):\\n return sum(map(int,str(abs(n1-n2))))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether every even index contains even numbers of a given list. Here is a solution in Python:\",\"targets\":\"def even_position(nums):\\n\\treturn all(nums[i]%2==i%2 for i in range(len(nums)))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to move all zeroes to the end of the given list. Here is a solution in Python:\",\"targets\":\"def move_zero(num_list):\\n a = [0 for i in range(num_list.count(0))]\\n x = [i for i in num_list if i != 0]\\n return x + a\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function which given a matrix represented as a list of lists returns the max of the n'th column. Here is a solution in Python:\",\"targets\":\"def max_of_nth(test_list, N):\\n res = max([sub[N] for sub in test_list])\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the largest number that can be formed with the given list of digits. Here is a solution in Python:\",\"targets\":\"def find_Max_Num(arr) : \\n n = len(arr)\\n arr.sort(reverse = True) \\n num = arr[0] \\n for i in range(1,n) : \\n num = num * 10 + arr[i] \\n return num\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert all possible convertible elements in a list of lists to floats. Here is a solution in Python:\",\"targets\":\"def list_to_float(test_list):\\n res = []\\n for tup in test_list:\\n temp = []\\n for ele in tup:\\n if ele.isalpha():\\n temp.append(ele)\\n else:\\n temp.append(float(ele))\\n res.append((temp[0],temp[1])) \\n return res\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to multiply two integers. Here is a solution in Python:\",\"targets\":\"def multiply_int(x, y):\\n if y < 0:\\n return -multiply_int(x, -y)\\n elif y == 0:\\n return 0\\n elif y == 1:\\n return x\\n else:\\n return x + multiply_int(x, y - 1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to get the angle of a complex number. This can be solved in Python with the following code:\",\"targets\":\"import cmath\\ndef angle_complex(a,b):\\n cn=complex(a,b)\\n angle=cmath.phase(a+b)\\n return angle\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find even numbers from a list of numbers. This can be solved in Python with the following code:\",\"targets\":\"def Split(list): \\n return [num for num in list if num % 2 == 0]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to count number items that are identical in the same position of three given lists. Here is a solution in Python:\",\"targets\":\"def count_samepair(list1,list2,list3):\\n result = sum(m == n == o for m, n, o in zip(list1,list2,list3))\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to reverse an array upto a given position. This can be solved in Python with the following code:\",\"targets\":\"def reverse_Array_Upto_K(input, k): \\n return (input[k-1::-1] + input[k:])\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to convert a given string to uppercase. This can be solved in Python with the following code:\",\"targets\":\"def is_upper(string):\\n return (string.upper())\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the number of ways to partition a set of Bell numbers. Here is a solution in Python:\",\"targets\":\"def bell_number(n): \\n bell = [[0 for i in range(n+1)] for j in range(n+1)] \\n bell[0][0] = 1\\n for i in range(1, n+1): \\n bell[i][0] = bell[i-1][i-1] \\n for j in range(1, i+1): \\n bell[i][j] = bell[i-1][j-1] + bell[i][j-1] \\n return bell[n][0]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the last position of an element in a sorted array. This can be solved in Python with the following code:\",\"targets\":\"def last(arr,x):\\n n = len(arr)\\n low = 0\\n high = n - 1\\n res = -1 \\n while (low <= high):\\n mid = (low + high) \\/\\/ 2 \\n if arr[mid] > x:\\n high = mid - 1\\n elif arr[mid] < x:\\n low = mid + 1\\n else:\\n res = mid\\n low = mid + 1\\n return res\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the sum of even factors of a number. This can be solved in Python with the following code:\",\"targets\":\"import math \\ndef sumofFactors(n) : \\n if (n % 2 != 0) : \\n return 0\\n res = 1\\n for i in range(2, (int)(math.sqrt(n)) + 1) : \\n count = 0\\n curr_sum = 1\\n curr_term = 1\\n while (n % i == 0) : \\n count= count + 1\\n n = n \\/\\/ i \\n if (i == 2 and count == 1) : \\n curr_sum = 0\\n curr_term = curr_term * i \\n curr_sum = curr_sum + curr_term \\n res = res * curr_sum \\n if (n >= 2) : \\n res = res * (1 + n) \\n return res\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the size of the largest subset of a list of numbers so that every pair is divisible. Here is a solution in Python:\",\"targets\":\"def largest_subset(a):\\n\\tn = len(a)\\n\\tdp = [0 for i in range(n)]\\n\\tdp[n - 1] = 1; \\n\\tfor i in range(n - 2, -1, -1):\\n\\t\\tmxm = 0;\\n\\t\\tfor j in range(i + 1, n):\\n\\t\\t\\tif a[j] % a[i] == 0 or a[i] % a[j] == 0:\\n\\t\\t\\t\\tmxm = max(mxm, dp[j])\\n\\t\\tdp[i] = 1 + mxm\\n\\treturn max(dp)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether the given array is monotonic or not. Here is a solution in Python:\",\"targets\":\"def is_Monotonic(A): \\n return (all(A[i] <= A[i + 1] for i in range(len(A) - 1)) or\\n all(A[i] >= A[i + 1] for i in range(len(A) - 1)))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes base and power as arguments and calculate the sum of all digits of the base to the specified power. Here is a solution in Python:\",\"targets\":\"def power_base_sum(base, power):\\n return sum([int(i) for i in str(pow(base, power))])\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the length of the longest palindromic subsequence in the given string. This can be solved in Python with the following code:\",\"targets\":\"def lps(str): \\n\\tn = len(str) \\n\\tL = [[0 for x in range(n)] for x in range(n)] \\n\\tfor i in range(n): \\n\\t\\tL[i][i] = 1\\n\\tfor cl in range(2, n+1): \\n\\t\\tfor i in range(n-cl+1): \\n\\t\\t\\tj = i+cl-1\\n\\t\\t\\tif str[i] == str[j] and cl == 2: \\n\\t\\t\\t\\tL[i][j] = 2\\n\\t\\t\\telif str[i] == str[j]: \\n\\t\\t\\t\\tL[i][j] = L[i+1][j-1] + 2\\n\\t\\t\\telse: \\n\\t\\t\\t\\tL[i][j] = max(L[i][j-1], L[i+1][j]); \\n\\treturn L[0][n-1]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to divide two lists element wise. This can be solved in Python with the following code:\",\"targets\":\"def div_list(nums1,nums2):\\n result = map(lambda x, y: x \\/ y, nums1, nums2)\\n return list(result)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to maximize the given two tuples. This can be solved in Python with the following code:\",\"targets\":\"def maximize_elements(test_tup1, test_tup2):\\n res = tuple(tuple(max(a, b) for a, b in zip(tup1, tup2))\\n for tup1, tup2 in zip(test_tup1, test_tup2))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the maximum sum possible by using the given equation f(n) = max( (f(n\\/2) + f(n\\/3) + f(n\\/4) + f(n\\/5)), n). Here is a solution in Python:\",\"targets\":\"def get_max_sum (n):\\n\\tres = list()\\n\\tres.append(0)\\n\\tres.append(1)\\n\\ti = 2\\n\\twhile i= 10: \\n n = n \\/ 10 \\n return int(n)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to multiply two integers. This can be solved in Python with the following code:\",\"targets\":\"def multiply_int(x, y):\\n if y < 0:\\n return -multiply_int(x, -y)\\n elif y == 0:\\n return 0\\n elif y == 1:\\n return x\\n else:\\n return x + multiply_int(x, y - 1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the perimeter of a regular pentagon from the length of its sides. This can be solved in Python with the following code:\",\"targets\":\"import math\\ndef perimeter_pentagon(a):\\n perimeter=(5*a)\\n return perimeter\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the first non-repeated character in a given string. This can be solved in Python with the following code:\",\"targets\":\"def first_non_repeating_character(str1):\\n char_order = []\\n ctr = {}\\n for c in str1:\\n if c in ctr:\\n ctr[c] += 1\\n else:\\n ctr[c] = 1 \\n char_order.append(c)\\n for c in char_order:\\n if ctr[c] == 1:\\n return c\\n return None\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the minimum difference between any two elements in a given array. https:\\/\\/www.geeksforgeeks.org\\/find-minimum-difference-pair\\/ This can be solved in Python with the following code:\",\"targets\":\"def find_min_diff(arr,n): \\n arr = sorted(arr) \\n diff = 10**20 \\n for i in range(n-1): \\n if arr[i+1] - arr[i] < diff: \\n diff = arr[i+1] - arr[i] \\n return diff\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that returns the perimeter of a square given its side length as input. This can be solved in Python with the following code:\",\"targets\":\"def square_perimeter(a):\\n perimeter=4*a\\n return perimeter\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the sum of fourth power of first n odd natural numbers. Here is a solution in Python:\",\"targets\":\"def odd_num_sum(n) : \\n j = 0\\n sm = 0\\n for i in range(1,n + 1) : \\n j = (2*i-1) \\n sm = sm + (j*j*j*j) \\n return sm\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count the number of non-empty substrings of a given string. Here is a solution in Python:\",\"targets\":\"def number_of_substrings(str): \\n\\tstr_len = len(str); \\n\\treturn int(str_len * (str_len + 1) \\/ 2);\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to split a list at the nth eelment and add the first part to the end. This can be solved in Python with the following code:\",\"targets\":\"def split_Arr(l, n):\\n return l[n:] + l[:n]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check if all the elements in tuple have same data type or not. This can be solved in Python with the following code:\",\"targets\":\"def check_type(test_tuple):\\n res = True\\n for ele in test_tuple:\\n if not isinstance(ele, type(test_tuple[0])):\\n res = False\\n break\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the item with maximum frequency in a given list. Here is a solution in Python:\",\"targets\":\"from collections import defaultdict\\ndef max_occurrences(nums):\\n dict = defaultdict(int)\\n for i in nums:\\n dict[i] += 1\\n result = max(dict.items(), key=lambda x: x[1]) \\n return result[0]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the kth element in the given array using 1-based indexing. Here is a solution in Python:\",\"targets\":\"def kth_element(arr, k):\\n n = len(arr)\\n for i in range(n):\\n for j in range(0, n-i-1):\\n if arr[j] > arr[j+1]:\\n arr[j], arr[j+1] == arr[j+1], arr[j]\\n return arr[k-1]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find number of lists present in the given tuple. This can be solved in Python with the following code:\",\"targets\":\"def find_lists(Input): \\n\\tif isinstance(Input, list): \\n\\t\\treturn 1\\n\\telse: \\n\\t\\treturn len(Input)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function takes as input two lists [a_1,...,a_n], [b_1,...,b_n] and returns [a_1+b_1,...,a_n+b_n]. This can be solved in Python with the following code:\",\"targets\":\"def sum_list(lst1,lst2):\\n res_list = [lst1[i] + lst2[i] for i in range(len(lst1))] \\n return res_list\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to pack consecutive duplicates of a given list elements into sublists. This can be solved in Python with the following code:\",\"targets\":\"from itertools import groupby\\ndef pack_consecutive_duplicates(list1):\\n return [list(group) for key, group in groupby(list1)]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to count the number of occurence of the string 'std' in a given string. This can be solved in Python with the following code:\",\"targets\":\"def count_occurance(s):\\n count = 0\\n for i in range(len(s) - 2):\\n if (s[i] == 's' and s[i+1] == 't' and s[i+2] == 'd'):\\n count = count + 1\\n return count\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether the given number can be represented as the difference of two squares or not. Here is a solution in Python:\",\"targets\":\"def dif_Square(n): \\n if (n % 4 != 2): \\n return True\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the third side of a right angled triangle. Here is a solution in Python:\",\"targets\":\"import math\\ndef otherside_rightangle(w,h):\\n s=math.sqrt((w*w)+(h*h))\\n return s\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the length of the smallest list in a list of lists. Here is a solution in Python:\",\"targets\":\"def Find_Min_Length(lst): \\n minLength = min(len(x) for x in lst )\\n return minLength\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the maximum difference between available pairs in the given tuple list. This can be solved in Python with the following code:\",\"targets\":\"def max_difference(test_list):\\n temp = [abs(b - a) for a, b in test_list]\\n res = max(temp)\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to locate the right insertion point for a specified value in sorted order. This can be solved in Python with the following code:\",\"targets\":\"import bisect\\ndef right_insertion(a, x):\\n return bisect.bisect_right(a, x)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that checks whether a string contains the 'a' character followed by two or three 'b' characters. This can be solved in Python with the following code:\",\"targets\":\"import re\\ndef text_match_two_three(text):\\n patterns = 'ab{2,3}'\\n if re.search(patterns, text):\\n return True\\n else:\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to add the given tuple to the given list. This can be solved in Python with the following code:\",\"targets\":\"def add_tuple(test_list, test_tup):\\n test_list += test_tup\\n return test_list\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the product of first even and odd number of a given list. Here is a solution in Python:\",\"targets\":\"def mul_even_odd(list1):\\n first_even = next((el for el in list1 if el%2==0),-1)\\n first_odd = next((el for el in list1 if el%2!=0),-1)\\n return (first_even*first_odd)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in two tuples and subtracts the elements of the first tuple by the elements of the second tuple with the same index. Here is a solution in Python:\",\"targets\":\"def substract_elements(test_tup1, test_tup2):\\n res = tuple(map(lambda i, j: i - j, test_tup1, test_tup2))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to remove all whitespaces from the given string. This can be solved in Python with the following code:\",\"targets\":\"import re\\ndef remove_whitespaces(text1):\\n return (re.sub(r'\\\\s+', '',text1))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the next smallest palindrome of a specified integer, returned as an integer. Here is a solution in Python:\",\"targets\":\"import sys\\ndef next_smallest_palindrome(num):\\n numstr = str(num)\\n for i in range(num+1,sys.maxsize):\\n if str(i) == str(i)[::-1]:\\n return i\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the sum of all odd natural numbers within the range l and r. This can be solved in Python with the following code:\",\"targets\":\"def sum_odd(n): \\n terms = (n + 1)\\/\\/2\\n sum1 = terms * terms \\n return sum1 \\ndef sum_in_range(l,r): \\n return sum_odd(r) - sum_odd(l - 1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to get the difference between two lists. Here is a solution in Python:\",\"targets\":\"def Diff(li1,li2):\\n return list(set(li1)-set(li2)) + list(set(li2)-set(li1))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to convert the given string to lower case. Here is a solution in Python:\",\"targets\":\"def is_lower(string):\\n return (string.lower())\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the number of numbers with an odd value when rotating a binary string the given number of times. This can be solved in Python with the following code:\",\"targets\":\"def odd_Equivalent(s,n): \\n count=0\\n for i in range(0,n): \\n if (s[i] == '1'): \\n count = count + 1\\n return count\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the minimum number of rotations (greater than 0) required to get the same string. Here is a solution in Python:\",\"targets\":\"def find_Rotations(str): \\n tmp = str + str\\n n = len(str) \\n for i in range(1,n + 1): \\n substring = tmp[i: i+n] \\n if (str == substring): \\n return i \\n return n\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in a sorted array, its length (n), and an element and returns whether the element is the majority element in the given sorted array. (The majority element is the element that occurs more than n\\/2 times.) This can be solved in Python with the following code:\",\"targets\":\"def is_majority(arr, n, x):\\n\\ti = binary_search(arr, 0, n-1, x)\\n\\tif i == -1:\\n\\t\\treturn False\\n\\tif ((i + n\\/\\/2) <= (n -1)) and arr[i + n\\/\\/2] == x:\\n\\t\\treturn True\\n\\telse:\\n\\t\\treturn False\\ndef binary_search(arr, low, high, x):\\n\\tif high >= low:\\n\\t\\tmid = (low + high)\\/\\/2 \\n\\t\\tif (mid == 0 or x > arr[mid-1]) and (arr[mid] == x):\\n\\t\\t\\treturn mid\\n\\t\\telif x > arr[mid]:\\n\\t\\t\\treturn binary_search(arr, (mid + 1), high, x)\\n\\t\\telse:\\n\\t\\t\\treturn binary_search(arr, low, (mid -1), x)\\n\\treturn -1\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the sum of an array. This can be solved in Python with the following code:\",\"targets\":\"def _sum(arr): \\n sum=0\\n for i in arr: \\n sum = sum + i \\n return(sum)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to add the given tuple to the given list. Here is a solution in Python:\",\"targets\":\"def add_tuple(test_list, test_tup):\\n test_list += test_tup\\n return test_list\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the length of the smallest list in a list of lists. This can be solved in Python with the following code:\",\"targets\":\"def Find_Min_Length(lst): \\n minLength = min(len(x) for x in lst )\\n return minLength\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to calculate the maximum aggregate from the list of tuples. This can be solved in Python with the following code:\",\"targets\":\"from collections import defaultdict\\ndef max_aggregate(stdata):\\n temp = defaultdict(int)\\n for name, marks in stdata:\\n temp[name] += marks\\n return max(temp.items(), key=lambda x: x[1])\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the maximum absolute product between numbers in pairs of tuples within a given list. Here is a solution in Python:\",\"targets\":\"def max_product_tuple(list1):\\n result_max = max([abs(x * y) for x, y in list1] )\\n return result_max\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function that takes in an integer n and finds the sum of the first n even natural numbers that are raised to the fifth power. Here is a solution in Python:\",\"targets\":\"def even_Power_Sum(n): \\n sum = 0; \\n for i in range(1,n+1): \\n j = 2*i; \\n sum = sum + (j*j*j*j*j); \\n return sum;\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether the given number is undulating or not. Here is a solution in Python:\",\"targets\":\"def is_undulating(n): \\n\\tn = str(n)\\n\\tif (len(n) <= 2): \\n\\t\\treturn False\\n\\tfor i in range(2, len(n)): \\n\\t\\tif (n[i - 2] != n[i]): \\n\\t\\t\\treturn False\\n\\treturn True\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert more than one list to nested dictionary. This can be solved in Python with the following code:\",\"targets\":\"def convert_list_dictionary(l1, l2, l3):\\n result = [{x: {y: z}} for (x, y, z) in zip(l1, l2, l3)]\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check if the given tuple has any none value or not. Here is a solution in Python:\",\"targets\":\"def check_none(test_tup):\\n res = any(map(lambda ele: ele is None, test_tup))\\n return res\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert all possible convertible elements in a list of lists to floats. This can be solved in Python with the following code:\",\"targets\":\"def list_to_float(test_list):\\n res = []\\n for tup in test_list:\\n temp = []\\n for ele in tup:\\n if ele.isalpha():\\n temp.append(ele)\\n else:\\n temp.append(float(ele))\\n res.append((temp[0],temp[1])) \\n return res\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the maximum value in a given heterogeneous list. Here is a solution in Python:\",\"targets\":\"def max_val(listval):\\n max_val = max(i for i in listval if isinstance(i, int)) \\n return(max_val)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to toggle bits of the number except the first and the last bit. https:\\/\\/www.geeksforgeeks.org\\/toggle-bits-number-expect-first-last-bits\\/ Here is a solution in Python:\",\"targets\":\"def set_middle_bits(n): \\n n |= n >> 1; \\n n |= n >> 2; \\n n |= n >> 4; \\n n |= n >> 8; \\n n |= n >> 16; \\n return (n >> 1) ^ 1\\ndef toggle_middle_bits(n): \\n if (n == 1): \\n return 1\\n return n ^ set_middle_bits(n)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Given a list of tuples, write a function that returns the first value of the tuple with the smallest second value. This can be solved in Python with the following code:\",\"targets\":\"from operator import itemgetter \\ndef index_minimum(test_list):\\n res = min(test_list, key = itemgetter(1))[0]\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the number of ways to partition a set of Bell numbers. This can be solved in Python with the following code:\",\"targets\":\"def bell_number(n): \\n bell = [[0 for i in range(n+1)] for j in range(n+1)] \\n bell[0][0] = 1\\n for i in range(1, n+1): \\n bell[i][0] = bell[i-1][i-1] \\n for j in range(1, i+1): \\n bell[i][j] = bell[i-1][j-1] + bell[i][j-1] \\n return bell[n][0]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function which takes a list and returns a list with the same elements, but the k'th element removed. Here is a solution in Python:\",\"targets\":\"def remove_kth_element(list1, L):\\n return list1[:L-1] + list1[L:]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find numbers within a given range from startnum ti endnum where every number is divisible by every digit it contains. https:\\/\\/www.w3resource.com\\/python-exercises\\/lambda\\/python-lambda-exercise-24.php Here is a solution in Python:\",\"targets\":\"def divisible_by_digits(startnum, endnum):\\n return [n for n in range(startnum, endnum+1) \\\\\\n if not any(map(lambda x: int(x) == 0 or n%int(x) != 0, str(n)))]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in a list and an element and inserts the element before each element in the list, and returns the resulting list. This can be solved in Python with the following code:\",\"targets\":\"def insert_element(list,element):\\n list = [v for elt in list for v in (element, elt)]\\n return list\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to remove odd characters in a string. Here is a solution in Python:\",\"targets\":\"def remove_odd(str1):\\n str2 = ''\\n for i in range(1, len(str1) + 1):\\n if(i % 2 == 0):\\n str2 = str2 + str1[i - 1]\\n return str2\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find tuples which have all elements divisible by k from the given list of tuples. This can be solved in Python with the following code:\",\"targets\":\"def find_tuples(test_list, K):\\n res = [sub for sub in test_list if all(ele % K == 0 for ele in sub)]\\n return res\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the sum of numbers in a list within a range specified by two indices. Here is a solution in Python:\",\"targets\":\"def sum_range_list(list1, m, n): \\n sum_range = 0 \\n for i in range(m, n+1, 1): \\n sum_range += list1[i] \\n return sum_range\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to return the sum of all divisors of a number. Here is a solution in Python:\",\"targets\":\"def sum_div(number):\\n divisors = [1]\\n for i in range(2, number):\\n if (number % i)==0:\\n divisors.append(i)\\n return sum(divisors)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the maximum difference between available pairs in the given tuple list. Here is a solution in Python:\",\"targets\":\"def max_difference(test_list):\\n temp = [abs(b - a) for a, b in test_list]\\n res = max(temp)\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to reverse only the vowels of a given string (where y is not a vowel). Here is a solution in Python:\",\"targets\":\"def reverse_vowels(str1):\\n\\tvowels = \\\"\\\"\\n\\tfor char in str1:\\n\\t\\tif char in \\\"aeiouAEIOU\\\":\\n\\t\\t\\tvowels += char\\n\\tresult_string = \\\"\\\"\\n\\tfor char in str1:\\n\\t\\tif char in \\\"aeiouAEIOU\\\":\\n\\t\\t\\tresult_string += vowels[-1]\\n\\t\\t\\tvowels = vowels[:-1]\\n\\t\\telse:\\n\\t\\t\\tresult_string += char\\n\\treturn result_string\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to get the sum of the digits of a non-negative integer. This can be solved in Python with the following code:\",\"targets\":\"def sum_digits(n):\\n if n == 0:\\n return 0\\n else:\\n return n % 10 + sum_digits(int(n \\/ 10))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function that takes in a positive integer n and finds the sum of even index binomial coefficients. This can be solved in Python with the following code:\",\"targets\":\"import math \\ndef even_binomial_Coeff_Sum( n): \\n return (1 << (n - 1))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the list with maximum length. Here is a solution in Python:\",\"targets\":\"def max_length_list(input_list):\\n max_length = max(len(x) for x in input_list ) \\n max_list = max(input_list, key = lambda i: len(i)) \\n return(max_length, max_list)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"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 plane. This can be solved in Python with the following code:\",\"targets\":\"def min_Jumps(steps, d): \\n (a, b) = steps\\n temp = a \\n a = min(a, b) \\n b = max(temp, b) \\n if (d >= b): \\n return (d + b - 1) \\/ b \\n if (d == 0): \\n return 0\\n if (d == a): \\n return 1\\n else:\\n return 2\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to set the left most unset bit. Here is a solution in Python:\",\"targets\":\"def set_left_most_unset_bit(n): \\n if not (n & (n + 1)): \\n return n \\n pos, temp, count = 0, n, 0 \\n while temp: \\n if not (temp & 1): \\n pos = count \\n count += 1; temp>>=1\\n return (n | (1 << (pos)))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether the length of the word is odd or not. Here is a solution in Python:\",\"targets\":\"def word_len(s): \\n s = s.split(' ') \\n for word in s: \\n if len(word)%2!=0: \\n return True \\n else:\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to flatten the list of lists into a single set of numbers. This can be solved in Python with the following code:\",\"targets\":\"def extract_singly(test_list):\\n res = []\\n temp = set()\\n for inner in test_list:\\n for ele in inner:\\n if not ele in temp:\\n temp.add(ele)\\n res.append(ele)\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether a list is sublist of another or not. This can be solved in Python with the following code:\",\"targets\":\"def is_Sub_Array(A,B): \\n n = len(A)\\n m = len(B)\\n i = 0; j = 0; \\n while (i < n and j < m): \\n if (A[i] == B[j]): \\n i += 1; \\n j += 1; \\n if (j == m): \\n return True; \\n else: \\n i = i - j + 1; \\n j = 0; \\n return False;\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert a date of yyyy-mm-dd format to dd-mm-yyyy format. This can be solved in Python with the following code:\",\"targets\":\"import re\\ndef change_date_format(dt):\\n return re.sub(r'(\\\\d{4})-(\\\\d{1,2})-(\\\\d{1,2})', '\\\\\\\\3-\\\\\\\\2-\\\\\\\\1', dt)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in a list and an element and inserts the element before each element in the list, and returns the resulting list. Here is a solution in Python:\",\"targets\":\"def insert_element(list,element):\\n list = [v for elt in list for v in (element, elt)]\\n return list\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert the given snake case string to camel case string. This can be solved in Python with the following code:\",\"targets\":\"import re\\ndef snake_to_camel(word):\\n return ''.join(x.capitalize() or '_' for x in word.split('_'))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the median of three numbers. Here is a solution in Python:\",\"targets\":\"def median_numbers(a,b,c):\\n if a > b:\\n if a < c:\\n median = a\\n elif b > c:\\n median = b\\n else:\\n median = c\\n else:\\n if a > c:\\n median = a\\n elif b < c:\\n median = b\\n else:\\n median = c\\n return median\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in a list and element and checks whether all items in the list are equal to the given element. This can be solved in Python with the following code:\",\"targets\":\"def check_element(list,element):\\n check_element=all(v== element for v in list)\\n return check_element\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to remove duplicate numbers from a given number of lists. Here is a solution in Python:\",\"targets\":\"def two_unique_nums(nums):\\n return [i for i in nums if nums.count(i)==1]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that matches a string that has an 'a' followed by anything, ending in 'b'. Here is a solution in Python:\",\"targets\":\"import re\\ndef text_starta_endb(text):\\n patterns = 'a.*?b$'\\n return re.search(patterns, text)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count the number of pairs whose sum is equal to ‘sum’. The funtion gets as input a list of numbers and the sum, Here is a solution in Python:\",\"targets\":\"def get_pairs_count(arr, sum):\\n count = 0 \\n for i in range(len(arr)):\\n for j in range(i + 1,len(arr)):\\n if arr[i] + arr[j] == sum:\\n count += 1\\n return count\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes an array and finds the maximum sum of a bitonic subsequence for the given array, where a sequence is bitonic if it is first increasing and then decreasing. This can be solved in Python with the following code:\",\"targets\":\"def max_sum(arr): \\n\\tMSIBS = arr[:] \\n\\tfor i in range(len(arr)): \\n\\t\\tfor j in range(0, i): \\n\\t\\t\\tif arr[i] > arr[j] and MSIBS[i] < MSIBS[j] + arr[i]: \\n\\t\\t\\t\\tMSIBS[i] = MSIBS[j] + arr[i] \\n\\tMSDBS = arr[:] \\n\\tfor i in range(1, len(arr) + 1): \\n\\t\\tfor j in range(1, i): \\n\\t\\t\\tif arr[-i] > arr[-j] and MSDBS[-i] < MSDBS[-j] + arr[-i]: \\n\\t\\t\\t\\tMSDBS[-i] = MSDBS[-j] + arr[-i] \\n\\tmax_sum = float(\\\"-Inf\\\") \\n\\tfor i, j, k in zip(MSIBS, MSDBS, arr): \\n\\t\\tmax_sum = max(max_sum, i + j - k) \\n\\treturn max_sum\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether the given two integers have opposite sign or not. This can be solved in Python with the following code:\",\"targets\":\"def opposite_Signs(x,y): \\n return ((x ^ y) < 0);\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether an element exists within a tuple. This can be solved in Python with the following code:\",\"targets\":\"def check_tuplex(tuplex,tuple1): \\n if tuple1 in tuplex:\\n return True\\n else:\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find whether all the given tuples have equal length or not. This can be solved in Python with the following code:\",\"targets\":\"def find_equal_tuple(Input):\\n k = 0 if not Input else len(Input[0])\\n flag = 1\\n for tuple in Input:\\n if len(tuple) != k:\\n flag = 0\\n break\\n return flag\\ndef get_equal(Input):\\n return find_equal_tuple(Input) == 1\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to remove the parenthesis and what is inbetween them from a string. Here is a solution in Python:\",\"targets\":\"import re\\ndef remove_parenthesis(items):\\n for item in items:\\n return (re.sub(r\\\" ?\\\\([^)]+\\\\)\\\", \\\"\\\", item))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count the number of equal numbers from three given integers. This can be solved in Python with the following code:\",\"targets\":\"def test_three_equal(x,y,z):\\n result = set([x,y,z])\\n if len(result)==3:\\n return 0\\n else:\\n return 4-len(result)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the next perfect square greater than a given number. This can be solved in Python with the following code:\",\"targets\":\"import math \\ndef next_Perfect_Square(N): \\n nextN = math.floor(math.sqrt(N)) + 1\\n return nextN * nextN\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to replace whitespaces with an underscore and vice versa in a given string. This can be solved in Python with the following code:\",\"targets\":\"def replace_spaces(text):\\n return \\\"\\\".join(\\\" \\\" if c == \\\"_\\\" else (\\\"_\\\" if c == \\\" \\\" else c) for c in text)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the tuple intersection of elements in the given tuple list irrespective of their order. This can be solved in Python with the following code:\",\"targets\":\"def tuple_intersection(test_list1, test_list2):\\n res = set([tuple(sorted(ele)) for ele in test_list1]) & set([tuple(sorted(ele)) for ele in test_list2])\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to remove uppercase substrings from a given string. Here is a solution in Python:\",\"targets\":\"import re\\ndef remove_uppercase(str1):\\n return re.sub('[A-Z]', '', str1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the element that appears only once in a sorted array. This can be solved in Python with the following code:\",\"targets\":\"def search(arr):\\n n = len(arr)\\n XOR = 0\\n for i in range(n) :\\n XOR = XOR ^ arr[i]\\n return (XOR)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether the count of divisors is even. https:\\/\\/www.w3resource.com\\/python-exercises\\/basic\\/python-basic-1-exercise-24.php This can be solved in Python with the following code:\",\"targets\":\"import math \\ndef count_divisors(n) : \\n count = 0\\n for i in range(1, (int)(math.sqrt(n)) + 2) : \\n if (n % i == 0) : \\n if( n \\/\\/ i == i) : \\n count = count + 1\\n else : \\n count = count + 2\\n return count % 2 == 0\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the longest common subsequence for the given three string sequence. https:\\/\\/www.geeksforgeeks.org\\/lcs-longest-common-subsequence-three-strings\\/ This can be solved in Python with the following code:\",\"targets\":\"def lcs_of_three(X, Y, Z): \\n m = len(X)\\n n = len(Y)\\n o = len(Z)\\n L = [[[0 for i in range(o+1)] for j in range(n+1)] for k in range(m+1)]\\n for i in range(m+1): \\n\\t for j in range(n+1): \\n\\t\\t for k in range(o+1): \\n\\t\\t\\t if (i == 0 or j == 0 or k == 0): \\n\\t\\t\\t\\t L[i][j][k] = 0\\n\\t\\t\\t elif (X[i-1] == Y[j-1] and X[i-1] == Z[k-1]): \\n\\t\\t\\t\\t L[i][j][k] = L[i-1][j-1][k-1] + 1\\n\\t\\t\\t else: \\n\\t\\t\\t\\t L[i][j][k] = max(max(L[i-1][j][k], L[i][j-1][k]), L[i][j][k-1]) \\n return L[m][n][o]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that gives loss amount on a sale if the given amount has loss else return 0. This can be solved in Python with the following code:\",\"targets\":\"def loss_amount(actual_cost,sale_amount): \\n if(sale_amount > actual_cost):\\n amount = sale_amount - actual_cost\\n return amount\\n else:\\n return 0\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the common elements in given nested lists. Here is a solution in Python:\",\"targets\":\"def common_in_nested_lists(nestedlist):\\n result = list(set.intersection(*map(set, nestedlist)))\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count the number of lists in a given number of lists. Here is a solution in Python:\",\"targets\":\"def count_list(input_list): \\n return len(input_list)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the number of divisors of a given integer. Here is a solution in Python:\",\"targets\":\"def divisor(n):\\n for i in range(n):\\n x = len([i for i in range(1,n+1) if not n % i])\\n return x\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert a list to a tuple. Here is a solution in Python:\",\"targets\":\"def list_tuple(listx):\\n tuplex = tuple(listx)\\n return tuplex\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether the given string is starting with a vowel or not using regex. This can be solved in Python with the following code:\",\"targets\":\"import re \\nregex = '^[aeiouAEIOU][A-Za-z0-9_]*'\\ndef check_str(string): \\n\\treturn re.search(regex, string)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the element of a list having maximum length. Here is a solution in Python:\",\"targets\":\"def Find_Max(lst): \\n maxList = max((x) for x in lst) \\n return maxList\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the intersection of two arrays. This can be solved in Python with the following code:\",\"targets\":\"def intersection_array(array_nums1,array_nums2):\\n result = list(filter(lambda x: x in array_nums1, array_nums2)) \\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that checks if a strings contains 'z', except at the start and end of the word. Here is a solution in Python:\",\"targets\":\"import re\\ndef text_match_wordz_middle(text):\\n return bool(re.search(r'\\\\Bz\\\\B', text))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count the number of pairs whose xor value is odd. Here is a solution in Python:\",\"targets\":\"def find_Odd_Pair(A,N) : \\n oddPair = 0\\n for i in range(0,N) : \\n for j in range(i+1,N) : \\n if ((A[i] ^ A[j]) % 2 != 0): \\n oddPair+=1 \\n return oddPair\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the maximum product formed by multiplying numbers of an increasing subsequence of that array. Here is a solution in Python:\",\"targets\":\"def max_product(arr): \\n n = len(arr)\\n mpis = arr[:]\\n for i in range(n): \\n current_prod = arr[i]\\n j = i + 1\\n while j < n:\\n if arr[j-1] > arr[j]: \\n break\\n current_prod *= arr[j]\\n if current_prod > mpis[j]:\\n mpis[j] = current_prod \\n j = j + 1\\n return max(mpis)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the sum of all odd length subarrays. https:\\/\\/www.geeksforgeeks.org\\/sum-of-all-odd-length-subarrays\\/ This can be solved in Python with the following code:\",\"targets\":\"def odd_length_sum(arr):\\n Sum = 0\\n l = len(arr)\\n for i in range(l):\\n Sum += ((((i + 1) *(l - i) + 1) \\/\\/ 2) * arr[i])\\n return Sum\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in two numbers and returns a tuple with the second number and then the first number. Here is a solution in Python:\",\"targets\":\"def swap_numbers(a,b):\\n temp = a\\n a = b\\n b = temp\\n return (a,b)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find whether the parity of a given number is odd. This can be solved in Python with the following code:\",\"targets\":\"def find_Parity(x): \\n y = x ^ (x >> 1); \\n y = y ^ (y >> 2); \\n y = y ^ (y >> 4); \\n y = y ^ (y >> 8); \\n y = y ^ (y >> 16); \\n if (y & 1): \\n return True\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in an integer n and calculates the harmonic sum of n-1. Here is a solution in Python:\",\"targets\":\"def harmonic_sum(n):\\n if n < 2:\\n return 1\\n else:\\n return 1 \\/ n + (harmonic_sum(n - 1))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to replace all spaces in the given string with '%20'. This can be solved in Python with the following code:\",\"targets\":\"def replace_spaces(string):\\n return string.replace(\\\" \\\", \\\"%20\\\")\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to extract the number of unique tuples in the given list. This can be solved in Python with the following code:\",\"targets\":\"def extract_freq(test_list):\\n res = len(list(set(tuple(sorted(sub)) for sub in test_list)))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the n'th lucas number. Here is a solution in Python:\",\"targets\":\"def find_lucas(n): \\n\\tif (n == 0): \\n\\t\\treturn 2\\n\\tif (n == 1): \\n\\t\\treturn 1\\n\\treturn find_lucas(n - 1) + find_lucas(n - 2)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the difference of the first even and first odd number of a given list. Here is a solution in Python:\",\"targets\":\"def diff_even_odd(list1):\\n first_even = next((el for el in list1 if el%2==0),-1)\\n first_odd = next((el for el in list1 if el%2!=0),-1)\\n return (first_even-first_odd)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether all dictionaries in a list are empty or not. This can be solved in Python with the following code:\",\"targets\":\"def empty_dit(list1):\\n empty_dit=all(not d for d in list1)\\n return empty_dit\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the nth tetrahedral number. Here is a solution in Python:\",\"targets\":\"def tetrahedral_number(n): \\n\\treturn (n * (n + 1) * (n + 2)) \\/ 6\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the sum of the largest contiguous sublist in the given list. Here is a solution in Python:\",\"targets\":\"def max_sub_array_sum(a, size):\\n max_so_far = 0\\n max_ending_here = 0\\n for i in range(0, size):\\n max_ending_here = max_ending_here + a[i]\\n if max_ending_here < 0:\\n max_ending_here = 0\\n elif (max_so_far < max_ending_here):\\n max_so_far = max_ending_here\\n return max_so_far\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether the entered number is greater than the elements of the given array. Here is a solution in Python:\",\"targets\":\"def check_greater(arr, number):\\n arr.sort()\\n return number > arr[-1]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the nth nonagonal number. Here is a solution in Python:\",\"targets\":\"def is_nonagonal(n): \\n\\treturn int(n * (7 * n - 5) \\/ 2)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the average of cubes of first n natural numbers. This can be solved in Python with the following code:\",\"targets\":\"def find_Average_Of_Cube(n): \\n sum = 0\\n for i in range(1, n + 1): \\n sum += i * i * i \\n return round(sum \\/ n, 6)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether a list of numbers contains only one distinct element or not. Here is a solution in Python:\",\"targets\":\"def unique_Element(arr):\\n s = set(arr)\\n return len(s) == 1\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert a string to a list of strings split on the space character. This can be solved in Python with the following code:\",\"targets\":\"def string_to_list(string): \\n lst = list(string.split(\\\" \\\")) \\n return lst\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert a date of yyyy-mm-dd format to dd-mm-yyyy format. Here is a solution in Python:\",\"targets\":\"import re\\ndef change_date_format(dt):\\n return re.sub(r'(\\\\d{4})-(\\\\d{1,2})-(\\\\d{1,2})', '\\\\\\\\3-\\\\\\\\2-\\\\\\\\1', dt)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether all the characters are same or not. This can be solved in Python with the following code:\",\"targets\":\"def all_Characters_Same(s) :\\n n = len(s)\\n for i in range(1,n) :\\n if s[i] != s[0] :\\n return False\\n return True\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to sort the given array by using shell sort. This can be solved in Python with the following code:\",\"targets\":\"def shell_sort(my_list):\\n gap = len(my_list) \\/\\/ 2\\n while gap > 0:\\n for i in range(gap, len(my_list)):\\n current_item = my_list[i]\\n j = i\\n while j >= gap and my_list[j - gap] > current_item:\\n my_list[j] = my_list[j - gap]\\n j -= gap\\n my_list[j] = current_item\\n gap \\/\\/= 2\\n\\n return my_list\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether every even index contains even numbers of a given list. This can be solved in Python with the following code:\",\"targets\":\"def even_position(nums):\\n\\treturn all(nums[i]%2==i%2 for i in range(len(nums)))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes base and power as arguments and calculate the sum of all digits of the base to the specified power. This can be solved in Python with the following code:\",\"targets\":\"def power_base_sum(base, power):\\n return sum([int(i) for i in str(pow(base, power))])\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to get the first element of each sublist. Here is a solution in Python:\",\"targets\":\"def Extract(lst): \\n return [item[0] for item in lst]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to flatten a given nested list structure. Here is a solution in Python:\",\"targets\":\"def flatten_list(list1):\\n result_list = []\\n if not list1: return result_list\\n stack = [list(list1)]\\n while stack:\\n c_num = stack.pop()\\n next = c_num.pop()\\n if c_num: stack.append(c_num)\\n if isinstance(next, list):\\n if next: stack.append(list(next))\\n else: result_list.append(next)\\n result_list.reverse()\\n return result_list\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the sublist having minimum length. Here is a solution in Python:\",\"targets\":\"def Find_Min(lst): \\n return min(lst, key=len)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function that takes in an integer n and returns the sum of the squares of the first n odd natural numbers. This can be solved in Python with the following code:\",\"targets\":\"def square_Sum(n): \\n return int(n*(4*n*n-1)\\/3)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the surface area of a square pyramid with a given base edge and height. Here is a solution in Python:\",\"targets\":\"def surface_Area(b,s): \\n return 2 * b * s + pow(b,2)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the minimum product from the pairs of tuples within a given list. Here is a solution in Python:\",\"targets\":\"def min_product_tuple(list1):\\n result_min = min([abs(x * y) for x, y in list1] )\\n return result_min\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find area of a sector. The function takes the radius and angle as inputs. Function should return None if the angle is larger than 360 degrees. This can be solved in Python with the following code:\",\"targets\":\"import math\\ndef sector_area(r,a):\\n if a > 360:\\n return None\\n return (math.pi*r**2) * (a\\/360)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether all dictionaries in a list are empty or not. Here is a solution in Python:\",\"targets\":\"def empty_dit(list1):\\n empty_dit=all(not d for d in list1)\\n return empty_dit\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to sort a dictionary by value. Here is a solution in Python:\",\"targets\":\"from collections import Counter\\ndef sort_counter(dict1):\\n x = Counter(dict1)\\n sort_counter=x.most_common()\\n return sort_counter\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to reverse words seperated by spaces in a given string. This can be solved in Python with the following code:\",\"targets\":\"def reverse_words(s):\\n return ' '.join(reversed(s.split()))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to calculate the geometric sum of n-1. https:\\/\\/www.w3resource.com\\/python-exercises\\/data-structures-and-algorithms\\/python-recursion-exercise-9.php This can be solved in Python with the following code:\",\"targets\":\"def geometric_sum(n):\\n if n < 0:\\n return 0\\n else:\\n return 1 \\/ (pow(2, n)) + geometric_sum(n - 1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the sublist having minimum length. This can be solved in Python with the following code:\",\"targets\":\"def Find_Min(lst): \\n return min(lst, key=len)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in positive integers m and n and finds the number of possible sequences of length n, such that each element is a positive integer and is greater than or equal to twice the previous element but less than or equal to m. This can be solved in Python with the following code:\",\"targets\":\"def get_total_number_of_sequences(m,n): \\n\\tT=[[0 for i in range(n+1)] for i in range(m+1)] \\n\\tfor i in range(m+1): \\n\\t\\tfor j in range(n+1): \\n\\t\\t\\tif i==0 or j==0: \\n\\t\\t\\t\\tT[i][j]=0\\n\\t\\t\\telif i> 1); \\n y = y ^ (y >> 2); \\n y = y ^ (y >> 4); \\n y = y ^ (y >> 8); \\n y = y ^ (y >> 16); \\n if (y & 1): \\n return True\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write function to find the sum of all items in the given dictionary. This can be solved in Python with the following code:\",\"targets\":\"def return_sum(dict):\\n sum = 0\\n for i in dict.values():\\n sum = sum + i\\n return sum\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to create a new tuple from the given string and list. Here is a solution in Python:\",\"targets\":\"def new_tuple(test_list, test_str):\\n return tuple(test_list + [test_str])\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to remove the characters which have odd index values of a given string. This can be solved in Python with the following code:\",\"targets\":\"def odd_values_string(str):\\n result = \\\"\\\" \\n for i in range(len(str)):\\n if i % 2 == 0:\\n result = result + str[i]\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the product of the array multiplication modulo n. This can be solved in Python with the following code:\",\"targets\":\"def find_remainder(arr, n): \\n mul = 1\\n for i in range(len(arr)): \\n mul = (mul * (arr[i] % n)) % n \\n return mul % n\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the area of a rectangle. This can be solved in Python with the following code:\",\"targets\":\"def rectangle_area(l,b):\\n area=l*b\\n return area\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in a list of tuples and returns a list containing the rear element of each tuple. This can be solved in Python with the following code:\",\"targets\":\"def rear_extract(test_list):\\n res = [lis[-1] for lis in test_list]\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert the given snake case string to camel case string. Here is a solution in Python:\",\"targets\":\"import re\\ndef snake_to_camel(word):\\n return ''.join(x.capitalize() or '_' for x in word.split('_'))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the second smallest number in a list. This can be solved in Python with the following code:\",\"targets\":\"def second_smallest(numbers):\\n unique_numbers = list(set(numbers))\\n unique_numbers.sort()\\n if len(unique_numbers) < 2:\\n return None\\n else:\\n return unique_numbers[1]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find whether a number is divisible by 11. Here is a solution in Python:\",\"targets\":\"def is_Diff(n): \\n return (n % 11 == 0)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the minimum difference between any two elements in a given array. https:\\/\\/www.geeksforgeeks.org\\/find-minimum-difference-pair\\/ Here is a solution in Python:\",\"targets\":\"def find_min_diff(arr,n): \\n arr = sorted(arr) \\n diff = 10**20 \\n for i in range(n-1): \\n if arr[i+1] - arr[i] < diff: \\n diff = arr[i+1] - arr[i] \\n return diff\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find nth centered hexagonal number. This can be solved in Python with the following code:\",\"targets\":\"def centered_hexagonal_number(n):\\n return 3 * n * (n - 1) + 1\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check if the given integer is a prime number. This can be solved in Python with the following code:\",\"targets\":\"def prime_num(num):\\n if num >=1:\\n for i in range(2, num\\/\\/2):\\n if (num % i) == 0:\\n return False\\n else:\\n return True\\n else:\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to create the next bigger number by rearranging the digits of a given number. Here is a solution in Python:\",\"targets\":\"def rearrange_bigger(n):\\n nums = list(str(n))\\n for i in range(len(nums)-2,-1,-1):\\n if nums[i] < nums[i+1]:\\n z = nums[i:]\\n y = min(filter(lambda x: x > z[0], z))\\n z.remove(y)\\n z.sort()\\n nums[i:] = [y] + z\\n return int(\\\"\\\".join(nums))\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to convert the given string to lower case. This can be solved in Python with the following code:\",\"targets\":\"def is_lower(string):\\n return (string.lower())\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to put spaces between words starting with capital letters in a given string. This can be solved in Python with the following code:\",\"targets\":\"import re\\ndef capital_words_spaces(str1):\\n return re.sub(r\\\"(\\\\w)([A-Z])\\\", r\\\"\\\\1 \\\\2\\\", str1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether a list is sublist of another or not. Here is a solution in Python:\",\"targets\":\"def is_Sub_Array(A,B): \\n n = len(A)\\n m = len(B)\\n i = 0; j = 0; \\n while (i < n and j < m): \\n if (A[i] == B[j]): \\n i += 1; \\n j += 1; \\n if (j == m): \\n return True; \\n else: \\n i = i - j + 1; \\n j = 0; \\n return False;\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to remove leading zeroes from an ip address. Here is a solution in Python:\",\"targets\":\"import re\\ndef removezero_ip(ip):\\n string = re.sub('\\\\.[0]*', '.', ip)\\n return string\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to replace all occurrences of spaces, commas, or dots with a colon. This can be solved in Python with the following code:\",\"targets\":\"import re\\ndef replace_specialchar(text):\\n return (re.sub(\\\"[ ,.]\\\", \\\":\\\", text))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to determine if the sum of the divisors of two integers are the same. Here is a solution in Python:\",\"targets\":\"import math \\ndef div_sum(n): \\n total = 1\\n i = 2\\n\\n while i * i <= n:\\n if (n % i == 0):\\n total = (total + i + math.floor(n \\/ i))\\n i += 1\\n\\n return total\\n\\ndef are_equivalent(num1, num2): \\n return div_sum(num1) == div_sum(num2);\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to get all lucid numbers smaller than or equal to a given integer. This can be solved in Python with the following code:\",\"targets\":\"def get_ludic(n):\\n\\tludics = []\\n\\tfor i in range(1, n + 1):\\n\\t\\tludics.append(i)\\n\\tindex = 1\\n\\twhile(index != len(ludics)):\\n\\t\\tfirst_ludic = ludics[index]\\n\\t\\tremove_index = index + first_ludic\\n\\t\\twhile(remove_index < len(ludics)):\\n\\t\\t\\tludics.remove(ludics[remove_index])\\n\\t\\t\\tremove_index = remove_index + first_ludic - 1\\n\\t\\tindex += 1\\n\\treturn ludics\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find sum and average of first n natural numbers. Here is a solution in Python:\",\"targets\":\"def sum_average(number):\\n total = 0\\n for value in range(1, number + 1):\\n total = total + value\\n average = total \\/ number\\n return (total,average)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to set all even bits of a given number. Here is a solution in Python:\",\"targets\":\"def even_bit_set_number(n): \\n count = 0;res = 0;temp = n \\n while(temp > 0): \\n if (count % 2 == 1): \\n res |= (1 << count)\\n count+=1\\n temp >>= 1\\n return (n | res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to perform the mathematical bitwise xor operation across the given tuples. Here is a solution in Python:\",\"targets\":\"def bitwise_xor(test_tup1, test_tup2):\\n res = tuple(ele1 ^ ele2 for ele1, ele2 in zip(test_tup1, test_tup2))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to set all even bits of a given number. This can be solved in Python with the following code:\",\"targets\":\"def even_bit_set_number(n): \\n count = 0;res = 0;temp = n \\n while(temp > 0): \\n if (count % 2 == 1): \\n res |= (1 << count)\\n count+=1\\n temp >>= 1\\n return (n | res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the last digit in factorial of a given number. Here is a solution in Python:\",\"targets\":\"def last_Digit_Factorial(n): \\n if (n == 0): return 1\\n elif (n <= 2): return n \\n elif (n == 3): return 6\\n elif (n == 4): return 4 \\n else: \\n return 0\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the shared elements from the given two lists. Here is a solution in Python:\",\"targets\":\"def similar_elements(test_tup1, test_tup2):\\n res = tuple(set(test_tup1) & set(test_tup2))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the volume of a triangular prism. Here is a solution in Python:\",\"targets\":\"def find_Volume(l,b,h) : \\n return ((l * b * h) \\/ 2)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to count those characters which have vowels as their neighbors in the given string. Here is a solution in Python:\",\"targets\":\"def count_vowels(test_str):\\n res = 0\\n vow_list = ['a', 'e', 'i', 'o', 'u']\\n for idx in range(1, len(test_str) - 1):\\n if test_str[idx] not in vow_list and (test_str[idx - 1] in vow_list or test_str[idx + 1] in vow_list):\\n res += 1\\n if test_str[0] not in vow_list and test_str[1] in vow_list:\\n res += 1\\n if test_str[-1] not in vow_list and test_str[-2] in vow_list:\\n res += 1\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to remove tuples from the given tuple. This can be solved in Python with the following code:\",\"targets\":\"def remove_nested(test_tup):\\n res = tuple()\\n for count, ele in enumerate(test_tup):\\n if not isinstance(ele, tuple):\\n res = res + (ele, )\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether the given number is undulating or not. This can be solved in Python with the following code:\",\"targets\":\"def is_undulating(n): \\n\\tn = str(n)\\n\\tif (len(n) <= 2): \\n\\t\\treturn False\\n\\tfor i in range(2, len(n)): \\n\\t\\tif (n[i - 2] != n[i]): \\n\\t\\t\\treturn False\\n\\treturn True\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether a given string is a decimal number with a precision of 2. Here is a solution in Python:\",\"targets\":\"def is_decimal(num):\\n import re\\n dnumre = re.compile(r\\\"\\\"\\\"^[0-9]+(\\\\.[0-9]{1,2})?$\\\"\\\"\\\")\\n result = dnumre.search(num)\\n return bool(result)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the ration of positive numbers in an array of integers. This can be solved in Python with the following code:\",\"targets\":\"from array import array\\ndef positive_count(nums):\\n n = len(nums)\\n n1 = 0\\n for x in nums:\\n if x > 0:\\n n1 += 1\\n else:\\n None\\n return round(n1\\/n,2)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function takes in an integer and check whether the frequency of each digit in the integer is less than or equal to the digit itself. Here is a solution in Python:\",\"targets\":\"def validate(n): \\n for i in range(10): \\n temp = n; \\n count = 0; \\n while (temp): \\n if (temp % 10 == i): \\n count+=1; \\n if (count > i): \\n return False\\n temp \\/\\/= 10; \\n return True\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether the given number is a perfect square or not. https:\\/\\/www.geeksforgeeks.org\\/check-if-given-number-is-perfect-square-in-cpp\\/ Here is a solution in Python:\",\"targets\":\"def is_perfect_square(n) :\\n i = 1\\n while (i * i<= n):\\n if ((n % i == 0) and (n \\/ i == i)):\\n return True \\n i = i + 1\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to calculate whether the matrix is a magic square. This can be solved in Python with the following code:\",\"targets\":\"def magic_square_test(my_matrix):\\n iSize = len(my_matrix[0])\\n sum_list = []\\n sum_list.extend([sum (lines) for lines in my_matrix]) \\n for col in range(iSize):\\n sum_list.append(sum(row[col] for row in my_matrix))\\n result1 = 0\\n for i in range(0,iSize):\\n result1 +=my_matrix[i][i]\\n sum_list.append(result1) \\n result2 = 0\\n for i in range(iSize-1,-1,-1):\\n result2 +=my_matrix[i][i]\\n sum_list.append(result2)\\n if len(set(sum_list))>1:\\n return False\\n return True\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find smallest number in a list. Here is a solution in Python:\",\"targets\":\"def smallest_num(xs):\\n return min(xs)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to calculate a dog's age in dog's years. This can be solved in Python with the following code:\",\"targets\":\"def dog_age(h_age):\\n if h_age < 0:\\n \\texit()\\n elif h_age <= 2:\\n\\t d_age = h_age * 10.5\\n else:\\n\\t d_age = 21 + (h_age - 2)*4\\n return d_age\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert degrees to radians. Here is a solution in Python:\",\"targets\":\"import math\\ndef radian_degree(degree):\\n radian = degree*(math.pi\\/180)\\n return radian\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function which returns nth catalan number. Here is a solution in Python:\",\"targets\":\"def catalan_number(num):\\n if num <=1:\\n return 1 \\n res_num = 0\\n for i in range(num):\\n res_num += catalan_number(i) * catalan_number(num-i-1)\\n return res_num\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the element that appears only once in a sorted array. Here is a solution in Python:\",\"targets\":\"def search(arr):\\n n = len(arr)\\n XOR = 0\\n for i in range(n) :\\n XOR = XOR ^ arr[i]\\n return (XOR)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the surface area of a cube of a given size. This can be solved in Python with the following code:\",\"targets\":\"def surfacearea_cube(l):\\n surfacearea= 6*l*l\\n return surfacearea\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to multiply all the numbers in a list and divide with the length of the list. This can be solved in Python with the following code:\",\"targets\":\"def multiply_num(numbers): \\n total = 1\\n for x in numbers:\\n total *= x \\n return total\\/len(numbers)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the median length of a trapezium. This can be solved in Python with the following code:\",\"targets\":\"def median_trapezium(base1,base2,height):\\n median = 0.5 * (base1+ base2)\\n return median\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the number of numbers with an odd value when rotating a binary string the given number of times. Here is a solution in Python:\",\"targets\":\"def odd_Equivalent(s,n): \\n count=0\\n for i in range(0,n): \\n if (s[i] == '1'): \\n count = count + 1\\n return count\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to count the number of occurence of the string 'std' in a given string. Here is a solution in Python:\",\"targets\":\"def count_occurance(s):\\n count = 0\\n for i in range(len(s) - 2):\\n if (s[i] == 's' and s[i+1] == 't' and s[i+2] == 'd'):\\n count = count + 1\\n return count\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function for computing square roots using the babylonian method. Here is a solution in Python:\",\"targets\":\"def babylonian_squareroot(number):\\n if(number == 0):\\n return 0;\\n g = number\\/2.0;\\n g2 = g + 1;\\n while(g != g2):\\n n = number\\/ g;\\n g2 = g;\\n g = (g + n)\\/2;\\n return g;\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find squares of individual elements in a list. Here is a solution in Python:\",\"targets\":\"def square_nums(nums):\\n square_nums = list(map(lambda x: x ** 2, nums))\\n return square_nums\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find words that are longer than n characters from a given list of words. Here is a solution in Python:\",\"targets\":\"def long_words(n, str):\\n word_len = []\\n txt = str.split(\\\" \\\")\\n for x in txt:\\n if len(x) > n:\\n word_len.append(x)\\n return word_len\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find quotient of two numbers (rounded down to the nearest integer). This can be solved in Python with the following code:\",\"targets\":\"def find(n,m): \\n q = n\\/\\/m \\n return (q)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check if the given tuples contain the k or not. Here is a solution in Python:\",\"targets\":\"def check_K(test_tup, K):\\n res = False\\n for ele in test_tup:\\n if ele == K:\\n res = True\\n break\\n return res\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to remove uneven elements in the nested mixed tuple. This can be solved in Python with the following code:\",\"targets\":\"def even_ele(test_tuple, even_fnc): \\n\\tres = tuple() \\n\\tfor ele in test_tuple: \\n\\t\\tif isinstance(ele, tuple): \\n\\t\\t\\tres += (even_ele(ele, even_fnc), ) \\n\\t\\telif even_fnc(ele): \\n\\t\\t\\tres += (ele, ) \\n\\treturn res \\ndef extract_even(test_tuple):\\n res = even_ele(test_tuple, lambda x: x % 2 == 0)\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the sum of common divisors of two given numbers. This can be solved in Python with the following code:\",\"targets\":\"def sum(a,b): \\n sum = 0\\n for i in range (1,min(a,b)): \\n if (a % i == 0 and b % i == 0): \\n sum += i \\n return sum\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to remove characters from the first string which are present in the second string. This can be solved in Python with the following code:\",\"targets\":\"NO_OF_CHARS = 256\\ndef str_to_list(string): \\n\\ttemp = [] \\n\\tfor x in string: \\n\\t\\ttemp.append(x) \\n\\treturn temp \\ndef lst_to_string(List): \\n\\treturn ''.join(List) \\ndef get_char_count_array(string): \\n\\tcount = [0] * NO_OF_CHARS \\n\\tfor i in string: \\n\\t\\tcount[ord(i)] += 1\\n\\treturn count \\ndef remove_dirty_chars(string, second_string): \\n\\tcount = get_char_count_array(second_string) \\n\\tip_ind = 0\\n\\tres_ind = 0\\n\\ttemp = '' \\n\\tstr_list = str_to_list(string) \\n\\twhile ip_ind != len(str_list): \\n\\t\\ttemp = str_list[ip_ind] \\n\\t\\tif count[ord(temp)] == 0: \\n\\t\\t\\tstr_list[res_ind] = str_list[ip_ind] \\n\\t\\t\\tres_ind += 1\\n\\t\\tip_ind+=1\\n\\treturn lst_to_string(str_list[0:res_ind])\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check if a string is present as a substring in a given list of string values. Here is a solution in Python:\",\"targets\":\"def find_substring(str1, sub_str):\\n if any(sub_str in s for s in str1):\\n return True\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in an array and element and returns a tuple containing a boolean that indicates if the element is in the array and the index position of the element (or -1 if the element is not found). Here is a solution in Python:\",\"targets\":\"def sequential_search(dlist, item):\\n pos = 0\\n found = False\\n while pos < len(dlist) and not found:\\n if dlist[pos] == item:\\n found = True\\n else:\\n pos = pos + 1\\n return found, pos\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function which takes two tuples of the same length and performs the element wise modulo. This can be solved in Python with the following code:\",\"targets\":\"def tuple_modulo(test_tup1, test_tup2):\\n res = tuple(ele1 % ele2 for ele1, ele2 in zip(test_tup1, test_tup2)) \\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to merge three lists into a single sorted list. Here is a solution in Python:\",\"targets\":\"import heapq\\ndef merge_sorted_list(num1,num2,num3):\\n num1=sorted(num1)\\n num2=sorted(num2)\\n num3=sorted(num3)\\n result = heapq.merge(num1,num2,num3)\\n return list(result)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to perform index wise addition of tuple elements in the given two nested tuples. Here is a solution in Python:\",\"targets\":\"def add_nested_tuples(test_tup1, test_tup2):\\n res = tuple(tuple(a + b for a, b in zip(tup1, tup2))\\n for tup1, tup2 in zip(test_tup1, test_tup2))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the size in bytes of the given tuple. This can be solved in Python with the following code:\",\"targets\":\"import sys \\ndef tuple_size(tuple_list):\\n return (sys.getsizeof(tuple_list))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the ascii value of a character. Here is a solution in Python:\",\"targets\":\"def ascii_value(k):\\n ch=k\\n return ord(ch)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count the number of equal numbers from three given integers. Here is a solution in Python:\",\"targets\":\"def test_three_equal(x,y,z):\\n result = set([x,y,z])\\n if len(result)==3:\\n return 0\\n else:\\n return 4-len(result)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the n'th star number. Here is a solution in Python:\",\"targets\":\"def find_star_num(n): \\n\\treturn (6 * n * (n - 1) + 1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to count the number of characters in a string that occur at the same position in the string as in the English alphabet (case insensitive). Here is a solution in Python:\",\"targets\":\"def count_char_position(str1): \\n count_chars = 0\\n for i in range(len(str1)):\\n if ((i == ord(str1[i]) - ord('A')) or \\n (i == ord(str1[i]) - ord('a'))): \\n count_chars += 1\\n return count_chars\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function takes in an integer n and returns the sum of squares of first n even natural numbers. This can be solved in Python with the following code:\",\"targets\":\"def square_Sum(n): \\n return int(2*n*(n+1)*(2*n+1)\\/3)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in positive integers m and n and finds the number of possible sequences of length n, such that each element is a positive integer and is greater than or equal to twice the previous element but less than or equal to m. Here is a solution in Python:\",\"targets\":\"def get_total_number_of_sequences(m,n): \\n\\tT=[[0 for i in range(n+1)] for i in range(m+1)] \\n\\tfor i in range(m+1): \\n\\t\\tfor j in range(n+1): \\n\\t\\t\\tif i==0 or j==0: \\n\\t\\t\\t\\tT[i][j]=0\\n\\t\\t\\telif i 0): \\n rev_num = (rev_num * 10 + num % 10) \\n num = num \\/\\/ 10 \\n return rev_num \\ndef check(n): \\n return (2 * rev(n) == n + 1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the first adverb and their positions in a given sentence. This can be solved in Python with the following code:\",\"targets\":\"import re\\ndef find_adverb_position(text):\\n for m in re.finditer(r\\\"\\\\w+ly\\\", text):\\n return (m.start(), m.end(), m.group(0))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the occurrence and position of the substrings within a string. Return None if there is no match. Here is a solution in Python:\",\"targets\":\"import re\\ndef occurance_substring(text,pattern):\\n for match in re.finditer(pattern, text):\\n s = match.start()\\n e = match.end()\\n return (text[s:e], s, e)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the volume of a cube given its side length. Here is a solution in Python:\",\"targets\":\"def volume_cube(l):\\n volume = l * l * l\\n return volume\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find all possible combinations of the elements of a given list. This can be solved in Python with the following code:\",\"targets\":\"def combinations_list(list1):\\n if len(list1) == 0:\\n return [[]]\\n result = []\\n for el in combinations_list(list1[1:]):\\n result += [el, el+[list1[0]]]\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in two tuples and subtracts the elements of the first tuple by the elements of the second tuple with the same index. This can be solved in Python with the following code:\",\"targets\":\"def substract_elements(test_tup1, test_tup2):\\n res = tuple(map(lambda i, j: i - j, test_tup1, test_tup2))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to locate the right insertion point for a specified value in sorted order. Here is a solution in Python:\",\"targets\":\"import bisect\\ndef right_insertion(a, x):\\n return bisect.bisect_right(a, x)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the sum of the product of consecutive binomial co-efficients. Here is a solution in Python:\",\"targets\":\"def binomial_Coeff(n,k): \\n C = [0] * (k + 1); \\n C[0] = 1; # nC0 is 1 \\n for i in range(1,n + 1): \\n for j in range(min(i, k),0,-1): \\n C[j] = C[j] + C[j - 1]; \\n return C[k]; \\ndef sum_Of_product(n): \\n return binomial_Coeff(2 * n,n - 1);\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert the given decimal number to its binary equivalent, represented as a string with no leading zeros. This can be solved in Python with the following code:\",\"targets\":\"def decimal_to_binary(n): \\n return bin(n).replace(\\\"0b\\\",\\\"\\\")\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to convert complex numbers to polar coordinates. This can be solved in Python with the following code:\",\"targets\":\"import cmath \\ndef convert(numbers): \\n num = cmath.polar(numbers) \\n return (num)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to count the number of sublists containing a particular element. Here is a solution in Python:\",\"targets\":\"def count_element_in_list(list1, x): \\n ctr = 0\\n for i in range(len(list1)): \\n if x in list1[i]: \\n ctr+= 1 \\n return ctr\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether it follows the sequence given in the patterns array. Here is a solution in Python:\",\"targets\":\"def is_samepatterns(colors, patterns): \\n if len(colors) != len(patterns):\\n return False \\n sdict = {}\\n pset = set()\\n sset = set() \\n for i in range(len(patterns)):\\n pset.add(patterns[i])\\n sset.add(colors[i])\\n if patterns[i] not in sdict.keys():\\n sdict[patterns[i]] = []\\n\\n keys = sdict[patterns[i]]\\n keys.append(colors[i])\\n sdict[patterns[i]] = keys\\n\\n if len(pset) != len(sset):\\n return False \\n\\n for values in sdict.values():\\n\\n for i in range(len(values) - 1):\\n if values[i] != values[i+1]:\\n return False\\n\\n return True\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the nth newman–shanks–williams prime number. This can be solved in Python with the following code:\",\"targets\":\"def newman_prime(n): \\n\\tif n == 0 or n == 1: \\n\\t\\treturn 1\\n\\treturn 2 * newman_prime(n - 1) + newman_prime(n - 2)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find nth bell number. This can be solved in Python with the following code:\",\"targets\":\"def bell_Number(n): \\n bell = [[0 for i in range(n+1)] for j in range(n+1)] \\n bell[0][0] = 1\\n for i in range(1, n+1):\\n bell[i][0] = bell[i-1][i-1]\\n for j in range(1, i+1): \\n bell[i][j] = bell[i-1][j-1] + bell[i][j-1] \\n return bell[n][0]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function which takes a list of integers and only returns the odd ones. Here is a solution in Python:\",\"targets\":\"def Split(list): \\n od_li = [] \\n for i in list: \\n if (i % 2 != 0): \\n od_li.append(i) \\n return od_li\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the cube sum of first n even natural numbers. This can be solved in Python with the following code:\",\"targets\":\"def cube_Sum(n): \\n sum = 0\\n for i in range(1,n + 1): \\n sum += (2*i)*(2*i)*(2*i) \\n return sum\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to round every number of a given list of numbers and print the total sum multiplied by the length of the list. This can be solved in Python with the following code:\",\"targets\":\"def round_and_sum(list1):\\n lenght=len(list1)\\n round_and_sum=sum(list(map(round,list1))* lenght)\\n return round_and_sum\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that matches a string that has an a followed by one or more b's. This can be solved in Python with the following code:\",\"targets\":\"import re\\ndef text_match_one(text):\\n patterns = 'ab+?'\\n if re.search(patterns, text):\\n return True\\n else:\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in an array and an integer n, and re-arranges the first n elements of the given array so that all negative elements appear before positive ones, and where the relative order among negative and positive elements is preserved. Here is a solution in Python:\",\"targets\":\"def re_arrange_array(arr, n):\\n j=0\\n for i in range(0, n):\\n if (arr[i] < 0):\\n temp = arr[i]\\n arr[i] = arr[j]\\n arr[j] = temp\\n j = j + 1\\n return arr\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the last digit in factorial of a given number. This can be solved in Python with the following code:\",\"targets\":\"def last_Digit_Factorial(n): \\n if (n == 0): return 1\\n elif (n <= 2): return n \\n elif (n == 3): return 6\\n elif (n == 4): return 4 \\n else: \\n return 0\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in a list and an integer L and splits the given list into two parts where the length of the first part of the list is L, and returns the resulting lists in a tuple. Here is a solution in Python:\",\"targets\":\"def split_two_parts(list1, L):\\n return list1[:L], list1[L:]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the volume of a sphere. This can be solved in Python with the following code:\",\"targets\":\"import math\\ndef volume_sphere(r):\\n volume=(4\\/3)*math.pi*r*r*r\\n return volume\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to sort each sublist of strings in a given list of lists. This can be solved in Python with the following code:\",\"targets\":\"def sort_sublists(list1):\\n result = list(map(sorted,list1)) \\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to get the angle of a complex number. Here is a solution in Python:\",\"targets\":\"import cmath\\ndef angle_complex(a,b):\\n cn=complex(a,b)\\n angle=cmath.phase(a+b)\\n return angle\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in an array and element and returns a tuple containing a boolean that indicates if the element is in the array and the index position of the element (or -1 if the element is not found). This can be solved in Python with the following code:\",\"targets\":\"def sequential_search(dlist, item):\\n pos = 0\\n found = False\\n while pos < len(dlist) and not found:\\n if dlist[pos] == item:\\n found = True\\n else:\\n pos = pos + 1\\n return found, pos\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the element of a list having maximum length. This can be solved in Python with the following code:\",\"targets\":\"def Find_Max(lst): \\n maxList = max((x) for x in lst) \\n return maxList\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in the radius and height of a cylinder and returns the the volume. This can be solved in Python with the following code:\",\"targets\":\"def volume_cylinder(r,h):\\n volume=3.1415*r*r*h\\n return volume\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether a list of numbers contains only one distinct element or not. This can be solved in Python with the following code:\",\"targets\":\"def unique_Element(arr):\\n s = set(arr)\\n return len(s) == 1\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to that rotate left bits by d bits a given number. We assume that the number is 32 bit. Here is a solution in Python:\",\"targets\":\"def left_rotate(n,d): \\n INT_BITS = 32\\n return (n << d)|(n >> (INT_BITS - d))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether every odd index contains odd numbers of a given list. Here is a solution in Python:\",\"targets\":\"def odd_position(nums):\\n\\treturn all(nums[i]%2==i%2 for i in range(len(nums)))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to create the next bigger number by rearranging the digits of a given number. This can be solved in Python with the following code:\",\"targets\":\"def rearrange_bigger(n):\\n nums = list(str(n))\\n for i in range(len(nums)-2,-1,-1):\\n if nums[i] < nums[i+1]:\\n z = nums[i:]\\n y = min(filter(lambda x: x > z[0], z))\\n z.remove(y)\\n z.sort()\\n nums[i:] = [y] + z\\n return int(\\\"\\\".join(nums))\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function that takes in an integer n and finds the sum of the first n even natural numbers that are raised to the fifth power. This can be solved in Python with the following code:\",\"targets\":\"def even_Power_Sum(n): \\n sum = 0; \\n for i in range(1,n+1): \\n j = 2*i; \\n sum = sum + (j*j*j*j*j); \\n return sum;\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the surface area of a cube of a given size. Here is a solution in Python:\",\"targets\":\"def surfacearea_cube(l):\\n surfacearea= 6*l*l\\n return surfacearea\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the minimum of two numbers. Here is a solution in Python:\",\"targets\":\"def minimum(a,b): \\n if a <= b: \\n return a \\n else: \\n return b\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that matches a string that has an 'a' followed by anything, ending in 'b'. This can be solved in Python with the following code:\",\"targets\":\"import re\\ndef text_starta_endb(text):\\n patterns = 'a.*?b$'\\n return re.search(patterns, text)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the pairwise addition of the neighboring elements of the given tuple. Here is a solution in Python:\",\"targets\":\"def add_pairwise(test_tup):\\n res = tuple(i + j for i, j in zip(test_tup, test_tup[1:]))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to get a colon of a tuple. This can be solved in Python with the following code:\",\"targets\":\"from copy import deepcopy\\ndef colon_tuplex(tuplex,m,n):\\n tuplex_colon = deepcopy(tuplex)\\n tuplex_colon[m].append(n)\\n return tuplex_colon\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to locate the left insertion point for a specified value in sorted order. https:\\/\\/www.w3resource.com\\/python-exercises\\/data-structures-and-algorithms\\/python-data-structure-exercise-24.php This can be solved in Python with the following code:\",\"targets\":\"import bisect\\ndef left_insertion(a, x):\\n i = bisect.bisect_left(a, x)\\n return i\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes an array and finds the maximum sum of a bitonic subsequence for the given array, where a sequence is bitonic if it is first increasing and then decreasing. Here is a solution in Python:\",\"targets\":\"def max_sum(arr): \\n\\tMSIBS = arr[:] \\n\\tfor i in range(len(arr)): \\n\\t\\tfor j in range(0, i): \\n\\t\\t\\tif arr[i] > arr[j] and MSIBS[i] < MSIBS[j] + arr[i]: \\n\\t\\t\\t\\tMSIBS[i] = MSIBS[j] + arr[i] \\n\\tMSDBS = arr[:] \\n\\tfor i in range(1, len(arr) + 1): \\n\\t\\tfor j in range(1, i): \\n\\t\\t\\tif arr[-i] > arr[-j] and MSDBS[-i] < MSDBS[-j] + arr[-i]: \\n\\t\\t\\t\\tMSDBS[-i] = MSDBS[-j] + arr[-i] \\n\\tmax_sum = float(\\\"-Inf\\\") \\n\\tfor i, j, k in zip(MSIBS, MSDBS, arr): \\n\\t\\tmax_sum = max(max_sum, i + j - k) \\n\\treturn max_sum\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function which takes a tuple of tuples and returns the average value for each tuple as a list. Here is a solution in Python:\",\"targets\":\"def average_tuple(nums):\\n result = [sum(x) \\/ len(x) for x in zip(*nums)]\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to sort a given list of strings of numbers numerically. https:\\/\\/www.geeksforgeeks.org\\/python-sort-numeric-strings-in-a-list\\/ Here is a solution in Python:\",\"targets\":\"def sort_numeric_strings(nums_str):\\n result = [int(x) for x in nums_str]\\n result.sort()\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the sum of non-repeated elements in a given list. Here is a solution in Python:\",\"targets\":\"def find_sum(arr): \\n arr.sort() \\n sum = arr[0] \\n for i in range(len(arr)-1): \\n if (arr[i] != arr[i+1]): \\n sum = sum + arr[i+1] \\n return sum\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the nth number in the newman conway sequence. This can be solved in Python with the following code:\",\"targets\":\"def sequence(n): \\n\\tif n == 1 or n == 2: \\n\\t\\treturn 1\\n\\telse: \\n\\t\\treturn sequence(sequence(n-1)) + sequence(n-sequence(n-1))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to flatten the list of lists into a single set of numbers. Here is a solution in Python:\",\"targets\":\"def extract_singly(test_list):\\n res = []\\n temp = set()\\n for inner in test_list:\\n for ele in inner:\\n if not ele in temp:\\n temp.add(ele)\\n res.append(ele)\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the perimeter of a regular pentagon from the length of its sides. Here is a solution in Python:\",\"targets\":\"import math\\ndef perimeter_pentagon(a):\\n perimeter=(5*a)\\n return perimeter\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count the upper case characters in a given string. This can be solved in Python with the following code:\",\"targets\":\"def upper_ctr(str):\\n upper_ctr = 0\\n for i in range(len(str)):\\n if str[i] >= 'A' and str[i] <= 'Z': upper_ctr += 1\\n return upper_ctr\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to sort each sublist of strings in a given list of lists. This can be solved in Python with the following code:\",\"targets\":\"def sort_sublists(input_list):\\n result = [sorted(x, key = lambda x:x[0]) for x in input_list] \\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to sort a list of elements. This can be solved in Python with the following code:\",\"targets\":\"def pancake_sort(nums):\\n arr_len = len(nums)\\n while arr_len > 1:\\n mi = nums.index(max(nums[0:arr_len]))\\n nums = nums[mi::-1] + nums[mi+1:len(nums)]\\n nums = nums[arr_len-1::-1] + nums[arr_len:len(nums)]\\n arr_len -= 1\\n return nums\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the last digit of a given number. This can be solved in Python with the following code:\",\"targets\":\"def last_Digit(n) :\\n return (n % 10)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the first odd number in a given list of numbers. This can be solved in Python with the following code:\",\"targets\":\"def first_odd(nums):\\n first_odd = next((el for el in nums if el%2!=0),-1)\\n return first_odd\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to count those characters which have vowels as their neighbors in the given string. This can be solved in Python with the following code:\",\"targets\":\"def count_vowels(test_str):\\n res = 0\\n vow_list = ['a', 'e', 'i', 'o', 'u']\\n for idx in range(1, len(test_str) - 1):\\n if test_str[idx] not in vow_list and (test_str[idx - 1] in vow_list or test_str[idx + 1] in vow_list):\\n res += 1\\n if test_str[0] not in vow_list and test_str[1] in vow_list:\\n res += 1\\n if test_str[-1] not in vow_list and test_str[-2] in vow_list:\\n res += 1\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to sort a list of elements. Here is a solution in Python:\",\"targets\":\"def comb_sort(nums):\\n shrink_fact = 1.3\\n gaps = len(nums)\\n swapped = True\\n i = 0\\n while gaps > 1 or swapped:\\n gaps = int(float(gaps) \\/ shrink_fact)\\n swapped = False\\n i = 0\\n while gaps + i < len(nums):\\n if nums[i] > nums[i+gaps]:\\n nums[i], nums[i+gaps] = nums[i+gaps], nums[i]\\n swapped = True\\n i += 1\\n return nums\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the occurrence and position of the substrings within a string. Return None if there is no match. This can be solved in Python with the following code:\",\"targets\":\"import re\\ndef occurance_substring(text,pattern):\\n for match in re.finditer(pattern, text):\\n s = match.start()\\n e = match.end()\\n return (text[s:e], s, e)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the sum of all odd natural numbers within the range l and r. Here is a solution in Python:\",\"targets\":\"def sum_odd(n): \\n terms = (n + 1)\\/\\/2\\n sum1 = terms * terms \\n return sum1 \\ndef sum_in_range(l,r): \\n return sum_odd(r) - sum_odd(l - 1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check if each element of second tuple is smaller than its corresponding element in the first tuple. This can be solved in Python with the following code:\",\"targets\":\"def check_smaller(test_tup1, test_tup2):\\n return all(x > y for x, y in zip(test_tup1, test_tup2))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to sum the length of the names of a given list of names after removing the names that start with a lowercase letter. Here is a solution in Python:\",\"targets\":\"def sample_nam(sample_names):\\n sample_names=list(filter(lambda el:el[0].isupper() and el[1:].islower(),sample_names))\\n return len(''.join(sample_names))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to create a list of N empty dictionaries. Here is a solution in Python:\",\"targets\":\"def empty_list(length):\\n empty_list = [{} for _ in range(length)]\\n return empty_list\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check if all the elements in tuple have same data type or not. Here is a solution in Python:\",\"targets\":\"def check_type(test_tuple):\\n res = True\\n for ele in test_tuple:\\n if not isinstance(ele, type(test_tuple[0])):\\n res = False\\n break\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function which takes a list of lists, where each sublist has two elements, and returns a list of two lists where the first list has the first element of each sublist and the second one has the second. This can be solved in Python with the following code:\",\"targets\":\"def merge(lst): \\n return [list(ele) for ele in list(zip(*lst))]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether the product of numbers in a list is even or not. This can be solved in Python with the following code:\",\"targets\":\"def is_product_even(arr): \\n for i in range(len(arr)): \\n if (arr[i] & 1) == 0: \\n return True\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to create a list of N empty dictionaries. This can be solved in Python with the following code:\",\"targets\":\"def empty_list(length):\\n empty_list = [{} for _ in range(length)]\\n return empty_list\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to return two words from a list of words starting with letter 'p'. Here is a solution in Python:\",\"targets\":\"import re\\ndef start_withp(words):\\n for w in words:\\n m = re.match(\\\"(P\\\\w+)\\\\W(P\\\\w+)\\\", w)\\n if m:\\n return m.groups()\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the count of all binary sequences of length 2n such that sum of first n bits is same as sum of last n bits. This can be solved in Python with the following code:\",\"targets\":\"def count_binary_seq(n): \\n\\tnCr = 1\\n\\tres = 1\\n\\tfor r in range(1, n + 1): \\n\\t\\tnCr = (nCr * (n + 1 - r)) \\/ r \\n\\t\\tres += nCr * nCr \\n\\treturn res\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the highest power of 2 that is less than or equal to n. This can be solved in Python with the following code:\",\"targets\":\"def highest_Power_of_2(n): \\n res = 0 \\n for i in range(n, 0, -1): \\n if ((i & (i - 1)) == 0): \\n res = i \\n break \\n return res\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the smallest missing number from a sorted list of natural numbers. This can be solved in Python with the following code:\",\"targets\":\"def find_First_Missing(array,start=0,end=None):\\n if end is None:\\n end = len(array) - 1 \\n if (start > end): \\n return end + 1\\n if (start != array[start]): \\n return start; \\n mid = int((start + end) \\/ 2) \\n if (array[mid] == mid): \\n return find_First_Missing(array,mid+1,end) \\n return find_First_Missing(array,start,mid)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find all words which are at least 4 characters long in a string. Here is a solution in Python:\",\"targets\":\"import re\\ndef find_char_long(text):\\n return (re.findall(r\\\"\\\\b\\\\w{4,}\\\\b\\\", text))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether all the bits are unset in the given range or not. Here is a solution in Python:\",\"targets\":\"def all_Bits_Set_In_The_Given_Range(n,l,r): \\n num = (((1 << r) - 1) ^ ((1 << (l - 1)) - 1)) \\n new_num = n & num\\n if (new_num == 0): \\n return True\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether the given amount has no profit and no loss Here is a solution in Python:\",\"targets\":\"def noprofit_noloss(actual_cost,sale_amount): \\n if(sale_amount == actual_cost):\\n return True\\n else:\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find whether all the given tuples have equal length or not. Here is a solution in Python:\",\"targets\":\"def find_equal_tuple(Input):\\n k = 0 if not Input else len(Input[0])\\n flag = 1\\n for tuple in Input:\\n if len(tuple) != k:\\n flag = 0\\n break\\n return flag\\ndef get_equal(Input):\\n return find_equal_tuple(Input) == 1\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to extract all the adjacent coordinates of the given coordinate tuple. Here is a solution in Python:\",\"targets\":\"def adjac(ele, sub = []): \\n if not ele: \\n yield sub \\n else: \\n yield from [idx for j in range(ele[0] - 1, ele[0] + 2) \\n for idx in adjac(ele[1:], sub + [j])] \\ndef get_coordinates(test_tup):\\n return list(adjac(test_tup))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether the given string starts and ends with the same character or not. This can be solved in Python with the following code:\",\"targets\":\"import re \\nregex = r'^[a-z]$|^([a-z]).*\\\\1$'\\ndef check_char(string): \\n\\tif(re.search(regex, string)): \\n\\t\\treturn \\\"Valid\\\" \\n\\telse: \\n\\t\\treturn \\\"Invalid\\\"\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to extract only the rear index element of each string in the given tuple. This can be solved in Python with the following code:\",\"targets\":\"def extract_rear(test_tuple):\\n res = list(sub[len(sub) - 1] for sub in test_tuple)\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to put spaces between words starting with capital letters in a given string. Here is a solution in Python:\",\"targets\":\"import re\\ndef capital_words_spaces(str1):\\n return re.sub(r\\\"(\\\\w)([A-Z])\\\", r\\\"\\\\1 \\\\2\\\", str1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the sum of the product of consecutive binomial co-efficients. This can be solved in Python with the following code:\",\"targets\":\"def binomial_Coeff(n,k): \\n C = [0] * (k + 1); \\n C[0] = 1; # nC0 is 1 \\n for i in range(1,n + 1): \\n for j in range(min(i, k),0,-1): \\n C[j] = C[j] + C[j - 1]; \\n return C[k]; \\ndef sum_Of_product(n): \\n return binomial_Coeff(2 * n,n - 1);\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the maximum product formed by multiplying numbers of an increasing subsequence of that array. This can be solved in Python with the following code:\",\"targets\":\"def max_product(arr): \\n n = len(arr)\\n mpis = arr[:]\\n for i in range(n): \\n current_prod = arr[i]\\n j = i + 1\\n while j < n:\\n if arr[j-1] > arr[j]: \\n break\\n current_prod *= arr[j]\\n if current_prod > mpis[j]:\\n mpis[j] = current_prod \\n j = j + 1\\n return max(mpis)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the intersection of two arrays. Here is a solution in Python:\",\"targets\":\"def intersection_array(array_nums1,array_nums2):\\n result = list(filter(lambda x: x in array_nums1, array_nums2)) \\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the smallest missing number from a sorted list of natural numbers. Here is a solution in Python:\",\"targets\":\"def find_First_Missing(array,start=0,end=None):\\n if end is None:\\n end = len(array) - 1 \\n if (start > end): \\n return end + 1\\n if (start != array[start]): \\n return start; \\n mid = int((start + end) \\/ 2) \\n if (array[mid] == mid): \\n return find_First_Missing(array,mid+1,end) \\n return find_First_Missing(array,start,mid)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Given a square matrix of size N*N given as a list of lists, where each cell is associated with a specific cost. A path is defined as a specific sequence of cells that starts from the top-left cell move only right or down and ends on bottom right cell. We want to find a path with the maximum average over all existing paths. Average is computed as total cost divided by the number of cells visited in the path. Here is a solution in Python:\",\"targets\":\"def maxAverageOfPath(cost):\\n N = len(cost)\\n dp = [[0 for i in range(N + 1)] for j in range(N + 1)]\\n dp[0][0] = cost[0][0]\\n for i in range(1, N):\\n dp[i][0] = dp[i - 1][0] + cost[i][0]\\n for j in range(1, N):\\n dp[0][j] = dp[0][j - 1] + cost[0][j]\\n for i in range(1, N):\\n for j in range(1, N):\\n dp[i][j] = max(dp[i - 1][j],\\n dp[i][j - 1]) + cost[i][j]\\n return dp[N - 1][N - 1] \\/ (2 * N - 1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to get the difference between two lists. This can be solved in Python with the following code:\",\"targets\":\"def Diff(li1,li2):\\n return list(set(li1)-set(li2)) + list(set(li2)-set(li1))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count the number of substrings with the sum of digits equal to their length. This can be solved in Python with the following code:\",\"targets\":\"from collections import defaultdict\\ndef count_Substrings(s):\\n n = len(s)\\n count,sum = 0,0\\n mp = defaultdict(lambda : 0)\\n mp[0] += 1\\n for i in range(n):\\n sum += ord(s[i]) - ord('0')\\n count += mp[sum - (i + 1)]\\n mp[sum - (i + 1)] += 1\\n return count\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to remove consecutive duplicates of a given list. This can be solved in Python with the following code:\",\"targets\":\"from itertools import groupby\\ndef consecutive_duplicates(nums):\\n return [key for key, group in groupby(nums)]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to get all lucid numbers smaller than or equal to a given integer. Here is a solution in Python:\",\"targets\":\"def get_ludic(n):\\n\\tludics = []\\n\\tfor i in range(1, n + 1):\\n\\t\\tludics.append(i)\\n\\tindex = 1\\n\\twhile(index != len(ludics)):\\n\\t\\tfirst_ludic = ludics[index]\\n\\t\\tremove_index = index + first_ludic\\n\\t\\twhile(remove_index < len(ludics)):\\n\\t\\t\\tludics.remove(ludics[remove_index])\\n\\t\\t\\tremove_index = remove_index + first_ludic - 1\\n\\t\\tindex += 1\\n\\treturn ludics\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the sum of an array. Here is a solution in Python:\",\"targets\":\"def _sum(arr): \\n sum=0\\n for i in arr: \\n sum = sum + i \\n return(sum)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert a snake case string to camel case string. Here is a solution in Python:\",\"targets\":\"def snake_to_camel(word):\\n import re\\n return ''.join(x.capitalize() or '_' for x in word.split('_'))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the sum of the largest contiguous sublist in the given list. This can be solved in Python with the following code:\",\"targets\":\"def max_sub_array_sum(a, size):\\n max_so_far = 0\\n max_ending_here = 0\\n for i in range(0, size):\\n max_ending_here = max_ending_here + a[i]\\n if max_ending_here < 0:\\n max_ending_here = 0\\n elif (max_so_far < max_ending_here):\\n max_so_far = max_ending_here\\n return max_so_far\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check if the given array represents min heap or not. https:\\/\\/www.geeksforgeeks.org\\/how-to-check-if-a-given-array-represents-a-binary-heap\\/ Here is a solution in Python:\",\"targets\":\"def check_min_heap_helper(arr, i):\\n if 2 * i + 2 > len(arr):\\n return True\\n left_child = (arr[i] <= arr[2 * i + 1]) and check_min_heap_helper(arr, 2 * i + 1)\\n right_child = (2 * i + 2 == len(arr)) or (arr[i] <= arr[2 * i + 2] \\n and check_min_heap_helper(arr, 2 * i + 2))\\n return left_child and right_child\\n\\ndef check_min_heap(arr):\\n return check_min_heap_helper(arr, 0)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check whether the given amount has no profit and no loss This can be solved in Python with the following code:\",\"targets\":\"def noprofit_noloss(actual_cost,sale_amount): \\n if(sale_amount == actual_cost):\\n return True\\n else:\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check if the given tuples contain the k or not. This can be solved in Python with the following code:\",\"targets\":\"def check_K(test_tup, K):\\n res = False\\n for ele in test_tup:\\n if ele == K:\\n res = True\\n break\\n return res\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to remove odd numbers from a given list. Here is a solution in Python:\",\"targets\":\"def remove_odd(l):\\n for i in l:\\n if i % 2 != 0:\\n l.remove(i)\\n return l\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to count the total number of characters in a string. Here is a solution in Python:\",\"targets\":\"def count_charac(str1):\\n total = 0\\n for i in str1:\\n total = total + 1\\n return total\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that matches a string that has an 'a' followed by one or more 'b's. https:\\/\\/www.w3resource.com\\/python-exercises\\/re\\/python-re-exercise-3.php This can be solved in Python with the following code:\",\"targets\":\"import re\\ndef text_match_zero_one(text):\\n patterns = 'ab+?'\\n if re.search(patterns, text):\\n return True\\n else:\\n return False\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the third side of a right angled triangle. This can be solved in Python with the following code:\",\"targets\":\"import math\\ndef otherside_rightangle(w,h):\\n s=math.sqrt((w*w)+(h*h))\\n return s\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert a given string to a tuple of characters. This can be solved in Python with the following code:\",\"targets\":\"def string_to_tuple(str1):\\n result = tuple(x for x in str1 if not x.isspace()) \\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function takes in an integer and check whether the frequency of each digit in the integer is less than or equal to the digit itself. This can be solved in Python with the following code:\",\"targets\":\"def validate(n): \\n for i in range(10): \\n temp = n; \\n count = 0; \\n while (temp): \\n if (temp % 10 == i): \\n count+=1; \\n if (count > i): \\n return False\\n temp \\/\\/= 10; \\n return True\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find tuples which have all elements divisible by k from the given list of tuples. Here is a solution in Python:\",\"targets\":\"def find_tuples(test_list, K):\\n res = [sub for sub in test_list if all(ele % K == 0 for ele in sub)]\\n return res\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether the given number can be represented as sum of non-zero powers of 2 or not. Here is a solution in Python:\",\"targets\":\"def is_Sum_Of_Powers_Of_Two(n): \\n if (n % 2 == 1): \\n return False\\n else: \\n return True\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the surface area of a sphere. This can be solved in Python with the following code:\",\"targets\":\"import math\\ndef surfacearea_sphere(r):\\n surfacearea=4*math.pi*r*r\\n return surfacearea\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert more than one list to nested dictionary. Here is a solution in Python:\",\"targets\":\"def convert_list_dictionary(l1, l2, l3):\\n result = [{x: {y: z}} for (x, y, z) in zip(l1, l2, l3)]\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to count the number of pairs whose sum is equal to ‘sum’. The funtion gets as input a list of numbers and the sum, This can be solved in Python with the following code:\",\"targets\":\"def get_pairs_count(arr, sum):\\n count = 0 \\n for i in range(len(arr)):\\n for j in range(i + 1,len(arr)):\\n if arr[i] + arr[j] == sum:\\n count += 1\\n return count\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert tuple string to integer tuple. This can be solved in Python with the following code:\",\"targets\":\"def tuple_str_int(test_str):\\n res = tuple(int(num) for num in test_str.replace('(', '').replace(')', '').replace('...', '').split(', '))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the nth decagonal number. This can be solved in Python with the following code:\",\"targets\":\"def is_num_decagonal(n): \\n\\treturn 4 * n * n - 3 * n\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to move all the numbers to the end of the given string. Here is a solution in Python:\",\"targets\":\"def move_num(test_str):\\n res = ''\\n dig = ''\\n for ele in test_str:\\n if ele.isdigit():\\n dig += ele\\n else:\\n res += ele\\n res += dig\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the sum of even numbers at even positions of a list. This can be solved in Python with the following code:\",\"targets\":\"def sum_even_and_even_index(arr): \\n i = 0\\n sum = 0\\n for i in range(0, len(arr),2): \\n if (arr[i] % 2 == 0) : \\n sum += arr[i] \\n return sum\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert tuple string to integer tuple. Here is a solution in Python:\",\"targets\":\"def tuple_str_int(test_str):\\n res = tuple(int(num) for num in test_str.replace('(', '').replace(')', '').replace('...', '').split(', '))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the maximum sum of increasing subsequence from prefix until ith index and also including a given kth element which is after i, i.e., k > i . Here is a solution in Python:\",\"targets\":\"def max_sum_increasing_subseq(a, n, index, k):\\n\\tdp = [[0 for i in range(n)] \\n\\t\\t\\tfor i in range(n)]\\n\\tfor i in range(n):\\n\\t\\tif a[i] > a[0]:\\n\\t\\t\\tdp[0][i] = a[i] + a[0]\\n\\t\\telse:\\n\\t\\t\\tdp[0][i] = a[i]\\n\\tfor i in range(1, n):\\n\\t\\tfor j in range(n):\\n\\t\\t\\tif a[j] > a[i] and j > i:\\n\\t\\t\\t\\tif dp[i - 1][i] + a[j] > dp[i - 1][j]:\\n\\t\\t\\t\\t\\tdp[i][j] = dp[i - 1][i] + a[j]\\n\\t\\t\\t\\telse:\\n\\t\\t\\t\\t\\tdp[i][j] = dp[i - 1][j]\\n\\t\\t\\telse:\\n\\t\\t\\t\\tdp[i][j] = dp[i - 1][j]\\n\\treturn dp[index][k]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to remove consecutive duplicates of a given list. Here is a solution in Python:\",\"targets\":\"from itertools import groupby\\ndef consecutive_duplicates(nums):\\n return [key for key, group in groupby(nums)]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to sum all amicable numbers from 1 to a specified number. Here is a solution in Python:\",\"targets\":\"def amicable_numbers_sum(limit):\\n if not isinstance(limit, int):\\n return \\\"Input is not an integer!\\\"\\n if limit < 1:\\n return \\\"Input must be bigger than 0!\\\"\\n amicables = set()\\n for num in range(2, limit+1):\\n if num in amicables:\\n continue\\n sum_fact = sum([fact for fact in range(1, num) if num % fact == 0])\\n sum_fact2 = sum([fact for fact in range(1, sum_fact) if sum_fact % fact == 0])\\n if num == sum_fact2 and num != sum_fact:\\n amicables.add(num)\\n amicables.add(sum_fact2)\\n return sum(amicables)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to convert a given tuple of positive integers into a single integer. Here is a solution in Python:\",\"targets\":\"def tuple_to_int(nums):\\n result = int(''.join(map(str,nums)))\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in the radius and height of a cylinder and returns the the volume. Here is a solution in Python:\",\"targets\":\"def volume_cylinder(r,h):\\n volume=3.1415*r*r*h\\n return volume\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in two lists and replaces the last element of the first list with the elements of the second list. Here is a solution in Python:\",\"targets\":\"def replace_list(list1,list2):\\n list1[-1:] = list2\\n replace_list=list1\\n return replace_list\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to calculate the sum (n - 2*i) from i=0 to n \\/\\/ 2, for instance n + (n-2) + (n-4)... (until n-x =< 0). This can be solved in Python with the following code:\",\"targets\":\"def sum_series(n):\\n if n < 1:\\n return 0\\n else:\\n return n + sum_series(n - 2)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the median of two sorted lists of same size. Here is a solution in Python:\",\"targets\":\"def get_median(arr1, arr2, n):\\n i = 0\\n j = 0\\n m1 = -1\\n m2 = -1\\n count = 0\\n while count < n + 1:\\n count += 1\\n if i == n:\\n m1 = m2\\n m2 = arr2[0]\\n break\\n elif j == n:\\n m1 = m2\\n m2 = arr1[0]\\n break\\n if arr1[i] <= arr2[j]:\\n m1 = m2\\n m2 = arr1[i]\\n i += 1\\n else:\\n m1 = m2\\n m2 = arr2[j]\\n j += 1\\n return (m1 + m2)\\/2\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether the given list contains consecutive numbers or not. Here is a solution in Python:\",\"targets\":\"def check_Consecutive(l): \\n return sorted(l) == list(range(min(l),max(l)+1))\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to find the index of smallest triangular number with n digits. https:\\/\\/www.geeksforgeeks.org\\/index-of-smallest-triangular-number-with-n-digits\\/ This can be solved in Python with the following code:\",\"targets\":\"import math \\ndef find_Index(n): \\n x = math.sqrt(2 * math.pow(10,(n - 1)))\\n return round(x)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the union of the elements of two given tuples and output them in sorted order. This can be solved in Python with the following code:\",\"targets\":\"def union_elements(test_tup1, test_tup2):\\n res = tuple(set(test_tup1 + test_tup2))\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the area of a rectangle. Here is a solution in Python:\",\"targets\":\"def rectangle_area(l,b):\\n area=l*b\\n return area\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to check whether the given number is even or not. Here is a solution in Python:\",\"targets\":\"def is_Even(n) : \\n if (n^1 == n+1) :\\n return True; \\n else :\\n return False;\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function that takes in a list of tuples and returns a list containing the rear element of each tuple. Here is a solution in Python:\",\"targets\":\"def rear_extract(test_list):\\n res = [lis[-1] for lis in test_list]\\n return (res)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the minimum product from the pairs of tuples within a given list. This can be solved in Python with the following code:\",\"targets\":\"def min_product_tuple(list1):\\n result_min = min([abs(x * y) for x, y in list1] )\\n return result_min\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the lateral surface area of a cone given radius r and the height h. This can be solved in Python with the following code:\",\"targets\":\"import math\\ndef lateralsurface_cone(r,h):\\n l = math.sqrt(r * r + h * h)\\n LSA = math.pi * r * l\\n return LSA\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to check if a dictionary is empty Here is a solution in Python:\",\"targets\":\"def my_dict(dict1):\\n if bool(dict1):\\n return False\\n else:\\n return True\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"We say that an element is common for lists l1, l2, l3 if it appears in all three lists under the same index. Write a function to find common elements from three lists. The function should return a list. This can be solved in Python with the following code:\",\"targets\":\"def extract_index_list(l1, l2, l3):\\n result = []\\n for m, n, o in zip(l1, l2, l3):\\n if (m == n == o):\\n result.append(m)\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the difference of the first even and first odd number of a given list. This can be solved in Python with the following code:\",\"targets\":\"def diff_even_odd(list1):\\n first_even = next((el for el in list1 if el%2==0),-1)\\n first_odd = next((el for el in list1 if el%2!=0),-1)\\n return (first_even-first_odd)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to find the ration of positive numbers in an array of integers. Here is a solution in Python:\",\"targets\":\"from array import array\\ndef positive_count(nums):\\n n = len(nums)\\n n1 = 0\\n for x in nums:\\n if x > 0:\\n n1 += 1\\n else:\\n None\\n return round(n1\\/n,2)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to split a list at the nth eelment and add the first part to the end. Here is a solution in Python:\",\"targets\":\"def split_Arr(l, n):\\n return l[n:] + l[:n]\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a function to calculate the value of 'a' to the power 'b'. This can be solved in Python with the following code:\",\"targets\":\"def power(a,b):\\n\\tif b==0:\\n\\t\\treturn 1\\n\\telif a==0:\\n\\t\\treturn 0\\n\\telif b==1:\\n\\t\\treturn a\\n\\telse:\\n\\t\\treturn a*power(a,b-1)\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solved\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n" "{\"inputs\":\"Write a python function to identify non-prime numbers. Here is a solution in Python:\",\"targets\":\"import math\\ndef is_not_prime(n):\\n result = False\\n for i in range(2,int(math.sqrt(n)) + 1):\\n if n % i == 0:\\n result = True\\n return result\",\"language\":\"python\",\"split\":\"test\",\"template\":\"function solution\",\"dataset\":\"Muennighoff\\/mbpp\",\"config\":\"sanitized\"}\n"