Dataset Viewer
Auto-converted to Parquet Duplicate
task_id
int64
601
974
text
stringlengths
38
249
code
stringlengths
30
908
test_list
listlengths
3
3
test_setup_code
stringclasses
2 values
challenge_test_list
listlengths
0
0
747
Write a function to convert the given string of integers into a tuple.
def check_subset(list1,list2): return all(map(list1.__contains__,list2))
[ "assert split_upperstring(\"PythonProgramLanguage\")==['Python','Program','Language']", "assert split_upperstring(\"PythonProgram\")==['Python','Program']", "assert split_upperstring(\"ProgrammingLanguage\")==['Programming','Language']" ]
[]
801
Write a python function to find the sum of an array.
import re def text_match_three(text): patterns = 'ab{3}?' if re.search(patterns, text): return 'Found a match!' else: return('Not matched!')
[ "assert Check_Solution(2,0,2) == \"Yes\"", "assert Check_Solution(2,-5,2) == \"Yes\"", "assert Check_Solution(1,2,3) == \"No\"" ]
[]
757
Write a function to increment the numeric values in the given strings by k.
def max_of_two( x, y ): if x > y: return x return y
[ "assert is_triangleexists(50,60,70)==True", "assert is_triangleexists(90,45,45)==True", "assert is_triangleexists(150,30,70)==False" ]
[]
943
Write a function to find the maximum sum that can be formed which has no three consecutive elements present.
def count_Unset_Bits(n) : cnt = 0; for i in range(1,n + 1) : temp = i; while (temp) : if (temp % 2 == 0) : cnt += 1; temp = temp // 2; return cnt;
[ "assert div_list([4,5,6],[1, 2, 3])==[4.0,2.5,2.0]", "assert div_list([3,2],[1,4])==[3.0, 0.5]", "assert div_list([90,120],[50,70])==[1.8, 1.7142857142857142]" ]
[]
950
Write a python function to check whether a sequence of numbers has an increasing trend or not.
def heap_sort(arr): heapify(arr) end = len(arr) - 1 while end > 0: arr[end], arr[0] = arr[0], arr[end] shift_down(arr, 0, end - 1) end -= 1 return arr def heapify(arr): start = len(arr) // 2 while start >= 0: shift_down(arr, start, len(arr) - 1) ...
[ "assert min_jumps([1, 3, 6, 1, 0, 9], 6) == 3", "assert min_jumps([1, 3, 5, 8, 9, 2, 6, 7, 6, 8, 9], 11) == 3", "assert min_jumps([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 11) == 10" ]
[]
633
Write a function to caluclate the area of a tetrahedron.
import cmath def len_complex(a,b): cn=complex(a,b) length=abs(cn) return length
[ "assert count_variable(4,2,0,-2)==['p', 'p', 'p', 'p', 'q', 'q'] ", "assert count_variable(0,1,2,3)==['q', 'r', 'r', 's', 's', 's'] ", "assert count_variable(11,15,12,23)==['p', 'p', 'p', 'p', 'p', 'p', 'p', 'p', 'p', 'p', 'p', 'q', 'q', 'q', 'q', 'q', 'q', 'q', 'q', 'q', 'q', 'q', 'q', 'q', 'q', 'q', 'r', 'r',...
[]
685
Write a function to find the nth delannoy number.
def recur_gcd(a, b): low = min(a, b) high = max(a, b) if low == 0: return high elif low == 1: return 1 else: return recur_gcd(low, high%low)
[ "assert filter_data({'Cierra Vega': (6.2, 70), 'Alden Cantrell': (5.9, 65), 'Kierra Gentry': (6.0, 68), 'Pierre Cox': (5.8, 66)},6.0,70)=={'Cierra Vega': (6.2, 70)}", "assert filter_data({'Cierra Vega': (6.2, 70), 'Alden Cantrell': (5.9, 65), 'Kierra Gentry': (6.0, 68), 'Pierre Cox': (5.8, 66)},5.9,67)=={'Cierra ...
[]
654
Write a python function to find the smallest missing number from the given array.
def fibonacci(n): if n == 1 or n == 2: return 1 else: return (fibonacci(n - 1) + (fibonacci(n - 2)))
[ "assert slope(4,2,2,5) == -1.5", "assert slope(2,4,4,6) == 1", "assert slope(1,2,4,2) == 0" ]
[]
798
Write a function to check whether the given ip address is valid or not using regex.
def sum_Range_list(nums, m, n): sum_range = 0 ...
[ "assert sub_lists([10, 20, 30, 40])==[[], [10], [20], [30], [40], [10, 20], [10, 30], [10, 40], [20, 30], [20, 40], [30, 40], [10, 20, 30], [10, 20, 40], [10, 30, 40], [20, 30, 40], [10, 20, 30, 40]]", "assert sub_lists(['X', 'Y', 'Z'])==[[], ['X'], ['Y'], ['Z'], ['X', 'Y'], ['X', 'Z'], ['Y', 'Z'], ['X', 'Y', 'Z'...
[]
762
Write a function to check if a triangle of positive area is possible with the given angles.
import re def extract_quotation(text1): return (re.findall(r'"(.*?)"', text1))
[ "assert combine_lists([1, 3, 5, 7, 9, 11],[0, 2, 4, 6, 8, 10])==[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]", "assert combine_lists([1, 3, 5, 6, 8, 9], [2, 5, 7, 11])==[1,2,3,5,5,6,7,8,9,11]", "assert combine_lists([1,3,7],[2,4,6])==[1,2,3,4,6,7]" ]
[]
678
Write a function to find the maximum of similar indices in two lists of tuples.
def rectangle_perimeter(l,b): perimeter=2*(l+b) return perimeter
[ "assert rombus_area(10,20)==100", "assert rombus_area(10,5)==25", "assert rombus_area(4,2)==4" ]
[]
705
Write a function to count number of lists in a given list of lists and square the count.
from itertools import combinations def sub_lists(my_list): subs = [] for i in range(0, len(my_list)+1): temp = [list(x) for x in combinations(my_list, i)] if len(temp)>0: subs.extend(temp) return subs
[ "assert check_monthnum_number(2)==True", "assert check_monthnum_number(1)==False", "assert check_monthnum_number(3)==False" ]
[]
663
Write a function to check whether the given month name contains 31 days or not.
def rotate_right(list1,m,n): result = list1[-(m):]+list1[:-(n)] return result
[ "assert max_run_uppercase('GeMKSForGERksISBESt') == 5", "assert max_run_uppercase('PrECIOusMOVemENTSYT') == 6", "assert max_run_uppercase('GooGLEFluTTER') == 4" ]
[]
648
Write a python function to check whether the given number can be represented by sum of two squares or not.
def are_Rotations(string1,string2): size1 = len(string1) size2 = len(string2) temp = '' if size1 != size2: return False temp = string1 + string1 if (temp.count(string2)> 0): return True else: return False
[ "assert remove_duplic_list([\"Python\", \"Exercises\", \"Practice\", \"Solution\", \"Exercises\"])==['Python', 'Exercises', 'Practice', 'Solution']", "assert remove_duplic_list([\"Python\", \"Exercises\", \"Practice\", \"Solution\", \"Exercises\",\"Java\"])==['Python', 'Exercises', 'Practice', 'Solution', 'Java']...
[]
922
Write a python function to find the first odd number in a given list of numbers.
def sort_tuple(tup): n = len(tup) for i in range(n): for j in range(n-i-1): if tup[j][0] > tup[j + 1][0]: tup[j], tup[j + 1] = tup[j + 1], tup[j] return tup
[ "assert count_reverse_pairs([\"julia\", \"best\", \"tseb\", \"for\", \"ailuj\"])== '2'", "assert count_reverse_pairs([\"geeks\", \"best\", \"for\", \"skeeg\"]) == '1'", "assert count_reverse_pairs([\"makes\", \"best\", \"sekam\", \"for\", \"rof\"]) == '2' " ]
[]
818
Write a function to extract year, month and date from a url by using regex.
def is_abundant(n): fctrsum = sum([fctr for fctr in range(1, n) if n % fctr == 0]) return fctrsum > n
[ "assert sum_Square(25) == True", "assert sum_Square(24) == False", "assert sum_Square(17) == True" ]
[]
716
Write a function to replace all spaces in the given string with character * list item * list item * list item * list item '%20'.
def count_Fac(n): m = n count = 0 i = 2 while((i * i) <= m): total = 0 while (n % i == 0): n /= i total += 1 temp = 0 j = 1 while((temp + j) <= total): temp += j count += 1 j += 1 ...
[ "assert cheap_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-1', 'price': 101.1}]", "assert cheap_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],2)==[{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}]", "ass...
[]
954
Write a function to find the median of two sorted arrays of same size.
import re def road_rd(street): return (re.sub('Road$', 'Rd.', street))
[ "assert rotate_right([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],3,4)==[8, 9, 10, 1, 2, 3, 4, 5, 6]", "assert rotate_right([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],2,2)==[9, 10, 1, 2, 3, 4, 5, 6, 7, 8]", "assert rotate_right([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],5,2)==[6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8]" ]
[]
696
Write a function to sort the given tuple list basis the total digits in tuple.
def product_Equal(n): if n < 10: return False prodOdd = 1; prodEven = 1 while n > 0: digit = n % 10 prodOdd *= digit n = n//10 if n == 0: break; digit = n % 10 prodEven *= digit n = n//10 if prodOdd == prodEv...
[ "assert toggle_middle_bits(9) == 15", "assert toggle_middle_bits(10) == 12", "assert toggle_middle_bits(11) == 13" ]
[]
811
Write a function to find maximum run of uppercase characters in the given string.
def find_Extra(arr1,arr2,n) : for i in range(0, n) : if (arr1[i] != arr2[i]) : return i return n
[ "assert find_closet([1, 4, 10],[2, 15, 20],[10, 12],3,3,2) == (10, 15, 10)", "assert find_closet([20, 24, 100],[2, 19, 22, 79, 800],[10, 12, 23, 24, 119],3,5,5) == (24, 22, 23)", "assert find_closet([2, 5, 11],[3, 16, 21],[11, 13],3,3,2) == (11, 16, 11)" ]
[]
793
Write a python function to check whether the given string is made up of two alternating characters or not.
def subset(ar, n): res = 0 ar.sort() for i in range(0, n) : count = 1 for i in range(n - 1): if ar[i] == ar[i + 1]: count+=1 else: break res = max(res, count) return res
[ "assert bell_Number(2) == 2", "assert bell_Number(3) == 5", "assert bell_Number(4) == 15" ]
[]
864
Write a function to find the longest chain which can be formed from the given set of pairs.
def all_Bits_Set_In_The_Given_Range(n,l,r): num = ((1 << r) - 1) ^ ((1 << (l - 1)) - 1) new_num = n & num if (num == new_num): return True return False
[ "assert remove_similar_row([[(4, 5), (3, 2)], [(2, 2), (4, 6)], [(3, 2), (4, 5)]] ) == {((2, 2), (4, 6)), ((3, 2), (4, 5))}", "assert remove_similar_row([[(5, 6), (4, 3)], [(3, 3), (5, 7)], [(4, 3), (5, 6)]] ) == {((4, 3), (5, 6)), ((3, 3), (5, 7))}", "assert remove_similar_row([[(6, 7), (5, 4)], [(4, 4), (6, 8...
[]
723
Write a python function to find the smallest prime divisor of a number.
def check_Odd_Parity(x): parity = 0 while (x != 0): x = x & (x - 1) parity += 1 if (parity % 2 == 1): return True else: return False
[ "assert check_Type_Of_Triangle(1,2,3) == \"Obtuse-angled Triangle\"", "assert check_Type_Of_Triangle(2,2,2) == \"Acute-angled Triangle\"", "assert check_Type_Of_Triangle(1,0,1) == \"Right-angled Triangle\"" ]
[]
859
Write a function to convert an integer into a roman numeral.
import re def check_substring(string, sample) : if (sample in string): y = "\A" + sample x = re.search(y, string) if x : return ("string starts with the given substring") else : return ("string doesnt start with the given substring") else : retur...
[ "assert largest_subset([ 1, 3, 6, 13, 17, 18 ], 6) == 4", "assert largest_subset([10, 5, 3, 15, 20], 5) == 3", "assert largest_subset([18, 1, 3, 6, 13, 17], 6) == 4" ]
[]
974
Write a python function to count the number of digits in factorial of a given number.
def check_greater(test_tup1, test_tup2): res = all(x < y for x, y in zip(test_tup1, test_tup2)) return (res)
[ "assert palindrome_lambda([\"php\", \"res\", \"Python\", \"abcd\", \"Java\", \"aaa\"])==['php', 'aaa']", "assert palindrome_lambda([\"abcd\", \"Python\", \"abba\", \"aba\"])==['abba', 'aba']", "assert palindrome_lambda([\"abcd\", \"abbccbba\", \"abba\", \"aba\"])==['abbccbba', 'abba', 'aba']" ]
[]
763
Write a python function to merge the first and last elements separately in a list of lists.
import re def num_position(text): for m in re.finditer("\d+", text): return m.start()
[ "assert check_subset([[1, 3], [5, 7], [9, 11], [13, 15, 17]] ,[[1, 3],[13,15,17]])==True", "assert check_subset([[1, 2], [2, 3], [3, 4], [5, 6]],[[3, 4], [5, 6]])==True", "assert check_subset([[[1, 2], [2, 3]], [[3, 4], [5, 7]]],[[[3, 4], [5, 6]]])==False" ]
[]
703
Write a function to extract unique values from the given dictionary values.
def max_of_three(num1,num2,num3): if (num1 >= num2) and (num1 >= num3): lnum = num1 elif (num2 >= num1) and (num2 >= num3): lnum = num2 else: lnum = num3 return lnum
[ "assert count_Divisors(10) == \"Even\"", "assert count_Divisors(100) == \"Odd\"", "assert count_Divisors(125) == \"Even\"" ]
[]
906
Write a function to concatenate the given two tuples to a nested tuple.
from itertools import zip_longest, chain, tee def exchange_elements(lst): lst1, lst2 = tee(iter(lst), 2) return list(chain.from_iterable(zip_longest(lst[1::2], lst[::2])))
[ "assert discriminant_value(4,8,2)==(\"Two solutions\",32)", "assert discriminant_value(5,7,9)==(\"no real solution\",-131)", "assert discriminant_value(0,0,9)==(\"one solution\",0)" ]
[]
882
Write a function to convert tuple string to integer tuple.
def count_reverse_pairs(test_list): res = sum([1 for idx in range(0, len(test_list)) for idxn in range(idx, len( test_list)) if test_list[idxn] == str(''.join(list(reversed(test_list[idx]))))]) return str(res)
[ "assert count_Rotation([3,2,1],3) == 1", "assert count_Rotation([4,5,1,2,3],5) == 2", "assert count_Rotation([7,8,9,1,2,3],6) == 3" ]
[]
621
Write a python function to check whether the given two arrays are equal or not.
def mul_list(nums1,nums2): result = map(lambda x, y: x * y, nums1, nums2) return list(result)
[ "assert all_Bits_Set_In_The_Given_Range(10,2,1) == True ", "assert all_Bits_Set_In_The_Given_Range(5,2,4) == False", "assert all_Bits_Set_In_The_Given_Range(22,2,3) == True " ]
[]
933
Write a function to perform chunking of tuples each of size n.
def filter_data(students,h,w): result = {k: s for k, s in students.items() if s[0] >=h and s[1] >=w} return result
[ "assert remove_even([1,3,5,2]) == [1,3,5]", "assert remove_even([5,6,7]) == [5,7]", "assert remove_even([1,2,3,4]) == [1,3]" ]
[]
904
Write a function to check if each element of the second tuple is greater than its corresponding index in the first tuple.
def No_of_cubes(N,K): No = 0 No = (N - K + 1) No = pow(No, 3) return No
[ "assert length_Of_Last_Word(\"python language\") == 8", "assert length_Of_Last_Word(\"PHP\") == 3", "assert length_Of_Last_Word(\"\") == 0" ]
[]
719
Write a python function to check whether every even index contains even numbers of a given list.
def get_inv_count(arr, n): inv_count = 0 for i in range(n): for j in range(i + 1, n): if (arr[i] > arr[j]): inv_count += 1 return inv_count
[ "assert swap_List([1,2,3]) == [3,2,1]", "assert swap_List([1,2,3,4,4]) == [4,2,3,4,1]", "assert swap_List([4,5,6]) == [6,5,4]" ]
[]
934
Write a python function to remove even numbers from a given list.
def unique_sublists(list1): result ={} for l in list1: result.setdefault(tuple(l), list()).append(1) for a, b in result.items(): result[a] = sum(b) return result
[ "assert ntimes_list([1, 2, 3, 4, 5, 6, 7],3)==[3, 6, 9, 12, 15, 18, 21]", "assert ntimes_list([1, 2, 3, 4, 5, 6, 7],4)==[4, 8, 12, 16, 20, 24, 28]", "assert ntimes_list([1, 2, 3, 4, 5, 6, 7],10)==[10, 20, 30, 40, 50, 60, 70]" ]
[]
769
Write a function to combine two dictionaries by adding values for common keys.
def coin_change(S, m, n): table = [[0 for x in range(m)] for x in range(n+1)] for i in range(m): table[0][i] = 1 for i in range(1, n+1): for j in range(m): x = table[i - S[j]][j] if i-S[j] >= 0 else 0 y = table[i][j-1] if j >= 1 else 0 table[...
[ "assert sort_tuple([(\"Amana\", 28), (\"Zenat\", 30), (\"Abhishek\", 29),(\"Nikhil\", 21), (\"B\", \"C\")]) == [('Abhishek', 29), ('Amana', 28), ('B', 'C'), ('Nikhil', 21), ('Zenat', 30)]", "assert sort_tuple([(\"aaaa\", 28), (\"aa\", 30), (\"bab\", 29), (\"bb\", 21), (\"csa\", \"C\")]) == [('aa', 30), ('aaaa', 2...
[]
911
Write a function to check if the given expression is balanced or not.
def power_base_sum(base, power): return sum([int(i) for i in str(pow(base, power))])
[ "assert end_num('abcdef')==False", "assert end_num('abcdef7')==True", "assert end_num('abc')==False" ]
[]
617
Write a python function to find the sum of non-repeated elements in a given array.
def is_key_present(d,x): if x in d: return True else: return False
[ "assert text_match_three(\"ac\")==('Not matched!')", "assert text_match_three(\"dc\")==('Not matched!')", "assert text_match_three(\"abbbba\")==('Found a match!')" ]
[]
688
Write a function to check if any list element is present in the given list.
def tuple_modulo(test_tup1, test_tup2): res = tuple(ele1 % ele2 for ele1, ele2 in zip(test_tup1, test_tup2)) return (res)
[ "assert remove_duplicate([[10, 20], [40], [30, 56, 25], [10, 20], [33], [40]])==[[10, 20], [30, 56, 25], [33], [40]] ", "assert remove_duplicate([\"a\", \"b\", \"a\", \"c\", \"c\"] )==[\"a\", \"b\", \"c\"]", "assert remove_duplicate([1, 3, 5, 6, 3, 5, 6, 1] )==[1, 3, 5, 6]" ]
[]
640
Write a function to calculate the sum of the positive numbers of a given list of numbers using lambda function.
def sort_String(str) : str = ''.join(sorted(str)) return (str)
[ "assert check_none((10, 4, 5, 6, None)) == True", "assert check_none((7, 8, 9, 11, 14)) == False", "assert check_none((1, 2, 3, 4, None)) == True" ]
[]
772
Write a function to find the maximum of nth column from the given tuple list.
def get_Pairs_Count(arr,n,sum): count = 0 for i in range(0,n): for j in range(i + 1,n): if arr[i] + arr[j] == sum: count += 1 return count
[ "assert sum_of_square(4) == 70", "assert sum_of_square(5) == 252", "assert sum_of_square(2) == 6" ]
[]
821
Write a python function to find the first repeated character in a given string.
def binomial_coeffi(n, k): if (k == 0 or k == n): return 1 return (binomial_coeffi(n - 1, k - 1) + binomial_coeffi(n - 1, k)) def rencontres_number(n, m): if (n == 0 and m == 0): return 1 if (n == 1 and m == 0): return 0 if (m == 0): return ((n - 1) * (rencontres_number(n - 1, 0)+ renc...
[ "assert count_same_pair([1, 2, 3, 4, 5, 6, 7, 8],[2, 2, 3, 1, 2, 6, 7, 9])==4", "assert count_same_pair([0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8],[2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8])==11", "assert count_same_pair([2, 4, -6, -9, 11, -12, 14, -5, 17],[2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8])==1" ]
[]
672
Write a python function to find the last position of an element in a sorted array.
def max_similar_indices(test_list1, test_list2): res = [(max(x[0], y[0]), max(x[1], y[1])) for x, y in zip(test_list1, test_list2)] return (res)
[ "assert all_Characters_Same(\"python\") == False", "assert all_Characters_Same(\"aaa\") == True", "assert all_Characters_Same(\"data\") == False" ]
[]
877
Write a python function to find lcm of two positive integers.
def sum_even_odd(list1): first_even = next((el for el in list1 if el%2==0),-1) first_odd = next((el for el in list1 if el%2!=0),-1) return (first_even+first_odd)
[ "assert pack_consecutive_duplicates([0, 0, 1, 2, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 4, 4])==[[0, 0], [1], [2], [3], [4, 4], [5], [6, 6, 6], [7], [8], [9], [4, 4]]", "assert pack_consecutive_duplicates([10, 10, 15, 19, 18, 18, 17, 26, 26, 17, 18, 10])==[[10, 10], [15], [19], [18, 18], [17], [26, 26], [17], [18], [10]]"...
[]
805
Write a function to find minimum of two numbers.
def get_key(dict): list = [] for key in dict.keys(): list.append(key) return list
[ "assert min_of_two(10,20)==10", "assert min_of_two(19,15)==15", "assert min_of_two(-10,-20)==-20" ]
root = Node(1) root.left = Node(2) root.right = Node(3) root.left.left = Node(4) root.left.right = Node(5) root1 = Node(1); root1.left = Node(2); root1.right = Node(3); root1.left.left = Node(4); root1.right.left = Node(5); root1.right.right = Node(6); root1.right.right.right= Node(7); ro...
[]
770
Write a function to find the equilibrium index of the given array.
def check_identical(test_list1, test_list2): res = test_list1 == test_list2 return (res)
[ "assert remove_length('The person is most value tet', 3) == 'person is most value'", "assert remove_length('If you told me about this ok', 4) == 'If you me about ok'", "assert remove_length('Forces of darkeness is come into the play', 4) == 'Forces of darkeness is the'" ]
[]
971
Write a function to group a sequence of key-value pairs into a dictionary of lists using collections module.
def clear_tuple(test_tup): temp = list(test_tup) temp.clear() test_tup = tuple(temp) return (test_tup)
[ "assert sector_area(4,45)==6.285714285714286", "assert sector_area(9,45)==31.82142857142857", "assert sector_area(9,360)==None" ]
[]
758
Write a function to sort the tuples alphabetically by the first item of each tuple.
def prime_num(num): if num >=1: for i in range(2, num//2): if (num % i) == 0: return False else: return True else: return False
[ "assert convert([1,2,3]) == 123", "assert convert([4,5,6]) == 456", "assert convert([7,8,9]) == 789" ]
[]
833
Write a function to get an item of a tuple.
def sum_positivenum(nums): sum_positivenum = list(filter(lambda nums:nums>0,nums)) return sum(sum_positivenum)
[ "assert min_sum_path([[ 2 ], [3, 9 ], [1, 6, 7 ]]) == 6", "assert min_sum_path([[ 2 ], [3, 7 ], [8, 5, 6 ]]) == 10 ", "assert min_sum_path([[ 3 ], [6, 4 ], [5, 2, 7 ]]) == 9" ]
[]
909
Write a function to sort a list in a dictionary.
def check_Concat(str1,str2): N = len(str1) M = len(str2) if (N % M != 0): return False for i in range(N): if (str1[i] != str2[i % M]): return False return True
[ "assert is_odd(5) == True", "assert is_odd(6) == False", "assert is_odd(7) == True" ]
[]
945
Write a function to find maximum of two numbers.
def even_num(x): if x%2==0: return True else: return False
[ "assert is_subset([11, 1, 13, 21, 3, 7], 6, [11, 3, 7, 1], 4) == True", "assert is_subset([1, 2, 3, 4, 5, 6], 6, [1, 2, 4], 3) == True", "assert is_subset([10, 5, 2, 23, 19], 5, [19, 5, 3], 3) == False" ]
[]
693
Write a python function to find the length of the last word in a given string.
def find_Min_Swaps(arr,n) : noOfZeroes = [0] * n count = 0 noOfZeroes[n - 1] = 1 - arr[n - 1] for i in range(n-2,-1,-1) : noOfZeroes[i] = noOfZeroes[i + 1] if (arr[i] == 0) : noOfZeroes[i] = noOfZeroes[i] + 1 for i in range(0,n) : if (arr[i] == 1)...
[ "assert remove_duplicate(\"Python Exercises Practice Solution Exercises\")==(\"Python Exercises Practice Solution\")", "assert remove_duplicate(\"Python Exercises Practice Solution Python\")==(\"Python Exercises Practice Solution\")", "assert remove_duplicate(\"Python Exercises Practice Solution Practice\")==(\...
[]
699
Write a function to find numbers within a given range where every number is divisible by every digit it contains.
import sys def find_closet(A, B, C, p, q, r): diff = sys.maxsize res_i = 0 res_j = 0 res_k = 0 i = 0 j = 0 k = 0 while(i < p and j < q and k < r): minimum = min(A[i], min(B[j], C[k])) maximum = max(A[i], max(B[j], C[k])); if maximum-minimum < diff: res_i = i res_j = j re...
[ "assert check_monthnumb(\"February\")==False", "assert check_monthnumb(\"January\")==True", "assert check_monthnumb(\"March\")==True" ]
[]
767
Write a function to sort a list of lists by length and value.
def is_Perfect_Square(n) : i = 1 while (i * i<= n): if ((n % i == 0) and (n / i == i)): return True i = i + 1 return False
[ "assert is_decimal('123.11')==True", "assert is_decimal('e666.86')==False", "assert is_decimal('3.124587')==False" ]
[]
604
Write a function to count the elements in a list until an element is a tuple.
import math def get_Pos_Of_Right_most_Set_Bit(n): return int(math.log2(n&-n)+1) def set_Right_most_Unset_Bit(n): if (n == 0): return 1 if ((n & (n + 1)) == 0): return n pos = get_Pos_Of_Right_most_Set_Bit(~n) return ((1 << (pos - 1)) | n)
[ "assert odd_position([2,1,4,3,6,7,6,3]) == True", "assert odd_position([4,1,2]) == True", "assert odd_position([1,2,3]) == False" ]
[]
748
Write a function to find the minimum total path sum in the given triangle.
import math def sum_series(number): total = 0 total = math.pow((number * (number + 1)) /2, 2) return total
[ "assert removals([1, 3, 4, 9, 10,11, 12, 17, 20], 9, 4) == 5", "assert removals([1, 5, 6, 2, 8], 5, 2) == 3", "assert removals([1, 2, 3 ,4, 5, 6], 6, 3) == 2" ]
[]
652
Write a function to find length of the subarray having maximum sum.
def maximum_product(nums): import heapq a, b = heapq.nlargest(3, nums), heapq.nsmallest(2, nums) return max(a[0] * a[1] * a[2], a[0] * b[0] * b[1])
[ "assert equilibrium_index([1, 2, 3, 4, 1, 2, 3]) == 3", "assert equilibrium_index([-7, 1, 5, 2, -4, 3, 0]) == 3", "assert equilibrium_index([1, 2, 3]) == -1" ]
[]
659
Write a function to sort the given array by using heap sort.
from collections import deque def check_expression(exp): if len(exp) & 1: return False stack = deque() for ch in exp: if ch == '(' or ch == '{' or ch == '[': stack.append(ch) if ch == ')' or ch == '}' or ch == ']': if not stack: retur...
[ "assert remove_tuple([(None, 2), (None, None), (3, 4), (12, 3), (None, )] ) == '[(None, 2), (3, 4), (12, 3)]'", "assert remove_tuple([(None, None), (None, None), (3, 6), (17, 3), (None,1 )] ) == '[(3, 6), (17, 3), (None, 1)]'", "assert remove_tuple([(1, 2), (2, None), (3, None), (24, 3), (None, None )] ) == '[(...
[]
632
Write a function to sort dictionary items by tuple product of keys for the given dictionary with tuple keys.
from collections import Counter def most_common_elem(s,a): most_common_elem=Counter(s).most_common(a) return most_common_elem
[ "assert join_tuples([(5, 6), (5, 7), (6, 8), (6, 10), (7, 13)] ) == [(5, 6, 7), (6, 8, 10), (7, 13)]", "assert join_tuples([(6, 7), (6, 8), (7, 9), (7, 11), (8, 14)] ) == [(6, 7, 8), (7, 9, 11), (8, 14)]", "assert join_tuples([(7, 8), (7, 9), (8, 10), (8, 12), (9, 15)] ) == [(7, 8, 9), (8, 10, 12), (9, 15)]" ]
[]
967
Write a function to find numbers divisible by m and n from a list of numbers using lambda function.
def remove_length(test_str, K): temp = test_str.split() res = [ele for ele in temp if len(ele) != K] res = ' '.join(res) return (res)
[ "assert is_upper(\"person\") ==\"PERSON\"", "assert is_upper(\"final\") == \"FINAL\"", "assert is_upper(\"Valid\") == \"VALID\"" ]
[]
727
Write a function to add the given tuple to the given list.
def odd_Num_Sum(n) : j = 0 sm = 0 for i in range(1,n + 1) : j = (2*i-1) sm = sm + (j*j*j*j) return sm
[ "assert area_tetrahedron(3)==15.588457268119894", "assert area_tetrahedron(20)==692.8203230275509", "assert area_tetrahedron(10)==173.20508075688772" ]
[]
611
Write a function to replace all occurrences of spaces, commas, or dots with a colon.
def reverse_words(s): return ' '.join(reversed(s.split()))
[ "assert remove_extra_char('**//Google Android// - 12. ') == 'GoogleAndroid12'", "assert remove_extra_char('****//Google Flutter//*** - 36. ') == 'GoogleFlutter36'", "assert remove_extra_char('**//Google Firebase// - 478. ') == 'GoogleFirebase478'" ]
[]
803
Write a function to remove similar rows from the given tuple matrix.
def add_list(nums1,nums2): result = map(lambda x, y: x + y, nums1, nums2) return list(result)
[ "assert jacobsthal_num(5) == 11", "assert jacobsthal_num(2) == 1", "assert jacobsthal_num(4) == 5" ]
[]
704
Write a function to convert a roman numeral to an integer.
def floor_Max(A,B,N): x = min(B - 1,N) return (A*x) // B
[ "assert merge([['x', 'y'], ['a', 'b'], ['m', 'n']]) == [['x', 'a', 'm'], ['y', 'b', 'n']]", "assert merge([[1, 2], [3, 4], [5, 6], [7, 8]]) == [[1, 3, 5, 7], [2, 4, 6, 8]]", "assert merge([['x', 'y','z' ], ['a', 'b','c'], ['m', 'n','o']]) == [['x', 'a', 'm'], ['y', 'b', 'n'],['z', 'c','o']]" ]
[]
855
## write a function to find the minimum number of jumps to reach the end of the array for the given array of integers where each element represents the max number of steps that can be made forward from that element. > indented block > indented block
import itertools def remove_duplicate(list1): list.sort(list1) remove_duplicate = list(list1 for list1,_ in itertools.groupby(list1)) return remove_duplicate
[ "assert tuple_to_set(('x', 'y', 'z') ) == {'y', 'x', 'z'}", "assert tuple_to_set(('a', 'b', 'c') ) == {'c', 'a', 'b'}", "assert tuple_to_set(('z', 'd', 'e') ) == {'d', 'e', 'z'}" ]
[]
694
Write a function to pack consecutive duplicates of a given list elements into sublists.
def count_range_in_list(li, min, max): ctr = 0 for x in li: if min <= x <= max: ctr += 1 return ctr
[ "assert lower_ctr('abc') == 3", "assert lower_ctr('string') == 6", "assert lower_ctr('Python') == 5" ]
[]
920
Write a function to generate a square matrix filled with elements from 1 to n raised to the power of 2 in spiral order.
def is_Word_Present(sentence,word): s = sentence.split(" ") for i in s: if (i == word): return True return False
[ "assert nCr_mod_p(10, 2, 13) == 6", "assert nCr_mod_p(11, 3, 14) == 11", "assert nCr_mod_p(18, 14, 19) == 1" ]
[]
650
Write a function that gives profit amount if the given amount has profit else return none.
def check(string): if len(set(string).intersection("AEIOUaeiou"))>=5: return ('accepted') else: return ("not accepted")
[ "assert validity_triangle(60,50,90)==False", "assert validity_triangle(45,75,60)==True", "assert validity_triangle(30,50,100)==True" ]
[]
631
Write a function to find the longest common subsequence for the given three string sequence.
def remove_nested(test_tup): res = tuple() for count, ele in enumerate(test_tup): if not isinstance(ele, tuple): res = res + (ele, ) return (res)
[ "assert remove_spaces('python program')==('python program')", "assert remove_spaces('python programming language')==('python programming language')", "assert remove_spaces('python program')==('python program')" ]
[]
792
Write a function to remove consecutive duplicates of a given list.
import math def get_First_Set_Bit_Pos(n): return math.log2(n&-n)+1
[ "assert min_Jumps(3,4,11)==3.5", "assert min_Jumps(3,4,0)==0", "assert min_Jumps(11,14,11)==1" ]
[]
760
Write a python function to calculate the product of all the numbers of a given tuple.
def lower_ctr(str): lower_ctr= 0 for i in range(len(str)): if str[i] >= 'a' and str[i] <= 'z': lower_ctr += 1 return lower_ctr
[ "assert average_tuple(((10, 10, 10, 12), (30, 45, 56, 45), (81, 80, 39, 32), (1, 2, 3, 4)))==[30.5, 34.25, 27.0, 23.25]", "assert average_tuple(((1, 1, -5), (30, -15, 56), (81, -60, -39), (-10, 2, 3)))== [25.5, -18.0, 3.75]", "assert average_tuple( ((100, 100, 100, 120), (300, 450, 560, 450), (810, 800, 390, 32...
[]
752
Write a function to calculate the harmonic sum of n-1.
def divisible_by_digits(startnum, endnum): return [n for n in range(startnum, endnum+1) \ if not any(map(lambda x: int(x) == 0 or n%int(x) != 0, str(n)))]
[ "assert find_Min_Sum([3,2,1],[2,1,3],3) == 0", "assert find_Min_Sum([1,2,3],[4,5,6],3) == 9", "assert find_Min_Sum([4,1,8,7],[2,3,6,5],4) == 6" ]
[]
643
Write a python function to count number of vowels in the string.
def reverse_list_lists(lists): for l in lists: l.sort(reverse = True) return lists
[ "assert grouping_dictionary([('yellow', 1), ('blue', 2), ('yellow', 3), ('blue', 4), ('red', 1)])== ({'yellow': [1, 3], 'blue': [2, 4], 'red': [1]})", "assert grouping_dictionary([('yellow', 10), ('blue', 20), ('yellow', 30), ('blue', 40), ('red', 10)])== ({'yellow': [10, 30], 'blue': [20, 40], 'red': [10]})", ...
[]
637
Write a function to find a path with the maximum average over all existing paths for the given square matrix of size n*n.
def min_of_two( x, y ): if x < y: return x return y
[ "assert lateralsurface_cone(5,12)==204.20352248333654", "assert lateralsurface_cone(10,15)==566.3586699569488", "assert lateralsurface_cone(19,17)==1521.8090132193388" ]
[]
776
Write a python function to move all zeroes to the end of the given list.
import re def occurance_substring(text,pattern): for match in re.finditer(pattern, text): s = match.start() e = match.end() return (text[s:e], s, e)
[ "assert is_abundant(12)==True", "assert is_abundant(13)==False", "assert is_abundant(9)==False" ]
[]
795
Write a function to find the perimeter of a rectangle.
def Diff(li1,li2): return (list(list(set(li1)-set(li2)) + list(set(li2)-set(li1))))
[ "assert floor_Max(11,10,9) == 9", "assert floor_Max(5,7,4) == 2", "assert floor_Max(2,2,1) == 1" ]
[]
887
Write a python function to convert a string to a list.
import re regex = '''^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)$''' def check_IP(Ip): if(re.search(regex, Ip)): return ("Valid IP address") else: return ("Invalid I...
[ "assert anagram_lambda([\"bcda\", \"abce\", \"cbda\", \"cbea\", \"adcb\"],\"abcd\")==['bcda', 'cbda', 'adcb']", "assert anagram_lambda([\"recitals\",\" python\"], \"articles\" )==[\"recitals\"]", "assert anagram_lambda([\" keep\",\" abcdef\",\" xyz\"],\" peek\")==[\" keep\"]" ]
[]
836
Write a python function to find the index of an extra element present in one sorted array.
def swap_List(newList): size = len(newList) temp = newList[0] newList[0] = newList[size - 1] newList[size - 1] = temp return newList
[ "assert check_valid((True, True, True, True) ) == True", "assert check_valid((True, False, True, True) ) == False", "assert check_valid((True, True, True, True) ) == True" ]
[]
701
Write a python function to find the minimun number of subsets with distinct elements.
def mul_consecutive_nums(nums): result = [b*a for a, b in zip(nums[:-1], nums[1:])] return result
[ "assert return_sum({'a': 100, 'b':200, 'c':300}) == 600", "assert return_sum({'a': 25, 'b':18, 'c':45}) == 88", "assert return_sum({'a': 36, 'b':39, 'c':49}) == 124" ]
[]
670
Write a python function to check whether the given number is odd or not using bitwise operator.
def chinese_zodiac(year): if (year - 2000) % 12 == 0: sign = 'Dragon' elif (year - 2000) % 12 == 1: sign = 'Snake' elif (year - 2000) % 12 == 2: sign = 'Horse' elif (year - 2000) % 12 == 3: sign = 'sheep' elif (year - 2000) % 12 == 4: sign = 'Monkey' elif (year - 2000) % 12 == ...
[ "assert get_Pairs_Count([1,1,1,1],4,2) == 6", "assert get_Pairs_Count([1,5,7,-1,5],5,6) == 3", "assert get_Pairs_Count([1,-2,3],3,1) == 1" ]
[]
815
Write a function to zip two given lists of lists.
def generate_matrix(n): if n<=0: return [] matrix=[row[:] for row in [[0]*n]*n] row_st=0 row_ed=n-1 col_st=0 col_ed=n-1 current=1 while (True): if current>n*n: break f...
[ "assert unique_Element([1,1,1],3) == 'YES'", "assert unique_Element([1,2,1,2],4) == 'NO'", "assert unique_Element([1,2,3,4,5],5) == 'NO'" ]
[]
896
Write a function to add all the numbers in a list and divide it with the length of the list.
def len_log(list1): min=len(list1[0]) for i in list1: if len(i)<min: min=len(i) return min
[ "assert count_Unset_Bits(2) == 1", "assert count_Unset_Bits(5) == 4", "assert count_Unset_Bits(14) == 17" ]
[]
778
Write a function to find palindromes in a given list of strings using lambda function.
def rombus_perimeter(a): perimeter=4*a return perimeter
[ "assert find_Points(5,10,1,5) == (1,10)", "assert find_Points(3,5,7,9) == (3,9)", "assert find_Points(1,5,2,8) == (1,8)" ]
[]
662
Write a python function to check whether the roots of a quadratic equation are numerically equal but opposite in sign or not.
INT_BITS = 32 def left_Rotate(n,d): return (n << d)|(n >> (INT_BITS - d))
[ "assert extract_max('100klh564abc365bg') == 564", "assert extract_max('hello300how546mer231') == 546", "assert extract_max('its233beenalong343journey234') == 343" ]
[]
771
Write a python function to count number of cubes of size k in a cube of size n.
def check_subset(test_tup1, test_tup2): res = set(test_tup2).issubset(test_tup1) return (res)
[ "assert road_rd(\"ravipadu Road\")==('ravipadu Rd.')", "assert road_rd(\"palnadu Road\")==('palnadu Rd.')", "assert road_rd(\"eshwar enclave Road\")==('eshwar enclave Rd.')" ]
[]
671
Write a function to sort a list of dictionaries using lambda function.
def check_monthnumb(monthname2): if(monthname2=="January" or monthname2=="March"or monthname2=="May" or monthname2=="July" or monthname2=="Augest" or monthname2=="October" or monthname2=="December"): return True else: return False
[ "assert are_Rotations(\"abc\",\"cba\") == False", "assert are_Rotations(\"abcd\",\"cdba\") == False", "assert are_Rotations(\"abacd\",\"cdaba\") == True" ]
[]
827
Write a function to get a lucid number smaller than or equal to n.
def binomial_coeff(n, k): C = [[0 for j in range(k + 1)] for i in range(n + 1)] for i in range(0, n + 1): for j in range(0, min(i, k) + 1): if (j == 0 or j == i): C[i][j] = 1 else: C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) return C[n][k] def lobb_num(n, m): return ((...
[ "assert reverse_Array_Upto_K([1, 2, 3, 4, 5, 6],4) == [4, 3, 2, 1, 5, 6]", "assert reverse_Array_Upto_K([4, 5, 6, 7], 2) == [5, 4, 6, 7]", "assert reverse_Array_Upto_K([9, 8, 7, 6, 5],3) == [7, 8, 9, 6, 5]" ]
[]
842
Write a python function to check whether the word is present in a given sentence or not.
def nth_nums(nums,n): nth_nums = list(map(lambda x: x ** n, nums)) return nth_nums
[ "assert round_up(123.01247,0)==124", "assert round_up(123.01247,1)==123.1", "assert round_up(123.01247,2)==123.02" ]
[]
674
Write a function to print n-times a list using map function.
def min_sum_path(A): memo = [None] * len(A) n = len(A) - 1 for i in range(len(A[n])): memo[i] = A[n][i] for i in range(len(A) - 2, -1,-1): for j in range( len(A[i])): memo[j] = A[i][j] + min(memo[j], memo[j + 1]) return memo[0]
[ "assert get_key({1:'python',2:'java'})==[1,2]", "assert get_key({10:'red',20:'blue',30:'black'})==[10,20,30]", "assert get_key({27:'language',39:'java',44:'little'})==[27,39,44]" ]
[]
658
Write a python function to count lower case letters in a given string.
def pair_wise(l1): temp = [] for i in range(len(l1) - 1): current_element, next_element = l1[i], l1[i + 1] x = (current_element, next_element) temp.append(x) return temp
[ "assert find_Extra([1,2,3,4],[1,2,3],3) == 3", "assert find_Extra([2,4,6,8,10],[2,4,6,8],4) == 4", "assert find_Extra([1,3,5,7,9,11],[1,3,5,7,9],5) == 5" ]
[]
789
Write a function to remove the nested record from the given tuple.
def _sum(arr): sum=0 for i in arr: sum = sum + i return(sum)
[ "assert raw_heap([25, 44, 68, 21, 39, 23, 89])==[21, 25, 23, 44, 39, 68, 89]", "assert raw_heap([25, 35, 22, 85, 14, 65, 75, 25, 58])== [14, 25, 22, 25, 35, 65, 75, 85, 58]", "assert raw_heap([4, 5, 6, 2])==[2, 4, 6, 5]" ]
[]
738
Write a function to create a new tuple from the given string and list.
from collections import Counter def count_variable(a,b,c,d): c = Counter(p=a, q=b, r=c, s=d) return list(c.elements())
[ "assert zip_list([[1, 3], [5, 7], [9, 11]] ,[[2, 4], [6, 8], [10, 12, 14]] )==[[1, 3, 2, 4], [5, 7, 6, 8], [9, 11, 10, 12, 14]]", "assert zip_list([[1, 2], [3, 4], [5, 6]] ,[[7, 8], [9, 10], [11, 12]] )==[[1, 2, 7, 8], [3, 4, 9, 10], [5, 6, 11, 12]]", "assert zip_list([['a','b'],['c','d']] , [['e','f'],['g','h'...
[]
888
Write a function to find the fixed point in the given array.
def Check_Solution(a,b,c) : if ((b*b) - (4*a*c)) > 0 : return ("2 solutions") elif ((b*b) - (4*a*c)) == 0 : return ("1 solution") else : return ("No solutions")
[ "assert max_chain_length([Pair(5, 24), Pair(15, 25),Pair(27, 40), Pair(50, 60)], 4) == 3", "assert max_chain_length([Pair(1, 2), Pair(3, 4),Pair(5, 6), Pair(7, 8)], 4) == 4", "assert max_chain_length([Pair(19, 10), Pair(11, 12),Pair(13, 14), Pair(15, 16), Pair(31, 54)], 5) == 5" ]
[]
921
Write a function to multiply consecutive numbers of a given list.
def decreasing_trend(nums): if (sorted(nums)== nums): return True else: return False
[ "assert prime_num(13)==True", "assert prime_num(7)==True", "assert prime_num(-1010)==False" ]
[]
931
Write a function to find the maximum number of segments of lengths a, b and c that can be formed from n.
import re def camel_to_snake(text): str1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', text) return re.sub('([a-z0-9])([A-Z])', r'\1_\2', str1).lower()
[ "assert new_tuple([\"WEB\", \"is\"], \"best\") == ('WEB', 'is', 'best')", "assert new_tuple([\"We\", \"are\"], \"Developers\") == ('We', 'are', 'Developers')", "assert new_tuple([\"Part\", \"is\"], \"Wrong\") == ('Part', 'is', 'Wrong')" ]
[]
735
Write a python function to find the sum of all even natural numbers within the range l and r.
import re def text_starta_endb(text): patterns = 'a.*?b$' if re.search(patterns, text): return 'Found a match!' else: return('Not matched!')
[ "assert len_log([\"win\",\"lose\",\"great\"]) == 3", "assert len_log([\"a\",\"ab\",\"abc\"]) == 1", "assert len_log([\"12\",\"12\",\"1234\"]) == 2" ]
[]
822
Write a function to find the sequences of one upper case letter followed by lower case letters.
import re def extract_date(url): return re.findall(r'/(\d{4})/(\d{1,2})/(\d{1,2})/', url)
[ "assert power_base_sum(2,100)==115", "assert power_base_sum(8,10)==37", "assert power_base_sum(8,15)==62" ]
[]
785
Write a function which accepts an arbitrary list and converts it to a heap using heap queue algorithm.
def Convert(string): li = list(string.split(" ")) return li
[ "assert mutiple_tuple((4, 3, 2, 2, -1, 18)) == -864", "assert mutiple_tuple((1,2,3)) == 6", "assert mutiple_tuple((-2,-4,-6)) == -48" ]
[]
697
Write a python function to find sum of products of all possible subarrays.
def first_odd(nums): first_odd = next((el for el in nums if el%2!=0),-1) return first_odd
[ "assert is_Two_Alter(\"abab\") == True", "assert is_Two_Alter(\"aaaa\") == False", "assert is_Two_Alter(\"xyz\") == False" ]
[]
863
Write a python function to check whether a sequence of numbers has a decreasing trend or not.
def is_triangleexists(a,b,c): if(a != 0 and b != 0 and c != 0 and (a + b + c)== 180): if((a + b)>= c or (b + c)>= a or (a + c)>= b): return True else: return False else: return False
[ "assert sort_sublists([[2], [0], [1, 3], [0, 7], [9, 11], [13, 15, 17]])==[[0], [2], [0, 7], [1, 3], [9, 11], [13, 15, 17]]", "assert sort_sublists([[1], [2, 3], [4, 5, 6], [7], [10, 11]])==[[1], [7], [2, 3], [10, 11], [4, 5, 6]]", "assert sort_sublists([[\"python\"],[\"java\",\"C\",\"C++\"],[\"DBMS\"],[\"SQL\"...
[]
745
Write a function to round up a number to specific digits.
def tuple_to_dict(test_tup): res = dict(test_tup[idx : idx + 2] for idx in range(0, len(test_tup), 2)) return (res)
[ "assert get_ludic(10) == [1, 2, 3, 5, 7]", "assert get_ludic(25) == [1, 2, 3, 5, 7, 11, 13, 17, 23, 25]", "assert get_ludic(45) == [1, 2, 3, 5, 7, 11, 13, 17, 23, 25, 29, 37, 41, 43]" ]
[]
End of preview. Expand in Data Studio

edition_0902_google-research-datasets-mbpp-readymade

A Readymade by TheFactoryX

Original Dataset

google-research-datasets/mbpp

Process

This dataset is a "readymade" - inspired by Marcel Duchamp's concept of taking everyday objects and recontextualizing them as art.

What we did:

  1. Selected the original dataset from Hugging Face
  2. Shuffled each column independently
  3. Destroyed all row-wise relationships
  4. Preserved structure, removed meaning

The result: Same data. Wrong order. New meaning. No meaning.

Purpose

This is art. This is not useful. This is the point.

Column relationships have been completely destroyed. The data maintains its types and values, but all semantic meaning has been removed.


Part of the Readymades project by TheFactoryX.

"I am a machine." — Andy Warhol

Downloads last month
6