id stringlengths 28 30 | content stringlengths 564 5.93k |
|---|---|
pythonsaga_data_PythonSaga_100 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate("Alice", 300000, 80000, 75000) == {'house tax': 6000, 'income tax': 8000, 'vehicle tax': 3750}
assert candidate("Bob", 450000, 120000, 60000) == {'house tax': 9000, 'income tax': 12000, 'vehicle tax': 3000}
ass... |
pythonsaga_data_PythonSaga_101 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate("(a+b)*c") == "Balanced"
assert candidate("(a+b)*c)") == "Not Balanced"
assert candidate("(a+b)c") == "Not Balanced"
assert candidate("(a+b)*[c-d]/{e+f}") == "Balanced"
from typing import List, Tuple, Dict,... |
pythonsaga_data_PythonSaga_102 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate([1, 2, 3, 4, 5, 6], [10, 20, 30]) == ([1, 2, 3, 4, 5, 6, 10, 20, 30], "Order 2 > Order 1")
assert candidate([5, 10, 15], [2, 7, 12]) == ([5, 10, 15, 2, 7, 12], "Order 1 > Order 2")
assert candidate([1, 2, 3], [4... |
pythonsaga_data_PythonSaga_103 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate("dog") == "Name of animal is dog, it belongs to mammal family and it barks."
assert candidate("cat") == "Name of animal is cat, it belongs to mammal family and it meows."
assert candidate("duck") == "Name of ani... |
pythonsaga_data_PythonSaga_104 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate([['N', 5], ['E', 3], ['S', 5], ['stop']]) == 3
assert candidate([['N', 5], ['N', 7], ['S', 5], ['stop']]) == 7
assert candidate([['E', 10], ['W', 5], ['N', 3], ['S', 3], ['stop']]) == 5
assert candidate([['E... |
pythonsaga_data_PythonSaga_105 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(3, [[1, 2, 4], [5, 9, 0], [3, 1, 7]]) == [[1, 5, 3], [2, 9, 1], [4, 0, 7]]
assert candidate(2, [[1, 2], [3, 4]]) == [[1, 3], [2, 4]]
assert candidate(4, [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15,... |
pythonsaga_data_PythonSaga_106 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(2, 2, [[1, 1], [1, 1]], [[1, 2], [3, 4]]) == 3
assert candidate(2, 2, [[1, 1], [1, 1]], [[1, 0], [0, -1]]) == -1
assert candidate(2, 3, [[1, 1, 1], [2, 2, 2]], [[2, 2, 2], [3, 3, 3]]) == 2
assert candidate(2... |
pythonsaga_data_PythonSaga_107 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(4, 5, [[1, 2, -1, -4, -20], [-8, -3, 4, 2, 1], [3, 8, 10, 1, 3], [-4, -1, 1, 7, -6]]) == 29
assert candidate(3, 3, [[-1, 2, -3], [4, -5, 6], [-7, 8, -9]]) == 5
assert candidate(2, 2, [[1, -2], [3, 4]]) == 7
... |
pythonsaga_data_PythonSaga_108 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(2, 3, [[3, 1, 6], [-9, 5, 7]]) == 4
assert candidate(2, 2, [[4, 2], [4, 5]]) == 2
assert candidate(3, 3, [[1, 2, 3], [6, 5, 4], [7, 8, 9]]) == 9
assert candidate(2, 2, [[-1, 6], [5, 3]]) == 2
from typing im... |
pythonsaga_data_PythonSaga_109 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(3, 3, [[1, -2, -3], [-2, -3, -3], [-3, -3, -2]]) == -1
assert candidate(2, 2, [[1, 2], [0, -4]]) == 0
assert candidate(2, 3, [[1, 2, 3], [4, 5, -6]]) == -1
assert candidate(3, 3, [[1, 1, 1], [1, -1, -2], [-1... |
pythonsaga_data_PythonSaga_110 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate([10, 10]) == True
assert candidate([1, 4, 3, 5]) == False
assert candidate([1, 2, 3, 6, 3, 2, 1]) == False
assert candidate([12, 9, 3, 6, 3, 2, 1]) == True
assert candidate([]) == True
from typing impor... |
pythonsaga_data_PythonSaga_111 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(10,[10, 10]) == [10,10]
assert candidate(2,[1, 4, 3, 5]) == [1,3]
assert candidate(3,[8, 5, 9, 2, 6, None, 10]) == [2,5]
assert candidate(1,[8, 5, 9, 2, 6, None, 10]) == [None,2]
from typing import List
de... |
pythonsaga_data_PythonSaga_112 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
# Test Case 1:
input_data1 = [3, 1, 5]
input_data2 = [4, 2, 6]
assert candidate(input_data1, input_data2) == [1, 2, 3, 4, 5, 6]
# Test Case 2:
input_data3 = [8, 2, 10, 1]
input_data4 = [5, 3, None, 0]
assert... |
pythonsaga_data_PythonSaga_113 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
input_data1 = [2, 1, 3]
assert candidate(input_data1) == True
input_data2 = [5, 1, 4, None, None, 3, 6]
assert candidate(input_data2) == False
input_data3 = [5, 1, 6, None, None, 5.5, 7]
assert candidate(input_data3... |
pythonsaga_data_PythonSaga_114 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate([5, 4, 5, 1, 1, 5, 5]) == 2
assert candidate([2, 4, 5, 4, 4, 5]) == 2
assert candidate([1, 1, 1, 1, 1, None, 1]) == 4
assert candidate([1, 2, 2, 2, 2, 3, 3, 2]) == 3
from typing import List
def longest_uni... |
pythonsaga_data_PythonSaga_115 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
input_data1 = [1, 3, 5, 4, 6, 13, 10, 9, 8, 15, 17]
assert candidate(input_data1) == [17, 15, 13, 9, 6, 5, 10, 4, 8, 3, 1]
input_data2 = [10, 5, 7, 2, 1, 8, 3, 6, 9, 4]
assert candidate(input_data2) == [10, 9, 8, 6, 4, 7, 3... |
pythonsaga_data_PythonSaga_116 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
# Test Case 1:
input_data1 = 4, [5, 4, 3, 7]
assert candidate(*input_data1) == 38
# Test Case 2:
input_data2 = 3, [1, 2, 3]
assert candidate(*input_data2) == 9
# Test Case 3:
input_data3 = 5, [10, 2, 8, 5,... |
pythonsaga_data_PythonSaga_117 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
# Test Case 1:
input_data1 = 'aaabc'
assert candidate(input_data1) == True
# Test Case 2:
input_data2 = 'aa'
assert candidate(input_data2) == False
# Test Case 3:
input_data3 = 'aabbccc'
assert candida... |
pythonsaga_data_PythonSaga_118 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
# Test Case 1:
input_data1 = 6, {'a': 5, 'b': 9, 'c': 12, 'd': 13, 'e': 16, 'f': 45}
assert candidate(*input_data1) == {'f': '0', 'c': '100', 'd': '101', 'a': '1100', 'b': '1101', 'e': '111'}
# Test Case 2:
input_data2... |
pythonsaga_data_PythonSaga_119 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
# Test Case 1:
input_data1 = 3, [[1, 3, 5, 7], [2, 4, 6, 8], [0, 9, 10, 11]]
assert candidate(*input_data1) == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
# Test Case 2:
input_data2 = 2, [[-1, 0, 2, 4], [3, 5, 6, 8]]
as... |
pythonsaga_data_PythonSaga_120 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
# Test Case 1:
input_words1 = ['hello', 'hell', 'hi', 'how', 'are', 'you', 'hero', 'hey']
input_word1 = 'he'
assert candidate(input_words1, input_word1) == ['hello', 'hell', 'hero', 'hey']
# Test Case 2:
input_word... |
pythonsaga_data_PythonSaga_121 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
# Test Case 1:
input_cities1 = ['Delhi', 'Mumbai', 'Chennai', 'Kolkata', 'Dehradun', 'Delhi']
assert candidate(input_cities1) == ['D', 'M', 'C', 'K', 'Deh', 'Delhi2']
# Test Case 2:
input_cities2 = ['Shimla', 'Safari',... |
pythonsaga_data_PythonSaga_122 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
# Test Case 1:
input_nums1 = [8, 1, 2, 12]
assert candidate(input_nums1) == 14
# Test Case 2:
input_nums2 = [1, 2, 3, 4]
assert candidate(input_nums2) == 7
# Test Case 3:
input_nums3 = [5, 10, 15, 20, 25]
... |
pythonsaga_data_PythonSaga_123 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
# Test Case 1:
input_words1 = ['code', 'edoc', 'da', 'd']
assert candidate(input_words1) == [['code', 'edoc'], ['da', 'd']]
# Test Case 2:
input_words2 = ['abcd', 'dcba', 'lls', 's', 'sssll']
assert candidate(input... |
pythonsaga_data_PythonSaga_124 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
# Test Case 1:
input_board1 = [['o','a','a','n'],['e','t','a','e'],['i','h','k','r'],['i','f','l','v']]
input_words1 = ['oath', 'pea', 'eat', 'rain']
assert candidate(4, 4, input_board1, input_words1) == ['oath', 'eat']
... |
pythonsaga_data_PythonSaga_125 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
# Test Case 1:
input_items1 = [[60, 10], [100, 20], [120, 30]]
input_capacity1 = 50
assert candidate(3, input_items1, input_capacity1) == 240
# Test Case 2:
input_items2 = [[60, -10], [100, 20]]
input_capacity2... |
pythonsaga_data_PythonSaga_126 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
# Test Case 1:
input_jobs1 = [[4, 20], [1, 10], [1, 40], [1, 30]]
assert candidate(4, input_jobs1) == [60, 2]
# Test Case 2:
input_jobs2 = [[2, 30], [3, 40], [4, 50], [5, 60]]
assert candidate(4, input_jobs2) == [1... |
pythonsaga_data_PythonSaga_127 | METADATA = {'author': 'ay', 'dataset': 'test'}
def check(candidate):
length1, width1 = 6, 4
cost1 = [[2, 1, 3, 1, 4], [4, 1, 2]]
assert candidate(length1, width1, cost1) == 42
length3, width3 = 4, 4
cost3 = [[1, 1, 1], [1, 1, 1]]
assert candidate(length3, width3, cost3) == 15
from typing impo... |
pythonsaga_data_PythonSaga_128 | METADATA = {'author': 'ay', 'dataset': 'test'}
def check(candidate):
# Test Case 1:
nums1, k1 = [5, 5, 3, 1], 5
assert candidate(nums1, k1) == 3
# Test Case 2:
nums2, k2 = [2, 4, 9], 3
assert candidate(nums2, k2) == 2
# Test Case 3:
nums3, k3 = [1, 2, 3, 4, 5], 3
assert candidate(... |
pythonsaga_data_PythonSaga_129 | METADATA = {'author': 'ay', 'dataset': 'test'}
def check(candidate):
# Test Case 1:
num1 = '313515'
assert candidate(num1) == '531135'
# Test Case 2:
num2 = '123'
assert candidate(num2) == 'not possible'
# Test Case 3:
num3 = '1223333'
assert candidate(num3) == '3321233'
# Te... |
pythonsaga_data_PythonSaga_130 | METADATA = {'author': 'ay', 'dataset': 'test'}
def check(candidate):
n1 = 4
maze1 = [[1, 0, 0, 0], [1, 1, 0, 1], [0, 1, 0, 1], [1, 1, 1, 1]]
assert candidate(n1, maze1) == [[1, 0, 0, 0], [1, 1, 0, 0], [0, 1, 0, 0], [0, 1, 1, 1]]
n2 = 3
maze2 = [[1, 0, 0], [1, 1, 1], [0, 0, 1]]
assert candidate(... |
pythonsaga_data_PythonSaga_131 | METADATA = {'author': 'ay', 'dataset': 'test'}
def check(candidate):
assert candidate('1234567', 4) == '7654321'
assert candidate('3435335', 3) == '5543333'
assert candidate('987654321', 5) == '987654321'
assert candidate('102233', 2) == '332210'
def big_number(num: str, swaps: int) -> str:
"""In ... |
pythonsaga_data_PythonSaga_132 | METADATA = {'author': 'ay', 'dataset': 'test'}
def check(candidate):
assert candidate(4, 3, 5, [[0, 1], [1, 2], [1, 3], [2, 3], [3, 0], [0, 2]]) == 1
assert candidate(3, 2, 3, [[0, 1], [1, 2], [2, 0]]) == 0
assert candidate(5, 3, 7, [[0, 1], [0, 2], [1, 2], [1, 3], [2, 4], [3, 4], [4, 0]]) == 1
assert ... |
pythonsaga_data_PythonSaga_133 | METADATA = {'author': 'ay', 'dataset': 'test'}
def check(candidate):
assert candidate('112358') == 'It is an additive number'
assert candidate('199100199') == 'It is an additive number'
assert candidate('123456') == 'It is not an additive number'
assert candidate('111222333') == 'It is an additive numb... |
pythonsaga_data_PythonSaga_134 | METADATA = {'author': 'ay', 'dataset': 'test'}
def check(candidate):
assert candidate(['send', 'more'], 'money') == True
assert candidate(['ox', 'ox'], 'xx') == False
assert candidate(['bat', 'tab'], 'bat') == False
assert candidate(['house', 'water'], 'money') == False
from typing import List
def so... |
pythonsaga_data_PythonSaga_135 | METADATA = {'author': 'ay', 'dataset': 'test'}
def check(candidate):
assert candidate('uSaisAI') == 'SaisAI'
assert candidate('xYz') == 'Not good'
assert candidate('aAbBcC') == 'aAbBcC'
assert candidate('AbCdEfG') == 'Not good'
def is_good(s: str) -> str:
"""I have a task to find whether a string ... |
pythonsaga_data_PythonSaga_136 | METADATA = {'author': 'ay', 'dataset': 'test'}
def check(candidate):
assert candidate(2, [3]) == 8
assert candidate(2, [1, 0]) == 1024
assert candidate(3, [2, 5]) == 1151
assert candidate(5, [1, 3, 7]) == 52
from typing import List
def power_mod(a: int, b: List[int]) -> int:
"""I have a very larg... |
pythonsaga_data_PythonSaga_137 | METADATA = {'author': 'ay', 'dataset': 'test'}
def check(candidate):
assert candidate([1, -5, 6, -2]) == 6
assert candidate([9, -4, 9]) == 18
assert candidate([5, -3, 5]) == 10
assert candidate([4, -1, 2, -1]) == 5
assert candidate([-2, 8, -3, 7, -1]) == 12
from typing import List
def max_sum(arr... |
pythonsaga_data_PythonSaga_138 | METADATA = {'author': 'ay', 'dataset': 'test'}
def check(candidate):
assert candidate(3, [-3, -2, -1, 0, 0, 1, 2, 3]) == [1, 2, -3]
assert candidate(2, [0, 0, 0, 0]) == [0, 0]
assert candidate(2, [-1, 0, -1, 0]) == [0, -1]
from typing import List
def recover_list(n: int, sums: List[int]) -> List[int]:
... |
pythonsaga_data_PythonSaga_139 | METADATA = {'author': 'ay', 'dataset': 'test'}
def check(candidate):
assert candidate([-2, 5, -1], -2, 2) == 3
assert candidate([1, 2, 3], 0, 5) == 5
assert candidate([3, 2, 1, 5], 1, 6) == 8
from typing import List
def being_sum(being: List[int], lower: int, upper: int) -> int:
"""I have a list 'bei... |
pythonsaga_data_PythonSaga_140 | METADATA = {'author': 'ay', 'dataset': 'test'}
def check(candidate):
assert candidate(4, 2) == 6
assert candidate(3, 2) == 3
assert candidate(6, 3) == 20
assert candidate(8, 4) == 70
def nCr(n: int, r: int) -> int:
"""I'm very much interested in mathematical problems, and today I learned nCr.
... |
pythonsaga_data_PythonSaga_141 | METADATA = {'author': 'ay', 'dataset': 'test'}
def check(candidate):
assert candidate(2, 10) == 4
assert candidate(1, 2) == 2
assert candidate(3, 15) == 5
assert candidate(5, 25) == 5
def bouncing_balls(n: int, h: int) -> int:
"""I have to test my bouncing ball, but there's a catch.
The ball ... |
pythonsaga_data_PythonSaga_142 | METADATA = {'author': 'ay', 'dataset': 'test'}
def check(candidate):
assert candidate(4) == 5
assert candidate(10) == 89
assert candidate(8) == 34
assert candidate(2) == 2
def zebra_crossing(n: int) -> int:
"""I'm waiting for a bus, and now I'm getting bored. To entertain myself, I looked around a... |
pythonsaga_data_PythonSaga_143 | METADATA = {'author': 'ay', 'dataset': 'test'}
def check(candidate):
assert candidate('327') == 2
assert candidate('094') == 0
assert candidate('111') == 2
def count_ways(number: str) -> int:
"""I wrote down a string of positive integers named 'number' but forgot to include commas to separate the numb... |
pythonsaga_data_PythonSaga_144 | def check(candidate):
assert candidate(15, 13, 11, [8, 3, 16, 6, 12, 20]) == -1
assert candidate(16, 9, 7, [1, 6, 2, 14, 5, 17, 4]) == 2
assert candidate(3, 15, 9, [14,4,18,1,15]) == 3
from typing import List
def treasureHunt(a: int, b: int, x: int, forbidden: List[int]) -> int:
"""I'm playing a game o... |
pythonsaga_data_PythonSaga_145 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(5, [[1, 2, 3], [], [4], [], []]) == [0, 1, 2, 3, 4]
assert candidate(3, [[1, 2], [], []]) == [0, 1, 2]
assert candidate(6, [[1, 2], [3, 5], [4], [], [], []]) == [0, 1, 2, 3, 5, 4]
assert candidate(4, [[1, 2]... |
pythonsaga_data_PythonSaga_146 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(6, [4, 5], [1, 1]) == 3
assert candidate(8, [2, 2], [7, 7]) == 4
assert candidate(5, [0, 0], [4, 4]) == 4
assert candidate(4, [1, 1], [3, 3]) == 4
from collections import deque
from typing import List
def... |
pythonsaga_data_PythonSaga_147 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(5, 5, [[0, 1], [1, 4], [4, 2], [2, 3], [3, 4]]) == [1, 4]
assert candidate(5, 4, [[0, 1], [1, 4], [4, 2], [2, 3]]) == [1, 4, 2]
assert candidate(5, 5, [[0, 1], [1, 2], [0, 2], [2, 3], [3, 4]]) == [2, 3]
from ty... |
pythonsaga_data_PythonSaga_148 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(5, 5, [[1,0],[0,2],[2,1],[0,3],[3,4]]) == [[0,1,2] ,[3] ,[4]]
assert candidate(3, 3, [[0,1],[1,2],[2,0]]) == [[0,1,2]]
assert candidate(9, 17, [[0,2],[0,1],[1,0],[1,3],[2,0],[2,3],[3,4],[4,3],[5,1],[5,4],[5,7],[... |
pythonsaga_data_PythonSaga_149 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(5, 5, [['X', '0', 'X', '0', '0'],
['X', '0', '0', '0', 'X'],
['X', 'X', 'X', 'X', 'X'],
['0', 'D', 'X', '0', '0'],
... |
pythonsaga_data_PythonSaga_150 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate([[1, 1, 3], [2, 1, 4], [1, 2, 3], [2, 1, 3], [3]]) == [False, True]
assert candidate([[1, 1, 2], [1, 3, 4], [2, 1, 4], [2, 2, 3], [3]]) == [False, False]
assert candidate([[1, 1, 2], [1, 3, 4], [2, 1, 4], [1, 2,... |
pythonsaga_data_PythonSaga_151 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(5, [[1, 3], [3, 0], [0, 2], [2, 4], [4, 0]]) == True
assert candidate(4, [[0, 1], [1, 2], [2, 3], [3, 0]]) == True
assert candidate(3, [[0, 1], [1, 2]]) == False
assert candidate(6, [[0, 1], [1, 2], [2, 3], ... |
pythonsaga_data_PythonSaga_152 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(3, [1, 2, 2], [[1, 2, 1], [2, 3, 1]]) == 3
assert candidate(4, [2, 3, 1, 4], [[1, 2, 2], [2, 3, 3], [3, 4, 4]]) == 9
assert candidate(5, [1, 2, 3, 4, 5], [[1, 2, 1], [3, 4, 2], [4, 5, 3], [2, 3, 1]]) == 8
as... |
pythonsaga_data_PythonSaga_153 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate([[1, 2], [2, 3], [2, 4], [2, 5]]) == 4
assert candidate([[1, 2], [2, 3], [3, 1]]) == -1
assert candidate([[1, 2], [2, 3], [3, 4], [3, 5], [6, 7], [7, 8], [7, 9], [7, 10]]) == 7
from typing import List
def gang_... |
pythonsaga_data_PythonSaga_154 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(2, 1, [[1, 2]]) == [0]
assert candidate(4, 2, [[1, 2], [2, 4]]) == [0, 2]
assert candidate(5, 3, [[1, 2], [3, 4], [4, 5]]) == [0, 0, 1]
assert candidate(6, 4, [[1, 2], [3, 4], [2, 5], [6, 1]]) == [0, 0, 1, 2... |
pythonsaga_data_PythonSaga_155 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(4, [[0, 16, 13, 0, 0, 0], [0, 0, 10, 12, 0, 0], [0, 4, 0, 0, 14, 0], [0, 0, 9, 0, 0, 20], [0, 0, 0, 7, 0, 4], [0, 0, 0, 0, 0, 0]]) == 23
from typing import List
def water_plant(cities: int, connections: List[List[int]]... |
pythonsaga_data_PythonSaga_156 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(4, [[0, 12, 14, 0, 0, 0], [12, 0, 1, 0, 0, 0], [14, 1, 0, 20, 10, 0], [0, 0, 20, 0, 0, 5], [0, 0, 10, 0, 0, 15], [0, 0, 0, 5, 15, 0]]) == 10
from typing import List
def truck_load(cities: int, connections: List[List[in... |
pythonsaga_data_PythonSaga_157 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(2, [[0, 3, 2, 0], [0, 0, 5, 2], [0, 0, 0, 3], [0, 0, 0, 0]]) == 5
import sys
from typing import List
def parcel(cities: int, route: List[List[int]]) -> int:
"""I have to courier the parcel from my home to my colle... |
pythonsaga_data_PythonSaga_158 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(4, [[0, 7, 7, 0, 0, 0], [0, 0, 0, 2, 7, 0], [0, 2, 0, 0, 5, 0], [0, 0, 0, 0, 0, 6], [0, 0, 0, 4, 0, 8], [0, 0, 0, 0, 0, 0]]) == 7
from collections import deque
from typing import List
def blood_flow(organ: int, blood_... |
pythonsaga_data_PythonSaga_159 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(4, [[0, 7, 7, 0, 0, 0], [0, 0, 0, 2, 7, 0], [0, 2, 0, 0, 5, 0], [0, 0, 0, 0, 0, 6], [0, 0, 0, 4, 0, 8], [0, 0, 0, 0, 0, 0]]) == 7
from collections import defaultdict
from typing import List
def data_transfer(routers:... |
pythonsaga_data_PythonSaga_160 | METADATA = {'author': 'ay','dataset': 'test'}
def check(candidate):
user_input_1 = 10
output_1 = candidate(user_input_1)
assert output_1 == '100 divided by 10 is 10.00'
user_input_2 = 3
output_2 = candidate(user_input_2)
assert output_2 == '100 divided by 3 is 33.33'
user_input_3 = 7
o... |
pythonsaga_data_PythonSaga_161 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(10, 5) == [['50', 'True'], ['2', 'True'], ['100000', 'True']]
assert candidate(8, 2) == [['16', 'True'], ['4', 'True'], ['64', 'True']]
assert candidate(15, 3) == [['45', 'True'], ['5', 'True'], ['3375', 'True']... |
pythonsaga_data_PythonSaga_162 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(["HS 01 1234", "06 1234", "AB 01 1134", "01 1234", "XX 11 1234"]) == ['Hind 01 1134', 'Hind 01 1234', 'Hind 01 1234', 'Hind 06 1234', 'Hind 11 1234']
assert candidate(["AB 12 3456", "XX 09 8765", "HS 05 4321", "03 5... |
pythonsaga_data_PythonSaga_163 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate([['amit', 'yadav', 23, 'm'], ['amit', 'jain', 12, 'm'], ['ankita', 'did', 23, 'f']]) == ['Mr. amit jain', 'Mr. amit yadav', 'Ms. ankita did']
assert candidate([['john', 'doe', 30, 'm'], ['jane', 'smith', 25, 'f'], [... |
pythonsaga_data_PythonSaga_164 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(3, 3, [[1, 3, 1], [1, 5, 1], [4, 2, 1]]) == 7
assert candidate(2, 3, [[1, 2, 3], [4, 5, 6]]) == 12
assert candidate(3, 3, [[5, 2, 7], [8, 1, 9], [4, 3, 6]]) == 17
assert candidate(3, 3, [[1, 1, 1], [1, 1, 1]... |
pythonsaga_data_PythonSaga_165 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(2, [[1, 10], [3, 5]]) == [18, 0]
assert candidate(3, [[2, 8], [5, 15], [1, 5]]) == [9, 27, 3]
assert candidate(1, [[3, 9]]) == [15]
assert candidate(4, [[1, 5], [6, 10], [11, 15], [16, 20]]) == [3, 9, 27,... |
pythonsaga_data_PythonSaga_166 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(3, [3, 4, 5]) == [
[[3, 4, 5], [6, 7, 8], [9, 10, 11]],
[[4, 5, 6], [7, 8, 9], [10, 11, 12]],
[[5, 6, 7], [8, 9, 10], [11, 12, 13]],
[[114, 126, 138], [156, 174, 192], [198, 222, 246]]
... |
pythonsaga_data_PythonSaga_167 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(2, 1000) == ['Time taken by concurrently_done is True', 'Time taken by parallel_done is True']
assert candidate(3, 500) == ['Time taken by concurrently_done is True', 'Time taken by parallel_done is True']
asser... |
pythonsaga_data_PythonSaga_168 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(4, [3, 5, 2, 4]) == ["Executing Task C...", "Executing Task A...", "Executing Task D...", "Executing Task B...", True]
assert candidate(3, [2, 4, 1]) == ["Executing Task C...", "Executing Task A...", "Executing Task... |
pythonsaga_data_PythonSaga_169 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(4, [1000000, 500000, 750000, 200000]) == [
"Performing Task A...",
"Performing Task B...",
"Performing Task C...",
"Performing Task D...",
"Done",
"Done",
"Done",
... |
pythonsaga_data_PythonSaga_170 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate([[1, -3, 0, 2], [2, 0, 1]]) == ['x^3 - 3x^2 + 2', '2x^2 + 1', 'x^3 - x^2 + 3', 'x^3 - 5x^2-1']
assert candidate([[1, 2, 3], [3, 2, 1]]) == ['x^2 + 2x + 3', '3x^2 + 2x + 1', '4x^2 + 4x + 4', '-2x^2 +2']
assert ca... |
pythonsaga_data_PythonSaga_171 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(["John", "1234", "10000", "Manager"]) == "My name is John, My id number is 1234, My salary is 10000 and my position is Manager."
assert candidate(["Ram", "12223", "20000", "CEO"]) == "My name is Ram, My id number is... |
pythonsaga_data_PythonSaga_172 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate("sedan") == "Welcome to car catalog, here you can find all the cars you need. This is a sedan car with 4 doors and 5 seats, usage is for family."
assert candidate("suv") == "Welcome to car catalog, here you can fin... |
pythonsaga_data_PythonSaga_173 | def check(candidate):
assert candidate(["John", "1000", "Deposit", "500", "Withdraw", "200", "Balance", "Exit"]) == ["Your current balance is 1300"]
assert candidate(["Alice", "1500", "Deposit", "300", "Balance", "Withdraw", "200", "Exit"]) == ["Your current balance is 1800", "Your current balance is 1600"]
... |
pythonsaga_data_PythonSaga_174 | METADATA = {'author': 'ay', 'dataset': 'test'}
def check(candidate):
assert candidate(['IIT', '100000', 'material addition', 'cement', '100', 'material addition', 'bricks', '1000', 'material addition', 'sand', '500', 'worker addition', 'John', '1', 'worker addition', 'Mike', '2', 'worker addition', 'Mary', '3', 's... |
pythonsaga_data_PythonSaga_175 | METADATA = {'author': 'ay', 'dataset': 'test'}
def check(candidate):
assert candidate("Hello i'm in context manager") == ["init method called", "enter method called", "Hello i'm in context manager", "exit method called"]
from typing import List
def input_for_cont1(data:str)->List[str]:
"""I want to create dum... |
pythonsaga_data_PythonSaga_176 | METADATA = {'author': 'ay', 'dataset': 'test'}
def check(candidate):
assert candidate("1,42,42") == "0.0238095238095238095238095238095238095238095"
assert candidate("3,7,9") == "0.428571429"
assert candidate("3,7,9") == "0.428571428571428571428571428571429"
from decimal import Decimal, getcontext
def inpu... |
pythonsaga_data_PythonSaga_177 | METADATA = {'author': 'ay', 'dataset': 'test'}
def check(candidate):
assert candidate("1,42,42") == "0.0238095238095238095238095238095238095238095"
assert candidate("3,7,9") == "0.428571429"
assert candidate("3,7,9") == "0.428571428571428571428571428571429"
from decimal import Decimal, getcontext
def inpu... |
pythonsaga_data_PythonSaga_178 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate(2,5) == "0.4"
assert candidate(2,0) == "integer division or modulo by zero"
assert candidate(1,5) == "0.2"
assert candidate(11,0) == "integer division or modulo by zero"
def divide(x:int, y:int) -> str:
... |
pythonsaga_data_PythonSaga_179 | METADATA = {
'author': 'ay',
'dataset': 'test'
}
def check(candidate):
assert candidate("This is a dummy file.", "This is a dummy file2.") == "I/O operation on closed file."
def write_file(first:str, second:str) -> str:
"""I have a file named dummy.txt. I want to write some text in it i.e. "This is a ... |
pythonsaga_data_PythonSaga_180 | METADATA = {'author': 'ay', 'dataset': 'test'}
def check(candidate):
assert candidate(3,5) == 1
assert candidate(4,20) == 4
assert candidate(6,15) == 3
assert candidate(26,39) == 13
def max_capacity(n:int, m:int) -> int:
"""I have 2 pack of floor of n and m kgs. I have to purchase a scope of such... |
pythonsaga_data_PythonSaga_181 | METADATA = {'author': 'ay', 'dataset': 'test'}
def check(candidate):
assert candidate(23, 11, 9, 12) == 2
assert candidate(17, 10, 11, 3) == 3
assert candidate(18, 11, 9, 3) == 6
assert candidate(21, 11, 9, 2) == 7
def max_stencils(n:int, a:int, b:int, c:int) -> int:
"""I have a wall of length n, ... |
pythonsaga_data_PythonSaga_182 | METADATA = {'author': 'ay', 'dataset': 'test'}
def check(candidate):
assert candidate(14, 2) == 13
assert candidate(7, 3) == 4
assert candidate(10, 2) == 5
assert candidate(11, 5) == 8
def round_chairs(n:int, k:int) -> int:
"""I am playing a game of round chairs with my friends. Where n chairs are... |
pythonsaga_data_PythonSaga_183 | METADATA = {'author': 'ay', 'dataset': 'test'}
def check(candidate):
assert candidate([2,3,4]) == ['adg', 'adh', 'adi', 'aeg', 'aeh', 'aei', 'afg', 'afh', 'afi', 'bdg', 'bdh', 'bdi', 'beg', 'beh', 'bei', 'bfg', 'bfh', 'bfi', 'cdg', 'cdh', 'cdi', 'ceg', 'ceh', 'cei', 'cfg', 'cfh', 'cfi']
assert candidate([1]) =... |
pythonsaga_data_PythonSaga_184 | METADATA = {'author': 'ay', 'dataset': 'test'}
def check(candidate):
assert candidate('aa', 'a+') == True
assert candidate('aa','a') == False
assert candidate('aab', '-a-') == True
assert candidate('aab', '-a') == False
def match_ptr(s:str, ptr:str) -> bool:
"""Given an string s and a pattern ptr,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.