id
stringlengths
28
30
content
stringlengths
564
5.93k
pythonsaga_data_PythonSaga_0
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate([100, 120, -30, 140, -50, -60, 170, 22,55,-20,-90]) == -120 assert candidate([111, 20, -130, 140, -50, -60, 170, 22,55,-20,-190]) == -329 assert candidate([170, 22,55,-20,-90]) == -40 assert candidate([10...
pythonsaga_data_PythonSaga_1
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate([0]) == True assert candidate([5,2,3]) == True assert candidate([8]) == False assert candidate([1 2 3 4 5 6]) == False from typing import List def split_big_bag(big_bag: List[int])->bool: """i have o...
pythonsaga_data_PythonSaga_2
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate([1, 2, 3, 4]) == False assert candidate([1, 2, 1, 2]) == True assert candidate([2, 1, 1, 1]) == True assert candidate([11, 0, 1, 3]) == True from typing import List def is_path_crossing(distances: List[i...
pythonsaga_data_PythonSaga_3
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate([[1, 1], [2, 3], [3, 2]]) == True assert candidate([[1, 1], [2, 2], [3, 3]]) == False assert candidate([[-1, -1], [0, 0], [1, 1]]) == False assert candidate([[0, 0], [1, 2], [3, 4]]) == True assert cand...
pythonsaga_data_PythonSaga_4
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate([[1,1],[1,3],[4,1],[4,5],[5,3]]) == 4 assert candidate([[1,1],[1,5],[3,1],[3,3],[2,2]]) == 9 assert candidate([[1,1], [2,2],[4,1]]) == 0 assert candidate([[1, 1], [1, 3], [3, 1], [4, 1], [4, 4]]) == 4 ...
pythonsaga_data_PythonSaga_5
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate(5) == [" A", " B A", " A B C", " D C B A", "E D C B A"] assert candidate(3) == [" A", " B A", "A B C"] assert candidate(1) == ["A"] assert candidate(0) == [] from typing import List def pattern1(n...
pythonsaga_data_PythonSaga_6
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate(5) == "1+4-9+16-25" assert candidate(3) == "1+4-9" assert candidate(1) == "1" assert candidate(0) == "" def pattern2(n: int) -> str: """ take n as input from user, where n is number of terms and ...
pythonsaga_data_PythonSaga_7
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate(1, 5, 6) == [-2, -3] assert candidate(1, 4, 4) == [-2, -2] assert candidate(1, 0, -1) == [1, -1] assert candidate(2, -8, 6) == [3, 1] from typing import List def find_roots(a: int, b: int, c: int) -> Li...
pythonsaga_data_PythonSaga_8
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate(1000, 5) == 1080.0 assert candidate(1000, 12) == 1100.0 assert candidate(1500, 3) == 1575.0 assert candidate(800, 8) == 864.0 def price_of_painting(mrp: float, age: int) -> float: """ lets say the...
pythonsaga_data_PythonSaga_9
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate(10, 2) == ['5.0', 'This is always executed'] assert candidate(10, 0) == ['You cannot divide by zero!'] assert candidate(10, 'a') == ['Please enter a valid integer!'] assert candidate(20, 4) == ['5.0', 'This...
pythonsaga_data_PythonSaga_10
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate(5) == [' * ', ' * * ', '* *', ' * * ', ' * '] assert candidate(3) == [' * ', '* *', ' * '] assert candidate(1) == ['*'] assert candidate(7) == [' * ', ' * * ', ' * * ', '* *', ' * * ', '...
pythonsaga_data_PythonSaga_11
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate(4) == ['A B C D', 'B C D', 'C D', 'D', 'C D', 'B C D', 'A B C D'] assert candidate(3) == ['A B C', 'B C', 'C', 'B C', 'A B C'] assert candidate(1) == ['A'] assert candidate(6) == ['A B C D E F', 'B C D E F'...
pythonsaga_data_PythonSaga_12
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert pattern(5) == [5, 7, 11, 13, 17] assert pattern(6) == [5, 7, 11, 13, 17, 19] assert pattern(10) == [5, 7, 11, 13, 17, 19, 23, 31, 41, 43] assert pattern(8) == [5, 7, 11, 13, 17, 19, 23, 31] from typing import List ...
pythonsaga_data_PythonSaga_13
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate(5) == [5, 7, 10, 36, 136] assert candidate(7) == [5, 7, 10, 36, 136, 690, 4128] assert candidate(3) == [5, 7, 10] assert candidate(10) == [5, 7, 10, 36, 136, 690, 4128, 28910, 231264, 2081394] from typing...
pythonsaga_data_PythonSaga_14
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert pattern(2) == ['1*2*5*6', '--3*4'] assert pattern(3) == ['1*2*3*10*11*12', '--4*5*8*9', '----6*7'] assert pattern(4) == ['1*2*3*4*17*18*19*20', '--5*6*7*14*15*16', '----8*9*12*13', '------10*11'] assert pattern(5) ==...
pythonsaga_data_PythonSaga_15
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate(15) == 'Yes, it is possible' assert candidate(11) == 'No, it is not possible' assert candidate(20) == 'Yes, it is possible' assert candidate(2) == 'No, it is possible' def toy_distribution(n: int) -> str:...
pythonsaga_data_PythonSaga_16
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate(5, [1, 2, 3, 4, 5, 6, 7]) == [1] assert candidate(3, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == [7] assert candidate(2, [3, 6, 9, 12, 15, 18]) == [6] assert candidate(6, [0, 2, 4, 6, 8, 10]) == [2] from typing im...
pythonsaga_data_PythonSaga_17
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): input_data1 = {'patient1': [20, 50, 5.5, 20], 'patient2': [30, 60, 5.6, 21], 'patient3': [40, 70, 5.7, 22]} output1 = [{'patient1': 20, 'patient2': 30, 'patient3': 40}, {'patient1': 50, 'patient2': 60, 'patient3': 70}, ...
pythonsaga_data_PythonSaga_18
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): input_data1 = {"Ankit": 92, "Bhavya": 78, "Charvi": 88} output1 = ['Rank 1: Ankit scored 92', 'Rank 2: Charvi scored 88', 'Rank 3: Bhavya scored 78'] input_data2 = {"John": 85, "Alice": 90, "Bob": 78, "Eve": 92} output2 = ...
pythonsaga_data_PythonSaga_19
METADATA = {'author': 'ay', 'dataset': 'test'} def check(candidate): assert converter(10, 1) == '1010' assert converter(10, 2) == 'A' assert converter(10, 3) == '12' assert converter(111, 3) == '1101111' def converter(num: int, choice: int) -> str: """I want to create converter which takes number ...
pythonsaga_data_PythonSaga_20
METADATA = {'author': 'ay', 'dataset': 'test'} def check(candidate): assert candidate([2, 3, 5, 4, 4]) == [2, 3, 6, 3, 2] assert candidate([1, 2, 2]) == [1, 3, 1] assert candidate([9, 9, 9]) == [1, 0, 0, 1] assert candidate([0]) == [1] from typing import List def next_smallest(num:List[int]) -> List[i...
pythonsaga_data_PythonSaga_21
METADATA = {'author': 'ay', 'dataset': 'test'} def check(candidate): teacher_data_1 = [['class1', 'teacher', 'abc', 'maths']] student_data_1 = [['class1', 'student', 'xyz', 'maths', 90, 'science', 80]] assert candidate(teacher_data_1, student_data_1) == {'class1': {'teacher': {'name': 'abc', 'subject': 'ma...
pythonsaga_data_PythonSaga_22
METADATA = {'author': 'ay', 'dataset': 'test'} def check(candidate): assert candidate((5, (6, (1, (9, (10, None)))))) == 9 assert candidate((1, (2, (3, (4, (5, None)))))) == -1 assert candidate((10, (20, (30, (40, (50, None)))))) == -10 assert candidate((2, (4, (8, (16, (32, None)))))) == -18 from typ...
pythonsaga_data_PythonSaga_23
METADATA = {'author': 'ay', 'dataset': 'test'} def check(candidate): assert candidate([1,2,3,3]) == 2 assert candidate([2,4,5,6,2,3,2]) == 3 assert candidate([1,2,3,4,5]) == 1 assert candidate([1,1,1,1,1]) == 5 from typing import List def shoes_in_bag(bag: List[int]) -> int: """let's say I have a ...
pythonsaga_data_PythonSaga_24
METADATA = {'author': 'ay', 'dataset': 'test'} def check(candidate): assert candidate(['Rose', 'Lily', 'Jasmine']) == [['Rose', 'Lily', 'Jasmine'], ['Rose', 'Jasmine', 'Lily'], ['Lily', 'Rose', 'Jasmine'], ['Lily', 'Jasmine', 'Rose'], ['Jasmine', 'Rose', 'Lily'], ['Jasmine', 'Lily', 'Rose']] assert candidate([...
pythonsaga_data_PythonSaga_25
METADATA = {'author': 'ay', 'dataset': 'test'} def check(candidate): assert candidate(1, 0) == 0.0 assert candidate(-1, 0) == 3.14 assert candidate(0, 1) == 1.57 assert candidate(2, -2) == -0.79 import cmath def phase(a: int, b: int) -> float: """I have a number which my teacher told is complex n...
pythonsaga_data_PythonSaga_26
METADATA = {'author': 'ay', 'dataset': 'test'} def check(candidate): assert candidate("and", 3, [1, 0, 1]) == 0 assert candidate("or", 3, [1, 0, 1]) == 1 assert candidate("not", 1, [0]) == 1 assert candidate("xor", 4, [1, 0, 1, 1]) == 1 from typing import List def gate(gate_type: str, n: int, variabl...
pythonsaga_data_PythonSaga_27
METADATA = {'author': 'ay', 'dataset': 'test'} def check(candidate): assert candidate(2, 3, 0.25) == [0.67, 1, 4] assert candidate(5, 2, 0.6) == [2.5, 3, 5] assert candidate(8, 4, 0.125) == [2.0, 1, 8] assert candidate(22, 7, 0.72) == [3.14, 18, 25] def division(num: int, deno: int, float_num: float) ...
pythonsaga_data_PythonSaga_28
METADATA = {'author': 'ay', 'dataset': 'test'} def check(candidate): assert candidate("The quick brown fox jumps over the lazy dog") == "It does contain all the letters of the alphabet." assert candidate("The quick brown fox jumps over the dog") == "It doesn't contain all the letters of the alphabet." asse...
pythonsaga_data_PythonSaga_29
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate("red") == "Probability of red color in deck of cards: 50.00%" assert candidate("1") == "Probability of 1 in deck of cards: 7.69%" assert candidate("2") == "Probability of 2 in deck of cards: 7.69%" assert ca...
pythonsaga_data_PythonSaga_30
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate([12, 17, 16, 15.5, 14], firstName='James', lastName='Bond', Class='7th') == [14.9, 'James', 'Bond', '7th'] assert candidate([10, 12, 13, 14, 15], firstName='John', lastName='Doe', Class='8th') == [12.8, 'John', 'Doe...
pythonsaga_data_PythonSaga_31
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate("factorial", 5, "palindrome", "madam", "prime", 7) == [ "The factorial of 5 is 120", "The string madam is a palindrome", "7 is a prime number" ] assert candidate("factorial", 5, "palindr...
pythonsaga_data_PythonSaga_32
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate(123) == "one hundred twenty three" assert candidate(456) == "four hundred fifty six" assert candidate(8989) == "eight thousand nine hundred eighty nine" assert candidate(1001) == "one thousand one" def num...
pythonsaga_data_PythonSaga_33
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate("2020-02-29", 365) == ("2019-03-01", "2019 is not a leap year") assert candidate("2023-12-16", 1) == ("2023-12-15", "2023 is not a leap year") assert candidate("2022-01-01", 10000) == ("1994-08-16", "1997 is no...
pythonsaga_data_PythonSaga_34
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate("cube", "surface area", 5) == 150.0 assert candidate("cone", "volume", 5, 10) == 261.8 # assert candidate("cuboid", "surface area", 3, 4, 5) == 94.0 assert candidate("sphere", "volume", 2) == 33.51 asser...
pythonsaga_data_PythonSaga_35
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate(['exp', 10]) == 22026.47 assert candidate(['log', 10, 100]) == 2.0 assert candidate(['exp', -1]) == 0.37 assert candidate(['log', 2, 10001]) == 9.97 import math from typing import List def operation(work...
pythonsaga_data_PythonSaga_36
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): input_1 = [['Ank', 'Ank Ya', '21', 'Delhi'], ['Amit', 'Amit Kumar', '21', 'Delhi']] result_1 = candidate(input_1) assert result_1 == {'Ank': {'name': 'Ank Ya', 'age': 21, 'city': 'Delhi'}, 'Amit': {'name...
pythonsaga_data_PythonSaga_37
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate("Geek12#") == "Invalid Password!" assert candidate("Geek12#@") == "Valid Password" assert candidate("Annnnnnnnnn") == "Invalid Password!" assert candidate("StrongPwd123#") == "Valid Password" assert can...
pythonsaga_data_PythonSaga_38
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate([10000, 5, "2020-01-01", "2020-01-10"]) == "Interest amount is 500.00 and number of days is 10" assert candidate([100, 10, "2020-01-01", "2020-01-30"]) == "Interest amount is 300.00 and number of days is 30" as...
pythonsaga_data_PythonSaga_39
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate([1, 2, 3, 4, 5]) == [3.0, 2.19, 3, 2, 4, 3.0, 1, 2.5, 2.5, 1.58, 1.58] assert candidate([10, 20, 30, 40, 50]) == [30, 21.9, 30, 30, 30, 30.0, 10, 200, 250, 14.14, 15.81] assert candidate([2, 4, 6, 8, 10]) == [6...
pythonsaga_data_PythonSaga_40
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate("Peter picked a peck of pickled peppers. A peck of pickled peppers Peter picked. If Peter picked a peck of pickled peppers, Where's the peck of pickled peppers Peter picked?") == True assert candidate("Peter Piper p...
pythonsaga_data_PythonSaga_41
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): input_1 = [['i', 'anil', '20'], ['i', 'ram', '30'], ['d', 'anil'], ['p', 'ram']] assert candidate(input_1) == ['Inserted', 'Inserted', 'Deleted', 'Marks of ram is : 30'] input_2 = [['i', 'jhon', '1'], ['c', 'jack'], ['p', 'jhon'...
pythonsaga_data_PythonSaga_42
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): input_1 = [[1, 2, 3, 4, 5], [2, 3, 4, 5, 6]] assert candidate(input_1) == [[2, 3, 4, 5], [1, 2, 3, 4, 5, 6], [1]] input_2 = [[1, 2, 3, 4, 5], [6, 7, 8, 9, 10]] assert candidate(input_2) == [[], [1, 2, 3, 4, 5, 6, 7, 8, 9...
pythonsaga_data_PythonSaga_43
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): input_1 = 'Hello' assert candidate(input_1) == ['Hello', "Hell'", "Hel''", "He'''", "H''''"] input_2 = 'World' assert candidate(input_2) == ['World', "Worl'", "Wor''", "Wo'''", "W''''"] input_3 = 'Python' assert can...
pythonsaga_data_PythonSaga_44
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): # Test Case 1 input_1 = 6 assert candidate(input_1) == ['\ /', ' \ / ', ' \/ ', ' | ', ' | ', ' | '] # Test Case 2 input_2 = 8 assert candidate(input_2) == ['\ /', ' \ / ', ' \ / ', ' ...
pythonsaga_data_PythonSaga_45
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): # Test Case 1 n_1 = 3 lines_1 = [ "The restoring of the board is for two weeks.", "Board officials said Silva was due to return to work.", "Silva was due to return to work." ] shift_1 = 4 asse...
pythonsaga_data_PythonSaga_46
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): # Test Case 1 input_1 = ['Hello i am programmer. I like python. I Love India .'] assert candidate(input_1) == 'Number of words in the file user_input.txt is 11' # Test Case 2 input_2 = ['All in the village were happy. ...
pythonsaga_data_PythonSaga_47
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): # Test Case 1 n_1 = 3 lines_1 = ['Hello I am Jone.', 'I like programming.', 'IIT Gandhinagar.'] k_1 = 2 assert candidate(n_1, lines_1, k_1) == ['Hello', 'like'] # Test Case 2 n_2 = 2 lines_2 = ['out of all t...
pythonsaga_data_PythonSaga_48
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): # Test Case 2 input_2 = [ [101, 'John', 'Math', 75], [102, 'Jane', 'Physics', 90], [103, 'Bob', 'Chemistry', 80], [101, 'John', 'Biology', 60], [102, 'Jane', 'Math', 85], [103, 'Bob', ...
pythonsaga_data_PythonSaga_49
METADATA = {'author': 'ay', 'dataset': 'test'} def check(candidate): # Test Case 1 input_1 = 3, ["Hello can you help me", "you are doing well. How can I help you.", "can you help me ? I think you dont want to help me"], 2 assert candidate(*input_1) == ( {'Hello': 1, 'can': 3, 'you': 4, 'help': 4, ...
pythonsaga_data_PythonSaga_50
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate("2+3*4") == ('234*+', '+2*34') assert candidate("((a^b)+c)") == ('ab^c+', '+^abc') assert candidate("a+b*c-d/e^f") == ('abc*+def^/-', '-+a*bc/d^ef') assert candidate("(A*B)+(C/D)") == ('AB*CD/+', '+*AB/CD') ...
pythonsaga_data_PythonSaga_51
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate("aaabbaaccd") == "bbaaccd" assert candidate("aaa") == "" assert candidate("abcde") == "abcde" assert candidate("aaaabbbaaccd") == "ccd" def remove_three_similar_characters(string: str) -> str: """My unc...
pythonsaga_data_PythonSaga_52
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate("245/53-5^4^*+", "+2*/45^^-5354") == "Both are same" assert candidate("ABD*+AD^+*", "++A*BD^AD") == "Both are same" assert candidate("245/535^4^*+", "+2*/45^^-5354") == "Both are not same" assert candidate("...
pythonsaga_data_PythonSaga_53
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate(6, ["Go('Poem 1')", "Go('Poem 2')", "Next()", "Previous(1)", "Next()", "Over"]) == "You are on the poem: Poem 2" assert candidate(5, ["Go('Poem A')", "Previous(3)", "Next()", "Go('Poem B')", "Over"]) == "You are on ...
pythonsaga_data_PythonSaga_54
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate(5, [1, 2, 3, 4, 5], [3, 2, 1, 4, 5]) == True assert candidate(5, [1, 2, 3, 4, 5], [5, 4, 3, 1, 2]) == False assert candidate(4, [10, 20, 30, 40], [20, 10, 40, 30]) == True assert candidate(3, [7, 6, 5], [6, ...
pythonsaga_data_PythonSaga_55
def check(candidate): assert candidate(6,[10, 20, 30, 40, 50, 60]) == "60<--50<--40<--30<--20<--10" assert candidate(3,['X', 'Y', 'Z']) == "Z<--Y<--X" assert candidate(1,['SingleBook']) == "SingleBook" assert candidate(0,[]) == "" from typing import List def reverse_book_order(n: int, books: list) -> s...
pythonsaga_data_PythonSaga_56
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate(11, [7, 5, 6, 6, 9, 5, 8, 13, 10, 7, 13]) == 12 assert candidate(5, [6, 7, 9, 11, 13]) == 0 assert candidate(7, [10, 8, 6, 12, 15, 13, 11]) == 8 assert candidate(6, [20, 18, 15, 21, 19, 22]) == 7 from typin...
pythonsaga_data_PythonSaga_57
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate(5, [4, 9, 6, 5, 7]) == [9, 0, 7, 7, 0] assert candidate(7, [5, 3, 2, 9, 4, 6, 1]) == [9, 9, 9, 0, 6, 0, 0] assert candidate(4, [10, 5, 8, 12]) == [12, 8, 12, 0] assert candidate(6, [2, 5, 7, 4, 3, 1]) == [5,...
pythonsaga_data_PythonSaga_58
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate(3, {4: [1, 2, 3, 4], 3: [5, None, 7, 8], 2: [9, None, 11, None]}) == [1, 2, 3, 4, 5, 7, 8, 9, 11] assert candidate(3, {5: [10, 11, 12, 13, 14], 4: [15, 16, 17, None, 18], 3: [19, 20, None, None, 21]}) == [10, 11, 12...
pythonsaga_data_PythonSaga_59
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate(11, [1, 4, 6, 8, 10, 13, 15, 19, 22, 27, 33]) == [1, 33, 4, 27, 6, 22, 8, 19, 10, 15, 13] assert candidate(10, [2, 5, 8, 11, 14, 17, 20, 23, 26, 29]) == [2, 29, 5, 26, 8, 23, 11, 20, 14, 17] assert candidate(6, ...
pythonsaga_data_PythonSaga_60
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): input1 = (11, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], [5, 10, 11]) output1 = candidate(*input1) assert output1 == ([1, 2, 3, 4, 6, 7, 8, 9], 1, 9) input2 = (10, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [2, 4, 6, 8, 10]) output2 =...
pythonsaga_data_PythonSaga_61
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): input1 = (['O', 'K', 'H', 'Li', 'Be', 'B', 'C', 'N', 'O', 'F', 'Ne'], 2, 4) output1 = candidate(*input1) assert output1 == ['O', 'K', 'Be', 'Li', 'H', 'B', 'C', 'N', 'O', 'F', 'Ne'] input2 = (['O', 'K', 'H', 'Li', 'Be', 'B...
pythonsaga_data_PythonSaga_62
METADATA = {'author': 'ay', 'dataset': 'test'} def check(candidate): input1 = (['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'], ['I', 'J', 'K', 'B', 'L', 'M'], 'B') output1 = candidate(*input1) assert output1 == ['B', 'C', 'D', 'E', 'F', 'G', 'H', 'A', 'B', 'L', 'M', 'I', 'J', 'K', 'B'] input2 = (['X', 'Y', ...
pythonsaga_data_PythonSaga_63
METADATA = {'author': 'ay', 'dataset': 'test'} def check(candidate): input1 = [1, 2, 3, 1] threshold1 = 3 output1 = candidate(input1, threshold1) assert output1 == [[1, 2, 3, 1], [1, 2, 3], [1, 2, 1], [1, 3, 1], [1, 3], [2, 3, 1], [2, 3], [3, 1]] input2 = [1, 2, 3, 1] threshold2 = 4 output...
pythonsaga_data_PythonSaga_64
METADATA = {'author': 'ay', 'dataset': 'test'} def check(candidate): input1 = ['A', 'D', 'A', 'R'] output1 = candidate(input1) assert output1 == ['Palindrome', 'The word is RADAR'] input2 = ['T', 'I', 'N', 'N', 'I'] output2 = candidate(input2) assert output2 == ['Palindrome', 'The word is NITI...
pythonsaga_data_PythonSaga_65
METADATA = {'author': 'ay', 'dataset': 'test'} def check(candidate): assert candidate([[1, 1], [1, 2], [1, 3], [3]]) == [[3, 2, 1]] assert candidate([[1, 1], [1, 2], [3], [2], [3]]) == [[2, 1], [1]] assert candidate([[1, 5], [1, 10], [1, 15], [2], [3]]) == [[10, 5]] assert candidate([[1, 3], [1, 6],[3]...
pythonsaga_data_PythonSaga_66
METADATA = {'author': 'ay', 'dataset': 'test'} def check(candidate): assert candidate([4, 0, 4]) == 4 assert candidate([3, 4, 3, 5, 4, 3, 4, 6, 5, 4, 5, 4]) == 9 assert candidate([1, 2, 3, 4, 5]) == 0 assert candidate([10, 5, 15, 2, 8, 12, 7]) == 19 from typing import List def skyline(street: List[in...
pythonsaga_data_PythonSaga_67
METADATA = {'author': 'ay', 'dataset': 'test'} def check(candidate): assert candidate([['ins_rear', 5], ['ins_fr', 10], ['del_fr'], ['del_rear'], ['ins_fr', 15], ['ins_rear', 20]]) == [15, 20] assert candidate([['ins_rear', 1], ['ins_rear', 2], ['ins_rear', 3], ['del_fr'], ['ins_fr', 4], ['del_rear']]) == [4, ...
pythonsaga_data_PythonSaga_68
METADATA = {'author': 'ay', 'dataset': 'test'} def check(candidate): assert candidate([1, 2, 3, 4, 5], [3]) == [2, 3, 4] assert candidate([1, 2, 3, 4, 5], [4]) == [] assert candidate([1, 2, 3, 4, 5], [2, 1, 3]) == [1, 4, 5] assert candidate([10, 20, 30, 40, 50], [1]) == [10, 20, 40, 50] from collectio...
pythonsaga_data_PythonSaga_69
METADATA = {'author': 'ay', 'dataset': 'test'} def check(candidate): assert candidate(4, [['*', '|', '*', '|'], ['|', '|', '*', '*']]) == 0 assert candidate(6, [['|', '|', '|', '*', '*', '|'], ['|', '*', '*', '*', '|', '|']]) == 3 from collections import deque from typing import List def office_party(n:int, ...
pythonsaga_data_PythonSaga_70
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate("Hello my Number is 12304589 and my friend's number is 987654321") == ['12304589', '987654321'] assert candidate("No numbers in this text") == [] assert candidate("123on456 789") == ['123', '456', '789'] ...
pythonsaga_data_PythonSaga_71
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate("IamStudyingInBdsfrom24hrs.") == "Iam Studying In Bds from: 24hrs." assert candidate("ThisIsMyFirstAssignmentof22ndBatch.") == "This Is My First Assignmentof: 22nd Batch." assert candidate("Iscored90Marksinfina...
pythonsaga_data_PythonSaga_72
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): text1 = "On 2023-01-15, we had a meeting. The financial report for the month was presented." expected1 = "On 15-01-2023, we had a meeting. The financial report for the month was presented." assert candidate(text1) == expected1 ...
pythonsaga_data_PythonSaga_73
METADATA = { 'author': 'ay', 'dataset': 'test' } def test(candidate): text1 = "Python PHP" expected_output1 = (False, []) assert candidate(text1) == expected_output1 text2 = "These exercises can be used for practice." expected_output2 = (True, [['These','exercises'], ['be', 'used']]) a...
pythonsaga_data_PythonSaga_74
METADATA = { 'author': 'ay', 'dataset': 'test' } def test(candidate): text1 = "For more details, visit https://www.example.com and http://test.com" expected_output1 = "https://www.example.com, http://test.com" assert candidate(text1) == expected_output1 text2 = "You can find us at https://www....
pythonsaga_data_PythonSaga_75
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate(['X', 'Y', 'Z', 'X', 'X', 'Z']) == {'X': 3, 'Z': 2, 'Y': 1} assert candidate(['A', 'A', 'A', 'A', 'A', 'A']) == {'A': 6} assert candidate(['Dog', 'Cat', 'Bird', 'Dog', 'Cat', 'Dog']) == {'Dog': 3, 'Cat': 2, 'Bird': 1} from co...
pythonsaga_data_PythonSaga_76
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate(3, [['insert', 1], ['insert', 4], ['display']]) == [[None, 1, 4]] assert candidate(5, [['insert', 10], ['insert', 20], ['insert', 30], ['search', 20]]) == [1] assert candidate(4, [['insert', 8], ['insert', 12], ['delete', 8], [...
pythonsaga_data_PythonSaga_77
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 11) == [(1, 10), (2, 9), (3, 8), (4, 7), (5, 6)] assert candidate([-1, 33, 2, -33, 99, 101, -2, 0], 0) == [(-33, 33), (-2, 2)] assert candidate([10, 20, -10, -20], 0) == [(-20, 20), (-10, 10)] ...
pythonsaga_data_PythonSaga_78
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate("xioyz", 2) == ['xioy', 'ioyz'] assert candidate("ixxi", 1) == ['ix', 'ixxi', 'xi'] assert candidate("abcde", 3) == [] from typing import List, Optional def balanced_substring(string:str, k:int) -> List[str]: """My teacher sa...
pythonsaga_data_PythonSaga_79
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate([1, 2, 1, 2]) == 1 assert candidate([2, 1, 3, 3, 2]) == 2 assert candidate([3, 3, 3, 3]) == 0 from typing import List def minTime(val: List[int]) -> int: """At each unit of time, we perform the following ...
pythonsaga_data_PythonSaga_80
METADATA = {'author': 'ay', 'dataset': 'test'} def check(candidate): assert candidate([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 11) == [10, None] assert candidate([11, 14, 23, 45, 56, 67, 78, 89, 90], 11) == [11, 14] assert candidate([1, 2, 8, 10, 10, 12, 19], 5) == [2, 8] assert candidate([2, 8, 10, 10, 12, 19...
pythonsaga_data_PythonSaga_81
METADATA = {'author': 'ay', 'dataset': 'test'} def check(candidate): assert candidate(4, [12, 34, 67, 90], 2) == 113 assert candidate(6, [10, 20, 30, 40, 50, 60], 3) == 90 assert candidate(5, [5, 10, 15, 20, 25], 2) == 45 assert candidate(3, [1, 2, 3], 1) == 6 from typing import List def chef(box:int...
pythonsaga_data_PythonSaga_82
METADATA = {'author': 'ay', 'dataset': 'test'} def check(candidate): assert candidate([1, 2, 3, 7, 5], 12) == [2, 4] assert candidate([10, 2, 3, 1, 7], 15) == [1, 3] assert candidate([1, 2, 3, 4, 5], 11) == [-1] from typing import List def stones(sizes: List[int], target: int) -> List[int]: """Imagin...
pythonsaga_data_PythonSaga_83
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate([3, 4, 1]) == 5 assert candidate([1, 2, 4, 3]) == 5 assert candidate([5, 2, 1, 6, 4, 3]) == 16 assert candidate([1, 2, 3, 4, 5]) == 5 from typing import List def ride(ages: List) -> int: """Imagine you ...
pythonsaga_data_PythonSaga_84
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate([1, 3, 2, 3, 1]) == 2 assert candidate([2, 4, 3, 5, 1]) == 3 assert candidate([5, 4, 3, 2, 1]) == 4 assert candidate([1, 2, 3, 4, 5]) == 0 from typing import List, Tuple def stupid_pair(nums: List) -> int:...
pythonsaga_data_PythonSaga_85
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate([1, 4, 7, 9, 11], [2, 4, 4, 7, 8, 11, 12]) == [[1, 2, 4, 4, 4, 7, 7, 8, 9, 11, 11, 12], [4, 7, 11], [1, 2, 8, 9, 12]] assert candidate([5, 8, 10, 12, 15], [2, 7, 10, 12, 14, 16]) == [[2, 5, 7, 8, 10, 10, 12, 12, 14,...
pythonsaga_data_PythonSaga_86
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate([3, 9, 1, 7, 22, 0, 1]) == [[0, 1, 1, 3, 7, 9, 22],[0, 1, 1, 3, 7, 9, 22]] assert candidate([5, 2, 8, 4, 1, 9, 3]) == [[1, 2, 3, 4, 5, 8, 9],[1, 2, 3, 4, 5, 8, 9] ] assert candidate([10, 7, 15, 3, 8, 12, 6]) == ...
pythonsaga_data_PythonSaga_87
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate(3, [[1, 2], [3, 4], [1, 5]]) == 6 assert candidate(2, [[1, 2], [2, 3]]) == 0 assert candidate(4, [[1, 2], [3, 4], [2, 3], [4, 5]]) == 0 assert candidate(1, [[1, 2], [2, 3], [5, 4], [4, 5]]) == 10 from typin...
pythonsaga_data_PythonSaga_88
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate(3, [[1000, 1030], [1004, 1130], [1130, 1200]]) == 2 assert candidate(4, [[900, 930], [930, 1000], [945, 1100], [1100, 1130]]) == 2 assert candidate(5, [[1000, 1030], [1030, 1100], [1045, 1130], [1115, 1200], [11...
pythonsaga_data_PythonSaga_89
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate([3, -1, -5, 2, 5, -9]) == 1350 assert candidate([-4, -5, -4]) == 20 assert candidate([2, -3, -2, 4, -1, -6, 1, 3]) == 864 assert candidate([1,-2,3,-4,0,5]) == 120 from typing import List def alloy(strength...
pythonsaga_data_PythonSaga_90
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate('acb') == 2 assert candidate('abc') == 1 assert candidate('string') == 598 assert candidate('cba') == 6 import math def rankOfPermutation(strg: str) -> int: """Take a string as input from user and prin...
pythonsaga_data_PythonSaga_91
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate(['A', 'B', 'D', 'E', 'F', 'G', 'A', 'B', 'E', 'F']) == 6 assert candidate(['B', 'B', 'B', 'A', 'C', 'B']) == 3 assert candidate(['A', 'A', 'B', 'B', 'C', 'C', 'D', 'E', 'F']) == 4 assert candidate(['A', 'B',...
pythonsaga_data_PythonSaga_92
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate(11, 3, 'zoomlazapzo', 'oza') == 'apzo' assert candidate(14, 3, 'timetopractice', 'toe') == 'eto' assert candidate(5, 2, 'abcbc', 'bc') == 'bc' assert candidate(13, 5, 'Itsgettinghot', 'thing') == 'tingh' de...
pythonsaga_data_PythonSaga_93
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate('b') == 5 assert candidate('aA0') == 3 assert candidate('aaaaAA12345') == 2 assert candidate('abcdefghijABCDEFGHIJ12345') == 5 def strong_pass(password: str) -> int: """A strong password meets following...
pythonsaga_data_PythonSaga_94
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate('banana') == 'ana' assert candidate('abcdcdbacd') == 'cd' assert candidate('abcdefg') == 'EMPTY' assert candidate('ababcabab') == 'abab' def overlap_substring(s: str) -> str: """Given a string s, find a...
pythonsaga_data_PythonSaga_95
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert set(candidate([11, 22, 33, 11, 11, 22, 11, 44])) == [33, 44] assert set(candidate([10, 11])) == [11, 10] assert set(candidate([1, 1, 2, 2, 3, 4, 4, 5])) == [3, 5] assert set(candidate([5, 5, 7, 7, 9, 9, 11, 11, 13, 13...
pythonsaga_data_PythonSaga_96
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate([4, 8, 12, 16]) == [8, 28] assert candidate([4, 8, 16, 2]) == [0, 24] assert candidate([7, 15, 22, 19]) == [18, 23] assert candidate([3, 5, 10, 15]) == [10, 15] from typing import List def find_max_and_or(...
pythonsaga_data_PythonSaga_97
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate(4) == 5 assert candidate(17) == 35 assert candidate(10) == 17 assert candidate(7) == 12 def set_bits(n:int) -> int: """Today in class we were taught that we can written any number in form of 0 and 1. ...
pythonsaga_data_PythonSaga_98
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate(10, 3) == 3 assert candidate(7, -3) == -2 assert candidate(-20, 4) == -5 assert candidate(15, 2) == 7 def quotient(dividend:int, divisor:int) -> int: """My teacher gave me divident and divisor and asked...
pythonsaga_data_PythonSaga_99
METADATA = { 'author': 'ay', 'dataset': 'test' } def check(candidate): assert candidate([1, 2, 3, 4]) == 6 assert candidate([4, 2, 3, 15]) == 5 from typing import List def good_subset(arr: List[int]) -> int: """I found one interesting question help me to solve this problem. I have a list of numbe...