question
stringlengths
104
2.09k
test_list
listlengths
3
3
test_time_limit
int64
1
1
test_method
stringclasses
1 value
prefix
stringclasses
1 value
Write a function to find common elements in given nested lists. * list item * list item * list item * list item Your code should pass the test: assert common_in_nested_lists([[12, 18, 23, 25, 45], [7, 12, 18, 24, 28], [1, 5, 8, 12, 15, 16, 18]])==[18, 12]
[ "assert common_in_nested_lists([[12, 18, 23, 25, 45], [7, 12, 18, 24, 28], [1, 5, 8, 12, 15, 16, 18]])==[18, 12]", "assert common_in_nested_lists([[12, 5, 23, 25, 45], [7, 11, 5, 23, 28], [1, 5, 8, 18, 23, 16]])==[5,23]", "assert common_in_nested_lists([[2, 3,4, 1], [4, 5], [6,4, 8],[4, 5], [6, 8,4]])==[4]" ]
1
function
Here is the completed code: ```python
Write a python function to find the perimeter of a cylinder. Your code should pass the test: assert perimeter(2,4) == 12
[ "assert perimeter(2,4) == 12", "assert perimeter(1,2) == 6", "assert perimeter(3,1) == 8" ]
1
function
Here is the completed code: ```python
Write a function to check if a string represents an integer or not. Your code should pass the test: assert check_integer("python")==False
[ "assert check_integer(\"python\")==False", "assert check_integer(\"1\")==True", "assert check_integer(\"12345\")==True" ]
1
function
Here is the completed code: ```python
Write a function to assign frequency to each tuple in the given tuple list. Your code should pass the test: 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)]'
[ "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)]'", "assert 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)]'", "assert 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)]'" ]
1
function
Here is the completed code: ```python
Write a function to check whether all dictionaries in a list are empty or not. Your code should pass the test: assert empty_dit([{},{},{}])==True
[ "assert empty_dit([{},{},{}])==True", "assert empty_dit([{1,2},{},{}])==False", "assert empty_dit({})==True" ]
1
function
Here is the completed code: ```python
Write a function to convert a given tuple of positive integers into an integer. Your code should pass the test: assert tuple_to_int((1,2,3))==123
[ "assert tuple_to_int((1,2,3))==123", "assert tuple_to_int((4,5,6))==456", "assert tuple_to_int((5,6,7))==567" ]
1
function
Here is the completed code: ```python
Write a function to convert all possible convertible elements in the list to float. Your code should pass the test: 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)]'
[ "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)]'", "assert 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)]'", "assert 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)]'" ]
1
function
Here is the completed code: ```python
[link text](https:// [link text](https:// [link text](a function to convert a string to a list. Your code should pass the test: assert string_to_list("python programming")==['python','programming']
[ "assert string_to_list(\"python programming\")==['python','programming']", "assert string_to_list(\"lists tuples strings\")==['lists','tuples','strings']", "assert string_to_list(\"write a program\")==['write','a','program']" ]
1
function
Here is the completed code: ```python
Write a python function to find the element that appears only once in a sorted array. Your code should pass the test: assert search([1,1,2,2,3],5) == 3
[ "assert search([1,1,2,2,3],5) == 3", "assert search([1,1,3,3,4,4,5,5,7,7,8],11) == 8", "assert search([1,2,2,3,3,4,4],7) == 1" ]
1
function
Here is the completed code: ```python
Write a function to find the maximum product from the pairs of tuples within a given list. Your code should pass the test: assert max_product_tuple([(2, 7), (2, 6), (1, 8), (4, 9)] )==36
[ "assert max_product_tuple([(2, 7), (2, 6), (1, 8), (4, 9)] )==36", "assert max_product_tuple([(10,20), (15,2), (5,10)] )==200", "assert max_product_tuple([(11,44), (10,15), (20,5), (12, 9)] )==484" ]
1
function
Here is the completed code: ```python
Write a function to find the triplet with sum of the given array Your code should pass the test: assert check_triplet([2, 7, 4, 0, 9, 5, 1, 3], 8, 6, 0) == True
[ "assert check_triplet([2, 7, 4, 0, 9, 5, 1, 3], 8, 6, 0) == True", "assert check_triplet([1, 4, 5, 6, 7, 8, 5, 9], 8, 6, 0) == False", "assert check_triplet([10, 4, 2, 3, 5], 5, 15, 0) == True" ]
1
function
Here is the completed code: ```python
Write a function to find n’th smart number. Your code should pass the test: assert smartNumber(1) == 30
[ "assert smartNumber(1) == 30", "assert smartNumber(50) == 273", "assert smartNumber(1000) == 2664" ]
1
function
Here is the completed code: ```python
Write a function to sum all amicable numbers from 1 to a specified number. Your code should pass the test: assert amicable_numbers_sum(999)==504
[ "assert amicable_numbers_sum(999)==504", "assert amicable_numbers_sum(9999)==31626", "assert amicable_numbers_sum(99)==0" ]
1
function
Here is the completed code: ```python
Write a function to get the angle of a complex number. Your code should pass the test: assert angle_complex(0,1j)==1.5707963267948966
[ "assert angle_complex(0,1j)==1.5707963267948966 ", "assert angle_complex(2,1j)==0.4636476090008061", "assert angle_complex(0,2j)==1.5707963267948966" ]
1
function
Here is the completed code: ```python
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. Your code should pass the test: assert find_length("11000010001", 11) == 6
[ "assert find_length(\"11000010001\", 11) == 6", "assert find_length(\"10111\", 5) == 1", "assert find_length(\"11011101100101\", 14) == 2 " ]
1
function
Here is the completed code: ```python
Write a python function to find the sum of common divisors of two given numbers. Your code should pass the test: assert sum(10,15) == 6
[ "assert sum(10,15) == 6", "assert sum(100,150) == 93", "assert sum(4,6) == 3" ]
1
function
Here is the completed code: ```python
Write a function to multiply two integers without using the * operator in python. Your code should pass the test: assert multiply_int(10,20)==200
[ "assert multiply_int(10,20)==200", "assert multiply_int(5,10)==50", "assert multiply_int(4,8)==32" ]
1
function
Here is the completed code: ```python
Write a function to shortlist words that are longer than n from a given list of words. Your code should pass the test: assert long_words(3,"python is a programming language")==['python','programming','language']
[ "assert long_words(3,\"python is a programming language\")==['python','programming','language']", "assert long_words(2,\"writing a program\")==['writing','program']", "assert long_words(5,\"sorting list\")==['sorting']" ]
1
function
Here is the completed code: ```python
Write a function to calculate magic square. Your code should pass the test: assert magic_square_test([[7, 12, 1, 14], [2, 13, 8, 11], [16, 3, 10, 5], [9, 6, 15, 4]])==True
[ "assert magic_square_test([[7, 12, 1, 14], [2, 13, 8, 11], [16, 3, 10, 5], [9, 6, 15, 4]])==True", "assert magic_square_test([[2, 7, 6], [9, 5, 1], [4, 3, 8]])==True", "assert magic_square_test([[2, 7, 6], [9, 5, 1], [4, 3, 7]])==False" ]
1
function
Here is the completed code: ```python
Write a function to find the item with maximum frequency in a given list. Your code should pass the test: 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)
[ "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)", "assert max_occurrences([2,3,8,4,7,9,8,7,9,15,14,10,12,13,16,16,18])==(8, 2)", "assert max_occurrences([10,20,20,30,40,90,80,50,30,20,50,10])==(20, 3)" ]
1
function
Here is the completed code: ```python
Write a python function to reverse only the vowels of a given string. Your code should pass the test: assert reverse_vowels("Python") == "Python"
[ "assert reverse_vowels(\"Python\") == \"Python\"", "assert reverse_vowels(\"USA\") == \"ASU\"", "assert reverse_vowels(\"ab\") == \"ab\"" ]
1
function
Here is the completed code: ```python
Write a function to convert tuple to a string. Your code should pass the test: assert tup_string(('e', 'x', 'e', 'r', 'c', 'i', 's', 'e', 's'))==("exercises")
[ "assert tup_string(('e', 'x', 'e', 'r', 'c', 'i', 's', 'e', 's'))==(\"exercises\")", "assert tup_string(('p','y','t','h','o','n'))==(\"python\")", "assert tup_string(('p','r','o','g','r','a','m'))==(\"program\")" ]
1
function
Here is the completed code: ```python
Write a function to calculate the sum of the negative numbers of a given list of numbers using lambda function. Your code should pass the test: assert sum_negativenum([2, 4, -6, -9, 11, -12, 14, -5, 17])==-32
[ "assert sum_negativenum([2, 4, -6, -9, 11, -12, 14, -5, 17])==-32", "assert sum_negativenum([10,15,-14,13,-18,12,-20])==-52", "assert sum_negativenum([19, -65, 57, 39, 152,-639, 121, 44, 90, -190])==-894" ]
1
function
Here is the completed code: ```python
Write a python function to check whether the last element of given array is even or odd after performing an operation p times. Your code should pass the test: assert check_last([5,7,10],3,1) == "ODD"
[ "assert check_last([5,7,10],3,1) == \"ODD\"", "assert check_last([2,3],2,3) == \"EVEN\"", "assert check_last([1,2,3],3,1) == \"ODD\"" ]
1
function
Here is the completed code: ```python
Write a function to find the nth hexagonal number. Your code should pass the test: assert hexagonal_num(10) == 190
[ "assert hexagonal_num(10) == 190", "assert hexagonal_num(5) == 45", "assert hexagonal_num(7) == 91" ]
1
function
Here is the completed code: ```python
Write a function to calculate electricity bill. Your code should pass the test: assert cal_electbill(75)==246.25
[ "assert cal_electbill(75)==246.25", "assert cal_electbill(265)==1442.75", "assert cal_electbill(100)==327.5" ]
1
function
Here is the completed code: ```python
Write a function to find the ration of zeroes in an array of integers. Your code should pass the test: assert zero_count([0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8])==0.15
[ "assert zero_count([0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8])==0.15", "assert zero_count([2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8])==0.00", "assert zero_count([2, 4, -6, -9, 11, -12, 14, -5, 17])==0.00" ]
1
function
Here is the completed code: ```python
Write a python function to check whether the given number can be represented as sum of non-zero powers of 2 or not. Your code should pass the test: assert is_Sum_Of_Powers_Of_Two(10) == True
[ "assert is_Sum_Of_Powers_Of_Two(10) == True", "assert is_Sum_Of_Powers_Of_Two(7) == False", "assert is_Sum_Of_Powers_Of_Two(14) == True" ]
1
function
Here is the completed code: ```python
Write a function to find the circumference of a circle. Your code should pass the test: assert circle_circumference(10)==62.830000000000005
[ "assert circle_circumference(10)==62.830000000000005", "assert circle_circumference(5)==31.415000000000003", "assert circle_circumference(4)==25.132" ]
1
function
Here is the completed code: ```python
Write a function to extract elements that occur singly in the given tuple list. Your code should pass the test: assert extract_singly([(3, 4, 5), (4, 5, 7), (1, 4)]) == [3, 4, 5, 7, 1]
[ "assert extract_singly([(3, 4, 5), (4, 5, 7), (1, 4)]) == [3, 4, 5, 7, 1]", "assert extract_singly([(1, 2, 3), (4, 2, 3), (7, 8)]) == [1, 2, 3, 4, 7, 8]", "assert extract_singly([(7, 8, 9), (10, 11, 12), (10, 11)]) == [7, 8, 9, 10, 11, 12]" ]
1
function
Here is the completed code: ```python
Write a function to sort a list of elements using pancake sort. Your code should pass the test: assert pancake_sort([15, 79, 25, 38, 69]) == [15, 25, 38, 69, 79]
[ "assert pancake_sort([15, 79, 25, 38, 69]) == [15, 25, 38, 69, 79]", "assert pancake_sort([98, 12, 54, 36, 85]) == [12, 36, 54, 85, 98]", "assert pancake_sort([41, 42, 32, 12, 23]) == [12, 23, 32, 41, 42]" ]
1
function
Here is the completed code: ```python
Write a function to count the same pair in three given lists. Your code should pass the test: 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
[ "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", "assert 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", "assert 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" ]
1
function
Here is the completed code: ```python
Write a function to find number of lists present in the given tuple. Your code should pass the test: assert find_lists(([1, 2, 3, 4], [5, 6, 7, 8])) == 2
[ "assert find_lists(([1, 2, 3, 4], [5, 6, 7, 8])) == 2", "assert find_lists(([1, 2], [3, 4], [5, 6])) == 3", "assert find_lists(([9, 8, 7, 6, 5, 4, 3, 2, 1])) == 1" ]
1
function
Here is the completed code: ```python
Write a python function to find the sum of absolute differences in all pairs of the given array. Your code should pass the test: assert sum_Pairs([1,8,9,15,16],5) == 74
[ "assert sum_Pairs([1,8,9,15,16],5) == 74", "assert sum_Pairs([1,2,3,4],4) == 10", "assert sum_Pairs([1,2,3,4,5,7,9,11,14],9) == 188" ]
1
function
Here is the completed code: ```python
Write a python function to find the maximum difference between any two elements in a given array. Your code should pass the test: assert max_Abs_Diff((2,1,5,3),4) == 4
[ "assert max_Abs_Diff((2,1,5,3),4) == 4", "assert max_Abs_Diff((9,3,2,5,1),5) == 8", "assert max_Abs_Diff((3,2,1),3) == 2" ]
1
function
Here is the completed code: ```python
Write a function to find the ascii value of total characters in a string. Your code should pass the test: assert ascii_value_string("python")==112
[ "assert ascii_value_string(\"python\")==112", "assert ascii_value_string(\"Program\")==80", "assert ascii_value_string(\"Language\")==76" ]
1
function
Here is the completed code: ```python
Write a function to find the maximum total path sum in the given triangle. Your code should pass the test: assert max_path_sum([[1, 0, 0], [4, 8, 0], [1, 5, 3]], 2, 2) == 14
[ "assert max_path_sum([[1, 0, 0], [4, 8, 0], [1, 5, 3]], 2, 2) == 14", "assert max_path_sum([[13, 0, 0], [7, 4, 0], [2, 4, 6]], 2, 2) == 24 ", "assert max_path_sum([[2, 0, 0], [11, 18, 0], [21, 25, 33]], 2, 2) == 53" ]
1
function
Here is the completed code: ```python
Write a function to divide a number into two parts such that the sum of digits is maximum. Your code should pass the test: assert sum_digits_twoparts(35)==17
[ "assert sum_digits_twoparts(35)==17", "assert sum_digits_twoparts(7)==7", "assert sum_digits_twoparts(100)==19" ]
1
function
Here is the completed code: ```python
Write a function to find the longest subsequence such that the difference between adjacents is one for the given array. Your code should pass the test: assert longest_subseq_with_diff_one([1, 2, 3, 4, 5, 3, 2], 7) == 6
[ "assert longest_subseq_with_diff_one([1, 2, 3, 4, 5, 3, 2], 7) == 6", "assert longest_subseq_with_diff_one([10, 9, 4, 5, 4, 8, 6], 7) == 3", "assert longest_subseq_with_diff_one([1, 2, 3, 2, 3, 7, 2, 1], 8) == 7" ]
1
function
Here is the completed code: ```python
Write a python function to find whether the given number is present in the infinite sequence or not. Your code should pass the test: assert does_Contain_B(1,7,3) == True
[ "assert does_Contain_B(1,7,3) == True", "assert does_Contain_B(1,-3,5) == False", "assert does_Contain_B(3,2,5) == False" ]
1
function
Here is the completed code: ```python
Write a python function to check whether the given number is co-prime or not. Your code should pass the test: assert is_coprime(17,13) == True
[ "assert is_coprime(17,13) == True", "assert is_coprime(15,21) == False", "assert is_coprime(25,45) == False" ]
1
function
Here is the completed code: ```python
Write a function to sort the given array by using merge sort. Your code should pass the test: assert merge_sort([3, 4, 2, 6, 5, 7, 1, 9]) == [1, 2, 3, 4, 5, 6, 7, 9]
[ "assert merge_sort([3, 4, 2, 6, 5, 7, 1, 9]) == [1, 2, 3, 4, 5, 6, 7, 9]", "assert merge_sort([7, 25, 45, 78, 11, 33, 19]) == [7, 11, 19, 25, 33, 45, 78]", "assert merge_sort([3, 1, 4, 9, 8]) == [1, 3, 4, 8, 9]" ]
1
function
Here is the completed code: ```python
Write a function to find the vertex of a parabola. Your code should pass the test: assert parabola_vertex(5,3,2)==(-0.3, 1.55)
[ "assert parabola_vertex(5,3,2)==(-0.3, 1.55)", "assert parabola_vertex(9,8,4)==(-0.4444444444444444, 2.2222222222222223)", "assert parabola_vertex(2,4,6)==(-1.0, 4.0)" ]
1
function
Here is the completed code: ```python
Write a function to extract every specified element from a given two dimensional list. Your code should pass the test: assert specified_element([[1, 2, 3, 2], [4, 5, 6, 2], [7, 1, 9, 5]],0)==[1, 4, 7]
[ "assert specified_element([[1, 2, 3, 2], [4, 5, 6, 2], [7, 1, 9, 5]],0)==[1, 4, 7]", "assert specified_element([[1, 2, 3, 2], [4, 5, 6, 2], [7, 1, 9, 5]],2)==[3, 6, 9]", "assert specified_element([[1, 2, 3, 2], [4, 5, 6, 2], [7, 1, 9, 5]],3)==[2,2,5]" ]
1
function
Here is the completed code: ```python
Write a python function to toggle all even bits of a given number. Your code should pass the test: assert even_bit_toggle_number(10) == 0
[ "assert even_bit_toggle_number(10) == 0", "assert even_bit_toggle_number(20) == 30", "assert even_bit_toggle_number(30) == 20" ]
1
function
Here is the completed code: ```python
Write a function to convert a tuple of string values to a tuple of integer values. Your code should pass the test: assert tuple_int_str((('333', '33'), ('1416', '55')))==((333, 33), (1416, 55))
[ "assert tuple_int_str((('333', '33'), ('1416', '55')))==((333, 33), (1416, 55))", "assert tuple_int_str((('999', '99'), ('1000', '500')))==((999, 99), (1000, 500))", "assert tuple_int_str((('666', '66'), ('1500', '555')))==((666, 66), (1500, 555))" ]
1
function
Here is the completed code: ```python
Write a function to reflect the run-length encoding from a list. Your code should pass the test: 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]]
[ "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]]", "assert 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']]", "assert encode_list('python')==[[1, 'p'], [1, 'y'], [1, 't'], [1, 'h'], [1, 'o'], [1, 'n']]" ]
1
function
Here is the completed code: ```python
Write a python function to find k number of operations required to make all elements equal. Your code should pass the test: assert min_Ops([2,2,2,2],4,3) == 0
[ "assert min_Ops([2,2,2,2],4,3) == 0", "assert min_Ops([4,2,6,8],4,3) == -1", "assert min_Ops([21,33,9,45,63],5,6) == 24" ]
1
function
Here is the completed code: ```python
Write a function to print the season for the given month and day. Your code should pass the test: assert month_season('January',4)==('winter')
[ "assert month_season('January',4)==('winter')", "assert month_season('October',28)==('autumn')", "assert month_season('June',6)==('spring')" ]
1
function
Here is the completed code: ```python
Write a function to find x and y that satisfies ax + by = n. Your code should pass the test: assert solution(2, 3, 7) == ('x = ', 2, ', y = ', 1)
[ "assert solution(2, 3, 7) == ('x = ', 2, ', y = ', 1)", "assert solution(4, 2, 7) == 'No solution'", "assert solution(1, 13, 17) == ('x = ', 4, ', y = ', 1)" ]
1
function
Here is the completed code: ```python
Write a function to remove all elements from a given list present in another list. Your code should pass the test: assert remove_elements([1,2,3,4,5,6,7,8,9,10],[2,4,6,8])==[1, 3, 5, 7, 9, 10]
[ "assert remove_elements([1,2,3,4,5,6,7,8,9,10],[2,4,6,8])==[1, 3, 5, 7, 9, 10]", "assert remove_elements([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],[1, 3, 5, 7])==[2, 4, 6, 8, 9, 10]", "assert remove_elements([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],[5,7])==[1, 2, 3, 4, 6, 8, 9, 10]" ]
1
function
Here is the completed code: ```python
Write a function to calculate the sum of the positive integers of n+(n-2)+(n-4)... (until n-x =< 0). Your code should pass the test: assert sum_series(6)==12
[ "assert sum_series(6)==12", "assert sum_series(10)==30", "assert sum_series(9)==25" ]
1
function
Here is the completed code: ```python
Write a function to calculate the area of a regular polygon. Your code should pass the test: assert area_polygon(4,20)==400.00000000000006
[ "assert area_polygon(4,20)==400.00000000000006", "assert area_polygon(10,15)==1731.1969896610804", "assert area_polygon(9,7)==302.90938549487214" ]
1
function
Here is the completed code: ```python
Write a python function to check whether the sum of divisors are same or not. Your code should pass the test: assert areEquivalent(36,57) == False
[ "assert areEquivalent(36,57) == False", "assert areEquivalent(2,4) == False", "assert areEquivalent(23,47) == True" ]
1
function
Here is the completed code: ```python
Write a python function to count characters at same position in a given string (lower and uppercase characters) as in english alphabet. Your code should pass the test: assert count_char_position("xbcefg") == 2
[ "assert count_char_position(\"xbcefg\") == 2", "assert count_char_position(\"ABcED\") == 3", "assert count_char_position(\"AbgdeF\") == 5" ]
1
function
Here is the completed code: ```python
Write a python function to count the pairs with xor as an even number. Your code should pass the test: assert find_even_Pair([5,4,7,2,1],5) == 4
[ "assert find_even_Pair([5,4,7,2,1],5) == 4", "assert find_even_Pair([7,2,8,1,0,5,11],7) == 9", "assert find_even_Pair([1,2,3],3) == 1" ]
1
function
Here is the completed code: ```python
Write a python function to find smallest power of 2 greater than or equal to n. Your code should pass the test: assert next_Power_Of_2(0) == 1
[ "assert next_Power_Of_2(0) == 1", "assert next_Power_Of_2(5) == 8", "assert next_Power_Of_2(17) == 32" ]
1
function
Here is the completed code: ```python
Write a python function to find the frequency of a number in a given array. Your code should pass the test: assert frequency([1,2,3],4) == 0
[ "assert frequency([1,2,3],4) == 0", "assert frequency([1,2,2,3,3,3,4],3) == 3", "assert frequency([0,1,2,3,1,2],1) == 2" ]
1
function
Here is the completed code: ```python
Write a function to calculate the nth pell number. Your code should pass the test: assert get_pell(4) == 12
[ "assert get_pell(4) == 12", "assert get_pell(7) == 169", "assert get_pell(8) == 408" ]
1
function
Here is the completed code: ```python
Write a function to find sum of the numbers in a list between the indices of a specified range. Your code should pass the test: assert sum_range_list( [2,1,5,6,8,3,4,9,10,11,8,12],8,10)==29
[ "assert sum_range_list( [2,1,5,6,8,3,4,9,10,11,8,12],8,10)==29", "assert sum_range_list( [2,1,5,6,8,3,4,9,10,11,8,12],5,7)==16", "assert sum_range_list( [2,1,5,6,8,3,4,9,10,11,8,12],7,10)==38" ]
1
function
Here is the completed code: ```python
Write a function to find the perimeter of a pentagon. Your code should pass the test: assert perimeter_pentagon(5)==25
[ "assert perimeter_pentagon(5)==25", "assert perimeter_pentagon(10)==50", "assert perimeter_pentagon(15)==75" ]
1
function
Here is the completed code: ```python
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 Your code should pass the test: assert count_occurance("letstdlenstdporstd") == 3
[ "assert count_occurance(\"letstdlenstdporstd\") == 3", "assert count_occurance(\"truststdsolensporsd\") == 1", "assert count_occurance(\"makestdsostdworthit\") == 2" ]
1
function
Here is the completed code: ```python
Write a function to remove everything except alphanumeric characters from a string. Your code should pass the test: assert remove_splchar('python @#&^%$*program123')==('pythonprogram123')
[ "assert remove_splchar('python @#&^%$*program123')==('pythonprogram123')", "assert remove_splchar('python %^$@!^&*() programming24%$^^() language')==('pythonprogramming24language')", "assert remove_splchar('python ^%&^()(+_)(_^&67) program')==('python67program')" ]
1
function
Here is the completed code: ```python
Write a function to group a sequence of key-value pairs into a dictionary of lists. Your code should pass the test: assert group_keyvalue([('yellow', 1), ('blue', 2), ('yellow', 3), ('blue', 4), ('red', 1)])=={'yellow': [1, 3], 'blue': [2, 4], 'red': [1]}
[ "assert group_keyvalue([('yellow', 1), ('blue', 2), ('yellow', 3), ('blue', 4), ('red', 1)])=={'yellow': [1, 3], 'blue': [2, 4], 'red': [1]}", "assert group_keyvalue([('python', 1), ('python', 2), ('python', 3), ('python', 4), ('python', 5)])=={'python': [1,2,3,4,5]}", "assert group_keyvalue([('yellow',100), ('blue', 200), ('yellow', 300), ('blue', 400), ('red', 100)])=={'yellow': [100, 300], 'blue': [200, 400], 'red': [100]}" ]
1
function
Here is the completed code: ```python
Write a function to verify validity of a string of parentheses. Your code should pass the test: assert is_valid_parenthese("(){}[]")==True
[ "assert is_valid_parenthese(\"(){}[]\")==True", "assert is_valid_parenthese(\"()[{)}\")==False", "assert is_valid_parenthese(\"()\")==True" ]
1
function
Here is the completed code: ```python
Write a function to find the perimeter of a triangle. Your code should pass the test: assert perimeter_triangle(10,20,30)==60
[ "assert perimeter_triangle(10,20,30)==60", "assert perimeter_triangle(3,4,5)==12", "assert perimeter_triangle(25,35,45)==105" ]
1
function
Here is the completed code: ```python
Write a python function to find two distinct numbers such that their lcm lies within the given range. Your code should pass the test: assert answer(3,8) == (3,6)
[ "assert answer(3,8) == (3,6)", "assert answer(2,6) == (2,4)", "assert answer(1,3) == (1,2)" ]
1
function
Here is the completed code: ```python
Write a function to search some literals strings in a string. Your code should pass the test: assert string_literals(['language'],'python language')==('Matched!')
[ "assert string_literals(['language'],'python language')==('Matched!')", "assert string_literals(['program'],'python language')==('Not Matched!')", "assert string_literals(['python'],'programming language')==('Not Matched!')" ]
1
function
Here is the completed code: ```python
Write a function to find if the given number is a keith number or not. Your code should pass the test: assert is_num_keith(14) == True
[ "assert is_num_keith(14) == True", "assert is_num_keith(12) == False", "assert is_num_keith(197) == True" ]
1
function
Here is the completed code: ```python
Write a function to calculate distance between two points using latitude and longitude. Your code should pass the test: assert distance_lat_long(23.5,67.5,25.5,69.5)==12179.372041317429
[ "assert distance_lat_long(23.5,67.5,25.5,69.5)==12179.372041317429", "assert distance_lat_long(10.5,20.5,30.5,40.5)==6069.397933300514", "assert distance_lat_long(10,20,30,40)==6783.751974994595" ]
1
function
Here is the completed code: ```python
Write a function to find the longest common prefix in the given set of strings. Your code should pass the test: assert common_prefix(["tablets", "tables", "taxi", "tamarind"], 4) == 'ta'
[ "assert common_prefix([\"tablets\", \"tables\", \"taxi\", \"tamarind\"], 4) == 'ta'", "assert common_prefix([\"apples\", \"ape\", \"april\"], 3) == 'ap'", "assert common_prefix([\"teens\", \"teenager\", \"teenmar\"], 3) == 'teen'" ]
1
function
Here is the completed code: ```python
Write a function to find uppercase, lowercase, special character and numeric values using regex. Your code should pass the test: assert find_character("ThisIsGeeksforGeeks") == (['T', 'I', 'G', 'G'], ['h', 'i', 's', 's', 'e', 'e', 'k', 's', 'f', 'o', 'r', 'e', 'e', 'k', 's'], [], [])
[ "assert find_character(\"ThisIsGeeksforGeeks\") == (['T', 'I', 'G', 'G'], ['h', 'i', 's', 's', 'e', 'e', 'k', 's', 'f', 'o', 'r', 'e', 'e', 'k', 's'], [], [])", "assert find_character(\"Hithere2\") == (['H'], ['i', 't', 'h', 'e', 'r', 'e'], ['2'], [])", "assert find_character(\"HeyFolks32\") == (['H', 'F'], ['e', 'y', 'o', 'l', 'k', 's'], ['3', '2'], [])" ]
1
function
Here is the completed code: ```python
Write a function to count all the distinct pairs having a difference of k in any array. Your code should pass the test: assert count_pairs([1, 5, 3, 4, 2], 5, 3) == 2
[ "assert count_pairs([1, 5, 3, 4, 2], 5, 3) == 2", "assert count_pairs([8, 12, 16, 4, 0, 20], 6, 4) == 5", "assert count_pairs([2, 4, 1, 3, 4], 5, 2) == 3" ]
1
function
Here is the completed code: ```python
Write a function to find all the values in a list that are greater than a specified number. Your code should pass the test: assert greater_specificnum([220, 330, 500],200)==True
[ "assert greater_specificnum([220, 330, 500],200)==True", "assert greater_specificnum([12, 17, 21],20)==False", "assert greater_specificnum([1,2,3,4],10)==False" ]
1
function
Here is the completed code: ```python
Write a function to find the focus of a parabola. Your code should pass the test: assert parabola_focus(5,3,2)==(-0.3, 1.6)
[ "assert parabola_focus(5,3,2)==(-0.3, 1.6)", "assert parabola_focus(9,8,4)==(-0.4444444444444444, 2.25)", "assert parabola_focus(2,4,6)==(-1.0, 4.125)" ]
1
function
Here is the completed code: ```python
Write a function to search some literals strings in a string by using regex. Your code should pass the test: assert check_literals('The quick brown fox jumps over the lazy dog.',['fox']) == 'Matched!'
[ "assert check_literals('The quick brown fox jumps over the lazy dog.',['fox']) == 'Matched!'", "assert check_literals('The quick brown fox jumps over the lazy dog.',['horse']) == 'Not Matched!'", "assert check_literals('The quick brown fox jumps over the lazy dog.',['lazy']) == 'Matched!'" ]
1
function
Here is the completed code: ```python
Write a function to find the longest common subsequence for the given two sequences. Your code should pass the test: assert longest_common_subsequence("AGGTAB" , "GXTXAYB", 6, 7) == 4
[ "assert longest_common_subsequence(\"AGGTAB\" , \"GXTXAYB\", 6, 7) == 4", "assert longest_common_subsequence(\"ABCDGH\" , \"AEDFHR\", 6, 6) == 3", "assert longest_common_subsequence(\"AXYT\" , \"AYZX\", 4, 4) == 2" ]
1
function
Here is the completed code: ```python
Write a python function to check whether the given number can be represented by product of two squares or not. Your code should pass the test: assert prod_Square(25) == False
[ "assert prod_Square(25) == False", "assert prod_Square(30) == False", "assert prod_Square(16) == True" ]
1
function
Here is the completed code: ```python
Write a python function to find the first missing positive number. Your code should pass the test: assert first_Missing_Positive([1,2,3,-1,5],5) == 4
[ "assert first_Missing_Positive([1,2,3,-1,5],5) == 4", "assert first_Missing_Positive([0,-1,-2,1,5,8],6) == 2", "assert first_Missing_Positive([0,1,2,5,-8],5) == 3" ]
1
function
Here is the completed code: ```python
Write a python function to count the number of integral co-ordinates that lie inside a square. Your code should pass the test: assert count_Intgral_Points(1,1,4,4) == 4
[ "assert count_Intgral_Points(1,1,4,4) == 4", "assert count_Intgral_Points(1,2,1,2) == 1", "assert count_Intgral_Points(4,2,6,4) == 1" ]
1
function
Here is the completed code: ```python
Write a function to check whether the given month name contains 30 days or not. Your code should pass the test: assert check_monthnumber("February")==False
[ "assert check_monthnumber(\"February\")==False", "assert check_monthnumber(\"June\")==True", "assert check_monthnumber(\"April\")==True" ]
1
function
Here is the completed code: ```python
Write a python function to check whether a string has atleast one letter and one number. Your code should pass the test: assert check_String('thishasboth29') == True
[ "assert check_String('thishasboth29') == True", "assert check_String('python') == False", "assert check_String ('string') == False" ]
1
function
Here is the completed code: ```python
Write a function to remove the duplicates from the given tuple. Your code should pass the test: assert remove_tuple((1, 3, 5, 2, 3, 5, 1, 1, 3)) == (1, 2, 3, 5)
[ "assert remove_tuple((1, 3, 5, 2, 3, 5, 1, 1, 3)) == (1, 2, 3, 5)", "assert remove_tuple((2, 3, 4, 4, 5, 6, 6, 7, 8, 8)) == (2, 3, 4, 5, 6, 7, 8)", "assert remove_tuple((11, 12, 13, 11, 11, 12, 14, 13)) == (11, 12, 13, 14)" ]
1
function
Here is the completed code: ```python
Write a python function to convert octal number to decimal number. Your code should pass the test: assert octal_To_Decimal(25) == 21
[ "assert octal_To_Decimal(25) == 21", "assert octal_To_Decimal(30) == 24", "assert octal_To_Decimal(40) == 32" ]
1
function
Here is the completed code: ```python
Write a python function to find the first position of an element in a sorted array. Your code should pass the test: assert first([1,2,3,4,5,6,6],6,6) == 5
[ "assert first([1,2,3,4,5,6,6],6,6) == 5", "assert first([1,2,2,2,3,2,2,4,2],2,9) == 1", "assert first([1,2,3],1,3) == 0" ]
1
function
Here is the completed code: ```python
Write a function to remove all the tuples with length k. Your code should pass the test: assert remove_tuples([(4, 5), (4, ), (8, 6, 7), (1, ), (3, 4, 6, 7)] , 1) == [(4, 5), (8, 6, 7), (3, 4, 6, 7)]
[ "assert remove_tuples([(4, 5), (4, ), (8, 6, 7), (1, ), (3, 4, 6, 7)] , 1) == [(4, 5), (8, 6, 7), (3, 4, 6, 7)]", "assert remove_tuples([(4, 5), (4,5), (6, 7), (1, 2, 3), (3, 4, 6, 7)] ,2) == [(1, 2, 3), (3, 4, 6, 7)]", "assert remove_tuples([(1, 4, 4), (4, 3), (8, 6, 7), (1, ), (3, 6, 7)] , 3) == [(4, 3), (1,)]" ]
1
function
Here is the completed code: ```python
Write a function to perform the exponentiation of the given two tuples. Your code should pass the test: assert find_exponentio((10, 4, 5, 6), (5, 6, 7, 5)) == (100000, 4096, 78125, 7776)
[ "assert find_exponentio((10, 4, 5, 6), (5, 6, 7, 5)) == (100000, 4096, 78125, 7776)", "assert find_exponentio((11, 5, 6, 7), (6, 7, 8, 6)) == (1771561, 78125, 1679616, 117649)", "assert find_exponentio((12, 6, 7, 8), (7, 8, 9, 7)) == (35831808, 1679616, 40353607, 2097152)" ]
1
function
Here is the completed code: ```python
Write a function to find the largest triangle that can be inscribed in an ellipse. Your code should pass the test: assert largest_triangle(4,2)==10.392304845413264
[ "assert largest_triangle(4,2)==10.392304845413264", "assert largest_triangle(5,7)==4.639421805988064", "assert largest_triangle(9,1)==105.2220865598093" ]
1
function
Here is the completed code: ```python
Write a python function to find highest power of 2 less than or equal to given number. Your code should pass the test: assert highest_Power_of_2(10) == 8
[ "assert highest_Power_of_2(10) == 8", "assert highest_Power_of_2(19) == 16", "assert highest_Power_of_2(32) == 32" ]
1
function
Here is the completed code: ```python
Write a function to find all index positions of the maximum values in a given list. Your code should pass the test: assert position_max([12,33,23,10,67,89,45,667,23,12,11,10,54])==[7]
[ "assert position_max([12,33,23,10,67,89,45,667,23,12,11,10,54])==[7]", "assert position_max([1,2,2,2,4,4,4,5,5,5,5])==[7,8,9,10]", "assert position_max([2,1,5,6,8,3,4,9,10,11,8,12])==[11]" ]
1
function
Here is the completed code: ```python
Write a python function to check whether the elements in a list are same or not. Your code should pass the test: assert chkList(['one','one','one']) == True
[ "assert chkList(['one','one','one']) == True", "assert chkList(['one','Two','Three']) == False", "assert chkList(['bigdata','python','Django']) == False" ]
1
function
Here is the completed code: ```python
Write a function to remove even characters in a string. Your code should pass the test: assert remove_even("python")==("pto")
[ "assert remove_even(\"python\")==(\"pto\")", "assert remove_even(\"program\")==(\"porm\")", "assert remove_even(\"language\")==(\"lnug\")" ]
1
function
Here is the completed code: ```python
Write a python function to find the hamming distance between given two integers. Your code should pass the test: assert hamming_Distance(4,8) == 2
[ "assert hamming_Distance(4,8) == 2", "assert hamming_Distance(2,4) == 2", "assert hamming_Distance(1,2) == 2" ]
1
function
Here is the completed code: ```python
Write a python function to count the occurrence of a given character in a string. Your code should pass the test: assert count("abcc","c") == 2
[ "assert count(\"abcc\",\"c\") == 2", "assert count(\"ababca\",\"a\") == 3", "assert count(\"mnmm0pm\",\"m\") == 4" ]
1
function
Here is the completed code: ```python
Write a function to find the inversions of tuple elements in the given tuple list. Your code should pass the test: assert inversion_elements((7, 8, 9, 1, 10, 7)) == (-8, -9, -10, -2, -11, -8)
[ "assert inversion_elements((7, 8, 9, 1, 10, 7)) == (-8, -9, -10, -2, -11, -8)", "assert inversion_elements((2, 4, 5, 6, 1, 7)) == (-3, -5, -6, -7, -2, -8)", "assert inversion_elements((8, 9, 11, 14, 12, 13)) == (-9, -10, -12, -15, -13, -14)" ]
1
function
Here is the completed code: ```python
Write a function to perform the adjacent element concatenation in the given tuples. Your code should pass the test: assert concatenate_elements(("DSP ", "IS ", "BEST ", "FOR ", "ALL ", "UTS")) == ('DSP IS ', 'IS BEST ', 'BEST FOR ', 'FOR ALL ', 'ALL UTS')
[ "assert concatenate_elements((\"DSP \", \"IS \", \"BEST \", \"FOR \", \"ALL \", \"UTS\")) == ('DSP IS ', 'IS BEST ', 'BEST FOR ', 'FOR ALL ', 'ALL UTS')", "assert concatenate_elements((\"RES \", \"IS \", \"BEST \", \"FOR \", \"ALL \", \"QESR\")) == ('RES IS ', 'IS BEST ', 'BEST FOR ', 'FOR ALL ', 'ALL QESR')", "assert concatenate_elements((\"MSAM\", \"IS \", \"BEST \", \"FOR \", \"ALL \", \"SKD\")) == ('MSAMIS ', 'IS BEST ', 'BEST FOR ', 'FOR ALL ', 'ALL SKD')" ]
1
function
Here is the completed code: ```python
Write a function to count the longest repeating subsequences such that the two subsequences don’t have same string characters at same positions. Your code should pass the test: assert find_longest_repeating_subseq("AABEBCDD") == 3
[ "assert find_longest_repeating_subseq(\"AABEBCDD\") == 3", "assert find_longest_repeating_subseq(\"aabb\") == 2", "assert find_longest_repeating_subseq(\"aab\") == 1" ]
1
function
Here is the completed code: ```python
Write a function to check the given decimal with a precision of 2 by using regex. Your code should pass the test: assert is_decimal('123.11') == True
[ "assert is_decimal('123.11') == True", "assert is_decimal('0.21') == True", "assert is_decimal('123.1214') == False" ]
1
function
Here is the completed code: ```python
Write a function to delete the smallest element from the given heap and then insert a new item. Your code should pass the test: assert heap_replace( [25, 44, 68, 21, 39, 23, 89],21)==[21, 25, 23, 44, 39, 68, 89]
[ "assert heap_replace( [25, 44, 68, 21, 39, 23, 89],21)==[21, 25, 23, 44, 39, 68, 89]", "assert heap_replace([25, 44, 68, 21, 39, 23, 89],110)== [23, 25, 68, 44, 39, 110, 89]", "assert heap_replace([25, 44, 68, 21, 39, 23, 89],500)==[23, 25, 68, 44, 39, 500, 89]" ]
1
function
Here is the completed code: ```python
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. Your code should pass the test: assert is_allowed_specific_char("ABCDEFabcdef123450") == True
[ "assert is_allowed_specific_char(\"ABCDEFabcdef123450\") == True", "assert is_allowed_specific_char(\"*&%@#!}{\") == False", "assert is_allowed_specific_char(\"HELLOhowareyou98765\") == True" ]
1
function
Here is the completed code: ```python