{"row": 0, "completion_input": "\"\"\"Write a python function to remove first and last occurrence of a given character from the string.\"\"\"\n\ndef remove_Occ(", "completion_prefix": "def remove_Occ(", "chat_input": [{"role": "user", "content": "Write a python function to remove first and last occurrence of a given character from the string.\nThe function should be named `remove_Occ`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert remove_Occ(\"hello\",\"l\") == \"heo\"\nassert remove_Occ(\"abcda\",\"a\") == \"bcd\"\nassert remove_Occ(\"PHP\",\"P\") == \"H\""} {"row": 1, "completion_input": "\"\"\"Write a function to sort a given matrix in ascending order according to the sum of its rows.\"\"\"\n\ndef sort_matrix(", "completion_prefix": "def sort_matrix(", "chat_input": [{"role": "user", "content": "Write a function to sort a given matrix in ascending order according to the sum of its rows.\nThe function should be named `sort_matrix`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert sort_matrix([[1, 2, 3], [2, 4, 5], [1, 1, 1]])==[[1, 1, 1], [1, 2, 3], [2, 4, 5]]\nassert sort_matrix([[1, 2, 3], [-2, 4, -5], [1, -1, 1]])==[[-2, 4, -5], [1, -1, 1], [1, 2, 3]]\nassert sort_matrix([[5,8,9],[6,4,3],[2,1,4]])==[[2, 1, 4], [6, 4, 3], [5, 8, 9]]"} {"row": 2, "completion_input": "\"\"\"Write a function to count the most common words in a dictionary.\"\"\"\n\ndef count_common(", "completion_prefix": "def count_common(", "chat_input": [{"role": "user", "content": "Write a function to count the most common words in a dictionary.\nThe function should be named `count_common`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_common(['red','green','black','pink','black','white','black','eyes','white','black','orange','pink','pink','red','red','white','orange','white',\"black\",'pink','green','green','pink','green','pink','white','orange',\"orange\",'red']) == [('pink', 6), ('black', 5), ('white', 5), ('red', 4)]\nassert count_common(['one', 'two', 'three', 'four', 'five', 'one', 'two', 'one', 'three', 'one']) == [('one', 4), ('two', 2), ('three', 2), ('four', 1)]\nassert count_common(['Facebook', 'Apple', 'Amazon', 'Netflix', 'Google', 'Apple', 'Netflix', 'Amazon']) == [('Apple', 2), ('Amazon', 2), ('Netflix', 2), ('Facebook', 1)]"} {"row": 3, "completion_input": "\"\"\"Write a python function to find the volume of a triangular prism.\"\"\"\n\ndef find_Volume(", "completion_prefix": "def find_Volume(", "chat_input": [{"role": "user", "content": "Write a python function to find the volume of a triangular prism.\nThe function should be named `find_Volume`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_Volume(10,8,6) == 240\nassert find_Volume(3,2,2) == 6\nassert find_Volume(1,2,1) == 1"} {"row": 4, "completion_input": "\"\"\"Write a function to split a string at lowercase letters.\"\"\"\n\ndef split_lowerstring(", "completion_prefix": "def split_lowerstring(", "chat_input": [{"role": "user", "content": "Write a function to split a string at lowercase letters.\nThe function should be named `split_lowerstring`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert split_lowerstring(\"AbCd\")==['bC','d']\nassert split_lowerstring(\"Python\")==['y', 't', 'h', 'o', 'n']\nassert split_lowerstring(\"Programming\")==['r', 'o', 'g', 'r', 'a', 'm', 'm', 'i', 'n', 'g']"} {"row": 5, "completion_input": "\"\"\"Write a function to find sequences of lowercase letters joined with an underscore.\"\"\"\n\ndef text_lowercase_underscore(", "completion_prefix": "def text_lowercase_underscore(", "chat_input": [{"role": "user", "content": "Write a function to find sequences of lowercase letters joined with an underscore.\nThe function should be named `text_lowercase_underscore`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert text_lowercase_underscore(\"aab_cbbbc\")==('Found a match!')\nassert text_lowercase_underscore(\"aab_Abbbc\")==('Not matched!')\nassert text_lowercase_underscore(\"Aaab_abbbc\")==('Not matched!')"} {"row": 6, "completion_input": "\"\"\"Write a function to find the perimeter of a square.\"\"\"\n\ndef square_perimeter(", "completion_prefix": "def square_perimeter(", "chat_input": [{"role": "user", "content": "Write a function to find the perimeter of a square.\nThe function should be named `square_perimeter`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert square_perimeter(10)==40\nassert square_perimeter(5)==20\nassert square_perimeter(4)==16"} {"row": 7, "completion_input": "\"\"\"Write a function to remove characters from the first string which are present in the second string.\"\"\"\n\ndef remove_dirty_chars(", "completion_prefix": "def remove_dirty_chars(", "chat_input": [{"role": "user", "content": "Write a function to remove characters from the first string which are present in the second string.\nThe function should be named `remove_dirty_chars`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert remove_dirty_chars(\"probasscurve\", \"pros\") == 'bacuve'\nassert remove_dirty_chars(\"digitalindia\", \"talent\") == 'digiidi'\nassert remove_dirty_chars(\"exoticmiles\", \"toxic\") == 'emles' "} {"row": 8, "completion_input": "\"\"\"Write a function to find whether a given array of integers contains any duplicate element.\"\"\"\n\ndef test_duplicate(", "completion_prefix": "def test_duplicate(", "chat_input": [{"role": "user", "content": "Write a function to find whether a given array of integers contains any duplicate element.\nThe function should be named `test_duplicate`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert test_duplicate(([1,2,3,4,5]))==False\nassert test_duplicate(([1,2,3,4, 4]))==True\nassert test_duplicate([1,1,2,2,3,3,4,4,5])==True"} {"row": 9, "completion_input": "\"\"\"Write a function to check if the given number is woodball or not.\"\"\"\n\ndef is_woodall(", "completion_prefix": "def is_woodall(", "chat_input": [{"role": "user", "content": "Write a function to check if the given number is woodball or not.\nThe function should be named `is_woodall`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert is_woodall(383) == True\nassert is_woodall(254) == False\nassert is_woodall(200) == False"} {"row": 10, "completion_input": "\"\"\"Write a function to find m number of multiples of n.\"\"\"\n\ndef multiples_of_num(", "completion_prefix": "def multiples_of_num(", "chat_input": [{"role": "user", "content": "Write a function to find m number of multiples of n.\nThe function should be named `multiples_of_num`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert multiples_of_num(4,3)== [3,6,9,12]\nassert multiples_of_num(2,5)== [5,10]\nassert multiples_of_num(9,2)== [2,4,6,8,10,12,14,16,18]"} {"row": 11, "completion_input": "\"\"\"Write a function to find the first duplicate element in a given array of integers.\"\"\"\n\ndef find_first_duplicate(", "completion_prefix": "def find_first_duplicate(", "chat_input": [{"role": "user", "content": "Write a function to find the first duplicate element in a given array of integers.\nThe function should be named `find_first_duplicate`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_first_duplicate(([1, 2, 3, 4, 4, 5]))==4\nassert find_first_duplicate([1, 2, 3, 4])==-1\nassert find_first_duplicate([1, 1, 2, 3, 3, 2, 2])==1"} {"row": 12, "completion_input": "\"\"\"Write a python function to find the maximum sum of elements of list in a list of lists.\"\"\"\n\ndef maximum_Sum(", "completion_prefix": "def maximum_Sum(", "chat_input": [{"role": "user", "content": "Write a python function to find the maximum sum of elements of list in a list of lists.\nThe function should be named `maximum_Sum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert maximum_Sum([[1,2,3],[4,5,6],[10,11,12],[7,8,9]]) == 33\nassert maximum_Sum([[0,1,1],[1,1,2],[3,2,1]]) == 6\nassert maximum_Sum([[0,1,3],[1,2,1],[9,8,2],[0,1,0],[6,4,8]]) == 19"} {"row": 13, "completion_input": "\"\"\"Write a function to convert the given binary number to its decimal equivalent.\"\"\"\n\ndef binary_to_decimal(", "completion_prefix": "def binary_to_decimal(", "chat_input": [{"role": "user", "content": "Write a function to convert the given binary number to its decimal equivalent.\nThe function should be named `binary_to_decimal`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert binary_to_decimal(100) == 4\nassert binary_to_decimal(1011) == 11\nassert binary_to_decimal(1101101) == 109"} {"row": 14, "completion_input": "\"\"\"Write a python function to find the product of non-repeated elements in a given array.\"\"\"\n\ndef find_Product(", "completion_prefix": "def find_Product(", "chat_input": [{"role": "user", "content": "Write a python function to find the product of non-repeated elements in a given array.\nThe function should be named `find_Product`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_Product([1,1,2,3],4) == 6\nassert find_Product([1,2,3,1,1],5) == 6\nassert find_Product([1,1,4,5,6],5) == 120"} {"row": 15, "completion_input": "\"\"\"Write a function to check if the given tuple list has all k elements.\"\"\"\n\ndef check_k_elements(", "completion_prefix": "def check_k_elements(", "chat_input": [{"role": "user", "content": "Write a function to check if the given tuple list has all k elements.\nThe function should be named `check_k_elements`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert check_k_elements([(4, 4), (4, 4, 4), (4, 4), (4, 4, 4, 4), (4, )], 4) == True\nassert check_k_elements([(7, 7, 7), (7, 7)], 7) == True\nassert check_k_elements([(9, 9), (9, 9, 9, 9)], 7) == False"} {"row": 16, "completion_input": "\"\"\"Write a python function to remove all digits from a list of strings.\"\"\"\n\ndef remove(", "completion_prefix": "def remove(", "chat_input": [{"role": "user", "content": "Write a python function to remove all digits from a list of strings.\nThe function should be named `remove`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert remove(['4words', '3letters', '4digits']) == ['words', 'letters', 'digits']\nassert remove(['28Jan','12Jan','11Jan']) == ['Jan','Jan','Jan']\nassert remove(['wonder1','wonder2','wonder3']) == ['wonder','wonder','wonder']"} {"row": 17, "completion_input": "\"\"\"Write a python function to find binomial co-efficient.\"\"\"\n\ndef binomial_Coeff(", "completion_prefix": "def binomial_Coeff(", "chat_input": [{"role": "user", "content": "Write a python function to find binomial co-efficient.\nThe function should be named `binomial_Coeff`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert binomial_Coeff(5,2) == 10\nassert binomial_Coeff(4,3) == 4\nassert binomial_Coeff(3,2) == 3"} {"row": 18, "completion_input": "\"\"\"Write a python function to find the element occurring odd number of times.\"\"\"\n\ndef get_Odd_Occurrence(", "completion_prefix": "def get_Odd_Occurrence(", "chat_input": [{"role": "user", "content": "Write a python function to find the element occurring odd number of times.\nThe function should be named `get_Odd_Occurrence`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert get_Odd_Occurrence([1,2,3,1,2,3,1],7) == 1\nassert get_Odd_Occurrence([1,2,3,2,3,1,3],7) == 3\nassert get_Odd_Occurrence([2,3,5,4,5,2,4,3,5,2,4,4,2],13) == 5"} {"row": 19, "completion_input": "\"\"\"Write a python function to count all the substrings starting and ending with same characters.\"\"\"\n\ndef count_Substring_With_Equal_Ends(", "completion_prefix": "def count_Substring_With_Equal_Ends(", "chat_input": [{"role": "user", "content": "Write a python function to count all the substrings starting and ending with same characters.\nThe function should be named `count_Substring_With_Equal_Ends`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_Substring_With_Equal_Ends(\"abc\") == 3\nassert count_Substring_With_Equal_Ends(\"abcda\") == 6\nassert count_Substring_With_Equal_Ends(\"ab\") == 2"} {"row": 20, "completion_input": "\"\"\"Write a function to find the top k integers that occur most frequently from given lists of sorted and distinct integers using heap queue algorithm.\"\"\"\n\ndef func(", "completion_prefix": "def func(", "chat_input": [{"role": "user", "content": "Write a function to find the top k integers that occur most frequently from given lists of sorted and distinct integers using heap queue algorithm.\nThe function should be named `func`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert func([[1, 2, 6], [1, 3, 4, 5, 7, 8], [1, 3, 5, 6, 8, 9], [2, 5, 7, 11], [1, 4, 7, 8, 12]],3)==[5, 7, 1]\nassert func([[1, 2, 6], [1, 3, 4, 5, 7, 8], [1, 3, 5, 6, 8, 9], [2, 5, 7, 11], [1, 4, 7, 8, 12]],1)==[1]\nassert func([[1, 2, 6], [1, 3, 4, 5, 7, 8], [1, 3, 5, 6, 8, 9], [2, 5, 7, 11], [1, 4, 7, 8, 12]],5)==[6, 5, 7, 8, 1]"} {"row": 21, "completion_input": "\"\"\"Write a python function to find the largest prime factor of a given number.\"\"\"\n\ndef max_Prime_Factors(", "completion_prefix": "def max_Prime_Factors(", "chat_input": [{"role": "user", "content": "Write a python function to find the largest prime factor of a given number.\nThe function should be named `max_Prime_Factors`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert max_Prime_Factors(15) == 5\nassert max_Prime_Factors(6) == 3\nassert max_Prime_Factors(2) == 2"} {"row": 22, "completion_input": "\"\"\"Write a python function to convert a decimal number to binary number.\"\"\"\n\ndef decimal_To_Binary(", "completion_prefix": "def decimal_To_Binary(", "chat_input": [{"role": "user", "content": "Write a python function to convert a decimal number to binary number.\nThe function should be named `decimal_To_Binary`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert decimal_To_Binary(10) == 1010\nassert decimal_To_Binary(1) == 1\nassert decimal_To_Binary(20) == 10100"} {"row": 23, "completion_input": "\"\"\"Write a python function to find the missing number in a sorted array.\"\"\"\n\ndef find_missing(", "completion_prefix": "def find_missing(", "chat_input": [{"role": "user", "content": "Write a python function to find the missing number in a sorted array.\nThe function should be named `find_missing`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_missing([1,2,3,5],4) == 4\nassert find_missing([1,3,4,5],4) == 2\nassert find_missing([1,2,3,5,6,7],5) == 4"} {"row": 24, "completion_input": "\"\"\"Write a function to find the n-th rectangular number.\"\"\"\n\ndef find_rect_num(", "completion_prefix": "def find_rect_num(", "chat_input": [{"role": "user", "content": "Write a function to find the n-th rectangular number.\nThe function should be named `find_rect_num`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_rect_num(4) == 20\nassert find_rect_num(5) == 30\nassert find_rect_num(6) == 42"} {"row": 25, "completion_input": "\"\"\"Write a python function to find the nth digit in the proper fraction of two given numbers.\"\"\"\n\ndef find_Nth_Digit(", "completion_prefix": "def find_Nth_Digit(", "chat_input": [{"role": "user", "content": "Write a python function to find the nth digit in the proper fraction of two given numbers.\nThe function should be named `find_Nth_Digit`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_Nth_Digit(1,2,1) == 5\nassert find_Nth_Digit(3,5,1) == 6\nassert find_Nth_Digit(5,6,5) == 3"} {"row": 26, "completion_input": "\"\"\"Write a function to sort a given mixed list of integers and strings.\"\"\"\n\ndef sort_mixed_list(", "completion_prefix": "def sort_mixed_list(", "chat_input": [{"role": "user", "content": "Write a function to sort a given mixed list of integers and strings.\nThe function should be named `sort_mixed_list`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert sort_mixed_list([19,'red',12,'green','blue', 10,'white','green',1])==[1, 10, 12, 19, 'blue', 'green', 'green', 'red', 'white']\nassert sort_mixed_list([19,'red',12,'green','blue', 10,'white','green',1])==[1, 10, 12, 19, 'blue', 'green', 'green', 'red', 'white']\nassert sort_mixed_list([19,'red',12,'green','blue', 10,'white','green',1])==[1, 10, 12, 19, 'blue', 'green', 'green', 'red', 'white']"} {"row": 27, "completion_input": "\"\"\"Write a function to find the division of first even and odd number of a given list.\"\"\"\n\ndef div_even_odd(", "completion_prefix": "def div_even_odd(", "chat_input": [{"role": "user", "content": "Write a function to find the division of first even and odd number of a given list.\nThe function should be named `div_even_odd`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert div_even_odd([1,3,5,7,4,1,6,8])==4\nassert div_even_odd([1,2,3,4,5,6,7,8,9,10])==2\nassert div_even_odd([1,5,7,9,10])==10"} {"row": 28, "completion_input": "\"\"\"Write a function to check if the letters of a given string can be rearranged so that two characters that are adjacent to each other are different.\"\"\"\n\ndef rearange_string(", "completion_prefix": "def rearange_string(", "chat_input": [{"role": "user", "content": "Write a function to check if the letters of a given string can be rearranged so that two characters that are adjacent to each other are different.\nThe function should be named `rearange_string`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert rearange_string(\"aab\")==('aba')\nassert rearange_string(\"aabb\")==('abab')\nassert rearange_string(\"abccdd\")==('cdabcd')"} {"row": 29, "completion_input": "\"\"\"Write a function to find frequency of the elements in a given list of lists using collections module.\"\"\"\n\ndef freq_element(", "completion_prefix": "def freq_element(", "chat_input": [{"role": "user", "content": "Write a function to find frequency of the elements in a given list of lists using collections module.\nThe function should be named `freq_element`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert freq_element([[1, 2, 3, 2], [4, 5, 6, 2], [7, 1, 9, 5]])==({2: 3, 1: 2, 5: 2, 3: 1, 4: 1, 6: 1, 7: 1, 9: 1})\nassert freq_element([[1,2,3,4],[5,6,7,8],[9,10,11,12]])==({1: 1, 2: 1, 3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1, 9: 1, 10: 1, 11: 1, 12: 1})\nassert freq_element([[15,20,30,40],[80,90,100,110],[30,30,80,90]])==({30: 3, 80: 2, 90: 2, 15: 1, 20: 1, 40: 1, 100: 1, 110: 1})"} {"row": 30, "completion_input": "\"\"\"Write a function to filter even numbers using lambda function.\"\"\"\n\ndef filter_evennumbers(", "completion_prefix": "def filter_evennumbers(", "chat_input": [{"role": "user", "content": "Write a function to filter even numbers using lambda function.\nThe function should be named `filter_evennumbers`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert filter_evennumbers([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])==[2, 4, 6, 8, 10]\nassert filter_evennumbers([10,20,45,67,84,93])==[10,20,84]\nassert filter_evennumbers([5,7,9,8,6,4,3])==[8,6,4]"} {"row": 31, "completion_input": "\"\"\"Write a python function to find the sum of repeated elements in a given array.\"\"\"\n\ndef find_Sum(", "completion_prefix": "def find_Sum(", "chat_input": [{"role": "user", "content": "Write a python function to find the sum of repeated elements in a given array.\nThe function should be named `find_Sum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_Sum([1,2,3,1,1,4,5,6],8) == 3\nassert find_Sum([1,2,3,1,1],5) == 3\nassert find_Sum([1,1,2],3) == 2"} {"row": 32, "completion_input": "\"\"\"Write a function to find sequences of lowercase letters joined with an underscore using regex.\"\"\"\n\ndef text_match(", "completion_prefix": "def text_match(", "chat_input": [{"role": "user", "content": "Write a function to find sequences of lowercase letters joined with an underscore using regex.\nThe function should be named `text_match`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert text_match(\"aab_cbbbc\") == 'Found a match!'\nassert text_match(\"aab_Abbbc\") == 'Not matched!'\nassert text_match(\"Aaab_abbbc\") == 'Not matched!'"} {"row": 33, "completion_input": "\"\"\"Write a function that matches a word at the beginning of a string.\"\"\"\n\ndef text_match_string(", "completion_prefix": "def text_match_string(", "chat_input": [{"role": "user", "content": "Write a function that matches a word at the beginning of a string.\nThe function should be named `text_match_string`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert text_match_string(\" python\")==('Not matched!')\nassert text_match_string(\"python\")==('Found a match!')\nassert text_match_string(\" lang\")==('Not matched!')"} {"row": 34, "completion_input": "\"\"\"Write a function to find the gcd of the given array elements.\"\"\"\n\ndef get_gcd(", "completion_prefix": "def get_gcd(", "chat_input": [{"role": "user", "content": "Write a function to find the gcd of the given array elements.\nThe function should be named `get_gcd`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert get_gcd([2, 4, 6, 8, 16]) == 2\nassert get_gcd([1, 2, 3]) == 1\nassert get_gcd([2, 4, 6, 8]) == 2 "} {"row": 35, "completion_input": "\"\"\"Write a python function to determine whether all the numbers are different from each other are not.\"\"\"\n\ndef test_distinct(", "completion_prefix": "def test_distinct(", "chat_input": [{"role": "user", "content": "Write a python function to determine whether all the numbers are different from each other are not.\nThe function should be named `test_distinct`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert test_distinct([1,5,7,9]) == True\nassert test_distinct([2,4,5,5,7,9]) == False\nassert test_distinct([1,2,3]) == True"} {"row": 36, "completion_input": "\"\"\"Write a python function to find the last digit when factorial of a divides factorial of b.\"\"\"\n\ndef compute_Last_Digit(", "completion_prefix": "def compute_Last_Digit(", "chat_input": [{"role": "user", "content": "Write a python function to find the last digit when factorial of a divides factorial of b.\nThe function should be named `compute_Last_Digit`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert compute_Last_Digit(2,4) == 2\nassert compute_Last_Digit(6,8) == 6\nassert compute_Last_Digit(1,2) == 2"} {"row": 37, "completion_input": "\"\"\"Write a python function to set all odd bits of a given number.\"\"\"\n\ndef odd_bit_set_number(", "completion_prefix": "def odd_bit_set_number(", "chat_input": [{"role": "user", "content": "Write a python function to set all odd bits of a given number.\nThe function should be named `odd_bit_set_number`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert odd_bit_set_number(10) == 15\nassert odd_bit_set_number(20) == 21\nassert odd_bit_set_number(30) == 31"} {"row": 38, "completion_input": "\"\"\"Write a function to extract every first or specified element from a given two-dimensional list.\"\"\"\n\ndef specified_element(", "completion_prefix": "def specified_element(", "chat_input": [{"role": "user", "content": "Write a function to extract every first or specified element from a given two-dimensional list.\nThe function should be named `specified_element`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert specified_element([[1, 2, 3, 2], [4, 5, 6, 2], [7, 1, 9, 5]],0)==[1, 4, 7]\nassert specified_element([[1, 2, 3, 2], [4, 5, 6, 2], [7, 1, 9, 5]],2)==[3, 6, 9]\nassert specified_element([[1, 2, 3, 2], [4, 5, 6, 2], [7, 1, 9, 5]],1)==[2,5,1]"} {"row": 39, "completion_input": "\"\"\"Write a function to find the list with minimum length using lambda function.\"\"\"\n\ndef min_length_list(", "completion_prefix": "def min_length_list(", "chat_input": [{"role": "user", "content": "Write a function to find the list with minimum length using lambda function.\nThe function should be named `min_length_list`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert min_length_list([[0], [1, 3], [5, 7], [9, 11], [13, 15, 17]])==(1, [0])\nassert min_length_list([[1,2,3,4,5],[1,2,3,4],[1,2,3],[1,2],[1]])==(1,[1])\nassert min_length_list([[3,4,5],[6,7,8,9],[10,11,12],[1,2]])==(2,[1,2])"} {"row": 40, "completion_input": "\"\"\"Write a function to print check if the triangle is equilateral or not.\"\"\"\n\ndef check_equilateral(", "completion_prefix": "def check_equilateral(", "chat_input": [{"role": "user", "content": "Write a function to print check if the triangle is equilateral or not.\nThe function should be named `check_equilateral`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert check_equilateral(6,8,12)==False \nassert check_equilateral(6,6,12)==False\nassert check_equilateral(6,6,6)==True"} {"row": 41, "completion_input": "\"\"\"Write a function to caluclate area of a parallelogram.\"\"\"\n\ndef parallelogram_area(", "completion_prefix": "def parallelogram_area(", "chat_input": [{"role": "user", "content": "Write a function to caluclate area of a parallelogram.\nThe function should be named `parallelogram_area`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert parallelogram_area(10,20)==200\nassert parallelogram_area(15,20)==300\nassert parallelogram_area(8,9)==72"} {"row": 42, "completion_input": "\"\"\"Write a python function to check whether the first and last characters of a given string are equal or not.\"\"\"\n\ndef check_Equality(", "completion_prefix": "def check_Equality(", "chat_input": [{"role": "user", "content": "Write a python function to check whether the first and last characters of a given string are equal or not.\nThe function should be named `check_Equality`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert check_Equality(\"abcda\") == \"Equal\"\nassert check_Equality(\"ab\") == \"Not Equal\"\nassert check_Equality(\"mad\") == \"Not Equal\""} {"row": 43, "completion_input": "\"\"\"Write a function to sort the given array by using counting sort.\"\"\"\n\ndef counting_sort(", "completion_prefix": "def counting_sort(", "chat_input": [{"role": "user", "content": "Write a function to sort the given array by using counting sort.\nThe function should be named `counting_sort`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert counting_sort([1,23,4,5,6,7,8]) == [1, 4, 5, 6, 7, 8, 23]\nassert counting_sort([12, 9, 28, 33, 69, 45]) == [9, 12, 28, 33, 45, 69]\nassert counting_sort([8, 4, 14, 3, 2, 1]) == [1, 2, 3, 4, 8, 14]"} {"row": 44, "completion_input": "\"\"\"Write a function to find t-nth term of geometric series.\"\"\"\n\ndef tn_gp(", "completion_prefix": "def tn_gp(", "chat_input": [{"role": "user", "content": "Write a function to find t-nth term of geometric series.\nThe function should be named `tn_gp`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert tn_gp(1,5,2)==16\nassert tn_gp(1,5,4)==256\nassert tn_gp(2,6,3)==486"} {"row": 45, "completion_input": "\"\"\"Write a python function to check if a given number is one less than twice its reverse.\"\"\"\n\ndef check(", "completion_prefix": "def check(", "chat_input": [{"role": "user", "content": "Write a python function to check if a given number is one less than twice its reverse.\nThe function should be named `check`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert check(70) == False\nassert check(23) == False\nassert check(73) == True"} {"row": 46, "completion_input": "\"\"\"Write a python function to find the largest number that can be formed with the given digits.\"\"\"\n\ndef find_Max_Num(", "completion_prefix": "def find_Max_Num(", "chat_input": [{"role": "user", "content": "Write a python function to find the largest number that can be formed with the given digits.\nThe function should be named `find_Max_Num`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_Max_Num([1,2,3],3) == 321\nassert find_Max_Num([4,5,6,1],4) == 6541\nassert find_Max_Num([1,2,3,9],4) == 9321"} {"row": 47, "completion_input": "\"\"\"Write a python function to check whether the given two integers have opposite sign or not.\"\"\"\n\ndef opposite_Signs(", "completion_prefix": "def opposite_Signs(", "chat_input": [{"role": "user", "content": "Write a python function to check whether the given two integers have opposite sign or not.\nThe function should be named `opposite_Signs`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert opposite_Signs(1,-2) == True\nassert opposite_Signs(3,2) == False\nassert opposite_Signs(-10,-10) == False"} {"row": 48, "completion_input": "\"\"\"Write a function to find the nth octagonal number.\"\"\"\n\ndef is_octagonal(", "completion_prefix": "def is_octagonal(", "chat_input": [{"role": "user", "content": "Write a function to find the nth octagonal number.\nThe function should be named `is_octagonal`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert is_octagonal(5) == 65\nassert is_octagonal(10) == 280\nassert is_octagonal(15) == 645"} {"row": 49, "completion_input": "\"\"\"Write a function to find the maximum length of the subsequence with difference between adjacent elements for the given array.\"\"\"\n\ndef max_len_sub(", "completion_prefix": "def max_len_sub(", "chat_input": [{"role": "user", "content": "Write a function to find the maximum length of the subsequence with difference between adjacent elements for the given array.\nThe function should be named `max_len_sub`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert max_len_sub([2, 5, 6, 3, 7, 6, 5, 8], 8) == 5\nassert max_len_sub([-2, -1, 5, -1, 4, 0, 3], 7) == 4\nassert max_len_sub([9, 11, 13, 15, 18], 5) == 1"} {"row": 50, "completion_input": "\"\"\"Write a python function to count number of substrings with the sum of digits equal to their length.\"\"\"\n\ndef count_Substrings(", "completion_prefix": "def count_Substrings(", "chat_input": [{"role": "user", "content": "Write a python function to count number of substrings with the sum of digits equal to their length.\nThe function should be named `count_Substrings`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_Substrings('112112',6) == 6\nassert count_Substrings('111',3) == 6\nassert count_Substrings('1101112',7) == 12"} {"row": 51, "completion_input": "\"\"\"Write a python function to find smallest number in a list.\"\"\"\n\ndef smallest_num(", "completion_prefix": "def smallest_num(", "chat_input": [{"role": "user", "content": "Write a python function to find smallest number in a list.\nThe function should be named `smallest_num`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert smallest_num([10, 20, 1, 45, 99]) == 1\nassert smallest_num([1, 2, 3]) == 1\nassert smallest_num([45, 46, 50, 60]) == 45"} {"row": 52, "completion_input": "\"\"\"Write a function to find the maximum difference between available pairs in the given tuple list.\"\"\"\n\ndef max_difference(", "completion_prefix": "def max_difference(", "chat_input": [{"role": "user", "content": "Write a function to find the maximum difference between available pairs in the given tuple list.\nThe function should be named `max_difference`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert max_difference([(3, 5), (1, 7), (10, 3), (1, 2)]) == 7\nassert max_difference([(4, 6), (2, 17), (9, 13), (11, 12)]) == 15\nassert max_difference([(12, 35), (21, 27), (13, 23), (41, 22)]) == 23"} {"row": 53, "completion_input": "\"\"\"Write a function to sort a list of tuples using lambda.\"\"\"\n\ndef subject_marks(", "completion_prefix": "def subject_marks(", "chat_input": [{"role": "user", "content": "Write a function to sort a list of tuples using lambda.\nThe function should be named `subject_marks`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert subject_marks([('English', 88), ('Science', 90), ('Maths', 97), ('Social sciences', 82)])==[('Social sciences', 82), ('English', 88), ('Science', 90), ('Maths', 97)]\nassert subject_marks([('Telugu',49),('Hindhi',54),('Social',33)])==([('Social',33),('Telugu',49),('Hindhi',54)])\nassert subject_marks([('Physics',96),('Chemistry',97),('Biology',45)])==([('Biology',45),('Physics',96),('Chemistry',97)])"} {"row": 54, "completion_input": "\"\"\"Write a function of recursion list sum.\"\"\"\n\ndef recursive_list_sum(", "completion_prefix": "def recursive_list_sum(", "chat_input": [{"role": "user", "content": "Write a function of recursion list sum.\nThe function should be named `recursive_list_sum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert recursive_list_sum(([1, 2, [3,4],[5,6]]))==21\nassert recursive_list_sum(([7, 10, [15,14],[19,41]]))==106\nassert recursive_list_sum(([10, 20, [30,40],[50,60]]))==210"} {"row": 55, "completion_input": "\"\"\"Write a python function to count positive numbers in a list.\"\"\"\n\ndef pos_count(", "completion_prefix": "def pos_count(", "chat_input": [{"role": "user", "content": "Write a python function to count positive numbers in a list.\nThe function should be named `pos_count`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert pos_count([1,-2,3,-4]) == 2\nassert pos_count([3,4,5,-1]) == 3\nassert pos_count([1,2,3,4]) == 4"} {"row": 56, "completion_input": "\"\"\"Write a function to find the number of ways to partition a set of bell numbers.\"\"\"\n\ndef bell_number(", "completion_prefix": "def bell_number(", "chat_input": [{"role": "user", "content": "Write a function to find the number of ways to partition a set of bell numbers.\nThe function should be named `bell_number`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert bell_number(2)==2\nassert bell_number(10)==115975\nassert bell_number(56)==6775685320645824322581483068371419745979053216268760300"} {"row": 57, "completion_input": "\"\"\"Write a python function to check whether the given array is monotonic or not.\"\"\"\n\ndef is_Monotonic(", "completion_prefix": "def is_Monotonic(", "chat_input": [{"role": "user", "content": "Write a python function to check whether the given array is monotonic or not.\nThe function should be named `is_Monotonic`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert is_Monotonic([6, 5, 4, 4]) == True\nassert is_Monotonic([1, 2, 2, 3]) == True\nassert is_Monotonic([1, 3, 2]) == False"} {"row": 58, "completion_input": "\"\"\"Write a function to check whether a list contains the given sublist or not.\"\"\"\n\ndef is_sublist(", "completion_prefix": "def is_sublist(", "chat_input": [{"role": "user", "content": "Write a function to check whether a list contains the given sublist or not.\nThe function should be named `is_sublist`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert is_sublist([2,4,3,5,7],[3,7])==False\nassert is_sublist([2,4,3,5,7],[4,3])==True\nassert is_sublist([2,4,3,5,7],[1,6])==False"} {"row": 59, "completion_input": "\"\"\"Write a function to find whether all the given tuples have equal length or not.\"\"\"\n\ndef get_equal(", "completion_prefix": "def get_equal(", "chat_input": [{"role": "user", "content": "Write a function to find whether all the given tuples have equal length or not.\nThe function should be named `get_equal`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert get_equal([(11, 22, 33), (44, 55, 66)], 3) == 'All tuples have same length'\nassert get_equal([(1, 2, 3), (4, 5, 6, 7)], 3) == 'All tuples do not have same length'\nassert get_equal([(1, 2), (3, 4)], 2) == 'All tuples have same length'"} {"row": 60, "completion_input": "\"\"\"Write a function to sort a list of elements using comb sort.\"\"\"\n\ndef comb_sort(", "completion_prefix": "def comb_sort(", "chat_input": [{"role": "user", "content": "Write a function to sort a list of elements using comb sort.\nThe function should be named `comb_sort`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert comb_sort([5, 15, 37, 25, 79]) == [5, 15, 25, 37, 79]\nassert comb_sort([41, 32, 15, 19, 22]) == [15, 19, 22, 32, 41]\nassert comb_sort([99, 15, 13, 47]) == [13, 15, 47, 99]"} {"row": 61, "completion_input": "\"\"\"Write a python function to check whether the given number can be represented as difference of two squares or not.\"\"\"\n\ndef dif_Square(", "completion_prefix": "def dif_Square(", "chat_input": [{"role": "user", "content": "Write a python function to check whether the given number can be represented as difference of two squares or not.\nThe function should be named `dif_Square`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert dif_Square(5) == True\nassert dif_Square(10) == False\nassert dif_Square(15) == True"} {"row": 62, "completion_input": "\"\"\"Write a function to split the given string with multiple delimiters by using regex.\"\"\"\n\ndef multiple_split(", "completion_prefix": "def multiple_split(", "chat_input": [{"role": "user", "content": "Write a function to split the given string with multiple delimiters by using regex.\nThe function should be named `multiple_split`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert multiple_split('Forces of the \\ndarkness*are coming into the play.') == ['Forces of the ', 'darkness', 'are coming into the play.']\nassert multiple_split('Mi Box runs on the \\n Latest android*which has google assistance and chromecast.') == ['Mi Box runs on the ', ' Latest android', 'which has google assistance and chromecast.']\nassert multiple_split('Certain services\\nare subjected to change*over the seperate subscriptions.') == ['Certain services', 'are subjected to change', 'over the seperate subscriptions.']"} {"row": 63, "completion_input": "\"\"\"Write a function to check whether it follows the sequence given in the patterns array.\"\"\"\n\ndef is_samepatterns(", "completion_prefix": "def is_samepatterns(", "chat_input": [{"role": "user", "content": "Write a function to check whether it follows the sequence given in the patterns array.\nThe function should be named `is_samepatterns`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert is_samepatterns([\"red\",\"green\",\"green\"], [\"a\", \"b\", \"b\"])==True \nassert is_samepatterns([\"red\",\"green\",\"greenn\"], [\"a\",\"b\",\"b\"])==False \nassert is_samepatterns([\"red\",\"green\",\"greenn\"], [\"a\",\"b\"])==False "} {"row": 64, "completion_input": "\"\"\"Write a function to find tuples which have all elements divisible by k from the given list of tuples.\"\"\"\n\ndef find_tuples(", "completion_prefix": "def find_tuples(", "chat_input": [{"role": "user", "content": "Write a function to find tuples which have all elements divisible by k from the given list of tuples.\nThe function should be named `find_tuples`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_tuples([(6, 24, 12), (7, 9, 6), (12, 18, 21)], 6) == '[(6, 24, 12)]'\nassert find_tuples([(5, 25, 30), (4, 2, 3), (7, 8, 9)], 5) == '[(5, 25, 30)]'\nassert find_tuples([(7, 9, 16), (8, 16, 4), (19, 17, 18)], 4) == '[(8, 16, 4)]'"} {"row": 65, "completion_input": "\"\"\"Write a python function to count the number of squares in a rectangle.\"\"\"\n\ndef count_Squares(", "completion_prefix": "def count_Squares(", "chat_input": [{"role": "user", "content": "Write a python function to count the number of squares in a rectangle.\nThe function should be named `count_Squares`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_Squares(4,3) == 20\nassert count_Squares(2,2) == 5\nassert count_Squares(1,1) == 1"} {"row": 66, "completion_input": "\"\"\"Write a python function to find the difference between sum of even and odd digits.\"\"\"\n\ndef is_Diff(", "completion_prefix": "def is_Diff(", "chat_input": [{"role": "user", "content": "Write a python function to find the difference between sum of even and odd digits.\nThe function should be named `is_Diff`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert is_Diff (12345) == False\nassert is_Diff(1212112) == True\nassert is_Diff(1212) == False"} {"row": 67, "completion_input": "\"\"\"Write a python function to find number of integers with odd number of set bits.\"\"\"\n\ndef count_With_Odd_SetBits(", "completion_prefix": "def count_With_Odd_SetBits(", "chat_input": [{"role": "user", "content": "Write a python function to find number of integers with odd number of set bits.\nThe function should be named `count_With_Odd_SetBits`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_With_Odd_SetBits(5) == 3\nassert count_With_Odd_SetBits(10) == 5\nassert count_With_Odd_SetBits(15) == 8"} {"row": 68, "completion_input": "\"\"\"Write a python function to check whether the length of the word is odd or not.\"\"\"\n\ndef word_len(", "completion_prefix": "def word_len(", "chat_input": [{"role": "user", "content": "Write a python function to check whether the length of the word is odd or not.\nThe function should be named `word_len`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert word_len(\"Hadoop\") == False\nassert word_len(\"great\") == True\nassert word_len(\"structure\") == True"} {"row": 69, "completion_input": "\"\"\"Write a function to find the nth tetrahedral number.\"\"\"\n\ndef tetrahedral_number(", "completion_prefix": "def tetrahedral_number(", "chat_input": [{"role": "user", "content": "Write a function to find the nth tetrahedral number.\nThe function should be named `tetrahedral_number`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert tetrahedral_number(5) == 35.0\nassert tetrahedral_number(6) == 56.0\nassert tetrahedral_number(7) == 84.0"} {"row": 70, "completion_input": "\"\"\"Write a function to zip the two given tuples.\"\"\"\n\ndef zip_tuples(", "completion_prefix": "def zip_tuples(", "chat_input": [{"role": "user", "content": "Write a function to zip the two given tuples.\nThe function should be named `zip_tuples`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert zip_tuples((7, 8, 4, 5, 9, 10),(1, 5, 6) ) == [(7, 1), (8, 5), (4, 6), (5, 1), (9, 5), (10, 6)]\nassert zip_tuples((8, 9, 5, 6, 10, 11),(2, 6, 7) ) == [(8, 2), (9, 6), (5, 7), (6, 2), (10, 6), (11, 7)]\nassert zip_tuples((9, 10, 6, 7, 11, 12),(3, 7, 8) ) == [(9, 3), (10, 7), (6, 8), (7, 3), (11, 7), (12, 8)]"} {"row": 71, "completion_input": "\"\"\"Write a function to find the volume of a sphere.\"\"\"\n\ndef volume_sphere(", "completion_prefix": "def volume_sphere(", "chat_input": [{"role": "user", "content": "Write a function to find the volume of a sphere.\nThe function should be named `volume_sphere`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert volume_sphere(10)==4188.790204786391\nassert volume_sphere(25)==65449.84694978735\nassert volume_sphere(20)==33510.32163829113"} {"row": 72, "completion_input": "\"\"\"Write a python function to find the character made by adding all the characters of the given string.\"\"\"\n\ndef get_Char(", "completion_prefix": "def get_Char(", "chat_input": [{"role": "user", "content": "Write a python function to find the character made by adding all the characters of the given string.\nThe function should be named `get_Char`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert get_Char(\"abc\") == \"f\"\nassert get_Char(\"gfg\") == \"t\"\nassert get_Char(\"ab\") == \"c\""} {"row": 73, "completion_input": "\"\"\"Write a function to find the n-th number in newman conway sequence.\"\"\"\n\ndef sequence(", "completion_prefix": "def sequence(", "chat_input": [{"role": "user", "content": "Write a function to find the n-th number in newman conway sequence.\nThe function should be named `sequence`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert sequence(10) == 6\nassert sequence(2) == 1\nassert sequence(3) == 2"} {"row": 74, "completion_input": "\"\"\"Write a function to find the surface area of a sphere.\"\"\"\n\ndef surfacearea_sphere(", "completion_prefix": "def surfacearea_sphere(", "chat_input": [{"role": "user", "content": "Write a function to find the surface area of a sphere.\nThe function should be named `surfacearea_sphere`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert surfacearea_sphere(10)==1256.6370614359173\nassert surfacearea_sphere(15)==2827.4333882308138\nassert surfacearea_sphere(20)==5026.548245743669"} {"row": 75, "completion_input": "\"\"\"Write a function to find nth centered hexagonal number.\"\"\"\n\ndef centered_hexagonal_number(", "completion_prefix": "def centered_hexagonal_number(", "chat_input": [{"role": "user", "content": "Write a function to find nth centered hexagonal number.\nThe function should be named `centered_hexagonal_number`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert centered_hexagonal_number(10) == 271\nassert centered_hexagonal_number(2) == 7\nassert centered_hexagonal_number(9) == 217"} {"row": 76, "completion_input": "\"\"\"Write a function to merge three dictionaries into a single expression.\"\"\"\n\ndef merge_dictionaries_three(", "completion_prefix": "def merge_dictionaries_three(", "chat_input": [{"role": "user", "content": "Write a function to merge three dictionaries into a single expression.\nThe function should be named `merge_dictionaries_three`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert merge_dictionaries_three({ \"R\": \"Red\", \"B\": \"Black\", \"P\": \"Pink\" }, { \"G\": \"Green\", \"W\": \"White\" },{ \"O\": \"Orange\", \"W\": \"White\", \"B\": \"Black\" })=={'B': 'Black', 'R': 'Red', 'P': 'Pink', 'G': 'Green', 'W': 'White', 'O': 'Orange'}\nassert merge_dictionaries_three({ \"R\": \"Red\", \"B\": \"Black\", \"P\": \"Pink\" }, { \"G\": \"Green\", \"W\": \"White\" },{\"L\":\"lavender\",\"B\":\"Blue\"})=={'W': 'White', 'P': 'Pink', 'B': 'Black', 'R': 'Red', 'G': 'Green', 'L': 'lavender'}\nassert merge_dictionaries_three({ \"R\": \"Red\", \"B\": \"Black\", \"P\": \"Pink\" },{\"L\":\"lavender\",\"B\":\"Blue\"},{ \"G\": \"Green\", \"W\": \"White\" })=={'B': 'Black', 'P': 'Pink', 'R': 'Red', 'G': 'Green', 'L': 'lavender', 'W': 'White'}"} {"row": 77, "completion_input": "\"\"\"Write a function to get the frequency of the elements in a list.\"\"\"\n\ndef freq_count(", "completion_prefix": "def freq_count(", "chat_input": [{"role": "user", "content": "Write a function to get the frequency of the elements in a list.\nThe function should be named `freq_count`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert freq_count([10,10,10,10,20,20,20,20,40,40,50,50,30])==({10: 4, 20: 4, 40: 2, 50: 2, 30: 1}) \nassert freq_count([1,2,3,4,3,2,4,1,3,1,4])==({1:3, 2:2,3:3,4:3}) \nassert freq_count([5,6,7,4,9,10,4,5,6,7,9,5])==({10:1,5:3,6:2,7:2,4:2,9:2}) "} {"row": 78, "completion_input": "\"\"\"Write a function to find the closest smaller number than n.\"\"\"\n\ndef closest_num(", "completion_prefix": "def closest_num(", "chat_input": [{"role": "user", "content": "Write a function to find the closest smaller number than n.\nThe function should be named `closest_num`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert closest_num(11) == 10\nassert closest_num(7) == 6\nassert closest_num(12) == 11"} {"row": 79, "completion_input": "\"\"\"Write a python function to find the length of the longest word.\"\"\"\n\ndef len_log(", "completion_prefix": "def len_log(", "chat_input": [{"role": "user", "content": "Write a python function to find the length of the longest word.\nThe function should be named `len_log`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert len_log([\"python\",\"PHP\",\"bigdata\"]) == 7\nassert len_log([\"a\",\"ab\",\"abc\"]) == 3\nassert len_log([\"small\",\"big\",\"tall\"]) == 5"} {"row": 80, "completion_input": "\"\"\"Write a function to check if a substring is present in a given list of string values.\"\"\"\n\ndef find_substring(", "completion_prefix": "def find_substring(", "chat_input": [{"role": "user", "content": "Write a function to check if a substring is present in a given list of string values.\nThe function should be named `find_substring`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_substring([\"red\", \"black\", \"white\", \"green\", \"orange\"],\"ack\")==True\nassert find_substring([\"red\", \"black\", \"white\", \"green\", \"orange\"],\"abc\")==False\nassert find_substring([\"red\", \"black\", \"white\", \"green\", \"orange\"],\"ange\")==True"} {"row": 81, "completion_input": "\"\"\"Write a function to check whether the given number is undulating or not.\"\"\"\n\ndef is_undulating(", "completion_prefix": "def is_undulating(", "chat_input": [{"role": "user", "content": "Write a function to check whether the given number is undulating or not.\nThe function should be named `is_undulating`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert is_undulating(\"1212121\") == True\nassert is_undulating(\"1991\") == False\nassert is_undulating(\"121\") == True"} {"row": 82, "completion_input": "\"\"\"Write a function to calculate the value of 'a' to the power 'b'.\"\"\"\n\ndef power(", "completion_prefix": "def power(", "chat_input": [{"role": "user", "content": "Write a function to calculate the value of 'a' to the power 'b'.\nThe function should be named `power`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert power(3,4) == 81\nassert power(2,3) == 8\nassert power(5,5) == 3125"} {"row": 83, "completion_input": "\"\"\"Write a function to extract the index minimum value record from the given tuples.\"\"\"\n\ndef index_minimum(", "completion_prefix": "def index_minimum(", "chat_input": [{"role": "user", "content": "Write a function to extract the index minimum value record from the given tuples.\nThe function should be named `index_minimum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert index_minimum([('Rash', 143), ('Manjeet', 200), ('Varsha', 100)]) == 'Varsha'\nassert index_minimum([('Yash', 185), ('Dawood', 125), ('Sanya', 175)]) == 'Dawood'\nassert index_minimum([('Sai', 345), ('Salman', 145), ('Ayesha', 96)]) == 'Ayesha'"} {"row": 84, "completion_input": "\"\"\"Write a python function to find the minimum length of sublist.\"\"\"\n\ndef Find_Min_Length(", "completion_prefix": "def Find_Min_Length(", "chat_input": [{"role": "user", "content": "Write a python function to find the minimum length of sublist.\nThe function should be named `Find_Min_Length`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert Find_Min_Length([[1],[1,2]]) == 1\nassert Find_Min_Length([[1,2],[1,2,3],[1,2,3,4]]) == 2\nassert Find_Min_Length([[3,3,3],[4,4,4,4]]) == 3"} {"row": 85, "completion_input": "\"\"\"Write a python function to find the number of divisors of a given integer.\"\"\"\n\ndef divisor(", "completion_prefix": "def divisor(", "chat_input": [{"role": "user", "content": "Write a python function to find the number of divisors of a given integer.\nThe function should be named `divisor`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert divisor(15) == 4 \nassert divisor(12) == 6\nassert divisor(9) == 3"} {"row": 86, "completion_input": "\"\"\"Write a function to find frequency count of list of lists.\"\"\"\n\ndef frequency_lists(", "completion_prefix": "def frequency_lists(", "chat_input": [{"role": "user", "content": "Write a function to find frequency count of list of lists.\nThe function should be named `frequency_lists`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert frequency_lists([[1, 2, 3, 2], [4, 5, 6, 2], [7, 8, 9, 5]])=={1: 1, 2: 3, 3: 1, 4: 1, 5: 2, 6: 1, 7: 1, 8: 1, 9: 1}\nassert frequency_lists([[1,2,3,4],[5,6,7,8],[9,10,11,12]])=={1: 1, 2: 1, 3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1, 9: 1,10:1,11:1,12:1}\nassert frequency_lists([[20,30,40,17],[18,16,14,13],[10,20,30,40]])=={20:2,30:2,40:2,17: 1,18:1, 16: 1,14: 1,13: 1, 10: 1}"} {"row": 87, "completion_input": "\"\"\"Write a function to multiply all the numbers in a list and divide with the length of the list.\"\"\"\n\ndef multiply_num(", "completion_prefix": "def multiply_num(", "chat_input": [{"role": "user", "content": "Write a function to multiply all the numbers in a list and divide with the length of the list.\nThe function should be named `multiply_num`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert multiply_num((8, 2, 3, -1, 7))==-67.2\nassert multiply_num((-10,-20,-30))==-2000.0\nassert multiply_num((19,15,18))==1710.0"} {"row": 88, "completion_input": "\"\"\"Write a function to convert the given decimal number to its binary equivalent.\"\"\"\n\ndef decimal_to_binary(", "completion_prefix": "def decimal_to_binary(", "chat_input": [{"role": "user", "content": "Write a function to convert the given decimal number to its binary equivalent.\nThe function should be named `decimal_to_binary`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert decimal_to_binary(8) == '1000'\nassert decimal_to_binary(18) == '10010'\nassert decimal_to_binary(7) == '111' "} {"row": 89, "completion_input": "\"\"\"Write a function to find the next smallest palindrome of a specified number.\"\"\"\n\ndef next_smallest_palindrome(", "completion_prefix": "def next_smallest_palindrome(", "chat_input": [{"role": "user", "content": "Write a function to find the next smallest palindrome of a specified number.\nThe function should be named `next_smallest_palindrome`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert next_smallest_palindrome(99)==101\nassert next_smallest_palindrome(1221)==1331\nassert next_smallest_palindrome(120)==121"} {"row": 90, "completion_input": "\"\"\"Write a function to find the kth element in the given array.\"\"\"\n\ndef kth_element(", "completion_prefix": "def kth_element(", "chat_input": [{"role": "user", "content": "Write a function to find the kth element in the given array.\nThe function should be named `kth_element`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert kth_element([12,3,5,7,19], 5, 2) == 3\nassert kth_element([17,24,8,23], 4, 3) == 8\nassert kth_element([16,21,25,36,4], 5, 4) == 36"} {"row": 91, "completion_input": "\"\"\"Write a function to convert snake case string to camel case string.\"\"\"\n\ndef snake_to_camel(", "completion_prefix": "def snake_to_camel(", "chat_input": [{"role": "user", "content": "Write a function to convert snake case string to camel case string.\nThe function should be named `snake_to_camel`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert snake_to_camel('python_program')=='PythonProgram'\nassert snake_to_camel('python_language')==('PythonLanguage')\nassert snake_to_camel('programming_language')==('ProgrammingLanguage')"} {"row": 92, "completion_input": "\"\"\"Write a function to find eulerian number a(n, m).\"\"\"\n\ndef eulerian_num(", "completion_prefix": "def eulerian_num(", "chat_input": [{"role": "user", "content": "Write a function to find eulerian number a(n, m).\nThe function should be named `eulerian_num`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert eulerian_num(3, 1) == 4\nassert eulerian_num(4, 1) == 11\nassert eulerian_num(5, 3) == 26"} {"row": 93, "completion_input": "\"\"\"Write a function to sort each sublist of strings in a given list of lists using lambda function.\"\"\"\n\ndef sort_sublists(", "completion_prefix": "def sort_sublists(", "chat_input": [{"role": "user", "content": "Write a function to sort each sublist of strings in a given list of lists using lambda function.\nThe function should be named `sort_sublists`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert sort_sublists(([\"green\", \"orange\"], [\"black\", \"white\"], [\"white\", \"black\", \"orange\"]))==[['green', 'orange'], ['black', 'white'], ['black', 'orange', 'white']]\nassert sort_sublists(([\" red \",\"green\" ],[\"blue \",\" black\"],[\" orange\",\"brown\"]))==[[' red ', 'green'], [' black', 'blue '], [' orange', 'brown']]\nassert sort_sublists(([\"zilver\",\"gold\"], [\"magnesium\",\"aluminium\"], [\"steel\", \"bronze\"]))==[['gold', 'zilver'],['aluminium', 'magnesium'], ['bronze', 'steel']]"} {"row": 94, "completion_input": "\"\"\"Write a python function to count true booleans in the given list.\"\"\"\n\ndef count(", "completion_prefix": "def count(", "chat_input": [{"role": "user", "content": "Write a python function to count true booleans in the given list.\nThe function should be named `count`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count([True,False,True]) == 2\nassert count([False,False]) == 0\nassert count([True,True,True]) == 3"} {"row": 95, "completion_input": "\"\"\"Write a function to add the given list to the given tuples.\"\"\"\n\ndef add_lists(", "completion_prefix": "def add_lists(", "chat_input": [{"role": "user", "content": "Write a function to add the given list to the given tuples.\nThe function should be named `add_lists`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert add_lists([5, 6, 7], (9, 10)) == (9, 10, 5, 6, 7)\nassert add_lists([6, 7, 8], (10, 11)) == (10, 11, 6, 7, 8)\nassert add_lists([7, 8, 9], (11, 12)) == (11, 12, 7, 8, 9)"} {"row": 96, "completion_input": "\"\"\"Write a python function to count hexadecimal numbers for a given range.\"\"\"\n\ndef count_Hexadecimal(", "completion_prefix": "def count_Hexadecimal(", "chat_input": [{"role": "user", "content": "Write a python function to count hexadecimal numbers for a given range.\nThe function should be named `count_Hexadecimal`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_Hexadecimal(10,15) == 6\nassert count_Hexadecimal(2,4) == 0\nassert count_Hexadecimal(15,16) == 1"} {"row": 97, "completion_input": "\"\"\"Write a function to merge multiple sorted inputs into a single sorted iterator using heap queue algorithm.\"\"\"\n\ndef merge_sorted_list(", "completion_prefix": "def merge_sorted_list(", "chat_input": [{"role": "user", "content": "Write a function to merge multiple sorted inputs into a single sorted iterator using heap queue algorithm.\nThe function should be named `merge_sorted_list`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert merge_sorted_list([25, 24, 15, 4, 5, 29, 110],[19, 20, 11, 56, 25, 233, 154],[24, 26, 54, 48])==[4, 5, 11, 15, 19, 20, 24, 24, 25, 25, 26, 29, 48, 54, 56, 110, 154, 233]\nassert merge_sorted_list([1, 3, 5, 6, 8, 9], [2, 5, 7, 11], [1, 4, 7, 8, 12])==[1, 1, 2, 3, 4, 5, 5, 6, 7, 7, 8, 8, 9, 11, 12]\nassert merge_sorted_list([18, 14, 10, 9, 8, 7, 9, 3, 2, 4, 1],[25, 35, 22, 85, 14, 65, 75, 25, 58],[12, 74, 9, 50, 61, 41])==[1, 2, 3, 4, 7, 8, 9, 9, 9, 10, 12, 14, 14, 18, 22, 25, 25, 35, 41, 50, 58, 61, 65, 74, 75, 85]"} {"row": 98, "completion_input": "\"\"\"Write a python function to find the count of rotations of a binary string with odd value.\"\"\"\n\ndef odd_Equivalent(", "completion_prefix": "def odd_Equivalent(", "chat_input": [{"role": "user", "content": "Write a python function to find the count of rotations of a binary string with odd value.\nThe function should be named `odd_Equivalent`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert odd_Equivalent(\"011001\",6) == 3\nassert odd_Equivalent(\"11011\",5) == 4\nassert odd_Equivalent(\"1010\",4) == 2"} {"row": 99, "completion_input": "\"\"\"Write a function to extract the ranges that are missing from the given list with the given start range and end range values.\"\"\"\n\ndef extract_missing(", "completion_prefix": "def extract_missing(", "chat_input": [{"role": "user", "content": "Write a function to extract the ranges that are missing from the given list with the given start range and end range values.\nThe function should be named `extract_missing`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert extract_missing([(6, 9), (15, 34), (48, 70)], 2, 100) == [(2, 6), (9, 100), (9, 15), (34, 100), (34, 48), (70, 100)]\nassert extract_missing([(7, 2), (15, 19), (38, 50)], 5, 60) == [(5, 7), (2, 60), (2, 15), (19, 60), (19, 38), (50, 60)]\nassert extract_missing([(7, 2), (15, 19), (38, 50)], 1, 52) == [(1, 7), (2, 52), (2, 15), (19, 52), (19, 38), (50, 52)]"} {"row": 100, "completion_input": "\"\"\"Write a function to find common elements in given nested lists. * list item * list item * list item * list item\"\"\"\n\ndef common_in_nested_lists(", "completion_prefix": "def common_in_nested_lists(", "chat_input": [{"role": "user", "content": "Write a function to find common elements in given nested lists. * list item * list item * list item * list item\nThe function should be named `common_in_nested_lists`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert common_in_nested_lists([[12, 18, 23, 25, 45], [7, 12, 18, 24, 28], [1, 5, 8, 12, 15, 16, 18]])==[18, 12]\nassert common_in_nested_lists([[12, 5, 23, 25, 45], [7, 11, 5, 23, 28], [1, 5, 8, 18, 23, 16]])==[5,23]\nassert common_in_nested_lists([[2, 3,4, 1], [4, 5], [6,4, 8],[4, 5], [6, 8,4]])==[4]"} {"row": 101, "completion_input": "\"\"\"Write a python function to find the perimeter of a cylinder.\"\"\"\n\ndef perimeter(", "completion_prefix": "def perimeter(", "chat_input": [{"role": "user", "content": "Write a python function to find the perimeter of a cylinder.\nThe function should be named `perimeter`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert perimeter(2,4) == 12\nassert perimeter(1,2) == 6\nassert perimeter(3,1) == 8"} {"row": 102, "completion_input": "\"\"\"Write a function to check if a string represents an integer or not.\"\"\"\n\ndef check_integer(", "completion_prefix": "def check_integer(", "chat_input": [{"role": "user", "content": "Write a function to check if a string represents an integer or not.\nThe function should be named `check_integer`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert check_integer(\"python\")==False\nassert check_integer(\"1\")==True\nassert check_integer(\"12345\")==True"} {"row": 103, "completion_input": "\"\"\"Write a function to assign frequency to each tuple in the given tuple list.\"\"\"\n\ndef assign_freq(", "completion_prefix": "def assign_freq(", "chat_input": [{"role": "user", "content": "Write a function to assign frequency to each tuple in the given tuple list.\nThe function should be named `assign_freq`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert assign_freq([(6, 5, 8), (2, 7), (6, 5, 8), (6, 5, 8), (9, ), (2, 7)] ) == '[(6, 5, 8, 3), (2, 7, 2), (9, 1)]'\nassert assign_freq([(4, 2, 4), (7, 1), (4, 8), (4, 2, 4), (9, 2), (7, 1)] ) == '[(4, 2, 4, 2), (7, 1, 2), (4, 8, 1), (9, 2, 1)]'\nassert assign_freq([(11, 13, 10), (17, 21), (4, 2, 3), (17, 21), (9, 2), (4, 2, 3)] ) == '[(11, 13, 10, 1), (17, 21, 2), (4, 2, 3, 2), (9, 2, 1)]'"} {"row": 104, "completion_input": "\"\"\"Write a function to check whether all dictionaries in a list are empty or not.\"\"\"\n\ndef empty_dit(", "completion_prefix": "def empty_dit(", "chat_input": [{"role": "user", "content": "Write a function to check whether all dictionaries in a list are empty or not.\nThe function should be named `empty_dit`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert empty_dit([{},{},{}])==True\nassert empty_dit([{1,2},{},{}])==False\nassert empty_dit({})==True"} {"row": 105, "completion_input": "\"\"\"Write a function to convert a given tuple of positive integers into an integer.\"\"\"\n\ndef tuple_to_int(", "completion_prefix": "def tuple_to_int(", "chat_input": [{"role": "user", "content": "Write a function to convert a given tuple of positive integers into an integer.\nThe function should be named `tuple_to_int`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert tuple_to_int((1,2,3))==123\nassert tuple_to_int((4,5,6))==456\nassert tuple_to_int((5,6,7))==567"} {"row": 106, "completion_input": "\"\"\"Write a function to convert all possible convertible elements in the list to float.\"\"\"\n\ndef list_to_float(", "completion_prefix": "def list_to_float(", "chat_input": [{"role": "user", "content": "Write a function to convert all possible convertible elements in the list to float.\nThe function should be named `list_to_float`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert list_to_float( [(\"3\", \"4\"), (\"1\", \"26.45\"), (\"7.32\", \"8\"), (\"4\", \"8\")] ) == '[(3.0, 4.0), (1.0, 26.45), (7.32, 8.0), (4.0, 8.0)]'\nassert list_to_float( [(\"4\", \"4\"), (\"2\", \"27\"), (\"4.12\", \"9\"), (\"7\", \"11\")] ) == '[(4.0, 4.0), (2.0, 27.0), (4.12, 9.0), (7.0, 11.0)]'\nassert list_to_float( [(\"6\", \"78\"), (\"5\", \"26.45\"), (\"1.33\", \"4\"), (\"82\", \"13\")] ) == '[(6.0, 78.0), (5.0, 26.45), (1.33, 4.0), (82.0, 13.0)]'"} {"row": 107, "completion_input": "\"\"\"[link text](https:// [link text](https:// [link text](https://)))write a function to convert a string to a list.\"\"\"\n\ndef string_to_list(", "completion_prefix": "def string_to_list(", "chat_input": [{"role": "user", "content": "[link text](https:// [link text](https:// [link text](https://)))write a function to convert a string to a list.\nThe function should be named `string_to_list`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert string_to_list(\"python programming\")==['python','programming']\nassert string_to_list(\"lists tuples strings\")==['lists','tuples','strings']\nassert string_to_list(\"write a program\")==['write','a','program']"} {"row": 108, "completion_input": "\"\"\"Write a python function to find the element that appears only once in a sorted array.\"\"\"\n\ndef search(", "completion_prefix": "def search(", "chat_input": [{"role": "user", "content": "Write a python function to find the element that appears only once in a sorted array.\nThe function should be named `search`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert search([1,1,2,2,3],5) == 3\nassert search([1,1,3,3,4,4,5,5,7,7,8],11) == 8\nassert search([1,2,2,3,3,4,4],7) == 1"} {"row": 109, "completion_input": "\"\"\"Write a function to find the maximum product from the pairs of tuples within a given list.\"\"\"\n\ndef max_product_tuple(", "completion_prefix": "def max_product_tuple(", "chat_input": [{"role": "user", "content": "Write a function to find the maximum product from the pairs of tuples within a given list.\nThe function should be named `max_product_tuple`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert max_product_tuple([(2, 7), (2, 6), (1, 8), (4, 9)] )==36\nassert max_product_tuple([(10,20), (15,2), (5,10)] )==200\nassert max_product_tuple([(11,44), (10,15), (20,5), (12, 9)] )==484"} {"row": 110, "completion_input": "\"\"\"Write a function to find the triplet with sum of the given array\"\"\"\n\ndef check_triplet(", "completion_prefix": "def check_triplet(", "chat_input": [{"role": "user", "content": "Write a function to find the triplet with sum of the given array\nThe function should be named `check_triplet`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert check_triplet([2, 7, 4, 0, 9, 5, 1, 3], 8, 6, 0) == True\nassert check_triplet([1, 4, 5, 6, 7, 8, 5, 9], 8, 6, 0) == False\nassert check_triplet([10, 4, 2, 3, 5], 5, 15, 0) == True"} {"row": 111, "completion_input": "\"\"\"Write a function to find n’th smart number.\"\"\"\n\ndef smartNumber(", "completion_prefix": "def smartNumber(", "chat_input": [{"role": "user", "content": "Write a function to find n’th smart number.\nThe function should be named `smartNumber`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert smartNumber(1) == 30\nassert smartNumber(50) == 273\nassert smartNumber(1000) == 2664"} {"row": 112, "completion_input": "\"\"\"Write a function to sum all amicable numbers from 1 to a specified number.\"\"\"\n\ndef amicable_numbers_sum(", "completion_prefix": "def amicable_numbers_sum(", "chat_input": [{"role": "user", "content": "Write a function to sum all amicable numbers from 1 to a specified number.\nThe function should be named `amicable_numbers_sum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert amicable_numbers_sum(999)==504\nassert amicable_numbers_sum(9999)==31626\nassert amicable_numbers_sum(99)==0"} {"row": 113, "completion_input": "\"\"\"Write a function to get the angle of a complex number.\"\"\"\n\ndef angle_complex(", "completion_prefix": "def angle_complex(", "chat_input": [{"role": "user", "content": "Write a function to get the angle of a complex number.\nThe function should be named `angle_complex`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert angle_complex(0,1j)==1.5707963267948966 \nassert angle_complex(2,1j)==0.4636476090008061\nassert angle_complex(0,2j)==1.5707963267948966"} {"row": 114, "completion_input": "\"\"\"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.\"\"\"\n\ndef find_length(", "completion_prefix": "def find_length(", "chat_input": [{"role": "user", "content": "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.\nThe function should be named `find_length`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_length(\"11000010001\", 11) == 6\nassert find_length(\"10111\", 5) == 1\nassert find_length(\"11011101100101\", 14) == 2 "} {"row": 115, "completion_input": "\"\"\"Write a python function to find the sum of common divisors of two given numbers.\"\"\"\n\ndef sum(", "completion_prefix": "def sum(", "chat_input": [{"role": "user", "content": "Write a python function to find the sum of common divisors of two given numbers.\nThe function should be named `sum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert sum(10,15) == 6\nassert sum(100,150) == 93\nassert sum(4,6) == 3"} {"row": 116, "completion_input": "\"\"\"Write a function to multiply two integers without using the * operator in python.\"\"\"\n\ndef multiply_int(", "completion_prefix": "def multiply_int(", "chat_input": [{"role": "user", "content": "Write a function to multiply two integers without using the * operator in python.\nThe function should be named `multiply_int`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert multiply_int(10,20)==200\nassert multiply_int(5,10)==50\nassert multiply_int(4,8)==32"} {"row": 117, "completion_input": "\"\"\"Write a function to shortlist words that are longer than n from a given list of words.\"\"\"\n\ndef long_words(", "completion_prefix": "def long_words(", "chat_input": [{"role": "user", "content": "Write a function to shortlist words that are longer than n from a given list of words.\nThe function should be named `long_words`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert long_words(3,\"python is a programming language\")==['python','programming','language']\nassert long_words(2,\"writing a program\")==['writing','program']\nassert long_words(5,\"sorting list\")==['sorting']"} {"row": 118, "completion_input": "\"\"\"Write a function to calculate magic square.\"\"\"\n\ndef magic_square_test(", "completion_prefix": "def magic_square_test(", "chat_input": [{"role": "user", "content": "Write a function to calculate magic square.\nThe function should be named `magic_square_test`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert magic_square_test([[7, 12, 1, 14], [2, 13, 8, 11], [16, 3, 10, 5], [9, 6, 15, 4]])==True\nassert magic_square_test([[2, 7, 6], [9, 5, 1], [4, 3, 8]])==True\nassert magic_square_test([[2, 7, 6], [9, 5, 1], [4, 3, 7]])==False"} {"row": 119, "completion_input": "\"\"\"Write a function to find the item with maximum frequency in a given list.\"\"\"\n\ndef max_occurrences(", "completion_prefix": "def max_occurrences(", "chat_input": [{"role": "user", "content": "Write a function to find the item with maximum frequency in a given list.\nThe function should be named `max_occurrences`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert max_occurrences([2,3,8,4,7,9,8,2,6,5,1,6,1,2,3,2,4,6,9,1,2])==(2, 5)\nassert max_occurrences([2,3,8,4,7,9,8,7,9,15,14,10,12,13,16,16,18])==(8, 2)\nassert max_occurrences([10,20,20,30,40,90,80,50,30,20,50,10])==(20, 3)"} {"row": 120, "completion_input": "\"\"\"Write a python function to reverse only the vowels of a given string.\"\"\"\n\ndef reverse_vowels(", "completion_prefix": "def reverse_vowels(", "chat_input": [{"role": "user", "content": "Write a python function to reverse only the vowels of a given string.\nThe function should be named `reverse_vowels`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert reverse_vowels(\"Python\") == \"Python\"\nassert reverse_vowels(\"USA\") == \"ASU\"\nassert reverse_vowels(\"ab\") == \"ab\""} {"row": 121, "completion_input": "\"\"\"Write a function to convert tuple to a string.\"\"\"\n\ndef tup_string(", "completion_prefix": "def tup_string(", "chat_input": [{"role": "user", "content": "Write a function to convert tuple to a string.\nThe function should be named `tup_string`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert tup_string(('e', 'x', 'e', 'r', 'c', 'i', 's', 'e', 's'))==(\"exercises\")\nassert tup_string(('p','y','t','h','o','n'))==(\"python\")\nassert tup_string(('p','r','o','g','r','a','m'))==(\"program\")"} {"row": 122, "completion_input": "\"\"\"Write a function to calculate the sum of the negative numbers of a given list of numbers using lambda function.\"\"\"\n\ndef sum_negativenum(", "completion_prefix": "def sum_negativenum(", "chat_input": [{"role": "user", "content": "Write a function to calculate the sum of the negative numbers of a given list of numbers using lambda function.\nThe function should be named `sum_negativenum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert sum_negativenum([2, 4, -6, -9, 11, -12, 14, -5, 17])==-32\nassert sum_negativenum([10,15,-14,13,-18,12,-20])==-52\nassert sum_negativenum([19, -65, 57, 39, 152,-639, 121, 44, 90, -190])==-894"} {"row": 123, "completion_input": "\"\"\"Write a python function to check whether the last element of given array is even or odd after performing an operation p times.\"\"\"\n\ndef check_last(", "completion_prefix": "def check_last(", "chat_input": [{"role": "user", "content": "Write a python function to check whether the last element of given array is even or odd after performing an operation p times.\nThe function should be named `check_last`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert check_last([5,7,10],3,1) == \"ODD\"\nassert check_last([2,3],2,3) == \"EVEN\"\nassert check_last([1,2,3],3,1) == \"ODD\""} {"row": 124, "completion_input": "\"\"\"Write a function to find the nth hexagonal number.\"\"\"\n\ndef hexagonal_num(", "completion_prefix": "def hexagonal_num(", "chat_input": [{"role": "user", "content": "Write a function to find the nth hexagonal number.\nThe function should be named `hexagonal_num`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert hexagonal_num(10) == 190\nassert hexagonal_num(5) == 45\nassert hexagonal_num(7) == 91"} {"row": 125, "completion_input": "\"\"\"Write a function to calculate electricity bill.\"\"\"\n\ndef cal_electbill(", "completion_prefix": "def cal_electbill(", "chat_input": [{"role": "user", "content": "Write a function to calculate electricity bill.\nThe function should be named `cal_electbill`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert cal_electbill(75)==246.25\nassert cal_electbill(265)==1442.75\nassert cal_electbill(100)==327.5"} {"row": 126, "completion_input": "\"\"\"Write a function to find the ration of zeroes in an array of integers.\"\"\"\n\ndef zero_count(", "completion_prefix": "def zero_count(", "chat_input": [{"role": "user", "content": "Write a function to find the ration of zeroes in an array of integers.\nThe function should be named `zero_count`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert zero_count([0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8])==0.15\nassert zero_count([2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8])==0.00\nassert zero_count([2, 4, -6, -9, 11, -12, 14, -5, 17])==0.00"} {"row": 127, "completion_input": "\"\"\"Write a python function to check whether the given number can be represented as sum of non-zero powers of 2 or not.\"\"\"\n\ndef is_Sum_Of_Powers_Of_Two(", "completion_prefix": "def is_Sum_Of_Powers_Of_Two(", "chat_input": [{"role": "user", "content": "Write a python function to check whether the given number can be represented as sum of non-zero powers of 2 or not.\nThe function should be named `is_Sum_Of_Powers_Of_Two`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert is_Sum_Of_Powers_Of_Two(10) == True\nassert is_Sum_Of_Powers_Of_Two(7) == False\nassert is_Sum_Of_Powers_Of_Two(14) == True"} {"row": 128, "completion_input": "\"\"\"Write a function to find the circumference of a circle.\"\"\"\n\ndef circle_circumference(", "completion_prefix": "def circle_circumference(", "chat_input": [{"role": "user", "content": "Write a function to find the circumference of a circle.\nThe function should be named `circle_circumference`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert circle_circumference(10)==62.830000000000005\nassert circle_circumference(5)==31.415000000000003\nassert circle_circumference(4)==25.132"} {"row": 129, "completion_input": "\"\"\"Write a function to extract elements that occur singly in the given tuple list.\"\"\"\n\ndef extract_singly(", "completion_prefix": "def extract_singly(", "chat_input": [{"role": "user", "content": "Write a function to extract elements that occur singly in the given tuple list.\nThe function should be named `extract_singly`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert extract_singly([(3, 4, 5), (4, 5, 7), (1, 4)]) == [3, 4, 5, 7, 1]\nassert extract_singly([(1, 2, 3), (4, 2, 3), (7, 8)]) == [1, 2, 3, 4, 7, 8]\nassert extract_singly([(7, 8, 9), (10, 11, 12), (10, 11)]) == [7, 8, 9, 10, 11, 12]"} {"row": 130, "completion_input": "\"\"\"Write a function to sort a list of elements using pancake sort.\"\"\"\n\ndef pancake_sort(", "completion_prefix": "def pancake_sort(", "chat_input": [{"role": "user", "content": "Write a function to sort a list of elements using pancake sort.\nThe function should be named `pancake_sort`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert pancake_sort([15, 79, 25, 38, 69]) == [15, 25, 38, 69, 79]\nassert pancake_sort([98, 12, 54, 36, 85]) == [12, 36, 54, 85, 98]\nassert pancake_sort([41, 42, 32, 12, 23]) == [12, 23, 32, 41, 42]"} {"row": 131, "completion_input": "\"\"\"Write a function to count the same pair in three given lists.\"\"\"\n\ndef count_samepair(", "completion_prefix": "def count_samepair(", "chat_input": [{"role": "user", "content": "Write a function to count the same pair in three given lists.\nThe function should be named `count_samepair`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_samepair([1,2,3,4,5,6,7,8],[2,2,3,1,2,6,7,9],[2,1,3,1,2,6,7,9])==3\nassert count_samepair([1,2,3,4,5,6,7,8],[2,2,3,1,2,6,7,8],[2,1,3,1,2,6,7,8])==4\nassert count_samepair([1,2,3,4,2,6,7,8],[2,2,3,1,2,6,7,8],[2,1,3,1,2,6,7,8])==5"} {"row": 132, "completion_input": "\"\"\"Write a function to find number of lists present in the given tuple.\"\"\"\n\ndef find_lists(", "completion_prefix": "def find_lists(", "chat_input": [{"role": "user", "content": "Write a function to find number of lists present in the given tuple.\nThe function should be named `find_lists`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_lists(([1, 2, 3, 4], [5, 6, 7, 8])) == 2\nassert find_lists(([1, 2], [3, 4], [5, 6])) == 3\nassert find_lists(([9, 8, 7, 6, 5, 4, 3, 2, 1])) == 1"} {"row": 133, "completion_input": "\"\"\"Write a python function to find the sum of absolute differences in all pairs of the given array.\"\"\"\n\ndef sum_Pairs(", "completion_prefix": "def sum_Pairs(", "chat_input": [{"role": "user", "content": "Write a python function to find the sum of absolute differences in all pairs of the given array.\nThe function should be named `sum_Pairs`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert sum_Pairs([1,8,9,15,16],5) == 74\nassert sum_Pairs([1,2,3,4],4) == 10\nassert sum_Pairs([1,2,3,4,5,7,9,11,14],9) == 188"} {"row": 134, "completion_input": "\"\"\"Write a python function to find the maximum difference between any two elements in a given array.\"\"\"\n\ndef max_Abs_Diff(", "completion_prefix": "def max_Abs_Diff(", "chat_input": [{"role": "user", "content": "Write a python function to find the maximum difference between any two elements in a given array.\nThe function should be named `max_Abs_Diff`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert max_Abs_Diff((2,1,5,3),4) == 4\nassert max_Abs_Diff((9,3,2,5,1),5) == 8\nassert max_Abs_Diff((3,2,1),3) == 2"} {"row": 135, "completion_input": "\"\"\"Write a function to find the ascii value of total characters in a string.\"\"\"\n\ndef ascii_value_string(", "completion_prefix": "def ascii_value_string(", "chat_input": [{"role": "user", "content": "Write a function to find the ascii value of total characters in a string.\nThe function should be named `ascii_value_string`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert ascii_value_string(\"python\")==112\nassert ascii_value_string(\"Program\")==80\nassert ascii_value_string(\"Language\")==76"} {"row": 136, "completion_input": "\"\"\"Write a function to find the maximum total path sum in the given triangle.\"\"\"\n\ndef max_path_sum(", "completion_prefix": "def max_path_sum(", "chat_input": [{"role": "user", "content": "Write a function to find the maximum total path sum in the given triangle.\nThe function should be named `max_path_sum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert max_path_sum([[1, 0, 0], [4, 8, 0], [1, 5, 3]], 2, 2) == 14\nassert max_path_sum([[13, 0, 0], [7, 4, 0], [2, 4, 6]], 2, 2) == 24 \nassert max_path_sum([[2, 0, 0], [11, 18, 0], [21, 25, 33]], 2, 2) == 53"} {"row": 137, "completion_input": "\"\"\"Write a function to divide a number into two parts such that the sum of digits is maximum.\"\"\"\n\ndef sum_digits_twoparts(", "completion_prefix": "def sum_digits_twoparts(", "chat_input": [{"role": "user", "content": "Write a function to divide a number into two parts such that the sum of digits is maximum.\nThe function should be named `sum_digits_twoparts`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert sum_digits_twoparts(35)==17\nassert sum_digits_twoparts(7)==7\nassert sum_digits_twoparts(100)==19"} {"row": 138, "completion_input": "\"\"\"Write a function to find the longest subsequence such that the difference between adjacents is one for the given array.\"\"\"\n\ndef longest_subseq_with_diff_one(", "completion_prefix": "def longest_subseq_with_diff_one(", "chat_input": [{"role": "user", "content": "Write a function to find the longest subsequence such that the difference between adjacents is one for the given array.\nThe function should be named `longest_subseq_with_diff_one`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert longest_subseq_with_diff_one([1, 2, 3, 4, 5, 3, 2], 7) == 6\nassert longest_subseq_with_diff_one([10, 9, 4, 5, 4, 8, 6], 7) == 3\nassert longest_subseq_with_diff_one([1, 2, 3, 2, 3, 7, 2, 1], 8) == 7"} {"row": 139, "completion_input": "\"\"\"Write a python function to find whether the given number is present in the infinite sequence or not.\"\"\"\n\ndef does_Contain_B(", "completion_prefix": "def does_Contain_B(", "chat_input": [{"role": "user", "content": "Write a python function to find whether the given number is present in the infinite sequence or not.\nThe function should be named `does_Contain_B`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert does_Contain_B(1,7,3) == True\nassert does_Contain_B(1,-3,5) == False\nassert does_Contain_B(3,2,5) == False"} {"row": 140, "completion_input": "\"\"\"Write a python function to check whether the given number is co-prime or not.\"\"\"\n\ndef is_coprime(", "completion_prefix": "def is_coprime(", "chat_input": [{"role": "user", "content": "Write a python function to check whether the given number is co-prime or not.\nThe function should be named `is_coprime`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert is_coprime(17,13) == True\nassert is_coprime(15,21) == False\nassert is_coprime(25,45) == False"} {"row": 141, "completion_input": "\"\"\"Write a function to sort the given array by using merge sort.\"\"\"\n\ndef merge_sort(", "completion_prefix": "def merge_sort(", "chat_input": [{"role": "user", "content": "Write a function to sort the given array by using merge sort.\nThe function should be named `merge_sort`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert merge_sort([3, 4, 2, 6, 5, 7, 1, 9]) == [1, 2, 3, 4, 5, 6, 7, 9]\nassert merge_sort([7, 25, 45, 78, 11, 33, 19]) == [7, 11, 19, 25, 33, 45, 78]\nassert merge_sort([3, 1, 4, 9, 8]) == [1, 3, 4, 8, 9]"} {"row": 142, "completion_input": "\"\"\"Write a function to find the vertex of a parabola.\"\"\"\n\ndef parabola_vertex(", "completion_prefix": "def parabola_vertex(", "chat_input": [{"role": "user", "content": "Write a function to find the vertex of a parabola.\nThe function should be named `parabola_vertex`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert parabola_vertex(5,3,2)==(-0.3, 1.55)\nassert parabola_vertex(9,8,4)==(-0.4444444444444444, 2.2222222222222223)\nassert parabola_vertex(2,4,6)==(-1.0, 4.0)"} {"row": 143, "completion_input": "\"\"\"Write a function to extract every specified element from a given two dimensional list.\"\"\"\n\ndef specified_element(", "completion_prefix": "def specified_element(", "chat_input": [{"role": "user", "content": "Write a function to extract every specified element from a given two dimensional list.\nThe function should be named `specified_element`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert specified_element([[1, 2, 3, 2], [4, 5, 6, 2], [7, 1, 9, 5]],0)==[1, 4, 7]\nassert specified_element([[1, 2, 3, 2], [4, 5, 6, 2], [7, 1, 9, 5]],2)==[3, 6, 9]\nassert specified_element([[1, 2, 3, 2], [4, 5, 6, 2], [7, 1, 9, 5]],3)==[2,2,5]"} {"row": 144, "completion_input": "\"\"\"Write a python function to toggle all even bits of a given number.\"\"\"\n\ndef even_bit_toggle_number(", "completion_prefix": "def even_bit_toggle_number(", "chat_input": [{"role": "user", "content": "Write a python function to toggle all even bits of a given number.\nThe function should be named `even_bit_toggle_number`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert even_bit_toggle_number(10) == 0\nassert even_bit_toggle_number(20) == 30\nassert even_bit_toggle_number(30) == 20"} {"row": 145, "completion_input": "\"\"\"Write a function to convert a tuple of string values to a tuple of integer values.\"\"\"\n\ndef tuple_int_str(", "completion_prefix": "def tuple_int_str(", "chat_input": [{"role": "user", "content": "Write a function to convert a tuple of string values to a tuple of integer values.\nThe function should be named `tuple_int_str`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert tuple_int_str((('333', '33'), ('1416', '55')))==((333, 33), (1416, 55))\nassert tuple_int_str((('999', '99'), ('1000', '500')))==((999, 99), (1000, 500))\nassert tuple_int_str((('666', '66'), ('1500', '555')))==((666, 66), (1500, 555))"} {"row": 146, "completion_input": "\"\"\"Write a function to reflect the run-length encoding from a list.\"\"\"\n\ndef encode_list(", "completion_prefix": "def encode_list(", "chat_input": [{"role": "user", "content": "Write a function to reflect the run-length encoding from a list.\nThe function should be named `encode_list`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert encode_list([1,1,2,3,4,4.3,5,1])==[[2, 1], [1, 2], [1, 3], [1, 4], [1, 4.3], [1, 5], [1, 1]]\nassert encode_list('automatically')==[[1, 'a'], [1, 'u'], [1, 't'], [1, 'o'], [1, 'm'], [1, 'a'], [1, 't'], [1, 'i'], [1, 'c'], [1, 'a'], [2, 'l'], [1, 'y']]\nassert encode_list('python')==[[1, 'p'], [1, 'y'], [1, 't'], [1, 'h'], [1, 'o'], [1, 'n']]"} {"row": 147, "completion_input": "\"\"\"Write a python function to find k number of operations required to make all elements equal.\"\"\"\n\ndef min_Ops(", "completion_prefix": "def min_Ops(", "chat_input": [{"role": "user", "content": "Write a python function to find k number of operations required to make all elements equal.\nThe function should be named `min_Ops`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert min_Ops([2,2,2,2],4,3) == 0\nassert min_Ops([4,2,6,8],4,3) == -1\nassert min_Ops([21,33,9,45,63],5,6) == 24"} {"row": 148, "completion_input": "\"\"\"Write a function to print the season for the given month and day.\"\"\"\n\ndef month_season(", "completion_prefix": "def month_season(", "chat_input": [{"role": "user", "content": "Write a function to print the season for the given month and day.\nThe function should be named `month_season`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert month_season('January',4)==('winter')\nassert month_season('October',28)==('autumn')\nassert month_season('June',6)==('spring')"} {"row": 149, "completion_input": "\"\"\"Write a function to find x and y that satisfies ax + by = n.\"\"\"\n\ndef solution(", "completion_prefix": "def solution(", "chat_input": [{"role": "user", "content": "Write a function to find x and y that satisfies ax + by = n.\nThe function should be named `solution`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert solution(2, 3, 7) == ('x = ', 2, ', y = ', 1)\nassert solution(4, 2, 7) == 'No solution'\nassert solution(1, 13, 17) == ('x = ', 4, ', y = ', 1)"} {"row": 150, "completion_input": "\"\"\"Write a function to remove all elements from a given list present in another list.\"\"\"\n\ndef remove_elements(", "completion_prefix": "def remove_elements(", "chat_input": [{"role": "user", "content": "Write a function to remove all elements from a given list present in another list.\nThe function should be named `remove_elements`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert remove_elements([1,2,3,4,5,6,7,8,9,10],[2,4,6,8])==[1, 3, 5, 7, 9, 10]\nassert remove_elements([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],[1, 3, 5, 7])==[2, 4, 6, 8, 9, 10]\nassert remove_elements([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],[5,7])==[1, 2, 3, 4, 6, 8, 9, 10]"} {"row": 151, "completion_input": "\"\"\"Write a function to calculate the sum of the positive integers of n+(n-2)+(n-4)... (until n-x =< 0).\"\"\"\n\ndef sum_series(", "completion_prefix": "def sum_series(", "chat_input": [{"role": "user", "content": "Write a function to calculate the sum of the positive integers of n+(n-2)+(n-4)... (until n-x =< 0).\nThe function should be named `sum_series`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert sum_series(6)==12\nassert sum_series(10)==30\nassert sum_series(9)==25"} {"row": 152, "completion_input": "\"\"\"Write a function to calculate the area of a regular polygon.\"\"\"\n\ndef area_polygon(", "completion_prefix": "def area_polygon(", "chat_input": [{"role": "user", "content": "Write a function to calculate the area of a regular polygon.\nThe function should be named `area_polygon`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert area_polygon(4,20)==400.00000000000006\nassert area_polygon(10,15)==1731.1969896610804\nassert area_polygon(9,7)==302.90938549487214"} {"row": 153, "completion_input": "\"\"\"Write a python function to check whether the sum of divisors are same or not.\"\"\"\n\ndef areEquivalent(", "completion_prefix": "def areEquivalent(", "chat_input": [{"role": "user", "content": "Write a python function to check whether the sum of divisors are same or not.\nThe function should be named `areEquivalent`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert areEquivalent(36,57) == False\nassert areEquivalent(2,4) == False\nassert areEquivalent(23,47) == True"} {"row": 154, "completion_input": "\"\"\"Write a python function to count characters at same position in a given string (lower and uppercase characters) as in english alphabet.\"\"\"\n\ndef count_char_position(", "completion_prefix": "def count_char_position(", "chat_input": [{"role": "user", "content": "Write a python function to count characters at same position in a given string (lower and uppercase characters) as in english alphabet.\nThe function should be named `count_char_position`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_char_position(\"xbcefg\") == 2\nassert count_char_position(\"ABcED\") == 3\nassert count_char_position(\"AbgdeF\") == 5"} {"row": 155, "completion_input": "\"\"\"Write a python function to count the pairs with xor as an even number.\"\"\"\n\ndef find_even_Pair(", "completion_prefix": "def find_even_Pair(", "chat_input": [{"role": "user", "content": "Write a python function to count the pairs with xor as an even number.\nThe function should be named `find_even_Pair`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_even_Pair([5,4,7,2,1],5) == 4\nassert find_even_Pair([7,2,8,1,0,5,11],7) == 9\nassert find_even_Pair([1,2,3],3) == 1"} {"row": 156, "completion_input": "\"\"\"Write a python function to find smallest power of 2 greater than or equal to n.\"\"\"\n\ndef next_Power_Of_2(", "completion_prefix": "def next_Power_Of_2(", "chat_input": [{"role": "user", "content": "Write a python function to find smallest power of 2 greater than or equal to n.\nThe function should be named `next_Power_Of_2`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert next_Power_Of_2(0) == 1\nassert next_Power_Of_2(5) == 8\nassert next_Power_Of_2(17) == 32"} {"row": 157, "completion_input": "\"\"\"Write a python function to find the frequency of a number in a given array.\"\"\"\n\ndef frequency(", "completion_prefix": "def frequency(", "chat_input": [{"role": "user", "content": "Write a python function to find the frequency of a number in a given array.\nThe function should be named `frequency`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert frequency([1,2,3],4) == 0\nassert frequency([1,2,2,3,3,3,4],3) == 3\nassert frequency([0,1,2,3,1,2],1) == 2"} {"row": 158, "completion_input": "\"\"\"Write a function to calculate the nth pell number.\"\"\"\n\ndef get_pell(", "completion_prefix": "def get_pell(", "chat_input": [{"role": "user", "content": "Write a function to calculate the nth pell number.\nThe function should be named `get_pell`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert get_pell(4) == 12\nassert get_pell(7) == 169\nassert get_pell(8) == 408"} {"row": 159, "completion_input": "\"\"\"Write a function to find sum of the numbers in a list between the indices of a specified range.\"\"\"\n\ndef sum_range_list(", "completion_prefix": "def sum_range_list(", "chat_input": [{"role": "user", "content": "Write a function to find sum of the numbers in a list between the indices of a specified range.\nThe function should be named `sum_range_list`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert sum_range_list( [2,1,5,6,8,3,4,9,10,11,8,12],8,10)==29\nassert sum_range_list( [2,1,5,6,8,3,4,9,10,11,8,12],5,7)==16\nassert sum_range_list( [2,1,5,6,8,3,4,9,10,11,8,12],7,10)==38"} {"row": 160, "completion_input": "\"\"\"Write a function to find the perimeter of a pentagon.\"\"\"\n\ndef perimeter_pentagon(", "completion_prefix": "def perimeter_pentagon(", "chat_input": [{"role": "user", "content": "Write a function to find the perimeter of a pentagon.\nThe function should be named `perimeter_pentagon`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert perimeter_pentagon(5)==25\nassert perimeter_pentagon(10)==50\nassert perimeter_pentagon(15)==75"} {"row": 161, "completion_input": "\"\"\"Write a function to find the occurence of characters 'std' in the given string 1. list item 1. list item 1. list item 2. list item 2. list item 2. list item\"\"\"\n\ndef count_occurance(", "completion_prefix": "def count_occurance(", "chat_input": [{"role": "user", "content": "Write a function to find the occurence of characters 'std' in the given string 1. list item 1. list item 1. list item 2. list item 2. list item 2. list item\nThe function should be named `count_occurance`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_occurance(\"letstdlenstdporstd\") == 3\nassert count_occurance(\"truststdsolensporsd\") == 1\nassert count_occurance(\"makestdsostdworthit\") == 2"} {"row": 162, "completion_input": "\"\"\"Write a function to remove everything except alphanumeric characters from a string.\"\"\"\n\ndef remove_splchar(", "completion_prefix": "def remove_splchar(", "chat_input": [{"role": "user", "content": "Write a function to remove everything except alphanumeric characters from a string.\nThe function should be named `remove_splchar`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert remove_splchar('python @#&^%$*program123')==('pythonprogram123')\nassert remove_splchar('python %^$@!^&*() programming24%$^^() language')==('pythonprogramming24language')\nassert remove_splchar('python ^%&^()(+_)(_^&67) program')==('python67program')"} {"row": 163, "completion_input": "\"\"\"Write a function to group a sequence of key-value pairs into a dictionary of lists.\"\"\"\n\ndef group_keyvalue(", "completion_prefix": "def group_keyvalue(", "chat_input": [{"role": "user", "content": "Write a function to group a sequence of key-value pairs into a dictionary of lists.\nThe function should be named `group_keyvalue`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert group_keyvalue([('yellow', 1), ('blue', 2), ('yellow', 3), ('blue', 4), ('red', 1)])=={'yellow': [1, 3], 'blue': [2, 4], 'red': [1]}\nassert group_keyvalue([('python', 1), ('python', 2), ('python', 3), ('python', 4), ('python', 5)])=={'python': [1,2,3,4,5]}\nassert group_keyvalue([('yellow',100), ('blue', 200), ('yellow', 300), ('blue', 400), ('red', 100)])=={'yellow': [100, 300], 'blue': [200, 400], 'red': [100]}"} {"row": 164, "completion_input": "\"\"\"Write a function to verify validity of a string of parentheses.\"\"\"\n\ndef is_valid_parenthese(", "completion_prefix": "def is_valid_parenthese(", "chat_input": [{"role": "user", "content": "Write a function to verify validity of a string of parentheses.\nThe function should be named `is_valid_parenthese`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert is_valid_parenthese(\"(){}[]\")==True\nassert is_valid_parenthese(\"()[{)}\")==False\nassert is_valid_parenthese(\"()\")==True"} {"row": 165, "completion_input": "\"\"\"Write a function to find the perimeter of a triangle.\"\"\"\n\ndef perimeter_triangle(", "completion_prefix": "def perimeter_triangle(", "chat_input": [{"role": "user", "content": "Write a function to find the perimeter of a triangle.\nThe function should be named `perimeter_triangle`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert perimeter_triangle(10,20,30)==60\nassert perimeter_triangle(3,4,5)==12\nassert perimeter_triangle(25,35,45)==105"} {"row": 166, "completion_input": "\"\"\"Write a python function to find two distinct numbers such that their lcm lies within the given range.\"\"\"\n\ndef answer(", "completion_prefix": "def answer(", "chat_input": [{"role": "user", "content": "Write a python function to find two distinct numbers such that their lcm lies within the given range.\nThe function should be named `answer`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert answer(3,8) == (3,6)\nassert answer(2,6) == (2,4)\nassert answer(1,3) == (1,2)"} {"row": 167, "completion_input": "\"\"\"Write a function to search some literals strings in a string.\"\"\"\n\ndef string_literals(", "completion_prefix": "def string_literals(", "chat_input": [{"role": "user", "content": "Write a function to search some literals strings in a string.\nThe function should be named `string_literals`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert string_literals(['language'],'python language')==('Matched!')\nassert string_literals(['program'],'python language')==('Not Matched!')\nassert string_literals(['python'],'programming language')==('Not Matched!')"} {"row": 168, "completion_input": "\"\"\"Write a function to find if the given number is a keith number or not.\"\"\"\n\ndef is_num_keith(", "completion_prefix": "def is_num_keith(", "chat_input": [{"role": "user", "content": "Write a function to find if the given number is a keith number or not.\nThe function should be named `is_num_keith`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert is_num_keith(14) == True\nassert is_num_keith(12) == False\nassert is_num_keith(197) == True"} {"row": 169, "completion_input": "\"\"\"Write a function to calculate distance between two points using latitude and longitude.\"\"\"\n\ndef distance_lat_long(", "completion_prefix": "def distance_lat_long(", "chat_input": [{"role": "user", "content": "Write a function to calculate distance between two points using latitude and longitude.\nThe function should be named `distance_lat_long`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert distance_lat_long(23.5,67.5,25.5,69.5)==12179.372041317429\nassert distance_lat_long(10.5,20.5,30.5,40.5)==6069.397933300514\nassert distance_lat_long(10,20,30,40)==6783.751974994595"} {"row": 170, "completion_input": "\"\"\"Write a function to find the longest common prefix in the given set of strings.\"\"\"\n\ndef common_prefix(", "completion_prefix": "def common_prefix(", "chat_input": [{"role": "user", "content": "Write a function to find the longest common prefix in the given set of strings.\nThe function should be named `common_prefix`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert common_prefix([\"tablets\", \"tables\", \"taxi\", \"tamarind\"], 4) == 'ta'\nassert common_prefix([\"apples\", \"ape\", \"april\"], 3) == 'ap'\nassert common_prefix([\"teens\", \"teenager\", \"teenmar\"], 3) == 'teen'"} {"row": 171, "completion_input": "\"\"\"Write a function to find uppercase, lowercase, special character and numeric values using regex.\"\"\"\n\ndef find_character(", "completion_prefix": "def find_character(", "chat_input": [{"role": "user", "content": "Write a function to find uppercase, lowercase, special character and numeric values using regex.\nThe function should be named `find_character`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_character(\"ThisIsGeeksforGeeks\") == (['T', 'I', 'G', 'G'], ['h', 'i', 's', 's', 'e', 'e', 'k', 's', 'f', 'o', 'r', 'e', 'e', 'k', 's'], [], [])\nassert find_character(\"Hithere2\") == (['H'], ['i', 't', 'h', 'e', 'r', 'e'], ['2'], [])\nassert find_character(\"HeyFolks32\") == (['H', 'F'], ['e', 'y', 'o', 'l', 'k', 's'], ['3', '2'], [])"} {"row": 172, "completion_input": "\"\"\"Write a function to count all the distinct pairs having a difference of k in any array.\"\"\"\n\ndef count_pairs(", "completion_prefix": "def count_pairs(", "chat_input": [{"role": "user", "content": "Write a function to count all the distinct pairs having a difference of k in any array.\nThe function should be named `count_pairs`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_pairs([1, 5, 3, 4, 2], 5, 3) == 2\nassert count_pairs([8, 12, 16, 4, 0, 20], 6, 4) == 5\nassert count_pairs([2, 4, 1, 3, 4], 5, 2) == 3"} {"row": 173, "completion_input": "\"\"\"Write a function to find all the values in a list that are greater than a specified number.\"\"\"\n\ndef greater_specificnum(", "completion_prefix": "def greater_specificnum(", "chat_input": [{"role": "user", "content": "Write a function to find all the values in a list that are greater than a specified number.\nThe function should be named `greater_specificnum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert greater_specificnum([220, 330, 500],200)==True\nassert greater_specificnum([12, 17, 21],20)==False\nassert greater_specificnum([1,2,3,4],10)==False"} {"row": 174, "completion_input": "\"\"\"Write a function to find the focus of a parabola.\"\"\"\n\ndef parabola_focus(", "completion_prefix": "def parabola_focus(", "chat_input": [{"role": "user", "content": "Write a function to find the focus of a parabola.\nThe function should be named `parabola_focus`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert parabola_focus(5,3,2)==(-0.3, 1.6)\nassert parabola_focus(9,8,4)==(-0.4444444444444444, 2.25)\nassert parabola_focus(2,4,6)==(-1.0, 4.125)"} {"row": 175, "completion_input": "\"\"\"Write a function to search some literals strings in a string by using regex.\"\"\"\n\ndef check_literals(", "completion_prefix": "def check_literals(", "chat_input": [{"role": "user", "content": "Write a function to search some literals strings in a string by using regex.\nThe function should be named `check_literals`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert check_literals('The quick brown fox jumps over the lazy dog.',['fox']) == 'Matched!'\nassert check_literals('The quick brown fox jumps over the lazy dog.',['horse']) == 'Not Matched!'\nassert check_literals('The quick brown fox jumps over the lazy dog.',['lazy']) == 'Matched!'"} {"row": 176, "completion_input": "\"\"\"Write a function to find the longest common subsequence for the given two sequences.\"\"\"\n\ndef longest_common_subsequence(", "completion_prefix": "def longest_common_subsequence(", "chat_input": [{"role": "user", "content": "Write a function to find the longest common subsequence for the given two sequences.\nThe function should be named `longest_common_subsequence`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert longest_common_subsequence(\"AGGTAB\" , \"GXTXAYB\", 6, 7) == 4\nassert longest_common_subsequence(\"ABCDGH\" , \"AEDFHR\", 6, 6) == 3\nassert longest_common_subsequence(\"AXYT\" , \"AYZX\", 4, 4) == 2"} {"row": 177, "completion_input": "\"\"\"Write a python function to check whether the given number can be represented by product of two squares or not.\"\"\"\n\ndef prod_Square(", "completion_prefix": "def prod_Square(", "chat_input": [{"role": "user", "content": "Write a python function to check whether the given number can be represented by product of two squares or not.\nThe function should be named `prod_Square`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert prod_Square(25) == False\nassert prod_Square(30) == False\nassert prod_Square(16) == True"} {"row": 178, "completion_input": "\"\"\"Write a python function to find the first missing positive number.\"\"\"\n\ndef first_Missing_Positive(", "completion_prefix": "def first_Missing_Positive(", "chat_input": [{"role": "user", "content": "Write a python function to find the first missing positive number.\nThe function should be named `first_Missing_Positive`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert first_Missing_Positive([1,2,3,-1,5],5) == 4\nassert first_Missing_Positive([0,-1,-2,1,5,8],6) == 2\nassert first_Missing_Positive([0,1,2,5,-8],5) == 3"} {"row": 179, "completion_input": "\"\"\"Write a python function to count the number of integral co-ordinates that lie inside a square.\"\"\"\n\ndef count_Intgral_Points(", "completion_prefix": "def count_Intgral_Points(", "chat_input": [{"role": "user", "content": "Write a python function to count the number of integral co-ordinates that lie inside a square.\nThe function should be named `count_Intgral_Points`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_Intgral_Points(1,1,4,4) == 4\nassert count_Intgral_Points(1,2,1,2) == 1\nassert count_Intgral_Points(4,2,6,4) == 1"} {"row": 180, "completion_input": "\"\"\"Write a function to check whether the given month name contains 30 days or not.\"\"\"\n\ndef check_monthnumber(", "completion_prefix": "def check_monthnumber(", "chat_input": [{"role": "user", "content": "Write a function to check whether the given month name contains 30 days or not.\nThe function should be named `check_monthnumber`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert check_monthnumber(\"February\")==False\nassert check_monthnumber(\"June\")==True\nassert check_monthnumber(\"April\")==True"} {"row": 181, "completion_input": "\"\"\"Write a python function to check whether a string has atleast one letter and one number.\"\"\"\n\ndef check_String(", "completion_prefix": "def check_String(", "chat_input": [{"role": "user", "content": "Write a python function to check whether a string has atleast one letter and one number.\nThe function should be named `check_String`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert check_String('thishasboth29') == True\nassert check_String('python') == False\nassert check_String ('string') == False"} {"row": 182, "completion_input": "\"\"\"Write a function to remove the duplicates from the given tuple.\"\"\"\n\ndef remove_tuple(", "completion_prefix": "def remove_tuple(", "chat_input": [{"role": "user", "content": "Write a function to remove the duplicates from the given tuple.\nThe function should be named `remove_tuple`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert remove_tuple((1, 3, 5, 2, 3, 5, 1, 1, 3)) == (1, 2, 3, 5)\nassert remove_tuple((2, 3, 4, 4, 5, 6, 6, 7, 8, 8)) == (2, 3, 4, 5, 6, 7, 8)\nassert remove_tuple((11, 12, 13, 11, 11, 12, 14, 13)) == (11, 12, 13, 14)"} {"row": 183, "completion_input": "\"\"\"Write a python function to convert octal number to decimal number.\"\"\"\n\ndef octal_To_Decimal(", "completion_prefix": "def octal_To_Decimal(", "chat_input": [{"role": "user", "content": "Write a python function to convert octal number to decimal number.\nThe function should be named `octal_To_Decimal`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert octal_To_Decimal(25) == 21\nassert octal_To_Decimal(30) == 24\nassert octal_To_Decimal(40) == 32"} {"row": 184, "completion_input": "\"\"\"Write a python function to find the first position of an element in a sorted array.\"\"\"\n\ndef first(", "completion_prefix": "def first(", "chat_input": [{"role": "user", "content": "Write a python function to find the first position of an element in a sorted array.\nThe function should be named `first`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert first([1,2,3,4,5,6,6],6,6) == 5\nassert first([1,2,2,2,3,2,2,4,2],2,9) == 1\nassert first([1,2,3],1,3) == 0"} {"row": 185, "completion_input": "\"\"\"Write a function to remove all the tuples with length k.\"\"\"\n\ndef remove_tuples(", "completion_prefix": "def remove_tuples(", "chat_input": [{"role": "user", "content": "Write a function to remove all the tuples with length k.\nThe function should be named `remove_tuples`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert remove_tuples([(4, 5), (4, ), (8, 6, 7), (1, ), (3, 4, 6, 7)] , 1) == [(4, 5), (8, 6, 7), (3, 4, 6, 7)]\nassert remove_tuples([(4, 5), (4,5), (6, 7), (1, 2, 3), (3, 4, 6, 7)] ,2) == [(1, 2, 3), (3, 4, 6, 7)]\nassert remove_tuples([(1, 4, 4), (4, 3), (8, 6, 7), (1, ), (3, 6, 7)] , 3) == [(4, 3), (1,)]"} {"row": 186, "completion_input": "\"\"\"Write a function to perform the exponentiation of the given two tuples.\"\"\"\n\ndef find_exponentio(", "completion_prefix": "def find_exponentio(", "chat_input": [{"role": "user", "content": "Write a function to perform the exponentiation of the given two tuples.\nThe function should be named `find_exponentio`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_exponentio((10, 4, 5, 6), (5, 6, 7, 5)) == (100000, 4096, 78125, 7776)\nassert find_exponentio((11, 5, 6, 7), (6, 7, 8, 6)) == (1771561, 78125, 1679616, 117649)\nassert find_exponentio((12, 6, 7, 8), (7, 8, 9, 7)) == (35831808, 1679616, 40353607, 2097152)"} {"row": 187, "completion_input": "\"\"\"Write a function to find the largest triangle that can be inscribed in an ellipse.\"\"\"\n\ndef largest_triangle(", "completion_prefix": "def largest_triangle(", "chat_input": [{"role": "user", "content": "Write a function to find the largest triangle that can be inscribed in an ellipse.\nThe function should be named `largest_triangle`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert largest_triangle(4,2)==10.392304845413264\nassert largest_triangle(5,7)==4.639421805988064\nassert largest_triangle(9,1)==105.2220865598093"} {"row": 188, "completion_input": "\"\"\"Write a python function to find highest power of 2 less than or equal to given number.\"\"\"\n\ndef highest_Power_of_2(", "completion_prefix": "def highest_Power_of_2(", "chat_input": [{"role": "user", "content": "Write a python function to find highest power of 2 less than or equal to given number.\nThe function should be named `highest_Power_of_2`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert highest_Power_of_2(10) == 8\nassert highest_Power_of_2(19) == 16\nassert highest_Power_of_2(32) == 32"} {"row": 189, "completion_input": "\"\"\"Write a function to find all index positions of the maximum values in a given list.\"\"\"\n\ndef position_max(", "completion_prefix": "def position_max(", "chat_input": [{"role": "user", "content": "Write a function to find all index positions of the maximum values in a given list.\nThe function should be named `position_max`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert position_max([12,33,23,10,67,89,45,667,23,12,11,10,54])==[7]\nassert position_max([1,2,2,2,4,4,4,5,5,5,5])==[7,8,9,10]\nassert position_max([2,1,5,6,8,3,4,9,10,11,8,12])==[11]"} {"row": 190, "completion_input": "\"\"\"Write a python function to check whether the elements in a list are same or not.\"\"\"\n\ndef chkList(", "completion_prefix": "def chkList(", "chat_input": [{"role": "user", "content": "Write a python function to check whether the elements in a list are same or not.\nThe function should be named `chkList`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert chkList(['one','one','one']) == True\nassert chkList(['one','Two','Three']) == False\nassert chkList(['bigdata','python','Django']) == False"} {"row": 191, "completion_input": "\"\"\"Write a function to remove even characters in a string.\"\"\"\n\ndef remove_even(", "completion_prefix": "def remove_even(", "chat_input": [{"role": "user", "content": "Write a function to remove even characters in a string.\nThe function should be named `remove_even`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert remove_even(\"python\")==(\"pto\")\nassert remove_even(\"program\")==(\"porm\")\nassert remove_even(\"language\")==(\"lnug\")"} {"row": 192, "completion_input": "\"\"\"Write a python function to find the hamming distance between given two integers.\"\"\"\n\ndef hamming_Distance(", "completion_prefix": "def hamming_Distance(", "chat_input": [{"role": "user", "content": "Write a python function to find the hamming distance between given two integers.\nThe function should be named `hamming_Distance`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert hamming_Distance(4,8) == 2\nassert hamming_Distance(2,4) == 2\nassert hamming_Distance(1,2) == 2"} {"row": 193, "completion_input": "\"\"\"Write a python function to count the occurrence of a given character in a string.\"\"\"\n\ndef count(", "completion_prefix": "def count(", "chat_input": [{"role": "user", "content": "Write a python function to count the occurrence of a given character in a string.\nThe function should be named `count`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count(\"abcc\",\"c\") == 2\nassert count(\"ababca\",\"a\") == 3\nassert count(\"mnmm0pm\",\"m\") == 4"} {"row": 194, "completion_input": "\"\"\"Write a function to find the inversions of tuple elements in the given tuple list.\"\"\"\n\ndef inversion_elements(", "completion_prefix": "def inversion_elements(", "chat_input": [{"role": "user", "content": "Write a function to find the inversions of tuple elements in the given tuple list.\nThe function should be named `inversion_elements`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert inversion_elements((7, 8, 9, 1, 10, 7)) == (-8, -9, -10, -2, -11, -8)\nassert inversion_elements((2, 4, 5, 6, 1, 7)) == (-3, -5, -6, -7, -2, -8)\nassert inversion_elements((8, 9, 11, 14, 12, 13)) == (-9, -10, -12, -15, -13, -14)"} {"row": 195, "completion_input": "\"\"\"Write a function to perform the adjacent element concatenation in the given tuples.\"\"\"\n\ndef concatenate_elements(", "completion_prefix": "def concatenate_elements(", "chat_input": [{"role": "user", "content": "Write a function to perform the adjacent element concatenation in the given tuples.\nThe function should be named `concatenate_elements`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert concatenate_elements((\"DSP \", \"IS \", \"BEST \", \"FOR \", \"ALL \", \"UTS\")) == ('DSP IS ', 'IS BEST ', 'BEST FOR ', 'FOR ALL ', 'ALL UTS')\nassert concatenate_elements((\"RES \", \"IS \", \"BEST \", \"FOR \", \"ALL \", \"QESR\")) == ('RES IS ', 'IS BEST ', 'BEST FOR ', 'FOR ALL ', 'ALL QESR')\nassert concatenate_elements((\"MSAM\", \"IS \", \"BEST \", \"FOR \", \"ALL \", \"SKD\")) == ('MSAMIS ', 'IS BEST ', 'BEST FOR ', 'FOR ALL ', 'ALL SKD')"} {"row": 196, "completion_input": "\"\"\"Write a function to count the longest repeating subsequences such that the two subsequences don’t have same string characters at same positions.\"\"\"\n\ndef find_longest_repeating_subseq(", "completion_prefix": "def find_longest_repeating_subseq(", "chat_input": [{"role": "user", "content": "Write a function to count the longest repeating subsequences such that the two subsequences don’t have same string characters at same positions.\nThe function should be named `find_longest_repeating_subseq`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_longest_repeating_subseq(\"AABEBCDD\") == 3\nassert find_longest_repeating_subseq(\"aabb\") == 2\nassert find_longest_repeating_subseq(\"aab\") == 1"} {"row": 197, "completion_input": "\"\"\"Write a function to check the given decimal with a precision of 2 by using regex.\"\"\"\n\ndef is_decimal(", "completion_prefix": "def is_decimal(", "chat_input": [{"role": "user", "content": "Write a function to check the given decimal with a precision of 2 by using regex.\nThe function should be named `is_decimal`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert is_decimal('123.11') == True\nassert is_decimal('0.21') == True\nassert is_decimal('123.1214') == False"} {"row": 198, "completion_input": "\"\"\"Write a function to delete the smallest element from the given heap and then insert a new item.\"\"\"\n\ndef heap_replace(", "completion_prefix": "def heap_replace(", "chat_input": [{"role": "user", "content": "Write a function to delete the smallest element from the given heap and then insert a new item.\nThe function should be named `heap_replace`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert heap_replace( [25, 44, 68, 21, 39, 23, 89],21)==[21, 25, 23, 44, 39, 68, 89]\nassert heap_replace([25, 44, 68, 21, 39, 23, 89],110)== [23, 25, 68, 44, 39, 110, 89]\nassert heap_replace([25, 44, 68, 21, 39, 23, 89],500)==[23, 25, 68, 44, 39, 500, 89]"} {"row": 199, "completion_input": "\"\"\"Write a function to check that the given string contains only a certain set of characters(in this case a-z, a-z and 0-9) by using regex.\"\"\"\n\ndef is_allowed_specific_char(", "completion_prefix": "def is_allowed_specific_char(", "chat_input": [{"role": "user", "content": "Write a function to check that the given string contains only a certain set of characters(in this case a-z, a-z and 0-9) by using regex.\nThe function should be named `is_allowed_specific_char`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert is_allowed_specific_char(\"ABCDEFabcdef123450\") == True\nassert is_allowed_specific_char(\"*&%@#!}{\") == False\nassert is_allowed_specific_char(\"HELLOhowareyou98765\") == True"} {"row": 200, "completion_input": "\"\"\"Write a python function to count numbers whose oth and nth bits are set.\"\"\"\n\ndef count_Num(", "completion_prefix": "def count_Num(", "chat_input": [{"role": "user", "content": "Write a python function to count numbers whose oth and nth bits are set.\nThe function should be named `count_Num`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_Num(2) == 1\nassert count_Num(3) == 2\nassert count_Num(1) == 1"} {"row": 201, "completion_input": "\"\"\"Write a python function to find the sum of fourth power of n natural numbers.\"\"\"\n\ndef fourth_Power_Sum(", "completion_prefix": "def fourth_Power_Sum(", "chat_input": [{"role": "user", "content": "Write a python function to find the sum of fourth power of n natural numbers.\nThe function should be named `fourth_Power_Sum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert fourth_Power_Sum(2) == 17\nassert fourth_Power_Sum(4) == 354\nassert fourth_Power_Sum(6) == 2275"} {"row": 202, "completion_input": "\"\"\"Write a function to perform the concatenation of two string tuples.\"\"\"\n\ndef concatenate_strings(", "completion_prefix": "def concatenate_strings(", "chat_input": [{"role": "user", "content": "Write a function to perform the concatenation of two string tuples.\nThe function should be named `concatenate_strings`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert concatenate_strings((\"Manjeet\", \"Nikhil\", \"Akshat\"), (\" Singh\", \" Meherwal\", \" Garg\")) == ('Manjeet Singh', 'Nikhil Meherwal', 'Akshat Garg')\nassert concatenate_strings((\"Shaik\", \"Ayesha\", \"Sanya\"), (\" Dawood\", \" Begum\", \" Singh\")) == ('Shaik Dawood', 'Ayesha Begum', 'Sanya Singh')\nassert concatenate_strings((\"Harpreet\", \"Priyanka\", \"Muskan\"), (\"Kour\", \" Agarwal\", \"Sethi\")) == ('HarpreetKour', 'Priyanka Agarwal', 'MuskanSethi')"} {"row": 203, "completion_input": "\"\"\"Write a function to convert radians to degrees.\"\"\"\n\ndef degree_radian(", "completion_prefix": "def degree_radian(", "chat_input": [{"role": "user", "content": "Write a function to convert radians to degrees.\nThe function should be named `degree_radian`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert degree_radian(90)==5156.620156177409\nassert degree_radian(60)==3437.746770784939\nassert degree_radian(120)==6875.493541569878"} {"row": 204, "completion_input": "\"\"\"Write a function to decode a run-length encoded given list.\"\"\"\n\ndef decode_list(", "completion_prefix": "def decode_list(", "chat_input": [{"role": "user", "content": "Write a function to decode a run-length encoded given list.\nThe function should be named `decode_list`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert decode_list([[2, 1], 2, 3, [2, 4], 5,1])==[1,1,2,3,4,4,5,1]\nassert decode_list(['a', 'u', 't', 'o', 'm', 'a', 't', 'i', 'c', 'a', [2, 'l'], 'y'])==['a', 'u', 't', 'o', 'm', 'a', 't', 'i', 'c', 'a', 'l', 'l', 'y']\nassert decode_list(['p', 'y', 't', 'h', 'o', 'n'])==['p', 'y', 't', 'h', 'o', 'n']"} {"row": 205, "completion_input": "\"\"\"Write a function to check if a nested list is a subset of another nested list.\"\"\"\n\ndef check_subset_list(", "completion_prefix": "def check_subset_list(", "chat_input": [{"role": "user", "content": "Write a function to check if a nested list is a subset of another nested list.\nThe function should be named `check_subset_list`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert check_subset_list([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14],[[12, 18, 23, 25, 45], [7, 11, 19, 24, 28], [1, 5, 8, 18, 15, 16]])==False\nassert check_subset_list([[2, 3, 1], [4, 5], [6, 8]],[[4, 5], [6, 8]])==True\nassert check_subset_list([['a', 'b'], ['e'], ['c', 'd']],[['g']])==False"} {"row": 206, "completion_input": "\"\"\"Write a python function to find the first repeated character in a given string.\"\"\"\n\ndef first_Repeated_Char(", "completion_prefix": "def first_Repeated_Char(", "chat_input": [{"role": "user", "content": "Write a python function to find the first repeated character in a given string.\nThe function should be named `first_Repeated_Char`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert first_Repeated_Char(\"Google\") == \"o\"\nassert first_Repeated_Char(\"data\") == \"a\"\nassert first_Repeated_Char(\"python\") == '\\0'"} {"row": 207, "completion_input": "\"\"\"Write a python function to find the minimum operations required to make two numbers equal.\"\"\"\n\ndef min_Operations(", "completion_prefix": "def min_Operations(", "chat_input": [{"role": "user", "content": "Write a python function to find the minimum operations required to make two numbers equal.\nThe function should be named `min_Operations`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert min_Operations(2,4) == 1\nassert min_Operations(4,10) == 4\nassert min_Operations(1,4) == 3"} {"row": 208, "completion_input": "\"\"\"Write a function to extract maximum and minimum k elements in the given tuple.\"\"\"\n\ndef extract_min_max(", "completion_prefix": "def extract_min_max(", "chat_input": [{"role": "user", "content": "Write a function to extract maximum and minimum k elements in the given tuple.\nThe function should be named `extract_min_max`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert extract_min_max((5, 20, 3, 7, 6, 8), 2) == (3, 5, 8, 20)\nassert extract_min_max((4, 5, 6, 1, 2, 7), 3) == (1, 2, 4, 5, 6, 7)\nassert extract_min_max((2, 3, 4, 8, 9, 11, 7), 4) == (2, 3, 4, 7, 8, 9, 11)"} {"row": 209, "completion_input": "\"\"\"Write a function to replace maximum n occurrences of spaces, commas, or dots with a colon.\"\"\"\n\ndef replace_max_specialchar(", "completion_prefix": "def replace_max_specialchar(", "chat_input": [{"role": "user", "content": "Write a function to replace maximum n occurrences of spaces, commas, or dots with a colon.\nThe function should be named `replace_max_specialchar`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert replace_max_specialchar('Python language, Programming language.',2)==('Python:language: Programming language.')\nassert replace_max_specialchar('a b c,d e f',3)==('a:b:c:d e f')\nassert replace_max_specialchar('ram reshma,ram rahim',1)==('ram:reshma,ram rahim')"} {"row": 210, "completion_input": "\"\"\"Write a python function to find the first even number in a given list of numbers.\"\"\"\n\ndef first_even(", "completion_prefix": "def first_even(", "chat_input": [{"role": "user", "content": "Write a python function to find the first even number in a given list of numbers.\nThe function should be named `first_even`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert first_even ([1, 3, 5, 7, 4, 1, 6, 8]) == 4\nassert first_even([2, 3, 4]) == 2\nassert first_even([5, 6, 7]) == 6"} {"row": 211, "completion_input": "\"\"\"Write a function to check if all the elements in tuple have same data type or not.\"\"\"\n\ndef check_type(", "completion_prefix": "def check_type(", "chat_input": [{"role": "user", "content": "Write a function to check if all the elements in tuple have same data type or not.\nThe function should be named `check_type`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert check_type((5, 6, 7, 3, 5, 6) ) == True\nassert check_type((1, 2, \"4\") ) == False\nassert check_type((3, 2, 1, 4, 5) ) == True"} {"row": 212, "completion_input": "\"\"\"Write a function to check for majority element in the given sorted array.\"\"\"\n\ndef is_majority(", "completion_prefix": "def is_majority(", "chat_input": [{"role": "user", "content": "Write a function to check for majority element in the given sorted array.\nThe function should be named `is_majority`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert is_majority([1, 2, 3, 3, 3, 3, 10], 7, 3) == True\nassert is_majority([1, 1, 2, 4, 4, 4, 6, 6], 8, 4) == False\nassert is_majority([1, 1, 1, 2, 2], 5, 1) == True"} {"row": 213, "completion_input": "\"\"\"Write a python function to count set bits of a given number.\"\"\"\n\ndef count_Set_Bits(", "completion_prefix": "def count_Set_Bits(", "chat_input": [{"role": "user", "content": "Write a python function to count set bits of a given number.\nThe function should be named `count_Set_Bits`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_Set_Bits(2) == 1\nassert count_Set_Bits(4) == 1\nassert count_Set_Bits(6) == 2"} {"row": 214, "completion_input": "\"\"\"Write a python function to find the minimum element in a sorted and rotated array.\"\"\"\n\ndef find_Min(", "completion_prefix": "def find_Min(", "chat_input": [{"role": "user", "content": "Write a python function to find the minimum element in a sorted and rotated array.\nThe function should be named `find_Min`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_Min([1,2,3,4,5],0,4) == 1\nassert find_Min([4,6,8],0,2) == 4\nassert find_Min([2,3,5,7,9],0,4) == 2"} {"row": 215, "completion_input": "\"\"\"Write a python function to remove the characters which have odd index values of a given string.\"\"\"\n\ndef odd_values_string(", "completion_prefix": "def odd_values_string(", "chat_input": [{"role": "user", "content": "Write a python function to remove the characters which have odd index values of a given string.\nThe function should be named `odd_values_string`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert odd_values_string('abcdef') == 'ace'\nassert odd_values_string('python') == 'pto'\nassert odd_values_string('data') == 'dt'"} {"row": 216, "completion_input": "\"\"\"Write a function to find minimum of three numbers.\"\"\"\n\ndef min_of_three(", "completion_prefix": "def min_of_three(", "chat_input": [{"role": "user", "content": "Write a function to find minimum of three numbers.\nThe function should be named `min_of_three`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert min_of_three(10,20,0)==0\nassert min_of_three(19,15,18)==15\nassert min_of_three(-10,-20,-30)==-30"} {"row": 217, "completion_input": "\"\"\"Write a python function to check whether all the bits are unset in the given range or not.\"\"\"\n\ndef all_Bits_Set_In_The_Given_Range(", "completion_prefix": "def all_Bits_Set_In_The_Given_Range(", "chat_input": [{"role": "user", "content": "Write a python function to check whether all the bits are unset in the given range or not.\nThe function should be named `all_Bits_Set_In_The_Given_Range`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert all_Bits_Set_In_The_Given_Range(4,1,2) == True\nassert all_Bits_Set_In_The_Given_Range(17,2,4) == True\nassert all_Bits_Set_In_The_Given_Range(39,4,6) == False"} {"row": 218, "completion_input": "\"\"\"Write a function to re-arrange the elements of the given array so that all negative elements appear before positive ones.\"\"\"\n\ndef re_arrange_array(", "completion_prefix": "def re_arrange_array(", "chat_input": [{"role": "user", "content": "Write a function to re-arrange the elements of the given array so that all negative elements appear before positive ones.\nThe function should be named `re_arrange_array`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert re_arrange_array([-1, 2, -3, 4, 5, 6, -7, 8, 9], 9) == [-1, -3, -7, 4, 5, 6, 2, 8, 9]\nassert re_arrange_array([12, -14, -26, 13, 15], 5) == [-14, -26, 12, 13, 15]\nassert re_arrange_array([10, 24, 36, -42, -39, -78, 85], 7) == [-42, -39, -78, 10, 24, 36, 85]"} {"row": 219, "completion_input": "\"\"\"Write a function to replace blank spaces with any character in a string.\"\"\"\n\ndef replace_blank(", "completion_prefix": "def replace_blank(", "chat_input": [{"role": "user", "content": "Write a function to replace blank spaces with any character in a string.\nThe function should be named `replace_blank`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert replace_blank(\"hello people\",'@')==(\"hello@people\")\nassert replace_blank(\"python program language\",'$')==(\"python$program$language\")\nassert replace_blank(\"blank space\",\"-\")==(\"blank-space\")"} {"row": 220, "completion_input": "\"\"\"Write a function to find the maximum sum in the given right triangle of numbers.\"\"\"\n\ndef max_sum(", "completion_prefix": "def max_sum(", "chat_input": [{"role": "user", "content": "Write a function to find the maximum sum in the given right triangle of numbers.\nThe function should be named `max_sum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert max_sum([[1], [2,1], [3,3,2]], 3) == 6\nassert max_sum([[1], [1, 2], [4, 1, 12]], 3) == 15 \nassert max_sum([[2], [3,2], [13,23,12]], 3) == 28"} {"row": 221, "completion_input": "\"\"\"Write a function to get the n largest items from a dataset.\"\"\"\n\ndef larg_nnum(", "completion_prefix": "def larg_nnum(", "chat_input": [{"role": "user", "content": "Write a function to get the n largest items from a dataset.\nThe function should be named `larg_nnum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert larg_nnum([10, 20, 50, 70, 90, 20, 50, 40, 60, 80, 100],2)==[100,90]\nassert larg_nnum([10, 20, 50, 70, 90, 20, 50, 40, 60, 80, 100],5)==[100,90,80,70,60]\nassert larg_nnum([10, 20, 50, 70, 90, 20, 50, 40, 60, 80, 100],3)==[100,90,80]"} {"row": 222, "completion_input": "\"\"\"Write a function to find the lateral surface area of a cylinder.\"\"\"\n\ndef lateralsuface_cylinder(", "completion_prefix": "def lateralsuface_cylinder(", "chat_input": [{"role": "user", "content": "Write a function to find the lateral surface area of a cylinder.\nThe function should be named `lateralsuface_cylinder`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert lateralsuface_cylinder(10,5)==314.15000000000003\nassert lateralsuface_cylinder(4,5)==125.66000000000001\nassert lateralsuface_cylinder(4,10)==251.32000000000002"} {"row": 223, "completion_input": "\"\"\"Write a function to find the volume of a cube.\"\"\"\n\ndef volume_cube(", "completion_prefix": "def volume_cube(", "chat_input": [{"role": "user", "content": "Write a function to find the volume of a cube.\nThe function should be named `volume_cube`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert volume_cube(3)==27\nassert volume_cube(2)==8\nassert volume_cube(5)==125"} {"row": 224, "completion_input": "\"\"\"Write a python function to set all even bits of a given number.\"\"\"\n\ndef even_bit_set_number(", "completion_prefix": "def even_bit_set_number(", "chat_input": [{"role": "user", "content": "Write a python function to set all even bits of a given number.\nThe function should be named `even_bit_set_number`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert even_bit_set_number(10) == 10\nassert even_bit_set_number(20) == 30\nassert even_bit_set_number(30) == 30"} {"row": 225, "completion_input": "\"\"\"Write a python function to count the maximum number of equilateral triangles that can be formed within a given equilateral triangle.\"\"\"\n\ndef No_of_Triangle(", "completion_prefix": "def No_of_Triangle(", "chat_input": [{"role": "user", "content": "Write a python function to count the maximum number of equilateral triangles that can be formed within a given equilateral triangle.\nThe function should be named `No_of_Triangle`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert No_of_Triangle(4,2) == 7\nassert No_of_Triangle(4,3) == 3\nassert No_of_Triangle(1,3) == -1"} {"row": 226, "completion_input": "\"\"\"Write a function to check the occurrences of records which occur similar times in the given tuples.\"\"\"\n\ndef check_occurences(", "completion_prefix": "def check_occurences(", "chat_input": [{"role": "user", "content": "Write a function to check the occurrences of records which occur similar times in the given tuples.\nThe function should be named `check_occurences`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert check_occurences([(3, 1), (1, 3), (2, 5), (5, 2), (6, 3)] ) == {(1, 3): 2, (2, 5): 2, (3, 6): 1}\nassert check_occurences([(4, 2), (2, 4), (3, 6), (6, 3), (7, 4)] ) == {(2, 4): 2, (3, 6): 2, (4, 7): 1}\nassert check_occurences([(13, 2), (11, 23), (12, 25), (25, 12), (16, 23)] ) == {(2, 13): 1, (11, 23): 1, (12, 25): 2, (16, 23): 1}"} {"row": 227, "completion_input": "\"\"\"Write a python function to count number of non-empty substrings of a given string.\"\"\"\n\ndef number_of_substrings(", "completion_prefix": "def number_of_substrings(", "chat_input": [{"role": "user", "content": "Write a python function to count number of non-empty substrings of a given string.\nThe function should be named `number_of_substrings`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert number_of_substrings(\"abc\") == 6\nassert number_of_substrings(\"abcd\") == 10\nassert number_of_substrings(\"abcde\") == 15"} {"row": 228, "completion_input": "\"\"\"Write a function to find the number of possible sequences of length n such that each of the next element is greater than or equal to twice of the previous element but less than or equal to m.\"\"\"\n\ndef get_total_number_of_sequences(", "completion_prefix": "def get_total_number_of_sequences(", "chat_input": [{"role": "user", "content": "Write a function to find the number of possible sequences of length n such that each of the next element is greater than or equal to twice of the previous element but less than or equal to m.\nThe function should be named `get_total_number_of_sequences`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert get_total_number_of_sequences(10, 4) == 4\nassert get_total_number_of_sequences(5, 2) == 6\nassert get_total_number_of_sequences(16, 3) == 84"} {"row": 229, "completion_input": "\"\"\"Write a function to replace the last element of the list with another list.\"\"\"\n\ndef replace_list(", "completion_prefix": "def replace_list(", "chat_input": [{"role": "user", "content": "Write a function to replace the last element of the list with another list.\nThe function should be named `replace_list`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert replace_list([1, 3, 5, 7, 9, 10],[2, 4, 6, 8])==[1, 3, 5, 7, 9, 2, 4, 6, 8]\nassert replace_list([1,2,3,4,5],[5,6,7,8])==[1,2,3,4,5,6,7,8]\nassert replace_list([\"red\",\"blue\",\"green\"],[\"yellow\"])==[\"red\",\"blue\",\"yellow\"]"} {"row": 230, "completion_input": "\"\"\"Write a function to generate a 3d array having each element as '*'.\"\"\"\n\ndef array_3d(", "completion_prefix": "def array_3d(", "chat_input": [{"role": "user", "content": "Write a function to generate a 3d array having each element as '*'.\nThe function should be named `array_3d`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert array_3d(6,4,3)==[[['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*']], [['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*']], [['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*']]]\nassert array_3d(5,3,4)==[[['*', '*', '*', '*', '*'], ['*', '*', '*', '*','*'], ['*', '*', '*', '*', '*']], [['*', '*', '*', '*', '*'],['*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*']], [['*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*']], [['*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*']]]\nassert array_3d(1,2,3)==[[['*'],['*']],[['*'],['*']],[['*'],['*']]]"} {"row": 231, "completion_input": "\"\"\"Write a function to count total characters in a string.\"\"\"\n\ndef count_charac(", "completion_prefix": "def count_charac(", "chat_input": [{"role": "user", "content": "Write a function to count total characters in a string.\nThe function should be named `count_charac`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_charac(\"python programming\")==18\nassert count_charac(\"language\")==8\nassert count_charac(\"words\")==5"} {"row": 232, "completion_input": "\"\"\"Write a function to sort the given list based on the occurrence of first element of tuples.\"\"\"\n\ndef sort_on_occurence(", "completion_prefix": "def sort_on_occurence(", "chat_input": [{"role": "user", "content": "Write a function to sort the given list based on the occurrence of first element of tuples.\nThe function should be named `sort_on_occurence`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert sort_on_occurence([(1, 'Jake'), (2, 'Bob'), (1, 'Cara')]) == [(1, 'Jake', 'Cara', 2), (2, 'Bob', 1)]\nassert sort_on_occurence([('b', 'ball'), ('a', 'arm'), ('b', 'b'), ('a', 'ant')]) == [('b', 'ball', 'b', 2), ('a', 'arm', 'ant', 2)]\nassert sort_on_occurence([(2, 'Mark'), (3, 'Maze'), (2, 'Sara')]) == [(2, 'Mark', 'Sara', 2), (3, 'Maze', 1)]"} {"row": 233, "completion_input": "\"\"\"Write a python function to find the next perfect square greater than a given number.\"\"\"\n\ndef next_Perfect_Square(", "completion_prefix": "def next_Perfect_Square(", "chat_input": [{"role": "user", "content": "Write a python function to find the next perfect square greater than a given number.\nThe function should be named `next_Perfect_Square`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert next_Perfect_Square(35) == 36\nassert next_Perfect_Square(6) == 9\nassert next_Perfect_Square(9) == 16"} {"row": 234, "completion_input": "\"\"\"Write a function to find the maximum sum of bi-tonic sub-sequence for the given array.\"\"\"\n\ndef max_sum(", "completion_prefix": "def max_sum(", "chat_input": [{"role": "user", "content": "Write a function to find the maximum sum of bi-tonic sub-sequence for the given array.\nThe function should be named `max_sum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert max_sum([1, 15, 51, 45, 33, 100, 12, 18, 9], 9) == 194\nassert max_sum([80, 60, 30, 40, 20, 10], 6) == 210\nassert max_sum([2, 3 ,14, 16, 21, 23, 29, 30], 8) == 138"} {"row": 235, "completion_input": "\"\"\"Write a function for computing square roots using the babylonian method.\"\"\"\n\ndef babylonian_squareroot(", "completion_prefix": "def babylonian_squareroot(", "chat_input": [{"role": "user", "content": "Write a function for computing square roots using the babylonian method.\nThe function should be named `babylonian_squareroot`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert babylonian_squareroot(10)==3.162277660168379\nassert babylonian_squareroot(2)==1.414213562373095\nassert babylonian_squareroot(9)==3.0"} {"row": 236, "completion_input": "\"\"\"Write a function to find the longest palindromic subsequence in the given string.\"\"\"\n\ndef lps(", "completion_prefix": "def lps(", "chat_input": [{"role": "user", "content": "Write a function to find the longest palindromic subsequence in the given string.\nThe function should be named `lps`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert lps(\"TENS FOR TENS\") == 5 \nassert lps(\"CARDIO FOR CARDS\") == 7\nassert lps(\"PART OF THE JOURNEY IS PART\") == 9 "} {"row": 237, "completion_input": "\"\"\"Write a function to calculate the harmonic sum of n-1.\"\"\"\n\ndef harmonic_sum(", "completion_prefix": "def harmonic_sum(", "chat_input": [{"role": "user", "content": "Write a function to calculate the harmonic sum of n-1.\nThe function should be named `harmonic_sum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert harmonic_sum(7) == 2.5928571428571425\nassert harmonic_sum(4) == 2.083333333333333\nassert harmonic_sum(19) == 3.547739657143682"} {"row": 238, "completion_input": "\"\"\"Write a function to find the intersection of two arrays using lambda function.\"\"\"\n\ndef intersection_array(", "completion_prefix": "def intersection_array(", "chat_input": [{"role": "user", "content": "Write a function to find the intersection of two arrays using lambda function.\nThe function should be named `intersection_array`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert intersection_array([1, 2, 3, 5, 7, 8, 9, 10],[1, 2, 4, 8, 9])==[1, 2, 8, 9]\nassert intersection_array([1, 2, 3, 5, 7, 8, 9, 10],[3,5,7,9])==[3,5,7,9]\nassert intersection_array([1, 2, 3, 5, 7, 8, 9, 10],[10,20,30,40])==[10]"} {"row": 239, "completion_input": "\"\"\"Write a python function to count the occcurences of an element in a tuple.\"\"\"\n\ndef count_X(", "completion_prefix": "def count_X(", "chat_input": [{"role": "user", "content": "Write a python function to count the occcurences of an element in a tuple.\nThe function should be named `count_X`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_X((10, 8, 5, 2, 10, 15, 10, 8, 5, 8, 8, 2),4) == 0\nassert count_X((10, 8, 5, 2, 10, 15, 10, 8, 5, 8, 8, 2),10) == 3\nassert count_X((10, 8, 5, 2, 10, 15, 10, 8, 5, 8, 8, 2),8) == 4"} {"row": 240, "completion_input": "\"\"\"Write a function to insert an element before each element of a list.\"\"\"\n\ndef insert_element(", "completion_prefix": "def insert_element(", "chat_input": [{"role": "user", "content": "Write a function to insert an element before each element of a list.\nThe function should be named `insert_element`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert insert_element(['Red', 'Green', 'Black'] ,'c')==['c', 'Red', 'c', 'Green', 'c', 'Black'] \nassert insert_element(['python', 'java'] ,'program')==['program', 'python', 'program', 'java'] \nassert insert_element(['happy', 'sad'] ,'laugh')==['laugh', 'happy', 'laugh', 'sad'] "} {"row": 241, "completion_input": "\"\"\"Write a python function to convert complex numbers to polar coordinates.\"\"\"\n\ndef convert(", "completion_prefix": "def convert(", "chat_input": [{"role": "user", "content": "Write a python function to convert complex numbers to polar coordinates.\nThe function should be named `convert`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert convert(1) == (1.0, 0.0)\nassert convert(4) == (4.0,0.0)\nassert convert(5) == (5.0,0.0)"} {"row": 242, "completion_input": "\"\"\"Write a python function to count integers from a given list.\"\"\"\n\ndef count_integer(", "completion_prefix": "def count_integer(", "chat_input": [{"role": "user", "content": "Write a python function to count integers from a given list.\nThe function should be named `count_integer`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_integer([1,2,'abc',1.2]) == 2\nassert count_integer([1,2,3]) == 3\nassert count_integer([1,1.2,4,5.1]) == 2"} {"row": 243, "completion_input": "\"\"\"Write a function to find all words starting with 'a' or 'e' in a given string.\"\"\"\n\ndef words_ae(", "completion_prefix": "def words_ae(", "chat_input": [{"role": "user", "content": "Write a function to find all words starting with 'a' or 'e' in a given string.\nThe function should be named `words_ae`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert words_ae(\"python programe\")==['ame']\nassert words_ae(\"python programe language\")==['ame','anguage']\nassert words_ae(\"assert statement\")==['assert', 'atement']"} {"row": 244, "completion_input": "\"\"\"Write a function to choose specified number of colours from three different colours and generate all the combinations with repetitions.\"\"\"\n\ndef combinations_colors(", "completion_prefix": "def combinations_colors(", "chat_input": [{"role": "user", "content": "Write a function to choose specified number of colours from three different colours and generate all the combinations with repetitions.\nThe function should be named `combinations_colors`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert combinations_colors( [\"Red\",\"Green\",\"Blue\"],1)==[('Red',), ('Green',), ('Blue',)]\nassert combinations_colors( [\"Red\",\"Green\",\"Blue\"],2)==[('Red', 'Red'), ('Red', 'Green'), ('Red', 'Blue'), ('Green', 'Green'), ('Green', 'Blue'), ('Blue', 'Blue')]\nassert combinations_colors( [\"Red\",\"Green\",\"Blue\"],3)==[('Red', 'Red', 'Red'), ('Red', 'Red', 'Green'), ('Red', 'Red', 'Blue'), ('Red', 'Green', 'Green'), ('Red', 'Green', 'Blue'), ('Red', 'Blue', 'Blue'), ('Green', 'Green', 'Green'), ('Green', 'Green', 'Blue'), ('Green', 'Blue', 'Blue'), ('Blue', 'Blue', 'Blue')]"} {"row": 245, "completion_input": "\"\"\"Write a python function to count the number of prime numbers less than a given non-negative number.\"\"\"\n\ndef count_Primes_nums(", "completion_prefix": "def count_Primes_nums(", "chat_input": [{"role": "user", "content": "Write a python function to count the number of prime numbers less than a given non-negative number.\nThe function should be named `count_Primes_nums`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_Primes_nums(5) == 2\nassert count_Primes_nums(10) == 4\nassert count_Primes_nums(100) == 25"} {"row": 246, "completion_input": "\"\"\"Write a function to swap two numbers.\"\"\"\n\ndef swap_numbers(", "completion_prefix": "def swap_numbers(", "chat_input": [{"role": "user", "content": "Write a function to swap two numbers.\nThe function should be named `swap_numbers`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert swap_numbers(10,20)==(20,10)\nassert swap_numbers(15,17)==(17,15)\nassert swap_numbers(100,200)==(200,100)"} {"row": 247, "completion_input": "\"\"\"Write a function to find number of odd elements in the given list using lambda function.\"\"\"\n\ndef count_odd(", "completion_prefix": "def count_odd(", "chat_input": [{"role": "user", "content": "Write a function to find number of odd elements in the given list using lambda function.\nThe function should be named `count_odd`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_odd([1, 2, 3, 5, 7, 8, 10])==4\nassert count_odd([10,15,14,13,-18,12,-20])==2\nassert count_odd([1, 2, 4, 8, 9])==2"} {"row": 248, "completion_input": "\"\"\"Write a function to maximize the given two tuples.\"\"\"\n\ndef maximize_elements(", "completion_prefix": "def maximize_elements(", "chat_input": [{"role": "user", "content": "Write a function to maximize the given two tuples.\nThe function should be named `maximize_elements`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert maximize_elements(((1, 3), (4, 5), (2, 9), (1, 10)), ((6, 7), (3, 9), (1, 1), (7, 3))) == ((6, 7), (4, 9), (2, 9), (7, 10))\nassert maximize_elements(((2, 4), (5, 6), (3, 10), (2, 11)), ((7, 8), (4, 10), (2, 2), (8, 4))) == ((7, 8), (5, 10), (3, 10), (8, 11))\nassert maximize_elements(((3, 5), (6, 7), (4, 11), (3, 12)), ((8, 9), (5, 11), (3, 3), (9, 5))) == ((8, 9), (6, 11), (4, 11), (9, 12))"} {"row": 249, "completion_input": "\"\"\"Write a function to find the nth newman–shanks–williams prime number.\"\"\"\n\ndef newman_prime(", "completion_prefix": "def newman_prime(", "chat_input": [{"role": "user", "content": "Write a function to find the nth newman–shanks–williams prime number.\nThe function should be named `newman_prime`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert newman_prime(3) == 7 \nassert newman_prime(4) == 17\nassert newman_prime(5) == 41"} {"row": 250, "completion_input": "\"\"\"Write a function to perform mathematical division operation across the given tuples.\"\"\"\n\ndef division_elements(", "completion_prefix": "def division_elements(", "chat_input": [{"role": "user", "content": "Write a function to perform mathematical division operation across the given tuples.\nThe function should be named `division_elements`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert division_elements((10, 4, 6, 9),(5, 2, 3, 3)) == (2, 2, 2, 3)\nassert division_elements((12, 6, 8, 16),(6, 3, 4, 4)) == (2, 2, 2, 4)\nassert division_elements((20, 14, 36, 18),(5, 7, 6, 9)) == (4, 2, 6, 2)"} {"row": 251, "completion_input": "\"\"\"Write a function to split a given list into two parts where the length of the first part of the list is given.\"\"\"\n\ndef split_two_parts(", "completion_prefix": "def split_two_parts(", "chat_input": [{"role": "user", "content": "Write a function to split a given list into two parts where the length of the first part of the list is given.\nThe function should be named `split_two_parts`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert split_two_parts([1,1,2,3,4,4,5,1],3)==([1, 1, 2], [3, 4, 4, 5, 1])\nassert split_two_parts(['a', 'b', 'c', 'd'],2)==(['a', 'b'], ['c', 'd'])\nassert split_two_parts(['p', 'y', 't', 'h', 'o', 'n'],4)==(['p', 'y', 't', 'h'], ['o', 'n'])"} {"row": 252, "completion_input": "\"\"\"Write a function to merge two dictionaries.\"\"\"\n\ndef merge_dict(", "completion_prefix": "def merge_dict(", "chat_input": [{"role": "user", "content": "Write a function to merge two dictionaries.\nThe function should be named `merge_dict`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert merge_dict({'a': 100, 'b': 200},{'x': 300, 'y': 200})=={'x': 300, 'y': 200, 'a': 100, 'b': 200}\nassert merge_dict({'a':900,'b':900,'d':900},{'a':900,'b':900,'d':900})=={'a':900,'b':900,'d':900,'a':900,'b':900,'d':900}\nassert merge_dict({'a':10,'b':20},{'x':30,'y':40})=={'x':30,'y':40,'a':10,'b':20}"} {"row": 253, "completion_input": "\"\"\"Write a function to calculate a dog's age in dog's years.\"\"\"\n\ndef dog_age(", "completion_prefix": "def dog_age(", "chat_input": [{"role": "user", "content": "Write a function to calculate a dog's age in dog's years.\nThe function should be named `dog_age`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert dog_age(12)==61\nassert dog_age(15)==73\nassert dog_age(24)==109"} {"row": 254, "completion_input": "\"\"\"Write a function to split a list for every nth element.\"\"\"\n\ndef list_split(", "completion_prefix": "def list_split(", "chat_input": [{"role": "user", "content": "Write a function to split a list for every nth element.\nThe function should be named `list_split`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert list_split(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n'],3)==[['a', 'd', 'g', 'j', 'm'], ['b', 'e', 'h', 'k', 'n'], ['c', 'f', 'i', 'l']] \nassert list_split([1,2,3,4,5,6,7,8,9,10,11,12,13,14],3)==[[1,4,7,10,13], [2,5,8,11,14], [3,6,9,12]] \nassert list_split(['python','java','C','C++','DBMS','SQL'],2)==[['python', 'C', 'DBMS'], ['java', 'C++', 'SQL']] "} {"row": 255, "completion_input": "\"\"\"Write a function to find the lateral surface area of a cube.\"\"\"\n\ndef lateralsurface_cube(", "completion_prefix": "def lateralsurface_cube(", "chat_input": [{"role": "user", "content": "Write a function to find the lateral surface area of a cube.\nThe function should be named `lateralsurface_cube`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert lateralsurface_cube(5)==100\nassert lateralsurface_cube(9)==324\nassert lateralsurface_cube(10)==400"} {"row": 256, "completion_input": "\"\"\"Write a python function to find the sum of squares of first n odd natural numbers.\"\"\"\n\ndef square_Sum(", "completion_prefix": "def square_Sum(", "chat_input": [{"role": "user", "content": "Write a python function to find the sum of squares of first n odd natural numbers.\nThe function should be named `square_Sum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert square_Sum(2) == 10\nassert square_Sum(3) == 35\nassert square_Sum(4) == 84"} {"row": 257, "completion_input": "\"\"\"Write a function to find the n'th star number.\"\"\"\n\ndef find_star_num(", "completion_prefix": "def find_star_num(", "chat_input": [{"role": "user", "content": "Write a function to find the n'th star number.\nThe function should be named `find_star_num`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_star_num(3) == 37\nassert find_star_num(4) == 73\nassert find_star_num(5) == 121"} {"row": 258, "completion_input": "\"\"\"Write a function to find the ascii value of a character.\"\"\"\n\ndef ascii_value(", "completion_prefix": "def ascii_value(", "chat_input": [{"role": "user", "content": "Write a function to find the ascii value of a character.\nThe function should be named `ascii_value`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert ascii_value('A')==65\nassert ascii_value('R')==82\nassert ascii_value('S')==83"} {"row": 259, "completion_input": "\"\"\"Write a python function to find the sum of even numbers at even positions.\"\"\"\n\ndef sum_even_and_even_index(", "completion_prefix": "def sum_even_and_even_index(", "chat_input": [{"role": "user", "content": "Write a python function to find the sum of even numbers at even positions.\nThe function should be named `sum_even_and_even_index`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert sum_even_and_even_index([5, 6, 12, 1, 18, 8],6) == 30\nassert sum_even_and_even_index([3, 20, 17, 9, 2, 10, 18, 13, 6, 18],10) == 26\nassert sum_even_and_even_index([5, 6, 12, 1],4) == 12"} {"row": 260, "completion_input": "\"\"\"Write a python function to find the sum of fifth power of first n even natural numbers.\"\"\"\n\ndef even_Power_Sum(", "completion_prefix": "def even_Power_Sum(", "chat_input": [{"role": "user", "content": "Write a python function to find the sum of fifth power of first n even natural numbers.\nThe function should be named `even_Power_Sum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert even_Power_Sum(2) == 1056\nassert even_Power_Sum(3) == 8832\nassert even_Power_Sum(1) == 32"} {"row": 261, "completion_input": "\"\"\"Write a function to perfom the rear element extraction from list of tuples records.\"\"\"\n\ndef rear_extract(", "completion_prefix": "def rear_extract(", "chat_input": [{"role": "user", "content": "Write a function to perfom the rear element extraction from list of tuples records.\nThe function should be named `rear_extract`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert rear_extract([(1, 'Rash', 21), (2, 'Varsha', 20), (3, 'Kil', 19)]) == [21, 20, 19]\nassert rear_extract([(1, 'Sai', 36), (2, 'Ayesha', 25), (3, 'Salman', 45)]) == [36, 25, 45]\nassert rear_extract([(1, 'Sudeep', 14), (2, 'Vandana', 36), (3, 'Dawood', 56)]) == [14, 36, 56]"} {"row": 262, "completion_input": "\"\"\"Write a function to substract the contents of one tuple with corresponding index of other tuple.\"\"\"\n\ndef substract_elements(", "completion_prefix": "def substract_elements(", "chat_input": [{"role": "user", "content": "Write a function to substract the contents of one tuple with corresponding index of other tuple.\nThe function should be named `substract_elements`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert substract_elements((10, 4, 5), (2, 5, 18)) == (8, -1, -13)\nassert substract_elements((11, 2, 3), (24, 45 ,16)) == (-13, -43, -13)\nassert substract_elements((7, 18, 9), (10, 11, 12)) == (-3, 7, -3)"} {"row": 263, "completion_input": "\"\"\"Write a python function to find sum of even index binomial coefficients.\"\"\"\n\ndef even_binomial_Coeff_Sum(", "completion_prefix": "def even_binomial_Coeff_Sum(", "chat_input": [{"role": "user", "content": "Write a python function to find sum of even index binomial coefficients.\nThe function should be named `even_binomial_Coeff_Sum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert even_binomial_Coeff_Sum(4) == 8\nassert even_binomial_Coeff_Sum(6) == 32\nassert even_binomial_Coeff_Sum(2) == 2"} {"row": 264, "completion_input": "\"\"\"Write a python function to find the position of the last removed element from the given array.\"\"\"\n\ndef get_Position(", "completion_prefix": "def get_Position(", "chat_input": [{"role": "user", "content": "Write a python function to find the position of the last removed element from the given array.\nThe function should be named `get_Position`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert get_Position([2,5,4],3,2) == 2\nassert get_Position([4,3],2,2) == 2\nassert get_Position([1,2,3,4],4,1) == 4"} {"row": 265, "completion_input": "\"\"\"Write a function to find the volume of a cylinder.\"\"\"\n\ndef volume_cylinder(", "completion_prefix": "def volume_cylinder(", "chat_input": [{"role": "user", "content": "Write a function to find the volume of a cylinder.\nThe function should be named `volume_cylinder`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert volume_cylinder(10,5)==1570.7500000000002\nassert volume_cylinder(4,5)==251.32000000000002\nassert volume_cylinder(4,10)==502.64000000000004"} {"row": 266, "completion_input": "\"\"\"Write a function to filter a dictionary based on values.\"\"\"\n\ndef dict_filter(", "completion_prefix": "def dict_filter(", "chat_input": [{"role": "user", "content": "Write a function to filter a dictionary based on values.\nThe function should be named `dict_filter`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert dict_filter({'Cierra Vega': 175, 'Alden Cantrell': 180, 'Kierra Gentry': 165, 'Pierre Cox': 190},170)=={'Cierra Vega': 175, 'Alden Cantrell': 180, 'Pierre Cox': 190}\nassert dict_filter({'Cierra Vega': 175, 'Alden Cantrell': 180, 'Kierra Gentry': 165, 'Pierre Cox': 190},180)=={ 'Alden Cantrell': 180, 'Pierre Cox': 190}\nassert dict_filter({'Cierra Vega': 175, 'Alden Cantrell': 180, 'Kierra Gentry': 165, 'Pierre Cox': 190},190)=={ 'Pierre Cox': 190}"} {"row": 267, "completion_input": "\"\"\"Write a function to find the element count that occurs before the record in the given tuple.\"\"\"\n\ndef count_first_elements(", "completion_prefix": "def count_first_elements(", "chat_input": [{"role": "user", "content": "Write a function to find the element count that occurs before the record in the given tuple.\nThe function should be named `count_first_elements`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_first_elements((1, 5, 7, (4, 6), 10) ) == 3\nassert count_first_elements((2, 9, (5, 7), 11) ) == 2\nassert count_first_elements((11, 15, 5, 8, (2, 3), 8) ) == 4"} {"row": 268, "completion_input": "\"\"\"Write a function to find the nth decagonal number.\"\"\"\n\ndef is_num_decagonal(", "completion_prefix": "def is_num_decagonal(", "chat_input": [{"role": "user", "content": "Write a function to find the nth decagonal number.\nThe function should be named `is_num_decagonal`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert is_num_decagonal(3) == 27\nassert is_num_decagonal(7) == 175\nassert is_num_decagonal(10) == 370"} {"row": 269, "completion_input": "\"\"\"Write a function to search an element in the given array by using sequential search.\"\"\"\n\ndef sequential_search(", "completion_prefix": "def sequential_search(", "chat_input": [{"role": "user", "content": "Write a function to search an element in the given array by using sequential search.\nThe function should be named `sequential_search`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert sequential_search([11,23,58,31,56,77,43,12,65,19],31) == (True, 3)\nassert sequential_search([12, 32, 45, 62, 35, 47, 44, 61],61) == (True, 7)\nassert sequential_search([9, 10, 17, 19, 22, 39, 48, 56],48) == (True, 6)"} {"row": 270, "completion_input": "\"\"\"Write a python function to check if the elements of a given list are unique or not.\"\"\"\n\ndef all_unique(", "completion_prefix": "def all_unique(", "chat_input": [{"role": "user", "content": "Write a python function to check if the elements of a given list are unique or not.\nThe function should be named `all_unique`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert all_unique([1,2,3]) == True\nassert all_unique([1,2,1,2]) == False\nassert all_unique([1,2,3,4,5]) == True"} {"row": 271, "completion_input": "\"\"\"Write a function to substaract two lists using map and lambda function.\"\"\"\n\ndef sub_list(", "completion_prefix": "def sub_list(", "chat_input": [{"role": "user", "content": "Write a function to substaract two lists using map and lambda function.\nThe function should be named `sub_list`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert sub_list([1, 2, 3],[4,5,6])==[-3,-3,-3]\nassert sub_list([1,2],[3,4])==[-2,-2]\nassert sub_list([90,120],[50,70])==[40,50]"} {"row": 272, "completion_input": "\"\"\"Write a python function to check whether the frequency of each digit is less than or equal to the digit itself.\"\"\"\n\ndef validate(", "completion_prefix": "def validate(", "chat_input": [{"role": "user", "content": "Write a python function to check whether the frequency of each digit is less than or equal to the digit itself.\nThe function should be named `validate`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert validate(1234) == True\nassert validate(51241) == False\nassert validate(321) == True"} {"row": 273, "completion_input": "\"\"\"Write a function to check whether all items of a list are equal to a given string.\"\"\"\n\ndef check_element(", "completion_prefix": "def check_element(", "chat_input": [{"role": "user", "content": "Write a function to check whether all items of a list are equal to a given string.\nThe function should be named `check_element`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert check_element([\"green\", \"orange\", \"black\", \"white\"],'blue')==False\nassert check_element([1,2,3,4],7)==False\nassert check_element([\"green\", \"green\", \"green\", \"green\"],'green')==True"} {"row": 274, "completion_input": "\"\"\"Write a function that matches a string that has an a followed by two to three 'b'.\"\"\"\n\ndef text_match_two_three(", "completion_prefix": "def text_match_two_three(", "chat_input": [{"role": "user", "content": "Write a function that matches a string that has an a followed by two to three 'b'.\nThe function should be named `text_match_two_three`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert text_match_two_three(\"ac\")==('Not matched!')\nassert text_match_two_three(\"dc\")==('Not matched!')\nassert text_match_two_three(\"abbbba\")==('Found a match!')"} {"row": 275, "completion_input": "\"\"\"Write a function to find the largest sum of contiguous array in the modified array which is formed by repeating the given array k times.\"\"\"\n\ndef max_sub_array_sum_repeated(", "completion_prefix": "def max_sub_array_sum_repeated(", "chat_input": [{"role": "user", "content": "Write a function to find the largest sum of contiguous array in the modified array which is formed by repeating the given array k times.\nThe function should be named `max_sub_array_sum_repeated`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert max_sub_array_sum_repeated([10, 20, -30, -1], 4, 3) == 30\nassert max_sub_array_sum_repeated([-1, 10, 20], 3, 2) == 59\nassert max_sub_array_sum_repeated([-1, -2, -3], 3, 3) == -1"} {"row": 276, "completion_input": "\"\"\"Write a python function to find the sum of squares of first n even natural numbers.\"\"\"\n\ndef square_Sum(", "completion_prefix": "def square_Sum(", "chat_input": [{"role": "user", "content": "Write a python function to find the sum of squares of first n even natural numbers.\nThe function should be named `square_Sum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert square_Sum(2) == 20\nassert square_Sum(3) == 56\nassert square_Sum(4) == 120"} {"row": 277, "completion_input": "\"\"\"Write a function to count array elements having modular inverse under given prime number p equal to itself.\"\"\"\n\ndef modular_inverse(", "completion_prefix": "def modular_inverse(", "chat_input": [{"role": "user", "content": "Write a function to count array elements having modular inverse under given prime number p equal to itself.\nThe function should be named `modular_inverse`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert modular_inverse([ 1, 6, 4, 5 ], 4, 7) == 2\nassert modular_inverse([1, 3, 8, 12, 12], 5, 13) == 3\nassert modular_inverse([2, 3, 4, 5], 4, 6) == 1"} {"row": 278, "completion_input": "\"\"\"Write a python function to calculate the number of odd days in a given year.\"\"\"\n\ndef odd_Days(", "completion_prefix": "def odd_Days(", "chat_input": [{"role": "user", "content": "Write a python function to calculate the number of odd days in a given year.\nThe function should be named `odd_Days`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert odd_Days(100) == 5\nassert odd_Days(50) ==6\nassert odd_Days(75) == 2"} {"row": 279, "completion_input": "\"\"\"Write a function to find the list of lists with maximum length.\"\"\"\n\ndef max_length(", "completion_prefix": "def max_length(", "chat_input": [{"role": "user", "content": "Write a function to find the list of lists with maximum length.\nThe function should be named `max_length`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert max_length([[0], [1, 3], [5, 7], [9, 11], [13, 15, 17]])==(3, [13, 15, 17])\nassert max_length([[1], [5, 7], [10, 12, 14,15]])==(4, [10, 12, 14,15])\nassert max_length([[5], [15,20,25]])==(3, [15,20,25])"} {"row": 280, "completion_input": "\"\"\"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.\"\"\"\n\ndef count_no_of_ways(", "completion_prefix": "def count_no_of_ways(", "chat_input": [{"role": "user", "content": "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.\nThe function should be named `count_no_of_ways`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_no_of_ways(2, 4) == 16\nassert count_no_of_ways(3, 2) == 6\nassert count_no_of_ways(4, 4) == 228"} {"row": 281, "completion_input": "\"\"\"Write a python function to find quotient of two numbers.\"\"\"\n\ndef find(", "completion_prefix": "def find(", "chat_input": [{"role": "user", "content": "Write a python function to find quotient of two numbers.\nThe function should be named `find`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find(10,3) == 3\nassert find(4,2) == 2\nassert find(20,5) == 4"} {"row": 282, "completion_input": "\"\"\"Write a function to find the third side of a right angled triangle.\"\"\"\n\ndef otherside_rightangle(", "completion_prefix": "def otherside_rightangle(", "chat_input": [{"role": "user", "content": "Write a function to find the third side of a right angled triangle.\nThe function should be named `otherside_rightangle`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert otherside_rightangle(7,8)==10.63014581273465\nassert otherside_rightangle(3,4)==5\nassert otherside_rightangle(7,15)==16.55294535724685"} {"row": 283, "completion_input": "\"\"\"Write a function to find the maximum value in a given heterogeneous list.\"\"\"\n\ndef max_val(", "completion_prefix": "def max_val(", "chat_input": [{"role": "user", "content": "Write a function to find the maximum value in a given heterogeneous list.\nThe function should be named `max_val`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert max_val(['Python', 3, 2, 4, 5, 'version'])==5\nassert max_val(['Python', 15, 20, 25])==25\nassert max_val(['Python', 30, 20, 40, 50, 'version'])==50"} {"row": 284, "completion_input": "\"\"\"Write a function to return the sum of all divisors of a number.\"\"\"\n\ndef sum_div(", "completion_prefix": "def sum_div(", "chat_input": [{"role": "user", "content": "Write a function to return the sum of all divisors of a number.\nThe function should be named `sum_div`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert sum_div(8)==7\nassert sum_div(12)==16\nassert sum_div(7)==1"} {"row": 285, "completion_input": "\"\"\"Write a python function to count inversions in an array.\"\"\"\n\ndef get_Inv_Count(", "completion_prefix": "def get_Inv_Count(", "chat_input": [{"role": "user", "content": "Write a python function to count inversions in an array.\nThe function should be named `get_Inv_Count`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert get_Inv_Count([1,20,6,4,5],5) == 5\nassert get_Inv_Count([1,2,1],3) == 1\nassert get_Inv_Count([1,2,5,6,1],5) == 3"} {"row": 286, "completion_input": "\"\"\"Write a function to flatten a given nested list structure.\"\"\"\n\ndef flatten_list(", "completion_prefix": "def flatten_list(", "chat_input": [{"role": "user", "content": "Write a function to flatten a given nested list structure.\nThe function should be named `flatten_list`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert flatten_list([0, 10, [20, 30], 40, 50, [60, 70, 80], [90, 100, 110, 120]])==[0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120]\nassert flatten_list([[10, 20], [40], [30, 56, 25], [10, 20], [33], [40]])==[10, 20, 40, 30, 56, 25, 10, 20, 33, 40]\nassert flatten_list([[1,2,3], [4,5,6], [10,11,12], [7,8,9]])==[1, 2, 3, 4, 5, 6, 10, 11, 12, 7, 8, 9]"} {"row": 287, "completion_input": "\"\"\"Write a function to find the nested list elements which are present in another list.\"\"\"\n\ndef intersection_nested_lists(", "completion_prefix": "def intersection_nested_lists(", "chat_input": [{"role": "user", "content": "Write a function to find the nested list elements which are present in another list.\nThe function should be named `intersection_nested_lists`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert intersection_nested_lists( [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14],[[12, 18, 23, 25, 45], [7, 11, 19, 24, 28], [1, 5, 8, 18, 15, 16]])==[[12], [7, 11], [1, 5, 8]]\nassert intersection_nested_lists([[2, 3, 1], [4, 5], [6, 8]], [[4, 5], [6, 8]])==[[], []]\nassert intersection_nested_lists(['john','amal','joel','george'],[['john'],['jack','john','mary'],['howard','john'],['jude']])==[['john'], ['john'], ['john'], []]"} {"row": 288, "completion_input": "\"\"\"Write a function to calculate the maximum aggregate from the list of tuples.\"\"\"\n\ndef max_aggregate(", "completion_prefix": "def max_aggregate(", "chat_input": [{"role": "user", "content": "Write a function to calculate the maximum aggregate from the list of tuples.\nThe function should be named `max_aggregate`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert max_aggregate([('Juan Whelan',90),('Sabah Colley',88),('Peter Nichols',7),('Juan Whelan',122),('Sabah Colley',84)])==('Juan Whelan', 212)\nassert max_aggregate([('Juan Whelan',50),('Sabah Colley',48),('Peter Nichols',37),('Juan Whelan',22),('Sabah Colley',14)])==('Juan Whelan', 72)\nassert max_aggregate([('Juan Whelan',10),('Sabah Colley',20),('Peter Nichols',30),('Juan Whelan',40),('Sabah Colley',50)])==('Sabah Colley', 70)"} {"row": 289, "completion_input": "\"\"\"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.\"\"\"\n\ndef count_binary_seq(", "completion_prefix": "def count_binary_seq(", "chat_input": [{"role": "user", "content": "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.\nThe function should be named `count_binary_seq`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_binary_seq(1) == 2.0\nassert count_binary_seq(2) == 6.0\nassert count_binary_seq(3) == 20.0"} {"row": 290, "completion_input": "\"\"\"Write a function to find the depth of a dictionary.\"\"\"\n\ndef dict_depth(", "completion_prefix": "def dict_depth(", "chat_input": [{"role": "user", "content": "Write a function to find the depth of a dictionary.\nThe function should be named `dict_depth`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert dict_depth({'a':1, 'b': {'c': {'d': {}}}})==4\nassert dict_depth({'a':1, 'b': {'c':'python'}})==2\nassert dict_depth({1: 'Sun', 2: {3: {4:'Mon'}}})==3"} {"row": 291, "completion_input": "\"\"\"Write a python function to find the most significant bit number which is also a set bit.\"\"\"\n\ndef set_Bit_Number(", "completion_prefix": "def set_Bit_Number(", "chat_input": [{"role": "user", "content": "Write a python function to find the most significant bit number which is also a set bit.\nThe function should be named `set_Bit_Number`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert set_Bit_Number(6) == 4\nassert set_Bit_Number(10) == 8\nassert set_Bit_Number(18) == 16"} {"row": 292, "completion_input": "\"\"\"Write a python function to check whether the count of inversion of two types are same or not.\"\"\"\n\ndef solve(", "completion_prefix": "def solve(", "chat_input": [{"role": "user", "content": "Write a python function to check whether the count of inversion of two types are same or not.\nThe function should be named `solve`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert solve([1,0,2],3) == True\nassert solve([1,2,0],3) == False\nassert solve([1,2,1],3) == True"} {"row": 293, "completion_input": "\"\"\"Write a python function to find element at a given index after number of rotations.\"\"\"\n\ndef find_Element(", "completion_prefix": "def find_Element(", "chat_input": [{"role": "user", "content": "Write a python function to find element at a given index after number of rotations.\nThe function should be named `find_Element`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_Element([1,2,3,4,5],[[0,2],[0,3]],2,1) == 3\nassert find_Element([1,2,3,4],[[0,1],[0,2]],1,2) == 3\nassert find_Element([1,2,3,4,5,6],[[0,1],[0,2]],1,1) == 1"} {"row": 294, "completion_input": "\"\"\"Write a function to match two words from a list of words starting with letter 'p'.\"\"\"\n\ndef start_withp(", "completion_prefix": "def start_withp(", "chat_input": [{"role": "user", "content": "Write a function to match two words from a list of words starting with letter 'p'.\nThe function should be named `start_withp`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert start_withp([\"Python PHP\", \"Java JavaScript\", \"c c++\"])==('Python', 'PHP')\nassert start_withp([\"Python Programming\",\"Java Programming\"])==('Python','Programming')\nassert start_withp([\"Pqrst Pqr\",\"qrstuv\"])==('Pqrst','Pqr')"} {"row": 295, "completion_input": "\"\"\"Write a function to find the maximum sum of increasing subsequence from prefix till ith index and also including a given kth element which is after i, i.e., k > i .\"\"\"\n\ndef max_sum_increasing_subseq(", "completion_prefix": "def max_sum_increasing_subseq(", "chat_input": [{"role": "user", "content": "Write a function to find the maximum sum of increasing subsequence from prefix till ith index and also including a given kth element which is after i, i.e., k > i .\nThe function should be named `max_sum_increasing_subseq`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert max_sum_increasing_subseq([1, 101, 2, 3, 100, 4, 5 ], 7, 4, 6) == 11\nassert max_sum_increasing_subseq([1, 101, 2, 3, 100, 4, 5 ], 7, 2, 5) == 7\nassert max_sum_increasing_subseq([11, 15, 19, 21, 26, 28, 31], 7, 2, 4) == 71"} {"row": 296, "completion_input": "\"\"\"Write a function to get a colon of a tuple.\"\"\"\n\ndef colon_tuplex(", "completion_prefix": "def colon_tuplex(", "chat_input": [{"role": "user", "content": "Write a function to get a colon of a tuple.\nThe function should be named `colon_tuplex`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert colon_tuplex((\"HELLO\", 5, [], True) ,2,50)==(\"HELLO\", 5, [50], True) \nassert colon_tuplex((\"HELLO\", 5, [], True) ,2,100)==((\"HELLO\", 5, [100],True))\nassert colon_tuplex((\"HELLO\", 5, [], True) ,2,500)==(\"HELLO\", 5, [500], True)"} {"row": 297, "completion_input": "\"\"\"Write a function to find the specified number of largest products from two given lists.\"\"\"\n\ndef large_product(", "completion_prefix": "def large_product(", "chat_input": [{"role": "user", "content": "Write a function to find the specified number of largest products from two given lists.\nThe function should be named `large_product`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert large_product([1, 2, 3, 4, 5, 6],[3, 6, 8, 9, 10, 6],3)==[60, 54, 50]\nassert large_product([1, 2, 3, 4, 5, 6],[3, 6, 8, 9, 10, 6],4)==[60, 54, 50, 48]\nassert large_product([1, 2, 3, 4, 5, 6],[3, 6, 8, 9, 10, 6],5)==[60, 54, 50, 48, 45]"} {"row": 298, "completion_input": "\"\"\"Write a python function to find the maximum of two numbers.\"\"\"\n\ndef maximum(", "completion_prefix": "def maximum(", "chat_input": [{"role": "user", "content": "Write a python function to find the maximum of two numbers.\nThe function should be named `maximum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert maximum(5,10) == 10\nassert maximum(-1,-2) == -1\nassert maximum(9,7) == 9"} {"row": 299, "completion_input": "\"\"\"Write a function to convert a given string to a tuple.\"\"\"\n\ndef string_to_tuple(", "completion_prefix": "def string_to_tuple(", "chat_input": [{"role": "user", "content": "Write a function to convert a given string to a tuple.\nThe function should be named `string_to_tuple`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert string_to_tuple(\"python 3.0\")==('p', 'y', 't', 'h', 'o', 'n', '3', '.', '0')\nassert string_to_tuple(\"item1\")==('i', 't', 'e', 'm', '1')\nassert string_to_tuple(\"15.10\")==('1', '5', '.', '1', '0')"} {"row": 300, "completion_input": "\"\"\"Write a python function to set the left most unset bit.\"\"\"\n\ndef set_left_most_unset_bit(", "completion_prefix": "def set_left_most_unset_bit(", "chat_input": [{"role": "user", "content": "Write a python function to set the left most unset bit.\nThe function should be named `set_left_most_unset_bit`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert set_left_most_unset_bit(10) == 14\nassert set_left_most_unset_bit(12) == 14\nassert set_left_most_unset_bit(15) == 15"} {"row": 301, "completion_input": "\"\"\"Write a function to find the volume of a cone.\"\"\"\n\ndef volume_cone(", "completion_prefix": "def volume_cone(", "chat_input": [{"role": "user", "content": "Write a function to find the volume of a cone.\nThe function should be named `volume_cone`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert volume_cone(5,12)==314.15926535897927\nassert volume_cone(10,15)==1570.7963267948965\nassert volume_cone(19,17)==6426.651371693521"} {"row": 302, "completion_input": "\"\"\"Write a python function to print positive numbers in a list.\"\"\"\n\ndef pos_nos(", "completion_prefix": "def pos_nos(", "chat_input": [{"role": "user", "content": "Write a python function to print positive numbers in a list.\nThe function should be named `pos_nos`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert pos_nos([-1,-2,1,2]) == 1,2\nassert pos_nos([3,4,-5]) == 3,4\nassert pos_nos([-2,-3,1]) == 1"} {"row": 303, "completion_input": "\"\"\"Write a function to find out the maximum sum such that no two chosen numbers are adjacent for the given rectangular grid of dimension 2 x n.\"\"\"\n\ndef max_sum_rectangular_grid(", "completion_prefix": "def max_sum_rectangular_grid(", "chat_input": [{"role": "user", "content": "Write a function to find out the maximum sum such that no two chosen numbers are adjacent for the given rectangular grid of dimension 2 x n.\nThe function should be named `max_sum_rectangular_grid`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert max_sum_rectangular_grid([ [1, 4, 5], [2, 0, 0 ] ], 3) == 7\nassert max_sum_rectangular_grid([ [ 1, 2, 3, 4, 5], [ 6, 7, 8, 9, 10] ], 5) == 24\nassert max_sum_rectangular_grid([ [7, 9, 11, 15, 19], [21, 25, 28, 31, 32] ], 5) == 81"} {"row": 304, "completion_input": "\"\"\"Write a python function to find the first maximum length of even word.\"\"\"\n\ndef find_Max_Len_Even(", "completion_prefix": "def find_Max_Len_Even(", "chat_input": [{"role": "user", "content": "Write a python function to find the first maximum length of even word.\nThe function should be named `find_Max_Len_Even`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_Max_Len_Even(\"python language\") == \"language\"\nassert find_Max_Len_Even(\"maximum even length\") == \"length\"\nassert find_Max_Len_Even(\"eve\") == \"-1\""} {"row": 305, "completion_input": "\"\"\"Write a function to find the index of the last occurrence of a given number in a sorted array.\"\"\"\n\ndef find_last_occurrence(", "completion_prefix": "def find_last_occurrence(", "chat_input": [{"role": "user", "content": "Write a function to find the index of the last occurrence of a given number in a sorted array.\nThe function should be named `find_last_occurrence`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_last_occurrence([2, 5, 5, 5, 6, 6, 8, 9, 9, 9], 5) == 3\nassert find_last_occurrence([2, 3, 5, 8, 6, 6, 8, 9, 9, 9], 9) == 9\nassert find_last_occurrence([2, 2, 1, 5, 6, 6, 6, 9, 9, 9], 6) == 6"} {"row": 306, "completion_input": "\"\"\"Write a function to reflect the modified run-length encoding from a list.\"\"\"\n\ndef modified_encode(", "completion_prefix": "def modified_encode(", "chat_input": [{"role": "user", "content": "Write a function to reflect the modified run-length encoding from a list.\nThe function should be named `modified_encode`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert modified_encode([1,1,2,3,4,4,5,1])==[[2, 1], 2, 3, [2, 4], 5, 1]\nassert modified_encode('automatically')==['a', 'u', 't', 'o', 'm', 'a', 't', 'i', 'c', 'a', [2, 'l'], 'y']\nassert modified_encode('python')==['p', 'y', 't', 'h', 'o', 'n']"} {"row": 307, "completion_input": "\"\"\"Write a python function to find the maximum volume of a cuboid with given sum of sides.\"\"\"\n\ndef max_volume(", "completion_prefix": "def max_volume(", "chat_input": [{"role": "user", "content": "Write a python function to find the maximum volume of a cuboid with given sum of sides.\nThe function should be named `max_volume`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert max_volume(8) == 18\nassert max_volume(4) == 2\nassert max_volume(1) == 0"} {"row": 308, "completion_input": "\"\"\"Write a function to find all five characters long word in the given string by using regex.\"\"\"\n\ndef find_long_word(", "completion_prefix": "def find_long_word(", "chat_input": [{"role": "user", "content": "Write a function to find all five characters long word in the given string by using regex.\nThe function should be named `find_long_word`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_long_word('Please move back to strem') == ['strem']\nassert find_long_word('4K Ultra HD streaming player') == ['Ultra']\nassert find_long_word('Streaming Media Player') == ['Media']"} {"row": 309, "completion_input": "\"\"\"Write a function to calculate the difference between the squared sum of first n natural numbers and the sum of squared first n natural numbers.\"\"\"\n\ndef sum_difference(", "completion_prefix": "def sum_difference(", "chat_input": [{"role": "user", "content": "Write a function to calculate the difference between the squared sum of first n natural numbers and the sum of squared first n natural numbers.\nThe function should be named `sum_difference`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert sum_difference(12)==5434\nassert sum_difference(20)==41230\nassert sum_difference(54)==2151270"} {"row": 310, "completion_input": "\"\"\"Write a function to find the demlo number for the given number.\"\"\"\n\ndef find_demlo(", "completion_prefix": "def find_demlo(", "chat_input": [{"role": "user", "content": "Write a function to find the demlo number for the given number.\nThe function should be named `find_demlo`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_demlo(\"111111\") == '12345654321'\nassert find_demlo(\"1111\") == '1234321'\nassert find_demlo(\"13333122222\") == '123456789101110987654321'"} {"row": 311, "completion_input": "\"\"\"Write a function to find all index positions of the minimum values in a given list.\"\"\"\n\ndef position_min(", "completion_prefix": "def position_min(", "chat_input": [{"role": "user", "content": "Write a function to find all index positions of the minimum values in a given list.\nThe function should be named `position_min`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert position_min([12,33,23,10,67,89,45,667,23,12,11,10,54])==[3,11]\nassert position_min([1,2,2,2,4,4,4,5,5,5,5])==[0]\nassert position_min([2,1,5,6,8,3,4,9,10,11,8,12])==[1]"} {"row": 312, "completion_input": "\"\"\"Write a function to re-arrange the given array in alternating positive and negative items.\"\"\"\n\ndef re_arrange(", "completion_prefix": "def re_arrange(", "chat_input": [{"role": "user", "content": "Write a function to re-arrange the given array in alternating positive and negative items.\nThe function should be named `re_arrange`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert re_arrange([-5, -2, 5, 2, 4,\t7, 1, 8, 0, -8], 10) == [-5, 5, -2, 2, -8, 4, 7, 1, 8, 0]\nassert re_arrange([1, 2, 3, -4, -1, 4], 6) == [-4, 1, -1, 2, 3, 4]\nassert re_arrange([4, 7, 9, 77, -4, 5, -3, -9], 8) == [-4, 4, -3, 7, -9, 9, 77, 5]"} {"row": 313, "completion_input": "\"\"\"Write a function to extract the sum of alternate chains of tuples.\"\"\"\n\ndef sum_of_alternates(", "completion_prefix": "def sum_of_alternates(", "chat_input": [{"role": "user", "content": "Write a function to extract the sum of alternate chains of tuples.\nThe function should be named `sum_of_alternates`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert sum_of_alternates((5, 6, 3, 6, 10, 34)) == (46, 18)\nassert sum_of_alternates((1, 2, 3, 4, 5)) == (6, 9)\nassert sum_of_alternates((6, 7, 8, 9, 4, 5)) == (21, 18)"} {"row": 314, "completion_input": "\"\"\"Write a python function to find the minimum number of squares whose sum is equal to a given number.\"\"\"\n\ndef get_Min_Squares(", "completion_prefix": "def get_Min_Squares(", "chat_input": [{"role": "user", "content": "Write a python function to find the minimum number of squares whose sum is equal to a given number.\nThe function should be named `get_Min_Squares`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert get_Min_Squares(6) == 3\nassert get_Min_Squares(2) == 2\nassert get_Min_Squares(4) == 1"} {"row": 315, "completion_input": "\"\"\"Write a function to get the word with most number of occurrences in the given strings list.\"\"\"\n\ndef most_occurrences(", "completion_prefix": "def most_occurrences(", "chat_input": [{"role": "user", "content": "Write a function to get the word with most number of occurrences in the given strings list.\nThe function should be named `most_occurrences`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert most_occurrences([\"UTS is best for RTF\", \"RTF love UTS\", \"UTS is best\"] ) == 'UTS'\nassert most_occurrences([\"Its been a great year\", \"this year is so worse\", \"this year is okay\"] ) == 'year'\nassert most_occurrences([\"Families can be reunited\", \"people can be reunited\", \"Tasks can be achieved \"] ) == 'can'"} {"row": 316, "completion_input": "\"\"\"Write a function to print check if the triangle is isosceles or not.\"\"\"\n\ndef check_isosceles(", "completion_prefix": "def check_isosceles(", "chat_input": [{"role": "user", "content": "Write a function to print check if the triangle is isosceles or not.\nThe function should be named `check_isosceles`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert check_isosceles(6,8,12)==False \nassert check_isosceles(6,6,12)==True\nassert check_isosceles(6,16,20)==False"} {"row": 317, "completion_input": "\"\"\"Write a function to rotate a given list by specified number of items to the left direction.\"\"\"\n\ndef rotate_left(", "completion_prefix": "def rotate_left(", "chat_input": [{"role": "user", "content": "Write a function to rotate a given list by specified number of items to the left direction.\nThe function should be named `rotate_left`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert rotate_left([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],3,4)==[4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4]\nassert rotate_left([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],2,2)==[3, 4, 5, 6, 7, 8, 9, 10, 1, 2]\nassert rotate_left([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],5,2)==[6, 7, 8, 9, 10, 1, 2]"} {"row": 318, "completion_input": "\"\"\"Write a python function to count negative numbers in a list.\"\"\"\n\ndef neg_count(", "completion_prefix": "def neg_count(", "chat_input": [{"role": "user", "content": "Write a python function to count negative numbers in a list.\nThe function should be named `neg_count`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert neg_count([-1,-2,3,-4,-5]) == 4\nassert neg_count([1,2,3]) == 0\nassert neg_count([1,2,-3,-10,20]) == 2"} {"row": 319, "completion_input": "\"\"\"Write a function to find all three, four, five characters long words in the given string by using regex.\"\"\"\n\ndef find_char(", "completion_prefix": "def find_char(", "chat_input": [{"role": "user", "content": "Write a function to find all three, four, five characters long words in the given string by using regex.\nThe function should be named `find_char`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_char('For the four consumer complaints contact manager AKR reddy') == ['For', 'the', 'four', 'AKR', 'reddy']\nassert find_char('Certain service are subject to change MSR') == ['are', 'MSR']\nassert find_char('Third party legal desclaimers') == ['Third', 'party', 'legal']"} {"row": 320, "completion_input": "\"\"\"Write a python function to count unset bits of a given number.\"\"\"\n\ndef count_unset_bits(", "completion_prefix": "def count_unset_bits(", "chat_input": [{"role": "user", "content": "Write a python function to count unset bits of a given number.\nThe function should be named `count_unset_bits`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_unset_bits(2) == 1\nassert count_unset_bits(4) == 2\nassert count_unset_bits(6) == 1"} {"row": 321, "completion_input": "\"\"\"Write a function to count character frequency of a given string.\"\"\"\n\ndef char_frequency(", "completion_prefix": "def char_frequency(", "chat_input": [{"role": "user", "content": "Write a function to count character frequency of a given string.\nThe function should be named `char_frequency`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert char_frequency('python')=={'p': 1, 'y': 1, 't': 1, 'h': 1, 'o': 1, 'n': 1}\nassert char_frequency('program')=={'p': 1, 'r': 2, 'o': 1, 'g': 1, 'a': 1, 'm': 1}\nassert char_frequency('language')=={'l': 1, 'a': 2, 'n': 1, 'g': 2, 'u': 1, 'e': 1}"} {"row": 322, "completion_input": "\"\"\"Write a python function to sort a list according to the second element in sublist.\"\"\"\n\ndef Sort(", "completion_prefix": "def Sort(", "chat_input": [{"role": "user", "content": "Write a python function to sort a list according to the second element in sublist.\nThe function should be named `Sort`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert Sort([['a', 10], ['b', 5], ['c', 20], ['d', 15]]) == [['b', 5], ['a', 10], ['d', 15], ['c', 20]]\nassert Sort([['452', 10], ['256', 5], ['100', 20], ['135', 15]]) == [['256', 5], ['452', 10], ['135', 15], ['100', 20]]\nassert Sort([['rishi', 10], ['akhil', 5], ['ramya', 20], ['gaur', 15]]) == [['akhil', 5], ['rishi', 10], ['gaur', 15], ['ramya', 20]]"} {"row": 323, "completion_input": "\"\"\"Write a python function to check whether the triangle is valid or not if sides are given.\"\"\"\n\ndef check_Validity(", "completion_prefix": "def check_Validity(", "chat_input": [{"role": "user", "content": "Write a python function to check whether the triangle is valid or not if sides are given.\nThe function should be named `check_Validity`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert check_Validity(1,2,3) == False\nassert check_Validity(2,3,5) == False\nassert check_Validity(7,10,5) == True"} {"row": 324, "completion_input": "\"\"\"Write a function to find the sum of arithmetic progression.\"\"\"\n\ndef ap_sum(", "completion_prefix": "def ap_sum(", "chat_input": [{"role": "user", "content": "Write a function to find the sum of arithmetic progression.\nThe function should be named `ap_sum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert ap_sum(1,5,2)==25\nassert ap_sum(2,6,4)==72\nassert ap_sum(1,4,5)==34"} {"row": 325, "completion_input": "\"\"\"Write a function to check whether the given month name contains 28 days or not.\"\"\"\n\ndef check_monthnum(", "completion_prefix": "def check_monthnum(", "chat_input": [{"role": "user", "content": "Write a function to check whether the given month name contains 28 days or not.\nThe function should be named `check_monthnum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert check_monthnum(\"February\")==True\nassert check_monthnum(\"January\")==False\nassert check_monthnum(\"March\")==False"} {"row": 326, "completion_input": "\"\"\"Write a function that matches a word at the end of a string, with optional punctuation.\"\"\"\n\ndef text_match_word(", "completion_prefix": "def text_match_word(", "chat_input": [{"role": "user", "content": "Write a function that matches a word at the end of a string, with optional punctuation.\nThe function should be named `text_match_word`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert text_match_word(\"python.\")==('Found a match!')\nassert text_match_word(\"python.\")==('Found a match!')\nassert text_match_word(\" lang .\")==('Not matched!')"} {"row": 327, "completion_input": "\"\"\"Write a python function to count the number of substrings with same first and last characters.\"\"\"\n\ndef count_Substring_With_Equal_Ends(", "completion_prefix": "def count_Substring_With_Equal_Ends(", "chat_input": [{"role": "user", "content": "Write a python function to count the number of substrings with same first and last characters.\nThe function should be named `count_Substring_With_Equal_Ends`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_Substring_With_Equal_Ends('aba') == 4\nassert count_Substring_With_Equal_Ends('abcab') == 7\nassert count_Substring_With_Equal_Ends('abc') == 3"} {"row": 328, "completion_input": "\"\"\"Write a python function to find the maximum occuring divisor in an interval.\"\"\"\n\ndef find_Divisor(", "completion_prefix": "def find_Divisor(", "chat_input": [{"role": "user", "content": "Write a python function to find the maximum occuring divisor in an interval.\nThe function should be named `find_Divisor`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_Divisor(2,2) == 2\nassert find_Divisor(2,5) == 2\nassert find_Divisor(5,10) == 2"} {"row": 329, "completion_input": "\"\"\"Write a python function to find the sum of the three lowest positive numbers from a given list of numbers.\"\"\"\n\ndef sum_three_smallest_nums(", "completion_prefix": "def sum_three_smallest_nums(", "chat_input": [{"role": "user", "content": "Write a python function to find the sum of the three lowest positive numbers from a given list of numbers.\nThe function should be named `sum_three_smallest_nums`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert sum_three_smallest_nums([10,20,30,40,50,60,7]) == 37\nassert sum_three_smallest_nums([1,2,3,4,5]) == 6\nassert sum_three_smallest_nums([0,1,2,3,4,5]) == 6"} {"row": 330, "completion_input": "\"\"\"Write a function to convert the given set into ordered tuples.\"\"\"\n\ndef set_to_tuple(", "completion_prefix": "def set_to_tuple(", "chat_input": [{"role": "user", "content": "Write a function to convert the given set into ordered tuples.\nThe function should be named `set_to_tuple`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert set_to_tuple({1, 2, 3, 4, 5}) == (1, 2, 3, 4, 5)\nassert set_to_tuple({6, 7, 8, 9, 10, 11}) == (6, 7, 8, 9, 10, 11)\nassert set_to_tuple({12, 13, 14, 15, 16}) == (12, 13, 14, 15, 16)"} {"row": 331, "completion_input": "\"\"\"Write a function to find the smallest range that includes at-least one element from each of the given arrays.\"\"\"\n\ndef find_minimum_range(", "completion_prefix": "def find_minimum_range(", "chat_input": [{"role": "user", "content": "Write a function to find the smallest range that includes at-least one element from each of the given arrays.\nThe function should be named `find_minimum_range`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_minimum_range([[3, 6, 8, 10, 15], [1, 5, 12], [4, 8, 15, 16], [2, 6]]) == (4, 6)\nassert find_minimum_range([[ 2, 3, 4, 8, 10, 15 ], [1, 5, 12], [7, 8, 15, 16], [3, 6]]) == (4, 7)\nassert find_minimum_range([[4, 7, 9, 11, 16], [2, 6, 13], [5, 9, 16, 17], [3, 7]]) == (5, 7)"} {"row": 332, "completion_input": "\"\"\"Write a function to calculate the number of digits and letters in a string.\"\"\"\n\ndef dig_let(", "completion_prefix": "def dig_let(", "chat_input": [{"role": "user", "content": "Write a function to calculate the number of digits and letters in a string.\nThe function should be named `dig_let`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert dig_let(\"python\")==(6,0)\nassert dig_let(\"program\")==(7,0)\nassert dig_let(\"python3.0\")==(6,2)"} {"row": 333, "completion_input": "\"\"\"Write a python function to find number of elements with odd factors in a given range.\"\"\"\n\ndef count_Odd_Squares(", "completion_prefix": "def count_Odd_Squares(", "chat_input": [{"role": "user", "content": "Write a python function to find number of elements with odd factors in a given range.\nThe function should be named `count_Odd_Squares`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_Odd_Squares(5,100) == 8\nassert count_Odd_Squares(8,65) == 6\nassert count_Odd_Squares(2,5) == 1"} {"row": 334, "completion_input": "\"\"\"Write a function to find the difference between two consecutive numbers in a given list.\"\"\"\n\ndef diff_consecutivenums(", "completion_prefix": "def diff_consecutivenums(", "chat_input": [{"role": "user", "content": "Write a function to find the difference between two consecutive numbers in a given list.\nThe function should be named `diff_consecutivenums`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert diff_consecutivenums([1, 1, 3, 4, 4, 5, 6, 7])==[0, 2, 1, 0, 1, 1, 1]\nassert diff_consecutivenums([4, 5, 8, 9, 6, 10])==[1, 3, 1, -3, 4]\nassert diff_consecutivenums([0, 1, 2, 3, 4, 4, 4, 4, 5, 7])==[1, 1, 1, 1, 0, 0, 0, 1, 2]"} {"row": 335, "completion_input": "\"\"\"Write a function to find entringer number e(n, k).\"\"\"\n\ndef zigzag(", "completion_prefix": "def zigzag(", "chat_input": [{"role": "user", "content": "Write a function to find entringer number e(n, k).\nThe function should be named `zigzag`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert zigzag(4, 3) == 5\nassert zigzag(4, 2) == 4\nassert zigzag(3, 1) == 1"} {"row": 336, "completion_input": "\"\"\"Write a python function to count the number of squares in a rectangle.\"\"\"\n\ndef count_Squares(", "completion_prefix": "def count_Squares(", "chat_input": [{"role": "user", "content": "Write a python function to count the number of squares in a rectangle.\nThe function should be named `count_Squares`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_Squares(4,3) == 20\nassert count_Squares(1,2) == 2\nassert count_Squares(2,2) == 5"} {"row": 337, "completion_input": "\"\"\"Write a function to count sequences of given length having non-negative prefix sums that can be generated by given values.\"\"\"\n\ndef find_ways(", "completion_prefix": "def find_ways(", "chat_input": [{"role": "user", "content": "Write a function to count sequences of given length having non-negative prefix sums that can be generated by given values.\nThe function should be named `find_ways`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_ways(4) == 2\nassert find_ways(6) == 5\nassert find_ways(8) == 14"} {"row": 338, "completion_input": "\"\"\"Write a python function to check whether the given string is a binary string or not.\"\"\"\n\ndef check(", "completion_prefix": "def check(", "chat_input": [{"role": "user", "content": "Write a python function to check whether the given string is a binary string or not.\nThe function should be named `check`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert check(\"01010101010\") == \"Yes\"\nassert check(\"name0\") == \"No\"\nassert check(\"101\") == \"Yes\""} {"row": 339, "completion_input": "\"\"\"Write a python function to minimize the length of the string by removing occurrence of only one character.\"\"\"\n\ndef minimum_Length(", "completion_prefix": "def minimum_Length(", "chat_input": [{"role": "user", "content": "Write a python function to minimize the length of the string by removing occurrence of only one character.\nThe function should be named `minimum_Length`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert minimum_Length(\"mnm\") == 1\nassert minimum_Length(\"abcda\") == 3\nassert minimum_Length(\"abcb\") == 2"} {"row": 340, "completion_input": "\"\"\"Write a python function to find the first element occurring k times in a given array.\"\"\"\n\ndef first_Element(", "completion_prefix": "def first_Element(", "chat_input": [{"role": "user", "content": "Write a python function to find the first element occurring k times in a given array.\nThe function should be named `first_Element`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert first_Element([0,1,2,3,4,5],6,1) == 0\nassert first_Element([1,2,1,3,4],5,2) == 1\nassert first_Element([2,3,4,3,5,7,1,2,3,5],10,2) == 2"} {"row": 341, "completion_input": "\"\"\"Write a python function to check whether all the characters in a given string are unique.\"\"\"\n\ndef unique_Characters(", "completion_prefix": "def unique_Characters(", "chat_input": [{"role": "user", "content": "Write a python function to check whether all the characters in a given string are unique.\nThe function should be named `unique_Characters`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert unique_Characters('aba') == False\nassert unique_Characters('abc') == True\nassert unique_Characters('abab') == False"} {"row": 342, "completion_input": "\"\"\"Write a function to remove a specified column from a given nested list.\"\"\"\n\ndef remove_column(", "completion_prefix": "def remove_column(", "chat_input": [{"role": "user", "content": "Write a function to remove a specified column from a given nested list.\nThe function should be named `remove_column`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert remove_column([[1, 2, 3], [2, 4, 5], [1, 1, 1]],0)==[[2, 3], [4, 5], [1, 1]]\nassert remove_column([[1, 2, 3], [-2, 4, -5], [1, -1, 1]],2)==[[1, 2], [-2, 4], [1, -1]]\nassert remove_column([[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]],0)==[[3], [7], [3], [15, 17], [7], [11]]"} {"row": 343, "completion_input": "\"\"\"Write a function to find t-nth term of arithemetic progression.\"\"\"\n\ndef tn_ap(", "completion_prefix": "def tn_ap(", "chat_input": [{"role": "user", "content": "Write a function to find t-nth term of arithemetic progression.\nThe function should be named `tn_ap`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert tn_ap(1,5,2)==9\nassert tn_ap(2,6,4)==22\nassert tn_ap(1,4,5)==16"} {"row": 344, "completion_input": "\"\"\"Write a python function to count the number of rectangles in a circle of radius r.\"\"\"\n\ndef count_Rectangles(", "completion_prefix": "def count_Rectangles(", "chat_input": [{"role": "user", "content": "Write a python function to count the number of rectangles in a circle of radius r.\nThe function should be named `count_Rectangles`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_Rectangles(2) == 8\nassert count_Rectangles(1) == 1\nassert count_Rectangles(0) == 0"} {"row": 345, "completion_input": "\"\"\"Write a function to find the third angle of a triangle using two angles.\"\"\"\n\ndef find_angle(", "completion_prefix": "def find_angle(", "chat_input": [{"role": "user", "content": "Write a function to find the third angle of a triangle using two angles.\nThe function should be named `find_angle`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_angle(47,89)==44\nassert find_angle(45,95)==40\nassert find_angle(50,40)==90"} {"row": 346, "completion_input": "\"\"\"Write a function to find the maximum element of all the given tuple records.\"\"\"\n\ndef find_max(", "completion_prefix": "def find_max(", "chat_input": [{"role": "user", "content": "Write a function to find the maximum element of all the given tuple records.\nThe function should be named `find_max`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_max([(2, 4), (6, 7), (5, 1), (6, 10), (8, 7)]) == 10\nassert find_max([(3, 5), (7, 8), (6, 2), (7, 11), (9, 8)]) == 11\nassert find_max([(4, 6), (8, 9), (7, 3), (8, 12), (10, 9)]) == 12"} {"row": 347, "completion_input": "\"\"\"Write a function to find modulo division of two lists using map and lambda function.\"\"\"\n\ndef moddiv_list(", "completion_prefix": "def moddiv_list(", "chat_input": [{"role": "user", "content": "Write a function to find modulo division of two lists using map and lambda function.\nThe function should be named `moddiv_list`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert moddiv_list([4,5,6],[1, 2, 3])==[0, 1, 0]\nassert moddiv_list([3,2],[1,4])==[0, 2]\nassert moddiv_list([90,120],[50,70])==[40, 50]"} {"row": 348, "completion_input": "\"\"\"Write a python function to check whether one root of the quadratic equation is twice of the other or not.\"\"\"\n\ndef Check_Solution(", "completion_prefix": "def Check_Solution(", "chat_input": [{"role": "user", "content": "Write a python function to check whether one root of the quadratic equation is twice of the other or not.\nThe function should be named `Check_Solution`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert Check_Solution(1,3,2) == \"Yes\"\nassert Check_Solution(1,2,3) == \"No\"\nassert Check_Solution(1,-5,6) == \"No\""} {"row": 349, "completion_input": "\"\"\"Write a function to find the n’th carol number.\"\"\"\n\ndef get_carol(", "completion_prefix": "def get_carol(", "chat_input": [{"role": "user", "content": "Write a function to find the n’th carol number.\nThe function should be named `get_carol`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert get_carol(2) == 7\nassert get_carol(4) == 223\nassert get_carol(5) == 959"} {"row": 350, "completion_input": "\"\"\"Write a function to remove empty lists from a given list of lists.\"\"\"\n\ndef remove_empty(", "completion_prefix": "def remove_empty(", "chat_input": [{"role": "user", "content": "Write a function to remove empty lists from a given list of lists.\nThe function should be named `remove_empty`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert remove_empty([[], [], [], 'Red', 'Green', [1,2], 'Blue', [], []])==['Red', 'Green', [1, 2], 'Blue']\nassert remove_empty([[], [], [],[],[], 'Green', [1,2], 'Blue', [], []])==[ 'Green', [1, 2], 'Blue']\nassert remove_empty([[], [], [], 'Python',[],[], 'programming', 'language',[],[],[], [], []])==['Python', 'programming', 'language']"} {"row": 351, "completion_input": "\"\"\"Write a python function to find the item with maximum occurrences in a given list.\"\"\"\n\ndef max_occurrences(", "completion_prefix": "def max_occurrences(", "chat_input": [{"role": "user", "content": "Write a python function to find the item with maximum occurrences in a given list.\nThe function should be named `max_occurrences`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert max_occurrences([1,2,3,1,2,3,12,4,2]) == 2\nassert max_occurrences([1,2,6,7,0,1,0,1,0]) == 1,0\nassert max_occurrences([1,2,3,1,2,4,1]) == 1"} {"row": 352, "completion_input": "\"\"\"Write a function to add the k elements to each element in the tuple.\"\"\"\n\ndef add_K_element(", "completion_prefix": "def add_K_element(", "chat_input": [{"role": "user", "content": "Write a function to add the k elements to each element in the tuple.\nThe function should be named `add_K_element`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert add_K_element([(1, 3, 4), (2, 4, 6), (3, 8, 1)], 4) == [(5, 7, 8), (6, 8, 10), (7, 12, 5)]\nassert add_K_element([(1, 2, 3), (4, 5, 6), (7, 8, 9)], 8) == [(9, 10, 11), (12, 13, 14), (15, 16, 17)]\nassert add_K_element([(11, 12, 13), (14, 15, 16), (17, 18, 19)], 9) == [(20, 21, 22), (23, 24, 25), (26, 27, 28)]"} {"row": 353, "completion_input": "\"\"\"Write a function to find the number of flips required to make the given binary string a sequence of alternate characters.\"\"\"\n\ndef min_flip_to_make_string_alternate(", "completion_prefix": "def min_flip_to_make_string_alternate(", "chat_input": [{"role": "user", "content": "Write a function to find the number of flips required to make the given binary string a sequence of alternate characters.\nThe function should be named `min_flip_to_make_string_alternate`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert min_flip_to_make_string_alternate(\"0001010111\") == 2\nassert min_flip_to_make_string_alternate(\"001\") == 1\nassert min_flip_to_make_string_alternate(\"010111011\") == 2 "} {"row": 354, "completion_input": "\"\"\"Write a python function to count the number of digits of a given number.\"\"\"\n\ndef count_Digit(", "completion_prefix": "def count_Digit(", "chat_input": [{"role": "user", "content": "Write a python function to count the number of digits of a given number.\nThe function should be named `count_Digit`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_Digit(12345) == 5\nassert count_Digit(11223305) == 8\nassert count_Digit(4123459) == 7"} {"row": 355, "completion_input": "\"\"\"Write a python function to find the largest product of the pair of adjacent elements from a given list of integers.\"\"\"\n\ndef adjacent_num_product(", "completion_prefix": "def adjacent_num_product(", "chat_input": [{"role": "user", "content": "Write a python function to find the largest product of the pair of adjacent elements from a given list of integers.\nThe function should be named `adjacent_num_product`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert adjacent_num_product([1,2,3,4,5,6]) == 30\nassert adjacent_num_product([1,2,3,4,5]) == 20\nassert adjacent_num_product([2,3]) == 6"} {"row": 356, "completion_input": "\"\"\"Write a function to check if a binary tree is balanced or not.\"\"\"\n\ndef is_tree_balanced(", "completion_prefix": "def is_tree_balanced(", "chat_input": [{"role": "user", "content": "Write a function to check if a binary tree is balanced or not.\nThe function should be named `is_tree_balanced`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "root = Node(1) \r\nroot.left = Node(2) \r\nroot.right = Node(3) \r\nroot.left.left = Node(4) \r\nroot.left.right = Node(5) \r\nroot.left.left.left = Node(8) \r\nroot1 = Node(1) \r\nroot1.left = Node(2) \r\nroot1.right = Node(3) \r\nroot1.left.left = Node(4) \r\nroot1.left.right = Node(5) \r\nroot1.right.left = Node(6) \r\nroot1.left.left.left = Node(7)\r\nroot2 = Node(1) \r\nroot2.left = Node(2) \r\nroot2.right = Node(3) \r\nroot2.left.left = Node(4) \r\nroot2.left.right = Node(5)\r\nroot2.left.left.left = Node(7)\nassert is_tree_balanced(root) == False\nassert is_tree_balanced(root1) == True\nassert is_tree_balanced(root2) == False "} {"row": 357, "completion_input": "\"\"\"Write a function to repeat the given tuple n times.\"\"\"\n\ndef repeat_tuples(", "completion_prefix": "def repeat_tuples(", "chat_input": [{"role": "user", "content": "Write a function to repeat the given tuple n times.\nThe function should be named `repeat_tuples`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert repeat_tuples((1, 3), 4) == ((1, 3), (1, 3), (1, 3), (1, 3))\nassert repeat_tuples((1, 2), 3) == ((1, 2), (1, 2), (1, 2))\nassert repeat_tuples((3, 4), 5) == ((3, 4), (3, 4), (3, 4), (3, 4), (3, 4))"} {"row": 358, "completion_input": "\"\"\"Write a function to find the lateral surface area of cuboid\"\"\"\n\ndef lateralsurface_cuboid(", "completion_prefix": "def lateralsurface_cuboid(", "chat_input": [{"role": "user", "content": "Write a function to find the lateral surface area of cuboid\nThe function should be named `lateralsurface_cuboid`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert lateralsurface_cuboid(8,5,6)==156\nassert lateralsurface_cuboid(7,9,10)==320\nassert lateralsurface_cuboid(10,20,30)==1800"} {"row": 359, "completion_input": "\"\"\"Write a function to sort a tuple by its float element.\"\"\"\n\ndef float_sort(", "completion_prefix": "def float_sort(", "chat_input": [{"role": "user", "content": "Write a function to sort a tuple by its float element.\nThe function should be named `float_sort`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert float_sort([('item1', '12.20'), ('item2', '15.10'), ('item3', '24.5')])==[('item3', '24.5'), ('item2', '15.10'), ('item1', '12.20')] \nassert float_sort([('item1', '15'), ('item2', '10'), ('item3', '20')])==[('item3', '20'), ('item1', '15'), ('item2', '10')] \nassert float_sort([('item1', '5'), ('item2', '10'), ('item3', '14')])==[('item3', '14'), ('item2', '10'), ('item1', '5')] "} {"row": 360, "completion_input": "\"\"\"Write a function to find the smallest missing element in a sorted array.\"\"\"\n\ndef smallest_missing(", "completion_prefix": "def smallest_missing(", "chat_input": [{"role": "user", "content": "Write a function to find the smallest missing element in a sorted array.\nThe function should be named `smallest_missing`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert smallest_missing([0, 1, 2, 3, 4, 5, 6], 0, 6) == 7\nassert smallest_missing([0, 1, 2, 6, 9, 11, 15], 0, 6) == 3\nassert smallest_missing([1, 2, 3, 4, 6, 9, 11, 15], 0, 7) == 0"} {"row": 361, "completion_input": "\"\"\"Write a function to sort a given list of elements in ascending order using heap queue algorithm.\"\"\"\n\ndef heap_assending(", "completion_prefix": "def heap_assending(", "chat_input": [{"role": "user", "content": "Write a function to sort a given list of elements in ascending order using heap queue algorithm.\nThe function should be named `heap_assending`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert heap_assending([18, 14, 10, 9, 8, 7, 9, 3, 2, 4, 1])==[1, 2, 3, 4, 7, 8, 9, 9, 10, 14, 18]\nassert heap_assending([25, 35, 22, 85, 14, 65, 75, 25, 58])==[14, 22, 25, 25, 35, 58, 65, 75, 85]\nassert heap_assending([1, 3, 5, 7, 9, 2, 4, 6, 8, 0])==[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]"} {"row": 362, "completion_input": "\"\"\"Write a function to find the volume of a cuboid.\"\"\"\n\ndef volume_cuboid(", "completion_prefix": "def volume_cuboid(", "chat_input": [{"role": "user", "content": "Write a function to find the volume of a cuboid.\nThe function should be named `volume_cuboid`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert volume_cuboid(1,2,3)==6\nassert volume_cuboid(5,7,9)==315\nassert volume_cuboid(10,15,21)==3150"} {"row": 363, "completion_input": "\"\"\"Write a function to print all permutations of a given string including duplicates.\"\"\"\n\ndef permute_string(", "completion_prefix": "def permute_string(", "chat_input": [{"role": "user", "content": "Write a function to print all permutations of a given string including duplicates.\nThe function should be named `permute_string`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert permute_string('ab')==['ab', 'ba']\nassert permute_string('abc')==['abc', 'bac', 'bca', 'acb', 'cab', 'cba']\nassert permute_string('abcd')==['abcd', 'bacd', 'bcad', 'bcda', 'acbd', 'cabd', 'cbad', 'cbda', 'acdb', 'cadb', 'cdab', 'cdba', 'abdc', 'badc', 'bdac', 'bdca', 'adbc', 'dabc', 'dbac', 'dbca', 'adcb', 'dacb', 'dcab', 'dcba']"} {"row": 364, "completion_input": "\"\"\"Write a function to round the given number to the nearest multiple of a specific number.\"\"\"\n\ndef round_num(", "completion_prefix": "def round_num(", "chat_input": [{"role": "user", "content": "Write a function to round the given number to the nearest multiple of a specific number.\nThe function should be named `round_num`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert round_num(4722,10)==4720\nassert round_num(1111,5)==1110\nassert round_num(219,2)==218"} {"row": 365, "completion_input": "\"\"\"Write a function to remove tuple elements that occur more than once and replace the duplicates with some custom value.\"\"\"\n\ndef remove_replica(", "completion_prefix": "def remove_replica(", "chat_input": [{"role": "user", "content": "Write a function to remove tuple elements that occur more than once and replace the duplicates with some custom value.\nThe function should be named `remove_replica`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert remove_replica((1, 1, 4, 4, 4, 5, 5, 6, 7, 7)) == (1, 'MSP', 4, 'MSP', 'MSP', 5, 'MSP', 6, 7, 'MSP')\nassert remove_replica((2, 3, 4, 4, 5, 6, 6, 7, 8, 9, 9)) == (2, 3, 4, 'MSP', 5, 6, 'MSP', 7, 8, 9, 'MSP')\nassert remove_replica((2, 2, 5, 4, 5, 7, 5, 6, 7, 7)) == (2, 'MSP', 5, 4, 'MSP', 7, 'MSP', 6, 'MSP', 'MSP')"} {"row": 366, "completion_input": "\"\"\"Write a python function to remove all occurrences of a character in a given string.\"\"\"\n\ndef remove_Char(", "completion_prefix": "def remove_Char(", "chat_input": [{"role": "user", "content": "Write a python function to remove all occurrences of a character in a given string.\nThe function should be named `remove_Char`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert remove_Char(\"aba\",'a') == \"b\"\nassert remove_Char(\"toggle\",'g') == \"tole\"\nassert remove_Char(\"aabbc\",'b') == \"aac\""} {"row": 367, "completion_input": "\"\"\"Write a python function to shift last element to first position in the given list.\"\"\"\n\ndef move_first(", "completion_prefix": "def move_first(", "chat_input": [{"role": "user", "content": "Write a python function to shift last element to first position in the given list.\nThe function should be named `move_first`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert move_first([1,2,3,4]) == [4,1,2,3]\nassert move_first([0,1,2,3]) == [3,0,1,2]\nassert move_first([9,8,7,1]) == [1,9,8,7]"} {"row": 368, "completion_input": "\"\"\"Write a function to find the surface area of a cuboid.\"\"\"\n\ndef surfacearea_cuboid(", "completion_prefix": "def surfacearea_cuboid(", "chat_input": [{"role": "user", "content": "Write a function to find the surface area of a cuboid.\nThe function should be named `surfacearea_cuboid`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert surfacearea_cuboid(1,2,3)==22\nassert surfacearea_cuboid(5,7,9)==286\nassert surfacearea_cuboid(10,15,21)==1350"} {"row": 369, "completion_input": "\"\"\"Write a function to generate a two-dimensional array.\"\"\"\n\ndef multi_list(", "completion_prefix": "def multi_list(", "chat_input": [{"role": "user", "content": "Write a function to generate a two-dimensional array.\nThe function should be named `multi_list`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert multi_list(3,4)==[[0, 0, 0, 0], [0, 1, 2, 3], [0, 2, 4, 6]] \nassert multi_list(5,7)==[[0, 0, 0, 0, 0, 0, 0], [0, 1, 2, 3, 4, 5, 6], [0, 2, 4, 6, 8, 10, 12], [0, 3, 6, 9, 12, 15, 18], [0, 4, 8, 12, 16, 20, 24]]\nassert multi_list(10,15)==[[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28], [0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42], [0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56], [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70], [0, 6, 12, 18, 24, 30, 36, 42, 48, 54, 60, 66, 72, 78, 84], [0, 7, 14, 21, 28, 35, 42, 49, 56, 63, 70, 77, 84, 91, 98], [0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112], [0, 9, 18, 27, 36, 45, 54, 63, 72, 81, 90, 99, 108, 117, 126]]"} {"row": 370, "completion_input": "\"\"\"Write a function to sort a list of lists by a given index of the inner list.\"\"\"\n\ndef index_on_inner_list(", "completion_prefix": "def index_on_inner_list(", "chat_input": [{"role": "user", "content": "Write a function to sort a list of lists by a given index of the inner list.\nThe function should be named `index_on_inner_list`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert index_on_inner_list([('Greyson Fulton', 98, 99), ('Brady Kent', 97, 96), ('Wyatt Knott', 91, 94), ('Beau Turnbull', 94, 98)] ,0)==[('Beau Turnbull', 94, 98), ('Brady Kent', 97, 96), ('Greyson Fulton', 98, 99), ('Wyatt Knott', 91, 94)]\nassert index_on_inner_list([('Greyson Fulton', 98, 99), ('Brady Kent', 97, 96), ('Wyatt Knott', 91, 94), ('Beau Turnbull', 94, 98)] ,1)==[('Wyatt Knott', 91, 94), ('Beau Turnbull', 94, 98), ('Brady Kent', 97, 96), ('Greyson Fulton', 98, 99)]\nassert index_on_inner_list([('Greyson Fulton', 98, 99), ('Brady Kent', 97, 96), ('Wyatt Knott', 91, 94), ('Beau Turnbull', 94, 98)] ,2)==[('Wyatt Knott', 91, 94), ('Brady Kent', 97, 96), ('Beau Turnbull', 94, 98), ('Greyson Fulton', 98, 99)]"} {"row": 371, "completion_input": "\"\"\"Write a function to find the number of rotations in a circularly sorted array.\"\"\"\n\ndef find_rotation_count(", "completion_prefix": "def find_rotation_count(", "chat_input": [{"role": "user", "content": "Write a function to find the number of rotations in a circularly sorted array.\nThe function should be named `find_rotation_count`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_rotation_count([8, 9, 10, 1, 2, 3, 4, 5, 6, 7]) == 3\nassert find_rotation_count([8, 9, 10,2, 5, 6]) == 3\nassert find_rotation_count([2, 5, 6, 8, 9, 10]) == 0"} {"row": 372, "completion_input": "\"\"\"Write a python function to toggle all odd bits of a given number.\"\"\"\n\ndef even_bit_toggle_number(", "completion_prefix": "def even_bit_toggle_number(", "chat_input": [{"role": "user", "content": "Write a python function to toggle all odd bits of a given number.\nThe function should be named `even_bit_toggle_number`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert even_bit_toggle_number(10) == 15\nassert even_bit_toggle_number(20) == 1\nassert even_bit_toggle_number(30) == 11"} {"row": 373, "completion_input": "\"\"\"Write a python function to find the frequency of the smallest value in a given array.\"\"\"\n\ndef frequency_Of_Smallest(", "completion_prefix": "def frequency_Of_Smallest(", "chat_input": [{"role": "user", "content": "Write a python function to find the frequency of the smallest value in a given array.\nThe function should be named `frequency_Of_Smallest`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert frequency_Of_Smallest(5,[1,2,3,4,3]) == 1\nassert frequency_Of_Smallest(7,[3,1,2,5,6,2,3]) == 1\nassert frequency_Of_Smallest(7,[3,3,6,3,7,4,9]) == 3"} {"row": 374, "completion_input": "\"\"\"Write a function to find the n'th perrin number using recursion.\"\"\"\n\ndef get_perrin(", "completion_prefix": "def get_perrin(", "chat_input": [{"role": "user", "content": "Write a function to find the n'th perrin number using recursion.\nThe function should be named `get_perrin`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert get_perrin(9) == 12\nassert get_perrin(4) == 2\nassert get_perrin(6) == 5"} {"row": 375, "completion_input": "\"\"\"Write a function to find out the minimum no of swaps required for bracket balancing in the given string.\"\"\"\n\ndef swap_count(", "completion_prefix": "def swap_count(", "chat_input": [{"role": "user", "content": "Write a function to find out the minimum no of swaps required for bracket balancing in the given string.\nThe function should be named `swap_count`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert swap_count(\"[]][][\") == 2\nassert swap_count(\"[[][]]\") == 0\nassert swap_count(\"[[][]]][\") == 1"} {"row": 376, "completion_input": "\"\"\"Write a python function to check whether the hexadecimal number is even or odd.\"\"\"\n\ndef even_or_odd(", "completion_prefix": "def even_or_odd(", "chat_input": [{"role": "user", "content": "Write a python function to check whether the hexadecimal number is even or odd.\nThe function should be named `even_or_odd`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert even_or_odd(\"AB3454D\") ==\"Odd\"\nassert even_or_odd(\"ABC\") == \"Even\"\nassert even_or_odd(\"AAD\") == \"Odd\""} {"row": 377, "completion_input": "\"\"\"Write a python function to find the highest power of 2 that is less than or equal to n.\"\"\"\n\ndef highest_Power_of_2(", "completion_prefix": "def highest_Power_of_2(", "chat_input": [{"role": "user", "content": "Write a python function to find the highest power of 2 that is less than or equal to n.\nThe function should be named `highest_Power_of_2`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert highest_Power_of_2(10) == 8\nassert highest_Power_of_2(19) == 16\nassert highest_Power_of_2(32) == 32"} {"row": 378, "completion_input": "\"\"\"Write a function to find the n'th lucas number.\"\"\"\n\ndef find_lucas(", "completion_prefix": "def find_lucas(", "chat_input": [{"role": "user", "content": "Write a function to find the n'th lucas number.\nThe function should be named `find_lucas`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_lucas(9) == 76\nassert find_lucas(4) == 7\nassert find_lucas(3) == 4"} {"row": 379, "completion_input": "\"\"\"Write a function to insert a given string at the beginning of all items in a list.\"\"\"\n\ndef add_string(", "completion_prefix": "def add_string(", "chat_input": [{"role": "user", "content": "Write a function to insert a given string at the beginning of all items in a list.\nThe function should be named `add_string`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert add_string([1,2,3,4],'temp{0}')==['temp1', 'temp2', 'temp3', 'temp4']\nassert add_string(['a','b','c','d'], 'python{0}')==[ 'pythona', 'pythonb', 'pythonc', 'pythond']\nassert add_string([5,6,7,8],'string{0}')==['string5', 'string6', 'string7', 'string8']"} {"row": 380, "completion_input": "\"\"\"Write a function to convert more than one list to nested dictionary.\"\"\"\n\ndef convert_list_dictionary(", "completion_prefix": "def convert_list_dictionary(", "chat_input": [{"role": "user", "content": "Write a function to convert more than one list to nested dictionary.\nThe function should be named `convert_list_dictionary`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert convert_list_dictionary([\"S001\", \"S002\", \"S003\", \"S004\"],[\"Adina Park\", \"Leyton Marsh\", \"Duncan Boyle\", \"Saim Richards\"] ,[85, 98, 89, 92])==[{'S001': {'Adina Park': 85}}, {'S002': {'Leyton Marsh': 98}}, {'S003': {'Duncan Boyle': 89}}, {'S004': {'Saim Richards': 92}}]\nassert convert_list_dictionary([\"abc\",\"def\",\"ghi\",\"jkl\"],[\"python\",\"program\",\"language\",\"programs\"],[100,200,300,400])==[{'abc':{'python':100}},{'def':{'program':200}},{'ghi':{'language':300}},{'jkl':{'programs':400}}]\nassert convert_list_dictionary([\"A1\",\"A2\",\"A3\",\"A4\"],[\"java\",\"C\",\"C++\",\"DBMS\"],[10,20,30,40])==[{'A1':{'java':10}},{'A2':{'C':20}},{'A3':{'C++':30}},{'A4':{'DBMS':40}}]"} {"row": 381, "completion_input": "\"\"\"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).\"\"\"\n\ndef get_max_sum(", "completion_prefix": "def get_max_sum(", "chat_input": [{"role": "user", "content": "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).\nThe function should be named `get_max_sum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert get_max_sum(60) == 106\nassert get_max_sum(10) == 12\nassert get_max_sum(2) == 2"} {"row": 382, "completion_input": "\"\"\"Write a function to find the list with maximum length using lambda function.\"\"\"\n\ndef max_length_list(", "completion_prefix": "def max_length_list(", "chat_input": [{"role": "user", "content": "Write a function to find the list with maximum length using lambda function.\nThe function should be named `max_length_list`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert max_length_list([[0], [1, 3], [5, 7], [9, 11], [13, 15, 17]])==(3, [13, 15, 17])\nassert max_length_list([[1,2,3,4,5],[1,2,3,4],[1,2,3],[1,2],[1]])==(5,[1,2,3,4,5])\nassert max_length_list([[3,4,5],[6,7,8,9],[10,11,12]])==(4,[6,7,8,9])"} {"row": 383, "completion_input": "\"\"\"Write a function to check if given tuple is distinct or not.\"\"\"\n\ndef check_distinct(", "completion_prefix": "def check_distinct(", "chat_input": [{"role": "user", "content": "Write a function to check if given tuple is distinct or not.\nThe function should be named `check_distinct`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert check_distinct((1, 4, 5, 6, 1, 4)) == False\nassert check_distinct((1, 4, 5, 6)) == True\nassert check_distinct((2, 3, 4, 5, 6)) == True"} {"row": 384, "completion_input": "\"\"\"Write a python function to find the first non-repeated character in a given string.\"\"\"\n\ndef first_non_repeating_character(", "completion_prefix": "def first_non_repeating_character(", "chat_input": [{"role": "user", "content": "Write a python function to find the first non-repeated character in a given string.\nThe function should be named `first_non_repeating_character`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert first_non_repeating_character(\"abcabc\") == None\nassert first_non_repeating_character(\"abc\") == \"a\"\nassert first_non_repeating_character(\"ababc\") == \"c\""} {"row": 385, "completion_input": "\"\"\"Write a function to check whether the given string starts and ends with the same character or not using regex.\"\"\"\n\ndef check_char(", "completion_prefix": "def check_char(", "chat_input": [{"role": "user", "content": "Write a function to check whether the given string starts and ends with the same character or not using regex.\nThe function should be named `check_char`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert check_char(\"abba\") == \"Valid\"\nassert check_char(\"a\") == \"Valid\"\nassert check_char(\"abcd\") == \"Invalid\""} {"row": 386, "completion_input": "\"\"\"Write a function to find the median of three specific numbers.\"\"\"\n\ndef median_numbers(", "completion_prefix": "def median_numbers(", "chat_input": [{"role": "user", "content": "Write a function to find the median of three specific numbers.\nThe function should be named `median_numbers`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert median_numbers(25,55,65)==55.0\nassert median_numbers(20,10,30)==20.0\nassert median_numbers(15,45,75)==45.0"} {"row": 387, "completion_input": "\"\"\"Write a function to compute the sum of digits of each number of a given list.\"\"\"\n\ndef sum_of_digits(", "completion_prefix": "def sum_of_digits(", "chat_input": [{"role": "user", "content": "Write a function to compute the sum of digits of each number of a given list.\nThe function should be named `sum_of_digits`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert sum_of_digits([10,2,56])==14\nassert sum_of_digits([[10,20,4,5,'b',70,'a']])==19\nassert sum_of_digits([10,20,-4,5,-70])==19"} {"row": 388, "completion_input": "\"\"\"Write a function to perform the mathematical bitwise xor operation across the given tuples.\"\"\"\n\ndef bitwise_xor(", "completion_prefix": "def bitwise_xor(", "chat_input": [{"role": "user", "content": "Write a function to perform the mathematical bitwise xor operation across the given tuples.\nThe function should be named `bitwise_xor`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert bitwise_xor((10, 4, 6, 9), (5, 2, 3, 3)) == (15, 6, 5, 10)\nassert bitwise_xor((11, 5, 7, 10), (6, 3, 4, 4)) == (13, 6, 3, 14)\nassert bitwise_xor((12, 6, 8, 11), (7, 4, 5, 6)) == (11, 2, 13, 13)"} {"row": 389, "completion_input": "\"\"\"Write a function to extract the frequency of unique tuples in the given list order irrespective.\"\"\"\n\ndef extract_freq(", "completion_prefix": "def extract_freq(", "chat_input": [{"role": "user", "content": "Write a function to extract the frequency of unique tuples in the given list order irrespective.\nThe function should be named `extract_freq`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert extract_freq([(3, 4), (1, 2), (4, 3), (5, 6)] ) == 3\nassert extract_freq([(4, 15), (2, 3), (5, 4), (6, 7)] ) == 4\nassert extract_freq([(5, 16), (2, 3), (6, 5), (6, 9)] ) == 4"} {"row": 390, "completion_input": "\"\"\"Write a function to perform index wise addition of tuple elements in the given two nested tuples.\"\"\"\n\ndef add_nested_tuples(", "completion_prefix": "def add_nested_tuples(", "chat_input": [{"role": "user", "content": "Write a function to perform index wise addition of tuple elements in the given two nested tuples.\nThe function should be named `add_nested_tuples`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert add_nested_tuples(((1, 3), (4, 5), (2, 9), (1, 10)), ((6, 7), (3, 9), (1, 1), (7, 3))) == ((7, 10), (7, 14), (3, 10), (8, 13))\nassert add_nested_tuples(((2, 4), (5, 6), (3, 10), (2, 11)), ((7, 8), (4, 10), (2, 2), (8, 4))) == ((9, 12), (9, 16), (5, 12), (10, 15))\nassert add_nested_tuples(((3, 5), (6, 7), (4, 11), (3, 12)), ((8, 9), (5, 11), (3, 3), (9, 5))) == ((11, 14), (11, 18), (7, 14), (12, 17))"} {"row": 391, "completion_input": "\"\"\"Write a function to compute the value of ncr%p.\"\"\"\n\ndef ncr_modp(", "completion_prefix": "def ncr_modp(", "chat_input": [{"role": "user", "content": "Write a function to compute the value of ncr%p.\nThe function should be named `ncr_modp`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert ncr_modp(10,2,13)==6\nassert ncr_modp(15,12,43)==25\nassert ncr_modp(17,9,18)==10"} {"row": 392, "completion_input": "\"\"\"Write a function to check if a url is valid or not using regex.\"\"\"\n\ndef is_valid_URL(", "completion_prefix": "def is_valid_URL(", "chat_input": [{"role": "user", "content": "Write a function to check if a url is valid or not using regex.\nThe function should be named `is_valid_URL`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert is_valid_URL(\"https://www.google.com\") == True\nassert is_valid_URL(\"https:/www.gmail.com\") == False\nassert is_valid_URL(\"https:// www.redit.com\") == False"} {"row": 393, "completion_input": "\"\"\"Write a python function to find the minimum of two numbers.\"\"\"\n\ndef minimum(", "completion_prefix": "def minimum(", "chat_input": [{"role": "user", "content": "Write a python function to find the minimum of two numbers.\nThe function should be named `minimum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert minimum(1,2) == 1\nassert minimum(-5,-4) == -5\nassert minimum(0,0) == 0"} {"row": 394, "completion_input": "\"\"\"Write a function to check whether an element exists within a tuple.\"\"\"\n\ndef check_tuplex(", "completion_prefix": "def check_tuplex(", "chat_input": [{"role": "user", "content": "Write a function to check whether an element exists within a tuple.\nThe function should be named `check_tuplex`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert check_tuplex((\"w\", 3, \"r\", \"e\", \"s\", \"o\", \"u\", \"r\", \"c\", \"e\"),'r')==True\nassert check_tuplex((\"w\", 3, \"r\", \"e\", \"s\", \"o\", \"u\", \"r\", \"c\", \"e\"),'5')==False\nassert check_tuplex((\"w\", 3, \"r\", \"e\", \"s\", \"o\", \"u\", \"r\", \"c\",\"e\"),3)==True"} {"row": 395, "completion_input": "\"\"\"Write a python function to find the parity of a given number.\"\"\"\n\ndef find_Parity(", "completion_prefix": "def find_Parity(", "chat_input": [{"role": "user", "content": "Write a python function to find the parity of a given number.\nThe function should be named `find_Parity`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_Parity(12) == \"Even Parity\"\nassert find_Parity(7) == \"Odd Parity\"\nassert find_Parity(10) == \"Even Parity\""} {"row": 396, "completion_input": "\"\"\"Write a function to create the next bigger number by rearranging the digits of a given number.\"\"\"\n\ndef rearrange_bigger(", "completion_prefix": "def rearrange_bigger(", "chat_input": [{"role": "user", "content": "Write a function to create the next bigger number by rearranging the digits of a given number.\nThe function should be named `rearrange_bigger`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert rearrange_bigger(12)==21\nassert rearrange_bigger(10)==False\nassert rearrange_bigger(102)==120"} {"row": 397, "completion_input": "\"\"\"Write a function to find k number of pairs which consist of one element from the first array and one element from the second array.\"\"\"\n\ndef k_smallest_pairs(", "completion_prefix": "def k_smallest_pairs(", "chat_input": [{"role": "user", "content": "Write a function to find k number of pairs which consist of one element from the first array and one element from the second array.\nThe function should be named `k_smallest_pairs`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert k_smallest_pairs([1,3,7],[2,4,6],2)==[[1, 2], [1, 4]]\nassert k_smallest_pairs([1,3,7],[2,4,6],1)==[[1, 2]]\nassert k_smallest_pairs([1,3,7],[2,4,6],7)==[[1, 2], [1, 4], [3, 2], [1, 6], [3, 4], [3, 6], [7, 2]]"} {"row": 398, "completion_input": "\"\"\"Write a function to find the minimum product from the pairs of tuples within a given list.\"\"\"\n\ndef min_product_tuple(", "completion_prefix": "def min_product_tuple(", "chat_input": [{"role": "user", "content": "Write a function to find the minimum product from the pairs of tuples within a given list.\nThe function should be named `min_product_tuple`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert min_product_tuple([(2, 7), (2, 6), (1, 8), (4, 9)] )==8\nassert min_product_tuple([(10,20), (15,2), (5,10)] )==30\nassert min_product_tuple([(11,44), (10,15), (20,5), (12, 9)] )==100"} {"row": 399, "completion_input": "\"\"\"Write a function to find the minimum value in a given heterogeneous list.\"\"\"\n\ndef min_val(", "completion_prefix": "def min_val(", "chat_input": [{"role": "user", "content": "Write a function to find the minimum value in a given heterogeneous list.\nThe function should be named `min_val`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert min_val(['Python', 3, 2, 4, 5, 'version'])==2\nassert min_val(['Python', 15, 20, 25])==15\nassert min_val(['Python', 30, 20, 40, 50, 'version'])==20"} {"row": 400, "completion_input": "\"\"\"Write a function to convert the given snake case string to camel case string by using regex.\"\"\"\n\ndef snake_to_camel(", "completion_prefix": "def snake_to_camel(", "chat_input": [{"role": "user", "content": "Write a function to convert the given snake case string to camel case string by using regex.\nThe function should be named `snake_to_camel`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert snake_to_camel('android_tv') == 'AndroidTv'\nassert snake_to_camel('google_pixel') == 'GooglePixel'\nassert snake_to_camel('apple_watch') == 'AppleWatch'"} {"row": 401, "completion_input": "\"\"\"Write a python function to remove odd numbers from a given list.\"\"\"\n\ndef remove_odd(", "completion_prefix": "def remove_odd(", "chat_input": [{"role": "user", "content": "Write a python function to remove odd numbers from a given list.\nThe function should be named `remove_odd`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert remove_odd([1,2,3]) == [2]\nassert remove_odd([2,4,6]) == [2,4,6]\nassert remove_odd([10,20,3]) == [10,20]"} {"row": 402, "completion_input": "\"\"\"Write a function to extract the nth element from a given list of tuples.\"\"\"\n\ndef extract_nth_element(", "completion_prefix": "def extract_nth_element(", "chat_input": [{"role": "user", "content": "Write a function to extract the nth element from a given list of tuples.\nThe function should be named `extract_nth_element`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert extract_nth_element([('Greyson Fulton', 98, 99), ('Brady Kent', 97, 96), ('Wyatt Knott', 91, 94), ('Beau Turnbull', 94, 98)] ,0)==['Greyson Fulton', 'Brady Kent', 'Wyatt Knott', 'Beau Turnbull']\nassert extract_nth_element([('Greyson Fulton', 98, 99), ('Brady Kent', 97, 96), ('Wyatt Knott', 91, 94), ('Beau Turnbull', 94, 98)] ,2)==[99, 96, 94, 98]\nassert extract_nth_element([('Greyson Fulton', 98, 99), ('Brady Kent', 97, 96), ('Wyatt Knott', 91, 94), ('Beau Turnbull', 94, 98)],1)==[98, 97, 91, 94]"} {"row": 403, "completion_input": "\"\"\"Write a python function to check whether the value exists in a sequence or not.\"\"\"\n\ndef overlapping(", "completion_prefix": "def overlapping(", "chat_input": [{"role": "user", "content": "Write a python function to check whether the value exists in a sequence or not.\nThe function should be named `overlapping`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert overlapping([1,2,3,4,5],[6,7,8,9]) == False\nassert overlapping([1,2,3],[4,5,6]) == False\nassert overlapping([1,4,5],[1,4,5]) == True"} {"row": 404, "completion_input": "\"\"\"Write a python function to find a pair with highest product from a given array of integers.\"\"\"\n\ndef max_Product(", "completion_prefix": "def max_Product(", "chat_input": [{"role": "user", "content": "Write a python function to find a pair with highest product from a given array of integers.\nThe function should be named `max_Product`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert max_Product([1,2,3,4,7,0,8,4]) == (7,8)\nassert max_Product([0,-1,-2,-4,5,0,-6]) == (-4,-6)\nassert max_Product([1,2,3]) == (2,3)"} {"row": 405, "completion_input": "\"\"\"Write a function to find the maximum sum we can make by dividing number in three parts recursively and summing them up together for the given number.\"\"\"\n\ndef breakSum(", "completion_prefix": "def breakSum(", "chat_input": [{"role": "user", "content": "Write a function to find the maximum sum we can make by dividing number in three parts recursively and summing them up together for the given number.\nThe function should be named `breakSum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert breakSum(12) == 13\nassert breakSum(24) == 27\nassert breakSum(23) == 23"} {"row": 406, "completion_input": "\"\"\"Write a function to find common first element in given list of tuple.\"\"\"\n\ndef group_tuples(", "completion_prefix": "def group_tuples(", "chat_input": [{"role": "user", "content": "Write a function to find common first element in given list of tuple.\nThe function should be named `group_tuples`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert group_tuples([('x', 'y'), ('x', 'z'), ('w', 't')]) == [('x', 'y', 'z'), ('w', 't')]\nassert group_tuples([('a', 'b'), ('a', 'c'), ('d', 'e')]) == [('a', 'b', 'c'), ('d', 'e')]\nassert group_tuples([('f', 'g'), ('f', 'g'), ('h', 'i')]) == [('f', 'g', 'g'), ('h', 'i')]"} {"row": 407, "completion_input": "\"\"\"Write a python function to find the sublist having maximum length.\"\"\"\n\ndef Find_Max(", "completion_prefix": "def Find_Max(", "chat_input": [{"role": "user", "content": "Write a python function to find the sublist having maximum length.\nThe function should be named `Find_Max`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert Find_Max([['A'],['A','B'],['A','B','C']]) == ['A','B','C']\nassert Find_Max([[1],[1,2],[1,2,3]]) == [1,2,3]\nassert Find_Max([[1,1],[1,2,3],[1,5,6,1]]) == [1,5,6,1]"} {"row": 408, "completion_input": "\"\"\"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.\"\"\"\n\ndef round_and_sum(", "completion_prefix": "def round_and_sum(", "chat_input": [{"role": "user", "content": "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.\nThe function should be named `round_and_sum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert round_and_sum([22.4, 4.0, -16.22, -9.10, 11.00, -12.22, 14.20, -5.20, 17.50])==243\nassert round_and_sum([5,2,9,24.3,29])==345\nassert round_and_sum([25.0,56.7,89.2])==513"} {"row": 409, "completion_input": "\"\"\"Write a python function to find the cube sum of first n even natural numbers.\"\"\"\n\ndef cube_Sum(", "completion_prefix": "def cube_Sum(", "chat_input": [{"role": "user", "content": "Write a python function to find the cube sum of first n even natural numbers.\nThe function should be named `cube_Sum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert cube_Sum(2) == 72\nassert cube_Sum(3) == 288\nassert cube_Sum(4) == 800"} {"row": 410, "completion_input": "\"\"\"Write a function to concatenate each element of tuple by the delimiter.\"\"\"\n\ndef concatenate_tuple(", "completion_prefix": "def concatenate_tuple(", "chat_input": [{"role": "user", "content": "Write a function to concatenate each element of tuple by the delimiter.\nThe function should be named `concatenate_tuple`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert concatenate_tuple((\"ID\", \"is\", 4, \"UTS\") ) == 'ID-is-4-UTS'\nassert concatenate_tuple((\"QWE\", \"is\", 4, \"RTY\") ) == 'QWE-is-4-RTY'\nassert concatenate_tuple((\"ZEN\", \"is\", 4, \"OP\") ) == 'ZEN-is-4-OP'"} {"row": 411, "completion_input": "\"\"\"Write a python function to find the average of cubes of first n natural numbers.\"\"\"\n\ndef find_Average_Of_Cube(", "completion_prefix": "def find_Average_Of_Cube(", "chat_input": [{"role": "user", "content": "Write a python function to find the average of cubes of first n natural numbers.\nThe function should be named `find_Average_Of_Cube`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_Average_Of_Cube(2) == 4.5\nassert find_Average_Of_Cube(3) == 12\nassert find_Average_Of_Cube(1) == 1"} {"row": 412, "completion_input": "\"\"\"Write a function to solve gold mine problem.\"\"\"\n\ndef get_maxgold(", "completion_prefix": "def get_maxgold(", "chat_input": [{"role": "user", "content": "Write a function to solve gold mine problem.\nThe function should be named `get_maxgold`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert get_maxgold([[1, 3, 1, 5],[2, 2, 4, 1],[5, 0, 2, 3],[0, 6, 1, 2]],4,4)==16\nassert get_maxgold([[10,20],[30,40]],2,2)==70\nassert get_maxgold([[4,9],[3,7]],2,2)==13"} {"row": 413, "completion_input": "\"\"\"Write a function to extract only the rear index element of each string in the given tuple.\"\"\"\n\ndef extract_rear(", "completion_prefix": "def extract_rear(", "chat_input": [{"role": "user", "content": "Write a function to extract only the rear index element of each string in the given tuple.\nThe function should be named `extract_rear`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert extract_rear(('Mers', 'for', 'Vers') ) == ['s', 'r', 's']\nassert extract_rear(('Avenge', 'for', 'People') ) == ['e', 'r', 'e']\nassert extract_rear(('Gotta', 'get', 'go') ) == ['a', 't', 'o']"} {"row": 414, "completion_input": "\"\"\"Write a function to count the number of sublists containing a particular element.\"\"\"\n\ndef count_element_in_list(", "completion_prefix": "def count_element_in_list(", "chat_input": [{"role": "user", "content": "Write a function to count the number of sublists containing a particular element.\nThe function should be named `count_element_in_list`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_element_in_list([[1, 3], [5, 7], [1, 11], [1, 15, 7]],1)==3\nassert count_element_in_list([['A', 'B'], ['A', 'C'], ['A', 'D', 'E'], ['B', 'C', 'D']],'A')==3\nassert count_element_in_list([['A', 'B'], ['A', 'C'], ['A', 'D', 'E'], ['B', 'C', 'D']],'E')==1"} {"row": 415, "completion_input": "\"\"\"Write a function to filter odd numbers using lambda function.\"\"\"\n\ndef filter_oddnumbers(", "completion_prefix": "def filter_oddnumbers(", "chat_input": [{"role": "user", "content": "Write a function to filter odd numbers using lambda function.\nThe function should be named `filter_oddnumbers`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert filter_oddnumbers([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])==[1,3,5,7,9]\nassert filter_oddnumbers([10,20,45,67,84,93])==[45,67,93]\nassert filter_oddnumbers([5,7,9,8,6,4,3])==[5,7,9,3]"} {"row": 416, "completion_input": "\"\"\"Write a function to convert a date of yyyy-mm-dd format to dd-mm-yyyy format by using regex.\"\"\"\n\ndef change_date_format(", "completion_prefix": "def change_date_format(", "chat_input": [{"role": "user", "content": "Write a function to convert a date of yyyy-mm-dd format to dd-mm-yyyy format by using regex.\nThe function should be named `change_date_format`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert change_date_format(\"2026-01-02\") == '02-01-2026'\nassert change_date_format(\"2020-11-13\") == '13-11-2020'\nassert change_date_format(\"2021-04-26\") == '26-04-2021'"} {"row": 417, "completion_input": "\"\"\"Write a function to sort the given array by using shell sort.\"\"\"\n\ndef shell_sort(", "completion_prefix": "def shell_sort(", "chat_input": [{"role": "user", "content": "Write a function to sort the given array by using shell sort.\nThe function should be named `shell_sort`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert shell_sort([12, 23, 4, 5, 3, 2, 12, 81, 56, 95]) == [2, 3, 4, 5, 12, 12, 23, 56, 81, 95]\nassert shell_sort([24, 22, 39, 34, 87, 73, 68]) == [22, 24, 34, 39, 68, 73, 87]\nassert shell_sort([32, 30, 16, 96, 82, 83, 74]) == [16, 30, 32, 74, 82, 83, 96]"} {"row": 418, "completion_input": "\"\"\"Write a function to extract the elementwise and tuples from the given two tuples.\"\"\"\n\ndef and_tuples(", "completion_prefix": "def and_tuples(", "chat_input": [{"role": "user", "content": "Write a function to extract the elementwise and tuples from the given two tuples.\nThe function should be named `and_tuples`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert and_tuples((10, 4, 6, 9), (5, 2, 3, 3)) == (0, 0, 2, 1)\nassert and_tuples((1, 2, 3, 4), (5, 6, 7, 8)) == (1, 2, 3, 0)\nassert and_tuples((8, 9, 11, 12), (7, 13, 14, 17)) == (0, 9, 10, 0)"} {"row": 419, "completion_input": "\"\"\"Write a function to find the directrix of a parabola.\"\"\"\n\ndef parabola_directrix(", "completion_prefix": "def parabola_directrix(", "chat_input": [{"role": "user", "content": "Write a function to find the directrix of a parabola.\nThe function should be named `parabola_directrix`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert parabola_directrix(5,3,2)==-198\nassert parabola_directrix(9,8,4)==-2336\nassert parabola_directrix(2,4,6)==-130"} {"row": 420, "completion_input": "\"\"\"Write a function that takes two lists and returns true if they have at least one common element.\"\"\"\n\ndef common_element(", "completion_prefix": "def common_element(", "chat_input": [{"role": "user", "content": "Write a function that takes two lists and returns true if they have at least one common element.\nThe function should be named `common_element`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert common_element([1,2,3,4,5], [5,6,7,8,9])==True\nassert common_element([1,2,3,4,5], [6,7,8,9])==None\nassert common_element(['a','b','c'], ['d','b','e'])==True"} {"row": 421, "completion_input": "\"\"\"Write a function to find the median of a trapezium.\"\"\"\n\ndef median_trapezium(", "completion_prefix": "def median_trapezium(", "chat_input": [{"role": "user", "content": "Write a function to find the median of a trapezium.\nThe function should be named `median_trapezium`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert median_trapezium(15,25,35)==20\nassert median_trapezium(10,20,30)==15\nassert median_trapezium(6,9,4)==7.5"} {"row": 422, "completion_input": "\"\"\"Write a function to check whether the entered number is greater than the elements of the given array.\"\"\"\n\ndef check_greater(", "completion_prefix": "def check_greater(", "chat_input": [{"role": "user", "content": "Write a function to check whether the entered number is greater than the elements of the given array.\nThe function should be named `check_greater`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert check_greater([1, 2, 3, 4, 5], 4) == 'No, entered number is less than those in the array'\nassert check_greater([2, 3, 4, 5, 6], 8) == 'Yes, the entered number is greater than those in the array'\nassert check_greater([9, 7, 4, 8, 6, 1], 11) == 'Yes, the entered number is greater than those in the array'"} {"row": 423, "completion_input": "\"\"\"Write a function that matches a string that has an a followed by one or more b's.\"\"\"\n\ndef text_match_one(", "completion_prefix": "def text_match_one(", "chat_input": [{"role": "user", "content": "Write a function that matches a string that has an a followed by one or more b's.\nThe function should be named `text_match_one`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert text_match_one(\"ac\")==('Not matched!')\nassert text_match_one(\"dc\")==('Not matched!')\nassert text_match_one(\"abba\")==('Found a match!')"} {"row": 424, "completion_input": "\"\"\"Write a python function to find the last digit of a given number.\"\"\"\n\ndef last_Digit(", "completion_prefix": "def last_Digit(", "chat_input": [{"role": "user", "content": "Write a python function to find the last digit of a given number.\nThe function should be named `last_Digit`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert last_Digit(123) == 3\nassert last_Digit(25) == 5\nassert last_Digit(30) == 0"} {"row": 425, "completion_input": "\"\"\"Write a python function to print negative numbers in a list.\"\"\"\n\ndef neg_nos(", "completion_prefix": "def neg_nos(", "chat_input": [{"role": "user", "content": "Write a python function to print negative numbers in a list.\nThe function should be named `neg_nos`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert neg_nos([-1,4,5,-6]) == -1,-6\nassert neg_nos([-1,-2,3,4]) == -1,-2\nassert neg_nos([-7,-6,8,9]) == -7,-6"} {"row": 426, "completion_input": "\"\"\"Write a function to remove odd characters in a string.\"\"\"\n\ndef remove_odd(", "completion_prefix": "def remove_odd(", "chat_input": [{"role": "user", "content": "Write a function to remove odd characters in a string.\nThe function should be named `remove_odd`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert remove_odd(\"python\")==(\"yhn\")\nassert remove_odd(\"program\")==(\"rga\")\nassert remove_odd(\"language\")==(\"agae\")"} {"row": 427, "completion_input": "\"\"\"Write a function to count bidirectional tuple pairs.\"\"\"\n\ndef count_bidirectional(", "completion_prefix": "def count_bidirectional(", "chat_input": [{"role": "user", "content": "Write a function to count bidirectional tuple pairs.\nThe function should be named `count_bidirectional`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_bidirectional([(5, 6), (1, 2), (6, 5), (9, 1), (6, 5), (2, 1)] ) == '3'\nassert count_bidirectional([(5, 6), (1, 3), (6, 5), (9, 1), (6, 5), (2, 1)] ) == '2'\nassert count_bidirectional([(5, 6), (1, 2), (6, 5), (9, 2), (6, 5), (2, 1)] ) == '4'"} {"row": 428, "completion_input": "\"\"\"Write a function to convert a list of multiple integers into a single integer.\"\"\"\n\ndef multiple_to_single(", "completion_prefix": "def multiple_to_single(", "chat_input": [{"role": "user", "content": "Write a function to convert a list of multiple integers into a single integer.\nThe function should be named `multiple_to_single`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert multiple_to_single([11, 33, 50])==113350\nassert multiple_to_single([-1,2,3,4,5,6])==-123456\nassert multiple_to_single([10,15,20,25])==10152025"} {"row": 429, "completion_input": "\"\"\"Write a function to find all adverbs and their positions in a given sentence.\"\"\"\n\ndef find_adverb_position(", "completion_prefix": "def find_adverb_position(", "chat_input": [{"role": "user", "content": "Write a function to find all adverbs and their positions in a given sentence.\nThe function should be named `find_adverb_position`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_adverb_position(\"clearly!! we can see the sky\")==(0, 7, 'clearly')\nassert find_adverb_position(\"seriously!! there are many roses\")==(0, 9, 'seriously')\nassert find_adverb_position(\"unfortunately!! sita is going to home\")==(0, 13, 'unfortunately')"} {"row": 430, "completion_input": "\"\"\"Write a function to find the surface area of a cube.\"\"\"\n\ndef surfacearea_cube(", "completion_prefix": "def surfacearea_cube(", "chat_input": [{"role": "user", "content": "Write a function to find the surface area of a cube.\nThe function should be named `surfacearea_cube`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert surfacearea_cube(5)==150\nassert surfacearea_cube(3)==54\nassert surfacearea_cube(10)==600"} {"row": 431, "completion_input": "\"\"\"Write a function to find the ration of positive numbers in an array of integers.\"\"\"\n\ndef positive_count(", "completion_prefix": "def positive_count(", "chat_input": [{"role": "user", "content": "Write a function to find the ration of positive numbers in an array of integers.\nThe function should be named `positive_count`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert positive_count([0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8])==0.54\nassert positive_count([2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8])==0.69\nassert positive_count([2, 4, -6, -9, 11, -12, 14, -5, 17])==0.56"} {"row": 432, "completion_input": "\"\"\"Write a python function to find the largest negative number from the given list.\"\"\"\n\ndef largest_neg(", "completion_prefix": "def largest_neg(", "chat_input": [{"role": "user", "content": "Write a python function to find the largest negative number from the given list.\nThe function should be named `largest_neg`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert largest_neg([1,2,3,-4,-6]) == -6\nassert largest_neg([1,2,3,-8,-9]) == -9\nassert largest_neg([1,2,3,4,-1]) == -1"} {"row": 433, "completion_input": "\"\"\"Write a function to trim each tuple by k in the given tuple list.\"\"\"\n\ndef trim_tuple(", "completion_prefix": "def trim_tuple(", "chat_input": [{"role": "user", "content": "Write a function to trim each tuple by k in the given tuple list.\nThe function should be named `trim_tuple`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert trim_tuple([(5, 3, 2, 1, 4), (3, 4, 9, 2, 1),(9, 1, 2, 3, 5), (4, 8, 2, 1, 7)], 2) == '[(2,), (9,), (2,), (2,)]'\nassert trim_tuple([(5, 3, 2, 1, 4), (3, 4, 9, 2, 1), (9, 1, 2, 3, 5), (4, 8, 2, 1, 7)], 1) == '[(3, 2, 1), (4, 9, 2), (1, 2, 3), (8, 2, 1)]'\nassert trim_tuple([(7, 8, 4, 9), (11, 8, 12, 4),(4, 1, 7, 8), (3, 6, 9, 7)], 1) == '[(8, 4), (8, 12), (1, 7), (6, 9)]'"} {"row": 434, "completion_input": "\"\"\"Write a function to perform index wise multiplication of tuple elements in the given two tuples.\"\"\"\n\ndef index_multiplication(", "completion_prefix": "def index_multiplication(", "chat_input": [{"role": "user", "content": "Write a function to perform index wise multiplication of tuple elements in the given two tuples.\nThe function should be named `index_multiplication`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert index_multiplication(((1, 3), (4, 5), (2, 9), (1, 10)),((6, 7), (3, 9), (1, 1), (7, 3)) ) == ((6, 21), (12, 45), (2, 9), (7, 30))\nassert index_multiplication(((2, 4), (5, 6), (3, 10), (2, 11)),((7, 8), (4, 10), (2, 2), (8, 4)) ) == ((14, 32), (20, 60), (6, 20), (16, 44))\nassert index_multiplication(((3, 5), (6, 7), (4, 11), (3, 12)),((8, 9), (5, 11), (3, 3), (9, 5)) ) == ((24, 45), (30, 77), (12, 33), (27, 60))"} {"row": 435, "completion_input": "\"\"\"Write a python function to count the occurence of all elements of list in a tuple.\"\"\"\n\ndef count_Occurrence(", "completion_prefix": "def count_Occurrence(", "chat_input": [{"role": "user", "content": "Write a python function to count the occurence of all elements of list in a tuple.\nThe function should be named `count_Occurrence`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert count_Occurrence(('a', 'a', 'c', 'b', 'd'),['a', 'b'] ) == 3\nassert count_Occurrence((1, 2, 3, 1, 4, 6, 7, 1, 4),[1, 4, 7]) == 6\nassert count_Occurrence((1,2,3,4,5,6),[1,2]) == 2"} {"row": 436, "completion_input": "\"\"\"Write a function to find cubes of individual elements in a list using lambda function.\"\"\"\n\ndef cube_nums(", "completion_prefix": "def cube_nums(", "chat_input": [{"role": "user", "content": "Write a function to find cubes of individual elements in a list using lambda function.\nThe function should be named `cube_nums`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert cube_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])==[1, 8, 27, 64, 125, 216, 343, 512, 729, 1000]\nassert cube_nums([10,20,30])==([1000, 8000, 27000])\nassert cube_nums([12,15])==([1728, 3375])"} {"row": 437, "completion_input": "\"\"\"Write a function to calculate the sum of perrin numbers.\"\"\"\n\ndef cal_sum(", "completion_prefix": "def cal_sum(", "chat_input": [{"role": "user", "content": "Write a function to calculate the sum of perrin numbers.\nThe function should be named `cal_sum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert cal_sum(9) == 49\nassert cal_sum(10) == 66\nassert cal_sum(11) == 88"} {"row": 438, "completion_input": "\"\"\"Write a python function to check whether the triangle is valid or not if 3 points are given.\"\"\"\n\ndef check_Triangle(", "completion_prefix": "def check_Triangle(", "chat_input": [{"role": "user", "content": "Write a python function to check whether the triangle is valid or not if 3 points are given.\nThe function should be named `check_Triangle`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert check_Triangle(1,5,2,5,4,6) == 'Yes'\nassert check_Triangle(1,1,1,4,1,5) == 'No'\nassert check_Triangle(1,1,1,1,1,1) == 'No'"} {"row": 439, "completion_input": "\"\"\"Write a function to extract specified size of strings from a give list of string values.\"\"\"\n\ndef extract_string(", "completion_prefix": "def extract_string(", "chat_input": [{"role": "user", "content": "Write a function to extract specified size of strings from a give list of string values.\nThe function should be named `extract_string`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert extract_string(['Python', 'list', 'exercises', 'practice', 'solution'] ,8)==['practice', 'solution']\nassert extract_string(['Python', 'list', 'exercises', 'practice', 'solution'] ,6)==['Python']\nassert extract_string(['Python', 'list', 'exercises', 'practice', 'solution'] ,9)==['exercises']"} {"row": 440, "completion_input": "\"\"\"Write a function to remove all whitespaces from the given string using regex.\"\"\"\n\ndef remove_whitespaces(", "completion_prefix": "def remove_whitespaces(", "chat_input": [{"role": "user", "content": "Write a function to remove all whitespaces from the given string using regex.\nThe function should be named `remove_whitespaces`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert remove_whitespaces(' Google Flutter ') == 'GoogleFlutter'\nassert remove_whitespaces(' Google Dart ') == 'GoogleDart'\nassert remove_whitespaces(' iOS Swift ') == 'iOSSwift'"} {"row": 441, "completion_input": "\"\"\"Write a function that gives loss amount if the given amount has loss else return none.\"\"\"\n\ndef loss_amount(", "completion_prefix": "def loss_amount(", "chat_input": [{"role": "user", "content": "Write a function that gives loss amount if the given amount has loss else return none.\nThe function should be named `loss_amount`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert loss_amount(1500,1200)==None\nassert loss_amount(100,200)==100\nassert loss_amount(2000,5000)==3000"} {"row": 442, "completion_input": "\"\"\"Write a python function to find the sum of even factors of a number.\"\"\"\n\ndef sumofFactors(", "completion_prefix": "def sumofFactors(", "chat_input": [{"role": "user", "content": "Write a python function to find the sum of even factors of a number.\nThe function should be named `sumofFactors`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert sumofFactors(18) == 26\nassert sumofFactors(30) == 48\nassert sumofFactors(6) == 8"} {"row": 443, "completion_input": "\"\"\"Write a function that matches a word containing 'z'.\"\"\"\n\ndef text_match_wordz(", "completion_prefix": "def text_match_wordz(", "chat_input": [{"role": "user", "content": "Write a function that matches a word containing 'z'.\nThe function should be named `text_match_wordz`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert text_match_wordz(\"pythonz.\")==('Found a match!')\nassert text_match_wordz(\"xyz.\")==('Found a match!')\nassert text_match_wordz(\" lang .\")==('Not matched!')"} {"row": 444, "completion_input": "\"\"\"Write a function to check whether the given month number contains 31 days or not.\"\"\"\n\ndef check_monthnumb_number(", "completion_prefix": "def check_monthnumb_number(", "chat_input": [{"role": "user", "content": "Write a function to check whether the given month number contains 31 days or not.\nThe function should be named `check_monthnumb_number`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert check_monthnumb_number(5)==True\nassert check_monthnumb_number(2)==False\nassert check_monthnumb_number(6)==False"} {"row": 445, "completion_input": "\"\"\"Write a function to reverse strings in a given list of string values.\"\"\"\n\ndef reverse_string_list(", "completion_prefix": "def reverse_string_list(", "chat_input": [{"role": "user", "content": "Write a function to reverse strings in a given list of string values.\nThe function should be named `reverse_string_list`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert reverse_string_list(['Red', 'Green', 'Blue', 'White', 'Black'])==['deR', 'neerG', 'eulB', 'etihW', 'kcalB']\nassert reverse_string_list(['john','amal','joel','george'])==['nhoj','lama','leoj','egroeg']\nassert reverse_string_list(['jack','john','mary'])==['kcaj','nhoj','yram']"} {"row": 446, "completion_input": "\"\"\"Write a python function to find the sublist having minimum length.\"\"\"\n\ndef Find_Min(", "completion_prefix": "def Find_Min(", "chat_input": [{"role": "user", "content": "Write a python function to find the sublist having minimum length.\nThe function should be named `Find_Min`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert Find_Min([[1],[1,2],[1,2,3]]) == [1]\nassert Find_Min([[1,1],[1,1,1],[1,2,7,8]]) == [1,1]\nassert Find_Min([['x'],['x','y'],['x','y','z']]) == ['x']"} {"row": 447, "completion_input": "\"\"\"Write a function to find the area of a rectangle.\"\"\"\n\ndef rectangle_area(", "completion_prefix": "def rectangle_area(", "chat_input": [{"role": "user", "content": "Write a function to find the area of a rectangle.\nThe function should be named `rectangle_area`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert rectangle_area(10,20)==200\nassert rectangle_area(10,5)==50\nassert rectangle_area(4,2)==8"} {"row": 448, "completion_input": "\"\"\"Write a function to remove uppercase substrings from a given string by using regex.\"\"\"\n\ndef remove_uppercase(", "completion_prefix": "def remove_uppercase(", "chat_input": [{"role": "user", "content": "Write a function to remove uppercase substrings from a given string by using regex.\nThe function should be named `remove_uppercase`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert remove_uppercase('cAstyoUrFavoRitETVshoWs') == 'cstyoravoitshos'\nassert remove_uppercase('wAtchTheinTernEtrAdIo') == 'wtchheinerntrdo'\nassert remove_uppercase('VoicESeaRchAndreComMendaTionS') == 'oiceachndreomendaion'"} {"row": 449, "completion_input": "\"\"\"Write a python function to get the first element of each sublist.\"\"\"\n\ndef Extract(", "completion_prefix": "def Extract(", "chat_input": [{"role": "user", "content": "Write a python function to get the first element of each sublist.\nThe function should be named `Extract`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert Extract([[1, 2], [3, 4, 5], [6, 7, 8, 9]]) == [1, 3, 6]\nassert Extract([[1,2,3],[4, 5]]) == [1,4]\nassert Extract([[9,8,1],[1,2]]) == [9,1]"} {"row": 450, "completion_input": "\"\"\"Write a python function to count the upper case characters in a given string.\"\"\"\n\ndef upper_ctr(", "completion_prefix": "def upper_ctr(", "chat_input": [{"role": "user", "content": "Write a python function to count the upper case characters in a given string.\nThe function should be named `upper_ctr`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert upper_ctr('PYthon') == 1\nassert upper_ctr('BigData') == 1\nassert upper_ctr('program') == 0"} {"row": 451, "completion_input": "\"\"\"Write a function to find all possible combinations of the elements of a given list.\"\"\"\n\ndef combinations_list(", "completion_prefix": "def combinations_list(", "chat_input": [{"role": "user", "content": "Write a function to find all possible combinations of the elements of a given list.\nThe function should be named `combinations_list`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert combinations_list(['orange', 'red', 'green', 'blue'])==[[], ['orange'], ['red'], ['red', 'orange'], ['green'], ['green', 'orange'], ['green', 'red'], ['green', 'red', 'orange'], ['blue'], ['blue', 'orange'], ['blue', 'red'], ['blue', 'red', 'orange'], ['blue', 'green'], ['blue', 'green', 'orange'], ['blue', 'green', 'red'], ['blue', 'green', 'red', 'orange']]\nassert combinations_list(['red', 'green', 'blue', 'white', 'black', 'orange'])==[[], ['red'], ['green'], ['green', 'red'], ['blue'], ['blue', 'red'], ['blue', 'green'], ['blue', 'green', 'red'], ['white'], ['white', 'red'], ['white', 'green'], ['white', 'green', 'red'], ['white', 'blue'], ['white', 'blue', 'red'], ['white', 'blue', 'green'], ['white', 'blue', 'green', 'red'], ['black'], ['black', 'red'], ['black', 'green'], ['black', 'green', 'red'], ['black', 'blue'], ['black', 'blue', 'red'], ['black', 'blue', 'green'], ['black', 'blue', 'green', 'red'], ['black', 'white'], ['black', 'white', 'red'], ['black', 'white', 'green'], ['black', 'white', 'green', 'red'], ['black', 'white', 'blue'], ['black', 'white', 'blue', 'red'], ['black', 'white', 'blue', 'green'], ['black', 'white', 'blue', 'green', 'red'], ['orange'], ['orange', 'red'], ['orange', 'green'], ['orange', 'green', 'red'], ['orange', 'blue'], ['orange', 'blue', 'red'], ['orange', 'blue', 'green'], ['orange', 'blue', 'green', 'red'], ['orange', 'white'], ['orange', 'white', 'red'], ['orange', 'white', 'green'], ['orange', 'white', 'green', 'red'], ['orange', 'white', 'blue'], ['orange', 'white', 'blue', 'red'], ['orange', 'white', 'blue', 'green'], ['orange', 'white', 'blue', 'green', 'red'], ['orange', 'black'], ['orange', 'black', 'red'], ['orange', 'black', 'green'], ['orange', 'black', 'green', 'red'], ['orange', 'black', 'blue'], ['orange', 'black', 'blue', 'red'], ['orange', 'black', 'blue', 'green'], ['orange', 'black', 'blue', 'green', 'red'], ['orange', 'black', 'white'], ['orange', 'black', 'white', 'red'], ['orange', 'black', 'white', 'green'], ['orange', 'black', 'white', 'green', 'red'], ['orange', 'black', 'white', 'blue'], ['orange', 'black', 'white', 'blue', 'red'], ['orange', 'black', 'white', 'blue', 'green'], ['orange', 'black', 'white', 'blue', 'green', 'red']]\nassert combinations_list(['red', 'green', 'black', 'orange'])==[[], ['red'], ['green'], ['green', 'red'], ['black'], ['black', 'red'], ['black', 'green'], ['black', 'green', 'red'], ['orange'], ['orange', 'red'], ['orange', 'green'], ['orange', 'green', 'red'], ['orange', 'black'], ['orange', 'black', 'red'], ['orange', 'black', 'green'], ['orange', 'black', 'green', 'red']]"} {"row": 452, "completion_input": "\"\"\"Write a function to find the maximum product subarray of the given array.\"\"\"\n\ndef max_subarray_product(", "completion_prefix": "def max_subarray_product(", "chat_input": [{"role": "user", "content": "Write a function to find the maximum product subarray of the given array.\nThe function should be named `max_subarray_product`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert max_subarray_product([1, -2, -3, 0, 7, -8, -2]) == 112\nassert max_subarray_product([6, -3, -10, 0, 2]) == 180 \nassert max_subarray_product([-2, -40, 0, -2, -3]) == 80"} {"row": 453, "completion_input": "\"\"\"Write a function to check if all values are same in a dictionary.\"\"\"\n\ndef check_value(", "completion_prefix": "def check_value(", "chat_input": [{"role": "user", "content": "Write a function to check if all values are same in a dictionary.\nThe function should be named `check_value`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert check_value({'Cierra Vega': 12, 'Alden Cantrell': 12, 'Kierra Gentry': 12, 'Pierre Cox': 12},10)==False\nassert check_value({'Cierra Vega': 12, 'Alden Cantrell': 12, 'Kierra Gentry': 12, 'Pierre Cox': 12},12)==True\nassert check_value({'Cierra Vega': 12, 'Alden Cantrell': 12, 'Kierra Gentry': 12, 'Pierre Cox': 12},5)==False"} {"row": 454, "completion_input": "\"\"\"Write a function to drop empty items from a given dictionary.\"\"\"\n\ndef drop_empty(", "completion_prefix": "def drop_empty(", "chat_input": [{"role": "user", "content": "Write a function to drop empty items from a given dictionary.\nThe function should be named `drop_empty`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert drop_empty({'c1': 'Red', 'c2': 'Green', 'c3':None})=={'c1': 'Red', 'c2': 'Green'}\nassert drop_empty({'c1': 'Red', 'c2': None, 'c3':None})=={'c1': 'Red'}\nassert drop_empty({'c1': None, 'c2': 'Green', 'c3':None})=={ 'c2': 'Green'}"} {"row": 455, "completion_input": "\"\"\"Write a function to find the peak element in the given array.\"\"\"\n\ndef find_peak(", "completion_prefix": "def find_peak(", "chat_input": [{"role": "user", "content": "Write a function to find the peak element in the given array.\nThe function should be named `find_peak`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_peak([1, 3, 20, 4, 1, 0], 6) == 2\nassert find_peak([2, 3, 4, 5, 6], 5) == 4\nassert find_peak([8, 9, 11, 12, 14, 15], 6) == 5 "} {"row": 456, "completion_input": "\"\"\"Write a python function to convert decimal number to octal number.\"\"\"\n\ndef decimal_to_Octal(", "completion_prefix": "def decimal_to_Octal(", "chat_input": [{"role": "user", "content": "Write a python function to convert decimal number to octal number.\nThe function should be named `decimal_to_Octal`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert decimal_to_Octal(10) == 12\nassert decimal_to_Octal(2) == 2\nassert decimal_to_Octal(33) == 41"} {"row": 457, "completion_input": "\"\"\"Write a function to find the maximum product formed by multiplying numbers of an increasing subsequence of that array.\"\"\"\n\ndef max_product(", "completion_prefix": "def max_product(", "chat_input": [{"role": "user", "content": "Write a function to find the maximum product formed by multiplying numbers of an increasing subsequence of that array.\nThe function should be named `max_product`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert max_product([3, 100, 4, 5, 150, 6], 6) == 45000 \nassert max_product([4, 42, 55, 68, 80], 5) == 50265600\nassert max_product([10, 22, 9, 33, 21, 50, 41, 60], 8) == 21780000 "} {"row": 458, "completion_input": "\"\"\"Write a function to find the maximum profit earned from a maximum of k stock transactions\"\"\"\n\ndef max_profit(", "completion_prefix": "def max_profit(", "chat_input": [{"role": "user", "content": "Write a function to find the maximum profit earned from a maximum of k stock transactions\nThe function should be named `max_profit`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert max_profit([1, 5, 2, 3, 7, 6, 4, 5], 3) == 10\nassert max_profit([2, 4, 7, 5, 4, 3, 5], 2) == 7\nassert max_profit([10, 6, 8, 4, 2], 2) == 2"} {"row": 459, "completion_input": "\"\"\"Write a function to find the pairwise addition of the elements of the given tuples.\"\"\"\n\ndef add_pairwise(", "completion_prefix": "def add_pairwise(", "chat_input": [{"role": "user", "content": "Write a function to find the pairwise addition of the elements of the given tuples.\nThe function should be named `add_pairwise`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert add_pairwise((1, 5, 7, 8, 10)) == (6, 12, 15, 18)\nassert add_pairwise((2, 6, 8, 9, 11)) == (8, 14, 17, 20)\nassert add_pairwise((3, 7, 9, 10, 12)) == (10, 16, 19, 22)"} {"row": 460, "completion_input": "\"\"\"Write a python function to find remainder of array multiplication divided by n.\"\"\"\n\ndef find_remainder(", "completion_prefix": "def find_remainder(", "chat_input": [{"role": "user", "content": "Write a python function to find remainder of array multiplication divided by n.\nThe function should be named `find_remainder`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find_remainder([ 100, 10, 5, 25, 35, 14 ],6,11) ==9\nassert find_remainder([1,1,1],3,1) == 0\nassert find_remainder([1,2,1],3,2) == 0"} {"row": 461, "completion_input": "\"\"\"Write a python function to check whether the given list contains consecutive numbers or not.\"\"\"\n\ndef check_Consecutive(", "completion_prefix": "def check_Consecutive(", "chat_input": [{"role": "user", "content": "Write a python function to check whether the given list contains consecutive numbers or not.\nThe function should be named `check_Consecutive`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert check_Consecutive([1,2,3,4,5]) == True\nassert check_Consecutive([1,2,3,5,6]) == False\nassert check_Consecutive([1,2,1]) == False"} {"row": 462, "completion_input": "\"\"\"Write a function to find the tuple intersection of elements in the given tuple list irrespective of their order.\"\"\"\n\ndef tuple_intersection(", "completion_prefix": "def tuple_intersection(", "chat_input": [{"role": "user", "content": "Write a function to find the tuple intersection of elements in the given tuple list irrespective of their order.\nThe function should be named `tuple_intersection`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert tuple_intersection([(3, 4), (5, 6), (9, 10), (4, 5)] , [(5, 4), (3, 4), (6, 5), (9, 11)]) == {(4, 5), (3, 4), (5, 6)}\nassert tuple_intersection([(4, 1), (7, 4), (11, 13), (17, 14)] , [(1, 4), (7, 4), (16, 12), (10, 13)]) == {(4, 7), (1, 4)}\nassert tuple_intersection([(2, 1), (3, 2), (1, 3), (1, 4)] , [(11, 2), (2, 3), (6, 2), (1, 3)]) == {(1, 3), (2, 3)}"} {"row": 463, "completion_input": "\"\"\"Write a function to replace characters in a string.\"\"\"\n\ndef replace_char(", "completion_prefix": "def replace_char(", "chat_input": [{"role": "user", "content": "Write a function to replace characters in a string.\nThe function should be named `replace_char`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert replace_char(\"polygon\",'y','l')==(\"pollgon\")\nassert replace_char(\"character\",'c','a')==(\"aharaater\")\nassert replace_char(\"python\",'l','a')==(\"python\")"} {"row": 464, "completion_input": "\"\"\"Write a function to sort counter by value.\"\"\"\n\ndef sort_counter(", "completion_prefix": "def sort_counter(", "chat_input": [{"role": "user", "content": "Write a function to sort counter by value.\nThe function should be named `sort_counter`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert sort_counter({'Math':81, 'Physics':83, 'Chemistry':87})==[('Chemistry', 87), ('Physics', 83), ('Math', 81)]\nassert sort_counter({'Math':400, 'Physics':300, 'Chemistry':250})==[('Math', 400), ('Physics', 300), ('Chemistry', 250)]\nassert sort_counter({'Math':900, 'Physics':1000, 'Chemistry':1250})==[('Chemistry', 1250), ('Physics', 1000), ('Math', 900)]"} {"row": 465, "completion_input": "\"\"\"Write a python function to find the sum of the largest and smallest value in a given array.\"\"\"\n\ndef big_sum(", "completion_prefix": "def big_sum(", "chat_input": [{"role": "user", "content": "Write a python function to find the sum of the largest and smallest value in a given array.\nThe function should be named `big_sum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert big_sum([1,2,3]) == 4\nassert big_sum([-1,2,3,4]) == 3\nassert big_sum([2,3,6]) == 8"} {"row": 466, "completion_input": "\"\"\"Write a python function to convert the given string to lower case.\"\"\"\n\ndef is_lower(", "completion_prefix": "def is_lower(", "chat_input": [{"role": "user", "content": "Write a python function to convert the given string to lower case.\nThe function should be named `is_lower`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert is_lower(\"InValid\") == \"invalid\"\nassert is_lower(\"TruE\") == \"true\"\nassert is_lower(\"SenTenCE\") == \"sentence\""} {"row": 467, "completion_input": "\"\"\"Write a function to remove lowercase substrings from a given string.\"\"\"\n\ndef remove_lowercase(", "completion_prefix": "def remove_lowercase(", "chat_input": [{"role": "user", "content": "Write a function to remove lowercase substrings from a given string.\nThe function should be named `remove_lowercase`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert remove_lowercase(\"PYTHon\")==('PYTH')\nassert remove_lowercase(\"FInD\")==('FID')\nassert remove_lowercase(\"STRinG\")==('STRG')"} {"row": 468, "completion_input": "\"\"\"Write a python function to find the first digit of a given number.\"\"\"\n\ndef first_Digit(", "completion_prefix": "def first_Digit(", "chat_input": [{"role": "user", "content": "Write a python function to find the first digit of a given number.\nThe function should be named `first_Digit`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert first_Digit(123) == 1\nassert first_Digit(456) == 4\nassert first_Digit(12) == 1"} {"row": 469, "completion_input": "\"\"\"Write a python function to find the maximum occurring character in a given string.\"\"\"\n\ndef get_max_occuring_char(", "completion_prefix": "def get_max_occuring_char(", "chat_input": [{"role": "user", "content": "Write a python function to find the maximum occurring character in a given string.\nThe function should be named `get_max_occuring_char`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert get_max_occuring_char(\"data\") == \"a\"\nassert get_max_occuring_char(\"create\") == \"e\"\nassert get_max_occuring_char(\"brilliant girl\") == \"i\""} {"row": 470, "completion_input": "\"\"\"Write a function to determine if there is a subset of the given set with sum equal to the given sum.\"\"\"\n\ndef is_subset_sum(", "completion_prefix": "def is_subset_sum(", "chat_input": [{"role": "user", "content": "Write a function to determine if there is a subset of the given set with sum equal to the given sum.\nThe function should be named `is_subset_sum`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert is_subset_sum([3, 34, 4, 12, 5, 2], 6, 9) == True\nassert is_subset_sum([3, 34, 4, 12, 5, 2], 6, 30) == False\nassert is_subset_sum([3, 34, 4, 12, 5, 2], 6, 15) == True"} {"row": 471, "completion_input": "\"\"\"Write a function to find sequences of one upper case letter followed by lower case letters in the given string by using regex.\"\"\"\n\ndef match(", "completion_prefix": "def match(", "chat_input": [{"role": "user", "content": "Write a function to find sequences of one upper case letter followed by lower case letters in the given string by using regex.\nThe function should be named `match`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert match(\"Geeks\") == 'Yes'\nassert match(\"geeksforGeeks\") == 'Yes'\nassert match(\"geeks\") == 'No'"} {"row": 472, "completion_input": "\"\"\"Write a python function to find the first natural number whose factorial is divisible by x.\"\"\"\n\ndef first_Factorial_Divisible_Number(", "completion_prefix": "def first_Factorial_Divisible_Number(", "chat_input": [{"role": "user", "content": "Write a python function to find the first natural number whose factorial is divisible by x.\nThe function should be named `first_Factorial_Divisible_Number`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert first_Factorial_Divisible_Number(10) == 5\nassert first_Factorial_Divisible_Number(15) == 5\nassert first_Factorial_Divisible_Number(5) == 4"} {"row": 473, "completion_input": "\"\"\"Write a function to remove the matching tuples from the given two tuples.\"\"\"\n\ndef remove_matching_tuple(", "completion_prefix": "def remove_matching_tuple(", "chat_input": [{"role": "user", "content": "Write a function to remove the matching tuples from the given two tuples.\nThe function should be named `remove_matching_tuple`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert remove_matching_tuple([('Hello', 'dude'), ('How', 'are'), ('you', '?')], [('Hello', 'dude'), ('How', 'are')]) == [('you', '?')]\nassert remove_matching_tuple([('Part', 'of'), ('the', 'journey'), ('is ', 'end')], [('Journey', 'the'), ('is', 'end')]) == [('Part', 'of'), ('the', 'journey'), ('is ', 'end')]\nassert remove_matching_tuple([('Its', 'been'), ('a', 'long'), ('day', 'without')], [('a', 'long'), ('my', 'friend')]) == [('Its', 'been'), ('day', 'without')]"} {"row": 474, "completion_input": "\"\"\"Write a function to find the largest palindromic number in the given array.\"\"\"\n\ndef largest_palindrome(", "completion_prefix": "def largest_palindrome(", "chat_input": [{"role": "user", "content": "Write a function to find the largest palindromic number in the given array.\nThe function should be named `largest_palindrome`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert largest_palindrome([1, 232, 54545, 999991], 4) == 54545\nassert largest_palindrome([1, 2, 3, 4, 5, 50], 6) == 5\nassert largest_palindrome([1, 3, 7, 9, 45], 5) == 9"} {"row": 475, "completion_input": "\"\"\"Write a function to compute binomial probability for the given number.\"\"\"\n\ndef binomial_probability(", "completion_prefix": "def binomial_probability(", "chat_input": [{"role": "user", "content": "Write a function to compute binomial probability for the given number.\nThe function should be named `binomial_probability`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert binomial_probability(10, 5, 1.0/3) == 0.13656454808718185\nassert binomial_probability(11, 6, 2.0/4) == 0.2255859375\nassert binomial_probability(12, 7, 3.0/5) == 0.227030335488"} {"row": 476, "completion_input": "\"\"\"Write a function to sort a list of tuples in increasing order by the last element in each tuple.\"\"\"\n\ndef sort_tuple(", "completion_prefix": "def sort_tuple(", "chat_input": [{"role": "user", "content": "Write a function to sort a list of tuples in increasing order by the last element in each tuple.\nThe function should be named `sort_tuple`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert sort_tuple([(1, 3), (3, 2), (2, 1)] ) == [(2, 1), (3, 2), (1, 3)]\nassert sort_tuple([(2, 4), (3, 3), (1, 1)] ) == [(1, 1), (3, 3), (2, 4)]\nassert sort_tuple([(3, 9), (6, 7), (4, 3)] ) == [(4, 3), (6, 7), (3, 9)]"} {"row": 477, "completion_input": "\"\"\"Write a function to find the area of a pentagon.\"\"\"\n\ndef area_pentagon(", "completion_prefix": "def area_pentagon(", "chat_input": [{"role": "user", "content": "Write a function to find the area of a pentagon.\nThe function should be named `area_pentagon`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert area_pentagon(5)==43.01193501472417\nassert area_pentagon(10)==172.0477400588967\nassert area_pentagon(15)==387.10741513251753"} {"row": 478, "completion_input": "\"\"\"Write a python function to find the frequency of the largest value in a given array.\"\"\"\n\ndef frequency_Of_Largest(", "completion_prefix": "def frequency_Of_Largest(", "chat_input": [{"role": "user", "content": "Write a python function to find the frequency of the largest value in a given array.\nThe function should be named `frequency_Of_Largest`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert frequency_Of_Largest(5,[1,2,3,4,4]) == 2\nassert frequency_Of_Largest(3,[5,6,5]) == 1\nassert frequency_Of_Largest(4,[2,7,7,7]) == 3"} {"row": 479, "completion_input": "\"\"\"Write a function to extract all the pairs which are symmetric in the given tuple list.\"\"\"\n\ndef extract_symmetric(", "completion_prefix": "def extract_symmetric(", "chat_input": [{"role": "user", "content": "Write a function to extract all the pairs which are symmetric in the given tuple list.\nThe function should be named `extract_symmetric`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert extract_symmetric([(6, 7), (2, 3), (7, 6), (9, 8), (10, 2), (8, 9)] ) == {(8, 9), (6, 7)}\nassert extract_symmetric([(7, 8), (3, 4), (8, 7), (10, 9), (11, 3), (9, 10)] ) == {(9, 10), (7, 8)}\nassert extract_symmetric([(8, 9), (4, 5), (9, 8), (11, 10), (12, 4), (10, 11)] ) == {(8, 9), (10, 11)}"} {"row": 480, "completion_input": "\"\"\"Write a function to find the sum of geometric progression series.\"\"\"\n\ndef sum_gp(", "completion_prefix": "def sum_gp(", "chat_input": [{"role": "user", "content": "Write a function to find the sum of geometric progression series.\nThe function should be named `sum_gp`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert sum_gp(1,5,2)==31\nassert sum_gp(1,5,4)==341\nassert sum_gp(2,6,3)==728"} {"row": 481, "completion_input": "\"\"\"Write a function to search an element in the given array by using binary search.\"\"\"\n\ndef binary_search(", "completion_prefix": "def binary_search(", "chat_input": [{"role": "user", "content": "Write a function to search an element in the given array by using binary search.\nThe function should be named `binary_search`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert binary_search([1,2,3,5,8], 6) == False\nassert binary_search([7, 8, 9, 10, 13], 10) == True\nassert binary_search([11, 13, 14, 19, 22, 36], 23) == False"} {"row": 482, "completion_input": "\"\"\"Write a function to calculate a grid of hexagon coordinates where function returns a list of lists containing 6 tuples of x, y point coordinates.\"\"\"\n\ndef calculate_polygons(", "completion_prefix": "def calculate_polygons(", "chat_input": [{"role": "user", "content": "Write a function to calculate a grid of hexagon coordinates where function returns a list of lists containing 6 tuples of x, y point coordinates.\nThe function should be named `calculate_polygons`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert calculate_polygons(1,1, 4, 4, 3)==[[(-5.0, -4.196152422706632), (-5.0, -0.7320508075688767), (-2.0, 1.0), (1.0, -0.7320508075688767), (1.0, -4.196152422706632), (-2.0, -5.928203230275509), (-5.0, -4.196152422706632)], [(1.0, -4.196152422706632), (1.0, -0.7320508075688767), (4.0, 1.0), (7.0, -0.7320508075688767), (7.0, -4.196152422706632), (4.0, -5.928203230275509), (1.0, -4.196152422706632)], [(7.0, -4.196152422706632), (7.0, -0.7320508075688767), (10.0, 1.0), (13.0, -0.7320508075688767), (13.0, -4.196152422706632), (10.0, -5.928203230275509), (7.0, -4.196152422706632)], [(-2.0, 1.0000000000000004), (-2.0, 4.464101615137755), (1.0, 6.196152422706632), (4.0, 4.464101615137755), (4.0, 1.0000000000000004), (1.0, -0.7320508075688767), (-2.0, 1.0000000000000004)], [(4.0, 1.0000000000000004), (4.0, 4.464101615137755), (7.0, 6.196152422706632), (10.0, 4.464101615137755), (10.0, 1.0000000000000004), (7.0, -0.7320508075688767), (4.0, 1.0000000000000004)], [(-5.0, 6.196152422706632), (-5.0, 9.660254037844387), (-2.0, 11.392304845413264), (1.0, 9.660254037844387), (1.0, 6.196152422706632), (-2.0, 4.464101615137755), (-5.0, 6.196152422706632)], [(1.0, 6.196152422706632), (1.0, 9.660254037844387), (4.0, 11.392304845413264), (7.0, 9.660254037844387), (7.0, 6.196152422706632), (4.0, 4.464101615137755), (1.0, 6.196152422706632)], [(7.0, 6.196152422706632), (7.0, 9.660254037844387), (10.0, 11.392304845413264), (13.0, 9.660254037844387), (13.0, 6.196152422706632), (10.0, 4.464101615137755), (7.0, 6.196152422706632)], [(-2.0, 11.392304845413264), (-2.0, 14.85640646055102), (1.0, 16.588457268119896), (4.0, 14.85640646055102), (4.0, 11.392304845413264), (1.0, 9.660254037844387), (-2.0, 11.392304845413264)], [(4.0, 11.392304845413264), (4.0, 14.85640646055102), (7.0, 16.588457268119896), (10.0, 14.85640646055102), (10.0, 11.392304845413264), (7.0, 9.660254037844387), (4.0, 11.392304845413264)]]\nassert calculate_polygons(5,4,7,9,8)==[[(-11.0, -9.856406460551018), (-11.0, -0.6188021535170058), (-3.0, 4.0), (5.0, -0.6188021535170058), (5.0, -9.856406460551018), (-3.0, -14.475208614068023), (-11.0, -9.856406460551018)], [(5.0, -9.856406460551018), (5.0, -0.6188021535170058), (13.0, 4.0), (21.0, -0.6188021535170058), (21.0, -9.856406460551018), (13.0, -14.475208614068023), (5.0, -9.856406460551018)], [(21.0, -9.856406460551018), (21.0, -0.6188021535170058), (29.0, 4.0), (37.0, -0.6188021535170058), (37.0, -9.856406460551018), (29.0, -14.475208614068023), (21.0, -9.856406460551018)], [(-3.0, 4.0), (-3.0, 13.237604307034012), (5.0, 17.856406460551018), (13.0, 13.237604307034012), (13.0, 4.0), (5.0, -0.6188021535170058), (-3.0, 4.0)], [(13.0, 4.0), (13.0, 13.237604307034012), (21.0, 17.856406460551018), (29.0, 13.237604307034012), (29.0, 4.0), (21.0, -0.6188021535170058), (13.0, 4.0)], [(-11.0, 17.856406460551018), (-11.0, 27.09401076758503), (-3.0, 31.712812921102035), (5.0, 27.09401076758503), (5.0, 17.856406460551018), (-3.0, 13.237604307034012), (-11.0, 17.856406460551018)], [(5.0, 17.856406460551018), (5.0, 27.09401076758503), (13.0, 31.712812921102035), (21.0, 27.09401076758503), (21.0, 17.856406460551018), (13.0, 13.237604307034012), (5.0, 17.856406460551018)], [(21.0, 17.856406460551018), (21.0, 27.09401076758503), (29.0, 31.712812921102035), (37.0, 27.09401076758503), (37.0, 17.856406460551018), (29.0, 13.237604307034012), (21.0, 17.856406460551018)], [(-3.0, 31.712812921102035), (-3.0, 40.95041722813605), (5.0, 45.569219381653056), (13.0, 40.95041722813605), (13.0, 31.712812921102035), (5.0, 27.09401076758503), (-3.0, 31.712812921102035)], [(13.0, 31.712812921102035), (13.0, 40.95041722813605), (21.0, 45.569219381653056), (29.0, 40.95041722813605), (29.0, 31.712812921102035), (21.0, 27.09401076758503), (13.0, 31.712812921102035)]]\nassert calculate_polygons(9,6,4,3,2)==[[(5.0, 2.5358983848622456), (5.0, 4.8452994616207485), (7.0, 6.0), (9.0, 4.8452994616207485), (9.0, 2.5358983848622456), (7.0, 1.3811978464829942), (5.0, 2.5358983848622456)], [(7.0, 6.0), (7.0, 8.309401076758503), (9.0, 9.464101615137753), (11.0, 8.309401076758503), (11.0, 6.0), (9.0, 4.8452994616207485), (7.0, 6.0)]]"} {"row": 483, "completion_input": "\"\"\"Write a function to convert the given binary tuple to integer.\"\"\"\n\ndef binary_to_integer(", "completion_prefix": "def binary_to_integer(", "chat_input": [{"role": "user", "content": "Write a function to convert the given binary tuple to integer.\nThe function should be named `binary_to_integer`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert binary_to_integer((1, 1, 0, 1, 0, 0, 1)) == '105'\nassert binary_to_integer((0, 1, 1, 0, 0, 1, 0, 1)) == '101'\nassert binary_to_integer((1, 1, 0, 1, 0, 1)) == '53'"} {"row": 484, "completion_input": "\"\"\"Write a function to remove lowercase substrings from a given string by using regex.\"\"\"\n\ndef remove_lowercase(", "completion_prefix": "def remove_lowercase(", "chat_input": [{"role": "user", "content": "Write a function to remove lowercase substrings from a given string by using regex.\nThe function should be named `remove_lowercase`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert remove_lowercase('KDeoALOklOOHserfLoAJSIskdsf') == 'KDALOOOHLAJSI'\nassert remove_lowercase('ProducTnamEstreAmIngMediAplAYer') == 'PTEAIMAAY'\nassert remove_lowercase('maNufacTuredbYSheZenTechNolOGIes') == 'NTYSZTNOGI'"} {"row": 485, "completion_input": "\"\"\"Write a function to find the smallest integers from a given list of numbers using heap queue algorithm.\"\"\"\n\ndef heap_queue_smallest(", "completion_prefix": "def heap_queue_smallest(", "chat_input": [{"role": "user", "content": "Write a function to find the smallest integers from a given list of numbers using heap queue algorithm.\nThe function should be named `heap_queue_smallest`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert heap_queue_smallest( [25, 35, 22, 85, 14, 65, 75, 25, 58],3)==[14, 22, 25] \nassert heap_queue_smallest( [25, 35, 22, 85, 14, 65, 75, 25, 58],2)==[14, 22]\nassert heap_queue_smallest( [25, 35, 22, 85, 14, 65, 75, 22, 58],5)==[14, 22, 22, 25, 35]"} {"row": 486, "completion_input": "\"\"\"Write a function to find the surface area of a cone.\"\"\"\n\ndef surfacearea_cone(", "completion_prefix": "def surfacearea_cone(", "chat_input": [{"role": "user", "content": "Write a function to find the surface area of a cone.\nThe function should be named `surfacearea_cone`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert surfacearea_cone(5,12)==282.7433388230814\nassert surfacearea_cone(10,15)==880.5179353159282\nassert surfacearea_cone(19,17)==2655.923961165254"} {"row": 487, "completion_input": "\"\"\"Write a python function to find gcd of two positive integers.\"\"\"\n\ndef gcd(", "completion_prefix": "def gcd(", "chat_input": [{"role": "user", "content": "Write a python function to find gcd of two positive integers.\nThe function should be named `gcd`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert gcd(12, 17) == 1\nassert gcd(4,6) == 2\nassert gcd(2,9) == 1"} {"row": 488, "completion_input": "\"\"\"Write a function to find the diameter of a circle.\"\"\"\n\ndef diameter_circle(", "completion_prefix": "def diameter_circle(", "chat_input": [{"role": "user", "content": "Write a function to find the diameter of a circle.\nThe function should be named `diameter_circle`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert diameter_circle(10)==20\nassert diameter_circle(40)==80\nassert diameter_circle(15)==30"} {"row": 489, "completion_input": "\"\"\"Write a function to concatenate all elements of the given list into a string.\"\"\"\n\ndef concatenate_elements(", "completion_prefix": "def concatenate_elements(", "chat_input": [{"role": "user", "content": "Write a function to concatenate all elements of the given list into a string.\nThe function should be named `concatenate_elements`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert concatenate_elements(['hello','there','have','a','rocky','day'] ) == ' hello there have a rocky day'\nassert concatenate_elements([ 'Hi', 'there', 'How','are', 'you'] ) == ' Hi there How are you'\nassert concatenate_elements([ 'Part', 'of', 'the','journey', 'is', 'end'] ) == ' Part of the journey is end'"} {"row": 490, "completion_input": "\"\"\"Write a python function to find common divisor between two numbers in a given pair.\"\"\"\n\ndef num_comm_div(", "completion_prefix": "def num_comm_div(", "chat_input": [{"role": "user", "content": "Write a python function to find common divisor between two numbers in a given pair.\nThe function should be named `num_comm_div`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert num_comm_div(2,4) == 2\nassert num_comm_div(2,8) == 2\nassert num_comm_div(12,24) == 6"} {"row": 491, "completion_input": "\"\"\"Write a python function to find remainder of two numbers.\"\"\"\n\ndef find(", "completion_prefix": "def find(", "chat_input": [{"role": "user", "content": "Write a python function to find remainder of two numbers.\nThe function should be named `find`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert find(3,3) == 0\nassert find(10,3) == 1\nassert find(16,5) == 1"} {"row": 492, "completion_input": "\"\"\"Write a function to add consecutive numbers of a given list.\"\"\"\n\ndef add_consecutive_nums(", "completion_prefix": "def add_consecutive_nums(", "chat_input": [{"role": "user", "content": "Write a function to add consecutive numbers of a given list.\nThe function should be named `add_consecutive_nums`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert add_consecutive_nums([1, 1, 3, 4, 4, 5, 6, 7])==[2, 4, 7, 8, 9, 11, 13]\nassert add_consecutive_nums([4, 5, 8, 9, 6, 10])==[9, 13, 17, 15, 16]\nassert add_consecutive_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])==[3, 5, 7, 9, 11, 13, 15, 17, 19]"} {"row": 493, "completion_input": "\"\"\"Write a python function to find the cube sum of first n natural numbers.\"\"\"\n\ndef sum_Of_Series(", "completion_prefix": "def sum_Of_Series(", "chat_input": [{"role": "user", "content": "Write a python function to find the cube sum of first n natural numbers.\nThe function should be named `sum_Of_Series`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert sum_Of_Series(5) == 225\nassert sum_Of_Series(2) == 9\nassert sum_Of_Series(3) == 36"} {"row": 494, "completion_input": "\"\"\"Write a function to move all zeroes to the end of the given array.\"\"\"\n\ndef re_order(", "completion_prefix": "def re_order(", "chat_input": [{"role": "user", "content": "Write a function to move all zeroes to the end of the given array.\nThe function should be named `re_order`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert re_order([6, 0, 8, 2, 3, 0, 4, 0, 1]) == [6, 8, 2, 3, 4, 1, 0, 0, 0]\nassert re_order([4, 0, 2, 7, 0, 9, 0, 12, 0]) == [4, 2, 7, 9, 12, 0, 0, 0, 0]\nassert re_order([3, 11, 0, 74, 14, 0, 1, 0, 2]) == [3, 11, 74, 14, 1, 2, 0, 0, 0]"} {"row": 495, "completion_input": "\"\"\"Write a function to calculate the permutation coefficient of given p(n, k).\"\"\"\n\ndef permutation_coefficient(", "completion_prefix": "def permutation_coefficient(", "chat_input": [{"role": "user", "content": "Write a function to calculate the permutation coefficient of given p(n, k).\nThe function should be named `permutation_coefficient`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert permutation_coefficient(10, 2) == 90\nassert permutation_coefficient(10, 3) == 720\nassert permutation_coefficient(10, 1) == 10"} {"row": 496, "completion_input": "\"\"\"Write a function to remove specific words from a given list.\"\"\"\n\ndef remove_words(", "completion_prefix": "def remove_words(", "chat_input": [{"role": "user", "content": "Write a function to remove specific words from a given list.\nThe function should be named `remove_words`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert remove_words(['red', 'green', 'blue', 'white', 'black', 'orange'],['white', 'orange'])==['red', 'green', 'blue', 'black']\nassert remove_words(['red', 'green', 'blue', 'white', 'black', 'orange'],['black', 'orange'])==['red', 'green', 'blue', 'white']\nassert remove_words(['red', 'green', 'blue', 'white', 'black', 'orange'],['blue', 'white'])==['red', 'green', 'black', 'orange']"} {"row": 497, "completion_input": "\"\"\"Write a function to check if the common elements between two given lists are in the same order or not.\"\"\"\n\ndef same_order(", "completion_prefix": "def same_order(", "chat_input": [{"role": "user", "content": "Write a function to check if the common elements between two given lists are in the same order or not.\nThe function should be named `same_order`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert same_order([\"red\",\"green\",\"black\",\"orange\"],[\"red\",\"pink\",\"green\",\"white\",\"black\"])==True\nassert same_order([\"red\",\"pink\",\"green\",\"white\",\"black\"],[\"white\",\"orange\",\"pink\",\"black\"])==False\nassert same_order([\"red\",\"green\",\"black\",\"orange\"],[\"red\",\"pink\",\"green\",\"white\",\"black\"])==True"} {"row": 498, "completion_input": "\"\"\"Write a python function to find the average of odd numbers till a given odd number.\"\"\"\n\ndef average_Odd(", "completion_prefix": "def average_Odd(", "chat_input": [{"role": "user", "content": "Write a python function to find the average of odd numbers till a given odd number.\nThe function should be named `average_Odd`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert average_Odd(9) == 5\nassert average_Odd(5) == 3\nassert average_Odd(11) == 6"} {"row": 499, "completion_input": "\"\"\"Write a function to find the number of subsequences having product smaller than k for the given non negative array.\"\"\"\n\ndef no_of_subsequences(", "completion_prefix": "def no_of_subsequences(", "chat_input": [{"role": "user", "content": "Write a function to find the number of subsequences having product smaller than k for the given non negative array.\nThe function should be named `no_of_subsequences`.\n\nWrap your code in a python code block (i.e. ```python\nyour code here\n```)."}], "ground_truth": "assert no_of_subsequences([1,2,3,4], 10) == 11\nassert no_of_subsequences([4,8,7,2], 50) == 9\nassert no_of_subsequences([5,6,7,8], 15) == 4"}