Dataset Viewer
Auto-converted to Parquet
task_id
int64
text
string
code
string
test_list
list
test_setup_code
string
challenge_test_list
list
context
string
context_id
string
context_length_tokens
int64
code_length_chars
int64
89
Write a function to find the closest smaller number than n.
def closest_num(N): return (N - 1)
[ "assert closest_num(11) == 10", "assert closest_num(7) == 6", "assert closest_num(12) == 11" ]
[]
Bill went to the kitchen. Jeff went back to the bedroom. Fred went back to the hallway. Fred journeyed to the garden. Bill travelled to the bedroom. Fred picked up the milk there. Fred went to the office. Jeff went back to the hallway. Jeff travelled to the kitchen. Bill went back to the kitchen. Fred journeyed to the hallway. Bill moved to the hallway. Jeff travelled to the bedroom. Jeff journeyed to the bathroom. Fred gave the milk to Mary. Mary handed the milk to Fred. Bill moved to the kitchen. Fred gave the milk to Mary. Mary passed the milk to Fred. Bill went back to the bathroom. Fred gave the milk to Mary. Jeff journeyed to the hallway. Mary gave the milk to Fred. Fred dropped the milk.
babilong_0k_qa5_sample_84
160
37
62
Write a python function to find smallest number in a list.
def smallest_num(xs): return min(xs)
[ "assert smallest_num([10, 20, 1, 45, 99]) == 1", "assert smallest_num([1, 2, 3]) == 1", "assert smallest_num([45, 46, 50, 60]) == 45" ]
[]
Sandra went to the garden. Daniel picked up the milk. John moved to the garden. Daniel discarded the milk. Mary grabbed the milk there. Mary journeyed to the garden. Sandra journeyed to the hallway. Mary put down the milk. John grabbed the milk. John went back to the bathroom. Sandra journeyed to the bathroom. John travelled to the bedroom. John travelled to the kitchen. John went back to the bedroom. Sandra travelled to the garden. John took the apple. Sandra journeyed to the hallway. Daniel went back to the kitchen. Daniel went back to the hallway. John put down the milk.
babilong_0k_qa3_sample_71
127
39
502
Write a python function to find remainder of two numbers.
def find(n,m): r = n%m return (r)
[ "assert find(3,3) == 0", "assert find(10,3) == 1", "assert find(16,5) == 1" ]
[]
The office is east of the kitchen. The bedroom is west of the kitchen.
babilong_0k_qa4_sample_57
17
39
105
Write a python function to count true booleans in the given list.
def count(lst): return sum(lst)
[ "assert count([True,False,True]) == 2", "assert count([False,False]) == 0", "assert count([True,True,True]) == 3" ]
[]
Daniel moved to the office. Daniel travelled to the bedroom. John took the milk there. John travelled to the garden.
babilong_0k_qa2_sample_7
25
40
435
Write a python function to find the last digit of a given number.
def last_Digit(n) : return (n % 10)
[ "assert last_Digit(123) == 3", "assert last_Digit(25) == 5", "assert last_Digit(30) == 0" ]
[]
The bathroom is north of the garden. The bathroom is south of the bedroom.
babilong_0k_qa4_sample_96
17
41
35
Write a function to find the n-th rectangular number.
def find_rect_num(n): return n*(n + 1)
[ "assert find_rect_num(4) == 20", "assert find_rect_num(5) == 30", "assert find_rect_num(6) == 42" ]
[]
Mary picked up the football there. Mary dropped the football. Sandra journeyed to the hallway. Mary moved to the bathroom. Daniel travelled to the kitchen. Sandra journeyed to the bedroom. Daniel went back to the office. Sandra picked up the apple there. John moved to the garden. Sandra moved to the kitchen. Mary moved to the hallway. Sandra travelled to the office.
babilong_0k_qa2_sample_82
77
42
77
Write a python function to find the difference between sum of even and odd digits.
def is_Diff(n): return (n % 11 == 0)
[ "assert is_Diff (12345) == False", "assert is_Diff(1212112) == True", "assert is_Diff(1212) == False" ]
[]
Sandra took the apple there. Mary travelled to the garden. John took the milk. John discarded the milk there. Mary moved to the bathroom. Daniel travelled to the bathroom. John picked up the football. Mary went to the office. Daniel went to the office. John took the milk. Sandra discarded the apple there. John left the milk. Daniel took the milk. Sandra went to the kitchen. John left the football. Mary got the football. Sandra moved to the office. Sandra went back to the garden. Mary went back to the bathroom. John went to the kitchen. Daniel dropped the milk. Mary moved to the garden. Daniel grabbed the milk. Sandra travelled to the kitchen. Mary dropped the football. Mary took the football. Mary journeyed to the hallway. Mary discarded the football there. Mary went back to the kitchen. Sandra journeyed to the garden. Sandra moved to the hallway. John went to the bathroom. Mary journeyed to the garden. Sandra took the apple. Sandra grabbed the football. Daniel went back to the bathroom. Sandra went to the bedroom. Sandra moved to the kitchen. Daniel travelled to the hallway. Sandra moved to the hallway. John moved to the bedroom. Daniel went to the office. Sandra travelled to the bedroom. Daniel travelled to the garden. John went to the garden. Daniel journeyed to the hallway. Mary went to the bedroom. Sandra put down the apple. Sandra put down the football there. John went to the kitchen.
babilong_0k_qa3_sample_83
299
43
135
Write a function to find the nth hexagonal number.
def hexagonal_num(n): return n*(2*n - 1)
[ "assert hexagonal_num(10) == 190", "assert hexagonal_num(5) == 45", "assert hexagonal_num(7) == 91" ]
[]
Fred went to the bathroom. Jeff journeyed to the office. Fred travelled to the garden. Jeff travelled to the bathroom. Jeff got the football there. Mary moved to the kitchen. Fred travelled to the bedroom. Bill travelled to the bathroom. Jeff gave the football to Bill. Fred got the apple there. Bill gave the football to Jeff. Jeff travelled to the garden. Bill moved to the garden. Bill journeyed to the kitchen.
babilong_0k_qa5_sample_92
89
44
269
Write a function to find the ascii value of a character.
def ascii_value(k): ch=k return ord(ch)
[ "assert ascii_value('A')==65", "assert ascii_value('R')==82", "assert ascii_value('S')==83" ]
[]
Fred picked up the football there. Fred gave the football to Jeff. Bill went back to the bathroom. Jeff grabbed the milk there. Jeff gave the football to Fred. Fred handed the football to Jeff. Jeff handed the football to Fred. Fred gave the football to Jeff.
babilong_0k_qa5_sample_0
56
45
292
Write a python function to find quotient of two numbers.
def find(n,m): q = n//m return (q)
[ "assert find(10,3) == 3", "assert find(4,2) == 2", "assert find(20,5) == 4" ]
[]
Bill moved to the garden. Jeff took the football there. Mary journeyed to the bedroom. Fred journeyed to the garden. Fred journeyed to the hallway. Fred moved to the garden. Fred grabbed the apple there. Fred gave the apple to Bill. Bill passed the apple to Fred. Fred gave the apple to Bill. Mary moved to the office. Bill discarded the apple.
babilong_0k_qa5_sample_17
78
47
477
Write a python function to convert the given string to lower case.
def is_lower(string): return (string.lower())
[ "assert is_lower(\"InValid\") == \"invalid\"", "assert is_lower(\"TruE\") == \"true\"", "assert is_lower(\"SenTenCE\") == \"sentence\"" ]
[]
Daniel journeyed to the office. John took the football there. John discarded the football. John travelled to the garden. Daniel travelled to the garden. Sandra went to the garden. Daniel travelled to the kitchen. Daniel moved to the office. Mary grabbed the milk there. Daniel journeyed to the bedroom. John travelled to the office. Daniel travelled to the bathroom. John travelled to the kitchen. Mary travelled to the garden. Mary dropped the milk. John went back to the garden. Sandra got the milk there. Sandra put down the milk. Mary went back to the bathroom. Mary travelled to the bedroom.
babilong_0k_qa2_sample_1
123
48
59
Write a function to find the nth octagonal number.
def is_octagonal(n): return 3 * n * n - 2 * n
[ "assert is_octagonal(5) == 65", "assert is_octagonal(10) == 280", "assert is_octagonal(15) == 645" ]
[]
John went to the bathroom. Daniel travelled to the kitchen. John journeyed to the kitchen. Daniel journeyed to the hallway. Sandra travelled to the kitchen. Mary moved to the office. Daniel went back to the office. Sandra went back to the bathroom. John grabbed the milk there. John grabbed the apple there. Sandra journeyed to the office. Mary went to the hallway. John went to the bathroom. John discarded the apple. John put down the milk. John picked up the apple there. Daniel went back to the bathroom. John took the milk there. Daniel travelled to the garden. Sandra journeyed to the bathroom. John travelled to the kitchen. Mary went back to the office.
babilong_0k_qa2_sample_6
141
49
201
Write a python function to check whether the elements in a list are same or not.
def chkList(lst): return len(set(lst)) == 1
[ "assert chkList(['one','one','one']) == True", "assert chkList(['one','Two','Three']) == False", "assert chkList(['bigdata','python','Django']) == False" ]
[]
John moved to the kitchen. Daniel picked up the football. John journeyed to the garden. Mary moved to the bedroom. Mary went back to the garden. Sandra travelled to the hallway. Daniel left the football. Daniel took the football there. Sandra got the apple. John moved to the bedroom. Sandra took the milk. John moved to the kitchen. John went back to the office. Daniel journeyed to the garden. Mary travelled to the hallway. John went to the hallway. Daniel dropped the football. Mary went back to the kitchen. Mary moved to the garden. Sandra discarded the milk there. Mary took the football there. Sandra put down the apple. John journeyed to the garden. Sandra went back to the bathroom. John travelled to the bedroom. Mary dropped the football. Daniel got the football. Mary moved to the hallway. Mary journeyed to the bathroom. John went back to the hallway. Daniel dropped the football there. Sandra moved to the kitchen. Daniel travelled to the hallway. Daniel took the milk. Mary travelled to the kitchen. Daniel put down the milk. Daniel went back to the office. Daniel went to the garden. Sandra journeyed to the office. John grabbed the milk there. Daniel travelled to the office. John took the apple. Daniel moved to the hallway. John journeyed to the garden. Daniel went back to the kitchen. John moved to the bathroom. Daniel travelled to the garden. Daniel travelled to the hallway. John went back to the kitchen. John put down the apple. Mary journeyed to the office. John moved to the office. Daniel went back to the garden. John discarded the milk. John took the milk. Sandra moved to the bathroom. Daniel grabbed the football there. Daniel discarded the football there. John discarded the milk. Mary took the milk. Mary left the milk. Mary took the milk. Mary travelled to the hallway. Mary dropped the milk. Daniel went back to the bathroom. Mary grabbed the milk. John moved to the bathroom. Mary went to the bedroom. Mary put down the milk. Sandra went to the garden. John moved to the garden. Daniel went to the hallway. Mary took the milk there. Mary dropped the milk. Mary moved to the office. Sandra took the football. John travelled to the hallway. Sandra dropped the football. Sandra picked up the football there. Daniel went back to the bathroom. Sandra journeyed to the bathroom. Sandra put down the football. Sandra picked up the football. Mary went to the hallway. Sandra dropped the football. Sandra went to the bedroom. Sandra moved to the garden. John went back to the office. John moved to the hallway. John went back to the bathroom. John moved to the office. Daniel picked up the football there. Daniel dropped the football. John journeyed to the bathroom. John took the football. John dropped the football. Daniel got the football. Daniel travelled to the office. Sandra journeyed to the kitchen. Daniel journeyed to the bedroom.
babilong_0k_qa3_sample_46
603
49
458
Write a function to find the area of a rectangle.
def rectangle_area(l,b): area=l*b return area
[ "assert rectangle_area(10,20)==200", "assert rectangle_area(10,5)==50", "assert rectangle_area(4,2)==8" ]
[]
Bill went to the garden. Bill picked up the apple there. Mary travelled to the bedroom. Mary went to the bathroom. Bill dropped the apple. Fred moved to the hallway. Bill took the apple there. Bill put down the apple. Mary journeyed to the hallway. Jeff journeyed to the bathroom. Bill took the apple there. Fred moved to the garden. Mary went back to the office. Bill handed the apple to Fred.
babilong_0k_qa5_sample_91
89
51
267
Write a python function to find the sum of squares of first n odd natural numbers.
def square_Sum(n): return int(n*(4*n*n-1)/3)
[ "assert square_Sum(2) == 10", "assert square_Sum(3) == 35", "assert square_Sum(4) == 84" ]
[]
John moved to the office. Sandra journeyed to the hallway. John went back to the bathroom. Daniel went back to the hallway. Daniel moved to the kitchen. Mary journeyed to the bathroom. John journeyed to the office. Sandra went to the garden. Sandra grabbed the milk there. John went to the hallway. Mary took the apple there. Mary left the apple. Sandra put down the milk. Daniel journeyed to the garden. Daniel got the milk there. Mary went back to the hallway. Mary went back to the bedroom. Sandra moved to the bedroom. John travelled to the bathroom. John grabbed the apple there. Daniel moved to the bedroom. Mary picked up the football there. Mary went to the garden. John travelled to the kitchen. Sandra journeyed to the office. Mary moved to the kitchen.
babilong_0k_qa2_sample_76
166
52
58
Write a python function to check whether the given two integers have opposite sign or not.
def opposite_Signs(x,y): return ((x ^ y) < 0);
[ "assert opposite_Signs(1,-2) == True", "assert opposite_Signs(3,2) == False", "assert opposite_Signs(-10,-10) == False" ]
[]
Mary picked up the apple. John went to the garden. Sandra travelled to the office. Sandra took the milk. John went to the bedroom. Sandra went to the kitchen. John journeyed to the office. Mary left the apple. Mary travelled to the office. Sandra went to the office. Daniel went to the hallway. Sandra discarded the milk.
babilong_0k_qa3_sample_15
71
53
279
Write a function to find the nth decagonal number.
def is_num_decagonal(n): return 4 * n * n - 3 * n
[ "assert is_num_decagonal(3) == 27", "assert is_num_decagonal(7) == 175", "assert is_num_decagonal(10) == 370" ]
[]
Bill moved to the garden. Mary travelled to the bathroom. Fred moved to the bedroom. Mary took the milk there. Mary passed the milk to Jeff. Jeff passed the milk to Mary. Mary moved to the office. Mary put down the milk.
babilong_0k_qa5_sample_82
51
53
356
Write a function to find the third angle of a triangle using two angles.
def find_angle(a,b): c = 180 - (a + b) return c
[ "assert find_angle(47,89)==44", "assert find_angle(45,95)==40", "assert find_angle(50,40)==90" ]
[]
Daniel journeyed to the kitchen. Daniel journeyed to the office.
babilong_0k_qa1_sample_17
15
53
268
Write a function to find the n'th star number.
def find_star_num(n): return (6 * n * (n - 1) + 1)
[ "assert find_star_num(3) == 37", "assert find_star_num(4) == 73", "assert find_star_num(5) == 121" ]
[]
Fred picked up the football there. Jeff travelled to the hallway. Bill went back to the kitchen. Bill went to the hallway. Fred travelled to the garden. Fred grabbed the milk there. Bill travelled to the office. Fred put down the milk there. Fred put down the football. Bill journeyed to the hallway. Fred journeyed to the kitchen. Jeff travelled to the garden. Jeff picked up the milk there. Mary went back to the office. Mary moved to the kitchen. Jeff grabbed the football there. Bill travelled to the garden. Fred went to the office. Fred went to the kitchen. Jeff dropped the milk. Jeff picked up the milk there. Jeff went to the bedroom. Jeff left the football. Jeff dropped the milk. Jeff grabbed the milk there. Jeff journeyed to the kitchen. Jeff passed the milk to Mary. Mary passed the milk to Fred. Fred discarded the milk. Jeff got the milk there.
babilong_0k_qa5_sample_3
188
54
354
Write a function to find t-nth term of arithemetic progression.
def tn_ap(a,n,d): tn = a + (n - 1) * d return tn
[ "assert tn_ap(1,5,2)==9", "assert tn_ap(2,6,4)==22", "assert tn_ap(1,4,5)==16" ]
[]
Daniel picked up the football. Daniel discarded the football. Mary went back to the hallway. Sandra journeyed to the hallway. Sandra travelled to the office. Daniel moved to the garden. Sandra journeyed to the garden. John got the apple. Sandra travelled to the hallway. John journeyed to the garden. Sandra took the milk there. Mary went back to the office. Sandra discarded the milk. Mary moved to the hallway. John dropped the apple. Daniel got the apple there. Daniel discarded the apple. Mary took the milk there. Sandra went to the office. Mary journeyed to the office. Daniel went back to the hallway. John picked up the apple. John put down the apple. Daniel moved to the garden. Mary journeyed to the bedroom. Daniel journeyed to the bedroom. Daniel went back to the kitchen. Daniel moved to the garden. Daniel moved to the kitchen. Mary left the milk. Sandra moved to the bathroom. Mary got the milk. Mary discarded the milk. Mary travelled to the kitchen. John journeyed to the kitchen. Mary moved to the bedroom. Mary took the milk. Daniel picked up the football. Mary dropped the milk. Mary grabbed the milk. Mary went back to the hallway. Mary went back to the bedroom. Daniel left the football. John grabbed the football.
babilong_0k_qa3_sample_67
265
54
52
Write a function to caluclate area of a parallelogram.
def parallelogram_area(b,h): area=b*h return area
[ "assert parallelogram_area(10,20)==200", "assert parallelogram_area(15,20)==300", "assert parallelogram_area(8,9)==72" ]
[]
Daniel grabbed the apple. Sandra travelled to the bedroom. Sandra moved to the office. Mary journeyed to the office. Daniel put down the apple. John moved to the bathroom. Sandra travelled to the bedroom. Daniel went to the bathroom. Mary went back to the bathroom. Sandra took the apple. Mary took the milk. Mary put down the milk. Daniel got the milk. Sandra dropped the apple there. Daniel left the milk. Mary journeyed to the kitchen. John grabbed the milk there. John journeyed to the kitchen. John grabbed the football. John dropped the football there. John dropped the milk. John grabbed the football. Sandra grabbed the apple. John got the milk. Sandra moved to the hallway. Sandra moved to the office. Mary moved to the bathroom. Sandra left the apple. Daniel went to the office. Daniel moved to the hallway. John dropped the milk. Sandra took the apple. John took the milk. John travelled to the bedroom. Sandra put down the apple. Sandra went back to the bathroom. Sandra went back to the hallway. John dropped the football. Mary journeyed to the garden. John picked up the football there. Daniel travelled to the bedroom. Sandra moved to the bathroom. John went to the bathroom. Daniel went to the kitchen. John put down the milk. John got the milk there. Sandra went to the bedroom. Daniel went back to the hallway. Mary went back to the kitchen. Mary travelled to the bathroom. John put down the milk. Mary moved to the office. John got the milk. John dropped the football. Daniel moved to the kitchen. Mary got the apple. John went to the bedroom. Mary dropped the apple. Mary picked up the apple. Mary journeyed to the hallway. John dropped the milk. John moved to the office. Sandra journeyed to the garden. Mary went back to the kitchen. John moved to the kitchen. John moved to the bathroom. John went back to the kitchen. John went back to the bathroom. Mary travelled to the bathroom. John grabbed the football. Mary dropped the apple. John took the apple. Daniel went to the bedroom. Daniel took the milk. Daniel dropped the milk. Daniel moved to the garden. Sandra went back to the bathroom. John dropped the football there. Daniel moved to the kitchen. John discarded the apple. Mary journeyed to the office. Sandra journeyed to the office. Mary journeyed to the garden. John grabbed the football. Sandra went to the garden. Daniel went to the hallway. John went back to the bedroom. Daniel travelled to the bathroom. Mary went to the hallway. John travelled to the hallway. John went to the garden. Mary journeyed to the bedroom. Daniel went to the office. John put down the football. John got the football. Mary picked up the milk there. Sandra went back to the office. Mary went to the kitchen. Sandra went back to the hallway. John travelled to the office. John put down the football. Sandra went back to the kitchen. Daniel got the football. Mary put down the milk there. Daniel left the football. John went to the bathroom. Sandra went back to the bathroom. Sandra grabbed the apple. Mary went back to the bathroom. Sandra travelled to the hallway. Daniel travelled to the garden. Sandra put down the apple. John journeyed to the garden. Mary travelled to the hallway. John travelled to the bathroom. Sandra went to the bathroom. Mary travelled to the bedroom. John went back to the office. Daniel moved to the hallway. Daniel moved to the kitchen. John picked up the football. John left the football. Daniel took the milk. Daniel put down the milk. Daniel picked up the milk there. Daniel moved to the office. John went back to the kitchen. Daniel moved to the kitchen.
babilong_0k_qa3_sample_73
768
55
14
Write a python function to find the volume of a triangular prism.
def find_Volume(l,b,h) : return ((l * b * h) / 2)
[ "assert find_Volume(10,8,6) == 240", "assert find_Volume(3,2,2) == 6", "assert find_Volume(1,2,1) == 1" ]
[]
Daniel grabbed the football there. Daniel discarded the football. John got the football there. Mary went back to the hallway. Daniel moved to the bathroom. John dropped the football there. Sandra took the apple there. Daniel journeyed to the office. Mary took the football there. Mary dropped the football there. Mary went to the bedroom. John grabbed the football there. John moved to the bathroom. Mary moved to the kitchen. Daniel moved to the bathroom. Mary moved to the office.
babilong_0k_qa2_sample_49
98
56
287
Write a python function to find the sum of squares of first n even natural numbers.
def square_Sum(n): return int(2*n*(n+1)*(2*n+1)/3)
[ "assert square_Sum(2) == 20", "assert square_Sum(3) == 56", "assert square_Sum(4) == 120" ]
[]
John journeyed to the kitchen. Sandra went back to the kitchen. Daniel journeyed to the kitchen. Mary moved to the hallway. Sandra went to the office. Mary journeyed to the bedroom. Sandra journeyed to the garden. John travelled to the office. Mary went to the office. Mary journeyed to the hallway. Mary journeyed to the garden. Daniel journeyed to the office. John got the milk. John went to the kitchen. John moved to the bedroom. Mary went back to the bedroom.
babilong_0k_qa3_sample_10
105
57
460
Write a python function to get the first element of each sublist.
def Extract(lst): return [item[0] for item in lst]
[ "assert Extract([[1, 2], [3, 4, 5], [6, 7, 8, 9]]) == [1, 3, 6]", "assert Extract([[1,2,3],[4, 5]]) == [1,4]", "assert Extract([[9,8,1],[1,2]]) == [9,1]" ]
[]
Sandra moved to the hallway. Daniel journeyed to the bedroom. John went to the bathroom. Mary grabbed the apple. John moved to the kitchen. Mary went to the office. John went back to the bathroom. John picked up the football there. Mary left the apple. Mary grabbed the apple. John dropped the football. Sandra travelled to the kitchen. Mary went to the kitchen. Sandra grabbed the milk. John journeyed to the kitchen. Sandra went to the hallway. John moved to the garden. Sandra went to the office. Sandra went back to the bathroom. Mary moved to the bedroom. Mary went to the garden. John moved to the kitchen. Sandra grabbed the football there. Sandra dropped the football. Sandra discarded the milk there. Sandra went back to the hallway.
babilong_0k_qa3_sample_87
158
57
234
Write a function to find the volume of a cube.
def volume_cube(l): volume = l * l * l return volume
[ "assert volume_cube(3)==27", "assert volume_cube(2)==8", "assert volume_cube(5)==125" ]
[]
John took the apple there. John dropped the apple. Daniel went back to the bathroom. John grabbed the apple there. Mary travelled to the kitchen. Sandra went back to the garden. John dropped the apple. John took the apple there. John dropped the apple. Daniel travelled to the office. Sandra journeyed to the hallway. John got the apple there. Sandra journeyed to the bathroom. Daniel took the milk there. John discarded the apple. John moved to the kitchen. Daniel left the milk there. Daniel went back to the bathroom. Sandra journeyed to the garden. Mary got the football there. Mary discarded the football. John journeyed to the bathroom. Daniel travelled to the office. Daniel travelled to the bathroom. John moved to the garden. Mary went back to the office. Daniel travelled to the office. Daniel picked up the milk there. Daniel discarded the milk. John travelled to the bedroom.
babilong_0k_qa2_sample_71
184
58
341
Write a function to convert the given set into ordered tuples.
def set_to_tuple(s): t = tuple(sorted(s)) return (t)
[ "assert set_to_tuple({1, 2, 3, 4, 5}) == (1, 2, 3, 4, 5)", "assert set_to_tuple({6, 7, 8, 9, 10, 11}) == (6, 7, 8, 9, 10, 11)", "assert set_to_tuple({12, 13, 14, 15, 16}) == (12, 13, 14, 15, 16)" ]
[]
Mary went back to the bathroom. Mary journeyed to the bedroom. Mary took the milk there. Mary moved to the office. Bill journeyed to the garden. Mary passed the milk to Fred. Fred put down the milk there. Jeff went back to the bedroom. Mary journeyed to the garden. Bill went back to the hallway.
babilong_0k_qa5_sample_64
69
58
373
Write a function to find the volume of a cuboid.
def volume_cuboid(l,w,h): volume=l*w*h return volume
[ "assert volume_cuboid(1,2,3)==6", "assert volume_cuboid(5,7,9)==315", "assert volume_cuboid(10,15,21)==3150" ]
[]
Mary travelled to the hallway. Daniel journeyed to the bedroom. John went back to the garden. Sandra journeyed to the bathroom. John went to the kitchen. Sandra journeyed to the garden. Sandra moved to the hallway. John went back to the garden. Sandra went to the bathroom. Mary went to the office.
babilong_0k_qa1_sample_46
66
58
499
Write a function to find the diameter of a circle.
def diameter_circle(r): diameter=2*r return diameter
[ "assert diameter_circle(10)==20", "assert diameter_circle(40)==80", "assert diameter_circle(15)==30" ]
[]
Mary got the milk there. Mary gave the milk to Bill. Jeff went to the hallway. Bill gave the milk to Mary. Fred moved to the hallway. Mary handed the milk to Fred. Fred passed the milk to Mary. Mary journeyed to the bathroom. Mary discarded the milk there. Mary journeyed to the garden.
babilong_0k_qa5_sample_40
67
58
132
Write a function to convert tuple to a string.
def tup_string(tup1): str = ''.join(tup1) return str
[ "assert tup_string(('e', 'x', 'e', 'r', 'c', 'i', 's', 'e', 's'))==(\"exercises\")", "assert tup_string(('p','y','t','h','o','n'))==(\"python\")", "assert tup_string(('p','r','o','g','r','a','m'))==(\"program\")" ]
[]
The hallway is south of the bedroom. The kitchen is north of the bedroom.
babilong_0k_qa4_sample_53
17
59
17
Write a function to find the perimeter of a square.
def square_perimeter(a): perimeter=4*a return perimeter
[ "assert square_perimeter(10)==40", "assert square_perimeter(5)==20", "assert square_perimeter(4)==16" ]
[]
Sandra moved to the hallway. Mary took the apple there. John moved to the garden. John moved to the bedroom. Daniel moved to the kitchen. John went to the garden. Mary put down the apple there. Mary picked up the apple there. Mary moved to the hallway. Daniel journeyed to the office.
babilong_0k_qa2_sample_28
65
61
266
Write a function to find the lateral surface area of a cube.
def lateralsurface_cube(l): LSA = 4 * (l * l) return LSA
[ "assert lateralsurface_cube(5)==100", "assert lateralsurface_cube(9)==324", "assert lateralsurface_cube(10)==400" ]
[]
Daniel went back to the bedroom. Sandra went to the garden.
babilong_0k_qa1_sample_60
14
62
86
Write a function to find nth centered hexagonal number.
def centered_hexagonal_number(n): return 3 * n * (n - 1) + 1
[ "assert centered_hexagonal_number(10) == 271", "assert centered_hexagonal_number(2) == 7", "assert centered_hexagonal_number(9) == 217" ]
[]
John travelled to the garden. Mary went back to the office.
babilong_0k_qa1_sample_32
14
63
99
Write a function to convert the given decimal number to its binary equivalent.
def decimal_to_binary(n): return bin(n).replace("0b","")
[ "assert decimal_to_binary(8) == '1000'", "assert decimal_to_binary(18) == '10010'", "assert decimal_to_binary(7) == '111' " ]
[]
The bathroom is north of the garden. The bedroom is south of the garden.
babilong_0k_qa4_sample_6
17
63
262
Write a function to split a given list into two parts where the length of the first part of the list is given.
def split_two_parts(list1, L): return list1[:L], list1[L:]
[ "assert split_two_parts([1,1,2,3,4,4,5,1],3)==([1, 1, 2], [3, 4, 4, 5, 1])", "assert split_two_parts(['a', 'b', 'c', 'd'],2)==(['a', 'b'], ['c', 'd'])", "assert split_two_parts(['p', 'y', 't', 'h', 'o', 'n'],4)==(['p', 'y', 't', 'h'], ['o', 'n'])" ]
[]
Daniel grabbed the milk there. Daniel discarded the milk. John went back to the bedroom. Daniel moved to the kitchen. Mary travelled to the hallway. Daniel picked up the apple there. Sandra journeyed to the office. Sandra picked up the milk there. Sandra left the milk. John went back to the garden. Daniel left the apple. Daniel took the apple there. Mary went to the bathroom. John got the football there. Mary moved to the office. Daniel put down the apple. Sandra travelled to the kitchen. Daniel travelled to the bathroom. John journeyed to the kitchen. John travelled to the bathroom.
babilong_0k_qa2_sample_78
124
63
80
Write a function to find the nth tetrahedral number.
def tetrahedral_number(n): return (n * (n + 1) * (n + 2)) / 6
[ "assert tetrahedral_number(5) == 35.0", "assert tetrahedral_number(6) == 56.0", "assert tetrahedral_number(7) == 84.0" ]
[]
Bill travelled to the office. Fred moved to the hallway. Bill moved to the bedroom. Bill grabbed the milk there. Bill moved to the bathroom. Jeff moved to the office. Fred moved to the bedroom. Jeff travelled to the bathroom. Bill handed the milk to Mary. Fred went back to the kitchen. Mary gave the milk to Bill. Jeff moved to the kitchen. Bill went to the office. Fred journeyed to the hallway.
babilong_0k_qa5_sample_13
89
64
263
Write a function to merge two dictionaries.
def merge_dict(d1,d2): d = d1.copy() d.update(d2) return d
[ "assert merge_dict({'a': 100, 'b': 200},{'x': 300, 'y': 200})=={'x': 300, 'y': 200, 'a': 100, 'b': 200}", "assert merge_dict({'a':900,'b':900,'d':900},{'a':900,'b':900,'d':900})=={'a':900,'b':900,'d':900,'a':900,'b':900,'d':900}", "assert merge_dict({'a':10,'b':20},{'x':30,'y':40})=={'x':30,'y':40,'a':10,'b':20}" ]
[]
The bathroom is south of the hallway. The bedroom is north of the hallway.
babilong_0k_qa4_sample_22
17
64
276
Write a function to find the volume of a cylinder.
def volume_cylinder(r,h): volume=3.1415*r*r*h return volume
[ "assert volume_cylinder(10,5)==1570.7500000000002", "assert volume_cylinder(4,5)==251.32000000000002", "assert volume_cylinder(4,10)==502.64000000000004" ]
[]
John travelled to the hallway. Mary journeyed to the bathroom. Daniel went back to the bathroom. John moved to the bedroom.
babilong_0k_qa1_sample_0
27
65
369
Write a function to find the lateral surface area of cuboid
def lateralsurface_cuboid(l,w,h): LSA = 2*h*(l+w) return LSA
[ "assert lateralsurface_cuboid(8,5,6)==156", "assert lateralsurface_cuboid(7,9,10)==320", "assert lateralsurface_cuboid(10,20,30)==1800" ]
[]
Sandra journeyed to the bedroom. John moved to the kitchen. John went to the hallway. Sandra went to the bathroom. John went back to the kitchen. Daniel went to the hallway. Sandra got the football. Sandra travelled to the garden. Daniel journeyed to the garden. Daniel journeyed to the kitchen. Daniel went back to the office. Daniel travelled to the bedroom. John went back to the bedroom. Sandra went to the bedroom. Sandra went to the hallway. Sandra travelled to the office. Sandra went back to the bedroom. Sandra moved to the office. Sandra journeyed to the kitchen. Sandra travelled to the garden. John went back to the bathroom. Daniel moved to the office. John grabbed the apple. Daniel got the milk there. Daniel left the milk. Mary travelled to the bedroom. Mary moved to the kitchen. Daniel grabbed the milk. Daniel left the milk. Sandra left the football there.
babilong_0k_qa3_sample_27
186
66
112
Write a python function to find the perimeter of a cylinder.
def perimeter(diameter,height) : return 2*(diameter+height)
[ "assert perimeter(2,4) == 12", "assert perimeter(1,2) == 6", "assert perimeter(3,1) == 8" ]
[]
Daniel journeyed to the bedroom. Sandra picked up the football. Sandra picked up the apple. Daniel travelled to the office. Sandra put down the apple. Sandra left the football. Daniel journeyed to the bathroom. Sandra went back to the hallway. John went back to the kitchen. Mary went to the bathroom. Sandra travelled to the bedroom. Mary travelled to the office. John journeyed to the garden. Mary journeyed to the kitchen. Mary took the milk. John went back to the kitchen. Daniel travelled to the kitchen. Sandra went to the bathroom. Mary left the milk there. Daniel moved to the office. John moved to the bedroom. John moved to the kitchen. John picked up the milk. John discarded the milk. Mary grabbed the milk. Sandra travelled to the kitchen. Mary moved to the bathroom. Mary put down the milk. John went to the hallway. Mary grabbed the milk. Daniel travelled to the garden. Daniel got the apple. Mary travelled to the office. Daniel moved to the bedroom. Mary went to the kitchen. Mary journeyed to the garden. Sandra went back to the bathroom. Mary put down the milk there. Daniel dropped the apple. Daniel grabbed the apple. Mary moved to the kitchen. Mary went to the office.
babilong_0k_qa3_sample_38
255
67
257
Write a function to swap two numbers.
def swap_numbers(a,b): temp = a a = b b = temp return (a,b)
[ "assert swap_numbers(10,20)==(20,10)", "assert swap_numbers(15,17)==(17,15)", "assert swap_numbers(100,200)==(200,100)" ]
[]
John went back to the bathroom. John went back to the bedroom. Daniel went to the office. Mary took the milk. Mary left the milk. John went to the hallway. Mary took the milk. Mary left the milk. Sandra travelled to the bedroom. Mary went to the bathroom. Sandra went to the garden. Mary moved to the kitchen. Daniel moved to the bedroom. Sandra moved to the kitchen. Sandra got the milk. Daniel grabbed the football. John journeyed to the kitchen. Sandra moved to the office. Daniel took the apple there. Daniel put down the apple. John went back to the bedroom. John travelled to the office. Daniel discarded the football. Sandra dropped the milk. Sandra got the milk. Daniel picked up the football. Daniel got the apple. Daniel dropped the football. Daniel moved to the office. Sandra put down the milk. Daniel journeyed to the garden. Daniel went to the hallway. Sandra grabbed the milk. Mary went to the bedroom. Daniel left the apple. Daniel moved to the office. Daniel travelled to the bedroom. Daniel journeyed to the garden. Mary took the football there. Daniel went back to the office. Sandra put down the milk. John picked up the milk there. John dropped the milk. Sandra picked up the milk. Sandra went back to the bathroom. Mary put down the football. John went to the bedroom. Sandra left the milk. John went to the kitchen. Daniel moved to the bedroom. John travelled to the office. Mary grabbed the football. Sandra got the milk. Sandra moved to the garden. Mary travelled to the hallway. Mary grabbed the apple. Mary dropped the football. Sandra travelled to the bedroom. Sandra went back to the hallway. John moved to the bathroom. John journeyed to the office. Mary grabbed the football there. Mary left the football. Mary left the apple. John went to the bedroom. John travelled to the office. Sandra dropped the milk. Mary took the milk. Sandra took the apple. Mary left the milk. Mary got the milk. John moved to the kitchen. John went to the bedroom. Mary put down the milk there. Mary picked up the football. John moved to the kitchen. Sandra journeyed to the bathroom. Mary left the football. Mary got the milk there. John went back to the bathroom. Sandra went to the kitchen. Sandra went to the bedroom. Mary got the football. Daniel journeyed to the garden. Daniel went back to the bathroom. John went back to the hallway. Daniel journeyed to the garden. Daniel journeyed to the kitchen. John moved to the bedroom. Sandra moved to the garden. Sandra travelled to the kitchen. Daniel moved to the office. Mary journeyed to the bathroom. Mary put down the milk. Sandra moved to the garden. Mary went to the office. Daniel moved to the bathroom. Daniel grabbed the milk. Daniel dropped the milk. Mary dropped the football. Mary got the football. Mary dropped the football. John went to the office. John went to the kitchen. Sandra put down the apple. Mary journeyed to the hallway.
babilong_0k_qa3_sample_82
625
67
441
Write a function to find the surface area of a cube.
def surfacearea_cube(l): surfacearea= 6*l*l return surfacearea
[ "assert surfacearea_cube(5)==150", "assert surfacearea_cube(3)==54", "assert surfacearea_cube(10)==600" ]
[]
The hallway is west of the bathroom. The kitchen is east of the bathroom.
babilong_0k_qa4_sample_94
17
68
476
Write a python function to find the sum of the largest and smallest value in a given array.
def big_sum(nums): sum= max(nums)+min(nums) return sum
[ "assert big_sum([1,2,3]) == 4", "assert big_sum([-1,2,3,4]) == 3", "assert big_sum([2,3,6]) == 8" ]
[]
The kitchen is north of the garden. The hallway is north of the kitchen.
babilong_0k_qa4_sample_43
17
68
176
Write a function to find the perimeter of a triangle.
def perimeter_triangle(a,b,c): perimeter=a+b+c return perimeter
[ "assert perimeter_triangle(10,20,30)==60", "assert perimeter_triangle(3,4,5)==12", "assert perimeter_triangle(25,35,45)==105" ]
[]
Sandra moved to the garden. John went to the bedroom. John moved to the bathroom. John went to the garden. John journeyed to the bedroom. Sandra went to the office. Sandra went to the bathroom. Sandra moved to the kitchen. Sandra went to the bedroom. Sandra went to the office.
babilong_0k_qa1_sample_45
63
69
360
Write a function to find the n’th carol number.
def get_carol(n): result = (2**n) - 1 return result * result - 2
[ "assert get_carol(2) == 7", "assert get_carol(4) == 223", "assert get_carol(5) == 959" ]
[]
The bedroom is east of the garden. The bedroom is west of the hallway.
babilong_0k_qa4_sample_13
17
69
265
Write a function to split a list for every nth element.
def list_split(S, step): return [S[i::step] for i in range(step)]
[ "assert list_split(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n'],3)==[['a', 'd', 'g', 'j', 'm'], ['b', 'e', 'h', 'k', 'n'], ['c', 'f', 'i', 'l']] ", "assert list_split([1,2,3,4,5,6,7,8,9,10,11,12,13,14],3)==[[1,4,7,10,13], [2,5,8,11,14], [3,6,9,12]] ", "assert list_split(['python','java','C','C++','DBMS','SQL'],2)==[['python', 'C', 'DBMS'], ['java', 'C++', 'SQL']] " ]
[]
The garden is north of the kitchen. The hallway is north of the garden.
babilong_0k_qa4_sample_12
17
70
12
Write a function to sort a given matrix in ascending order according to the sum of its rows.
def sort_matrix(M): result = sorted(M, key=sum) return result
[ "assert sort_matrix([[1, 2, 3], [2, 4, 5], [1, 1, 1]])==[[1, 1, 1], [1, 2, 3], [2, 4, 5]]", "assert sort_matrix([[1, 2, 3], [-2, 4, -5], [1, -1, 1]])==[[-2, 4, -5], [1, -1, 1], [1, 2, 3]]", "assert sort_matrix([[5,8,9],[6,4,3],[2,1,4]])==[[2, 1, 4], [6, 4, 3], [5, 8, 9]]" ]
[]
Mary went to the garden. Jeff went back to the garden. Jeff grabbed the apple there. Fred moved to the office. Fred moved to the garden. Jeff passed the apple to Mary. Mary travelled to the hallway. Jeff went to the bedroom. Mary put down the apple. Jeff picked up the football there.
babilong_0k_qa5_sample_80
64
71
344
Write a python function to find number of elements with odd factors in a given range.
def count_Odd_Squares(n,m): return int(m**0.5) - int((n-1)**0.5)
[ "assert count_Odd_Squares(5,100) == 8", "assert count_Odd_Squares(8,65) == 6", "assert count_Odd_Squares(2,5) == 1" ]
[]
The bathroom is south of the hallway. The office is south of the bathroom.
babilong_0k_qa4_sample_44
17
71
439
Write a function to convert a list of multiple integers into a single integer.
def multiple_to_single(L): x = int("".join(map(str, L))) return x
[ "assert multiple_to_single([11, 33, 50])==113350", "assert multiple_to_single([-1,2,3,4,5,6])==-123456", "assert multiple_to_single([10,15,20,25])==10152025" ]
[]
The bedroom is west of the hallway. The hallway is west of the bathroom.
babilong_0k_qa4_sample_20
17
71
139
Write a function to find the circumference of a circle.
def circle_circumference(r): perimeter=2*3.1415*r return perimeter
[ "assert circle_circumference(10)==62.830000000000005", "assert circle_circumference(5)==31.415000000000003", "assert circle_circumference(4)==25.132" ]
[]
Fred travelled to the garden. Bill went to the hallway. Mary picked up the milk there. Mary handed the milk to Bill. Bill passed the milk to Mary. Mary went to the kitchen.
babilong_0k_qa5_sample_95
40
72
193
Write a function to remove the duplicates from the given tuple.
def remove_tuple(test_tup): res = tuple(set(test_tup)) return (res)
[ "assert remove_tuple((1, 3, 5, 2, 3, 5, 1, 1, 3)) == (1, 2, 3, 5)", "assert remove_tuple((2, 3, 4, 4, 5, 6, 6, 7, 8, 8)) == (2, 3, 4, 5, 6, 7, 8)", "assert remove_tuple((11, 12, 13, 11, 11, 12, 14, 13)) == (11, 12, 13, 14)" ]
[]
Daniel journeyed to the garden. Mary moved to the hallway. Daniel journeyed to the bedroom. John picked up the football there. John discarded the football. Daniel went to the hallway. Sandra went back to the bathroom. John picked up the football there. John journeyed to the garden. Sandra went back to the bedroom. John journeyed to the bathroom. Daniel journeyed to the bedroom. Sandra moved to the garden. Daniel moved to the garden. John journeyed to the office. Daniel went to the kitchen. Mary travelled to the kitchen. John travelled to the bathroom. Mary went to the bedroom. John picked up the apple there. Sandra went back to the kitchen. Daniel moved to the bathroom. Sandra travelled to the office. Daniel travelled to the kitchen. Sandra went back to the bathroom. Sandra travelled to the kitchen. Daniel picked up the milk there. Daniel moved to the office. Daniel dropped the milk. John dropped the apple.
babilong_0k_qa2_sample_86
192
74
339
Write a python function to find the maximum occuring divisor in an interval.
def find_Divisor(x,y): if (x==y): return y return 2
[ "assert find_Divisor(2,2) == 2", "assert find_Divisor(2,5) == 2", "assert find_Divisor(5,10) == 2" ]
[]
Bill moved to the bedroom. Mary took the football there. Mary dropped the football. Bill went to the bathroom. Bill moved to the bedroom. Mary got the football there. Mary handed the football to Fred. Fred discarded the football. Fred moved to the bedroom. Mary travelled to the office. Jeff went back to the office. Fred travelled to the office. Bill went back to the garden. Fred picked up the apple there. Fred travelled to the bathroom. Fred picked up the football there. Fred travelled to the kitchen. Fred grabbed the milk there. Fred dropped the apple. Fred took the apple there. Fred travelled to the hallway. Fred went back to the garden. Bill travelled to the office. Jeff travelled to the garden. Bill went to the bedroom. Mary went to the kitchen. Fred left the apple. Jeff went to the kitchen. Fred went back to the kitchen. Fred handed the football to Mary.
babilong_0k_qa5_sample_38
185
74
42
Write a python function to find the sum of repeated elements in a given array.
def find_Sum(arr,n): return sum([x for x in arr if arr.count(x) > 1])
[ "assert find_Sum([1,2,3,1,1,4,5,6],8) == 3", "assert find_Sum([1,2,3,1,1],5) == 3", "assert find_Sum([1,1,2],3) == 2" ]
[ "assert find_Sum([1,1,2,3,4,5,6,3,5],9) == 18" ]
Daniel journeyed to the hallway. Sandra went to the kitchen.
babilong_0k_qa1_sample_35
14
75
379
Write a function to find the surface area of a cuboid.
def surfacearea_cuboid(l,w,h): SA = 2*(l*w + l * h + w * h) return SA
[ "assert surfacearea_cuboid(1,2,3)==22", "assert surfacearea_cuboid(5,7,9)==286", "assert surfacearea_cuboid(10,15,21)==1350" ]
[]
John took the football there. John moved to the bedroom. John discarded the football. Sandra went to the bedroom.
babilong_0k_qa2_sample_92
24
75
55
Write a function to find t-nth term of geometric series.
import math def tn_gp(a,n,r): tn = a * (math.pow(r, n - 1)) return tn
[ "assert tn_gp(1,5,2)==16", "assert tn_gp(1,5,4)==256", "assert tn_gp(2,6,3)==486" ]
[]
Bill went to the kitchen. Jeff picked up the apple there. Jeff gave the apple to Fred. Fred passed the apple to Jeff. Jeff grabbed the milk there. Jeff discarded the milk. Fred picked up the milk there. Jeff gave the apple to Fred.
babilong_0k_qa5_sample_42
53
76
230
Write a function to replace blank spaces with any character in a string.
def replace_blank(str1,char): str2 = str1.replace(' ', char) return str2
[ "assert replace_blank(\"hello people\",'@')==(\"hello@people\")", "assert replace_blank(\"python program language\",'$')==(\"python$program$language\")", "assert replace_blank(\"blank space\",\"-\")==(\"blank-space\")" ]
[]
Mary travelled to the kitchen. Mary went back to the bedroom. Daniel went to the bathroom. Mary moved to the office. Mary journeyed to the bedroom. John moved to the office. Daniel went back to the garden. Daniel went back to the hallway. Daniel journeyed to the garden. John went back to the bathroom. Daniel travelled to the bedroom. John picked up the milk. John left the milk. Mary got the apple there. Sandra journeyed to the garden. John went back to the office. Sandra went to the bathroom. Mary left the apple. Sandra moved to the kitchen. Sandra moved to the office. Daniel journeyed to the hallway. Mary went back to the kitchen. John went to the garden. Mary journeyed to the bathroom. John travelled to the office. Mary picked up the milk. Mary went back to the hallway. Sandra moved to the kitchen. Daniel went to the office. Mary journeyed to the bedroom. Mary took the apple. Mary journeyed to the kitchen. Sandra moved to the bedroom. John went to the bedroom. Mary left the milk. Mary discarded the apple there. Sandra moved to the hallway. John moved to the bathroom. John went back to the bedroom. Daniel went back to the bathroom. John journeyed to the hallway. Daniel moved to the kitchen. Daniel took the apple. Daniel got the milk. Sandra journeyed to the bathroom. Daniel put down the milk. Daniel picked up the milk there. Daniel left the milk. Daniel discarded the apple there. John went back to the bathroom. Sandra picked up the football. Daniel got the milk there. Sandra discarded the football. Daniel went to the office. John grabbed the football. John dropped the football. Sandra grabbed the football. Sandra journeyed to the office. Daniel went to the bedroom. John went to the bedroom. Daniel discarded the milk. Daniel took the milk. Sandra dropped the football. Mary took the apple. Sandra moved to the kitchen. Daniel went to the office. John travelled to the garden. Daniel dropped the milk. Mary went back to the bathroom. Mary put down the apple. Daniel went back to the bathroom. Daniel grabbed the apple. Daniel journeyed to the kitchen. Daniel journeyed to the bedroom.
babilong_0k_qa3_sample_41
453
76
274
Write a python function to find sum of even index binomial coefficients.
import math def even_binomial_Coeff_Sum( n): return (1 << (n - 1))
[ "assert even_binomial_Coeff_Sum(4) == 8", "assert even_binomial_Coeff_Sum(6) == 32", "assert even_binomial_Coeff_Sum(2) == 2" ]
[]
Fred travelled to the bedroom. Fred moved to the office. Fred journeyed to the bathroom. Mary grabbed the football there. Jeff went back to the garden. Mary dropped the football. Mary took the football there. Mary took the apple there. Mary left the apple. Fred went to the office. Mary travelled to the hallway. Mary discarded the football there. Bill went to the kitchen. Mary went to the office. Bill took the apple there. Jeff got the milk there. Bill went back to the garden. Bill moved to the bathroom. Bill went back to the office. Fred went to the bathroom. Bill gave the apple to Mary. Jeff journeyed to the office. Mary went back to the hallway. Jeff passed the milk to Bill.
babilong_0k_qa5_sample_62
151
76
330
Write a function to find all three, four, five characters long words in the given string by using regex.
import re def find_char(text): return (re.findall(r"\b\w{3,5}\b", text))
[ "assert find_char('For the four consumer complaints contact manager AKR reddy') == ['For', 'the', 'four', 'AKR', 'reddy']", "assert find_char('Certain service are subject to change MSR') == ['are', 'MSR']", "assert find_char('Third party legal desclaimers') == ['Third', 'party', 'legal']" ]
[]
The kitchen is south of the bathroom. The garden is north of the bathroom.
babilong_0k_qa4_sample_4
17
76
368
Write a function to repeat the given tuple n times.
def repeat_tuples(test_tup, N): res = ((test_tup, ) * N) return (res)
[ "assert repeat_tuples((1, 3), 4) == ((1, 3), (1, 3), (1, 3), (1, 3))", "assert repeat_tuples((1, 2), 3) == ((1, 2), (1, 2), (1, 2))", "assert repeat_tuples((3, 4), 5) == ((3, 4), (3, 4), (3, 4), (3, 4), (3, 4))" ]
[]
John grabbed the football. Daniel went to the bedroom. John dropped the football. Daniel got the apple. Daniel dropped the apple there. John travelled to the hallway. Mary picked up the football. Mary put down the football. Daniel got the apple. Sandra grabbed the milk. Daniel went back to the bathroom. Mary went back to the kitchen. Daniel dropped the apple. John travelled to the garden. Sandra left the milk. Mary went back to the garden. Sandra picked up the milk there. John went back to the kitchen. Mary travelled to the bathroom. Mary travelled to the office. Sandra discarded the milk. Sandra got the milk. Daniel got the apple. Daniel went back to the kitchen. John moved to the bedroom. Daniel moved to the bathroom. Sandra dropped the milk there. Daniel dropped the apple there.
babilong_0k_qa3_sample_79
165
76
73
Write a function to split the given string with multiple delimiters by using regex.
import re def multiple_split(text): return (re.split('; |, |\*|\n',text))
[ "assert multiple_split('Forces of the \\ndarkness*are coming into the play.') == ['Forces of the ', 'darkness', 'are coming into the play.']", "assert multiple_split('Mi Box runs on the \\n Latest android*which has google assistance and chromecast.') == ['Mi Box runs on the ', ' Latest android', 'which has google assistance and chromecast.']", "assert multiple_split('Certain services\\nare subjected to change*over the seperate subscriptions.') == ['Certain services', 'are subjected to change', 'over the seperate subscriptions.']" ]
[]
The bathroom is east of the bedroom. The garden is west of the bedroom.
babilong_0k_qa4_sample_75
17
77
328
Write a function to rotate a given list by specified number of items to the left direction.
def rotate_left(list1,m,n): result = list1[m:]+list1[:n] return result
[ "assert rotate_left([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],3,4)==[4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4]", "assert rotate_left([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],2,2)==[3, 4, 5, 6, 7, 8, 9, 10, 1, 2]", "assert rotate_left([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],5,2)==[6, 7, 8, 9, 10, 1, 2]" ]
[]
Daniel went to the garden. Mary moved to the bedroom. Daniel journeyed to the bathroom. Sandra journeyed to the bathroom. Daniel moved to the hallway. Sandra journeyed to the kitchen.
babilong_0k_qa1_sample_24
40
77
335
Write a function to find the sum of arithmetic progression.
def ap_sum(a,n,d): total = (n * (2 * a + (n - 1) * d)) / 2 return total
[ "assert ap_sum(1,5,2)==25", "assert ap_sum(2,6,4)==72", "assert ap_sum(1,4,5)==34" ]
[]
John travelled to the bedroom. Mary went to the bathroom. Mary journeyed to the bedroom. Sandra travelled to the hallway. Daniel went back to the hallway. Sandra journeyed to the office.
babilong_0k_qa1_sample_40
40
77
418
Write a python function to find the sublist having maximum length.
def Find_Max(lst): maxList = max((x) for x in lst) return maxList
[ "assert Find_Max([['A'],['A','B'],['A','B','C']]) == ['A','B','C']", "assert Find_Max([[1],[1,2],[1,2,3]]) == [1,2,3]", "assert Find_Max([[1,1],[1,2,3],[1,5,6,1]]) == [1,5,6,1]" ]
[]
Mary journeyed to the garden. Sandra got the football there. Mary picked up the apple there. Mary dropped the apple. John went back to the garden. John picked up the apple there. John put down the apple. Sandra left the football. John went back to the bathroom. Sandra grabbed the football there. Mary journeyed to the bedroom. John went back to the office. Sandra discarded the football. Daniel moved to the hallway. Daniel journeyed to the office. Sandra picked up the football there. Daniel went back to the hallway. Sandra discarded the football. Mary took the football there. John went back to the bedroom. Mary went to the bathroom. Sandra travelled to the office.
babilong_0k_qa2_sample_91
140
77
457
Write a python function to find the sublist having minimum length.
def Find_Min(lst): minList = min((x) for x in lst) return minList
[ "assert Find_Min([[1],[1,2],[1,2,3]]) == [1]", "assert Find_Min([[1,1],[1,1,1],[1,2,7,8]]) == [1,1]", "assert Find_Min([['x'],['x','y'],['x','y','z']]) == ['x']" ]
[]
John got the milk there. Sandra journeyed to the hallway. Daniel went back to the bedroom. John left the milk. Daniel got the apple there. Sandra picked up the milk there. Sandra went to the bathroom. John went to the bathroom. Sandra journeyed to the bedroom. John travelled to the office. Mary travelled to the kitchen. Sandra moved to the bathroom. Mary went back to the hallway. Sandra dropped the milk. Sandra journeyed to the garden. John went to the garden. Mary journeyed to the bedroom. John moved to the kitchen.
babilong_0k_qa2_sample_64
114
77
115
Write a function to check whether all dictionaries in a list are empty or not.
def empty_dit(list1): empty_dit=all(not d for d in list1) return empty_dit
[ "assert empty_dit([{},{},{}])==True", "assert empty_dit([{1,2},{},{}])==False", "assert empty_dit({})==True" ]
[]
Mary went back to the bedroom. Mary took the milk. Mary dropped the milk there. Daniel travelled to the bedroom. Daniel picked up the football. Daniel journeyed to the bathroom. Mary grabbed the milk. John travelled to the office. Daniel discarded the football there. Daniel took the football. Daniel took the apple. Sandra went back to the office. Daniel put down the football. Daniel discarded the apple. John journeyed to the garden. Mary dropped the milk. John went back to the kitchen. Sandra moved to the bedroom. John went to the office. Mary picked up the milk. Mary dropped the milk. Mary journeyed to the garden. Daniel went back to the kitchen. John journeyed to the kitchen. Mary went to the office. Sandra got the milk. Daniel travelled to the garden. John travelled to the garden. Sandra went to the bathroom. Daniel journeyed to the office. Mary journeyed to the garden. Sandra picked up the football. Sandra left the football. Sandra picked up the football. Sandra discarded the football there. Sandra discarded the milk. John moved to the kitchen. Sandra took the apple. Sandra got the milk. John travelled to the garden. Mary moved to the kitchen. Mary travelled to the bathroom. Sandra went back to the kitchen. Daniel moved to the hallway. Mary journeyed to the garden. Sandra dropped the milk. Daniel travelled to the kitchen. Mary journeyed to the hallway. Mary travelled to the office. Sandra went back to the garden. John moved to the office. Sandra journeyed to the bedroom. John moved to the bathroom. John grabbed the football. Daniel moved to the garden. Mary went back to the hallway. John put down the football. Sandra left the apple. John took the football there. Daniel went to the kitchen.
babilong_0k_qa3_sample_3
362
78
171
Write a function to find the perimeter of a pentagon.
import math def perimeter_pentagon(a): perimeter=(5*a) return perimeter
[ "assert perimeter_pentagon(5)==25", "assert perimeter_pentagon(10)==50", "assert perimeter_pentagon(15)==75" ]
[]
John travelled to the hallway. Mary journeyed to the bathroom. Daniel went back to the bathroom. John moved to the bedroom. John went to the hallway. Sandra journeyed to the kitchen. Sandra travelled to the hallway. John went to the garden. Sandra went back to the bathroom. Sandra moved to the kitchen.
babilong_0k_qa1_sample_1
65
78
333
Write a python function to sort a list according to the second element in sublist.
def Sort(sub_li): sub_li.sort(key = lambda x: x[1]) return sub_li
[ "assert Sort([['a', 10], ['b', 5], ['c', 20], ['d', 15]]) == [['b', 5], ['a', 10], ['d', 15], ['c', 20]]", "assert Sort([['452', 10], ['256', 5], ['100', 20], ['135', 15]]) == [['256', 5], ['452', 10], ['135', 15], ['100', 20]]", "assert Sort([['rishi', 10], ['akhil', 5], ['ramya', 20], ['gaur', 15]]) == [['akhil', 5], ['rishi', 10], ['gaur', 15], ['ramya', 20]]" ]
[]
Bill travelled to the office. Fred moved to the hallway. Bill moved to the bedroom. Bill grabbed the milk there. Bill moved to the bathroom. Jeff moved to the office. Fred moved to the bedroom. Jeff travelled to the bathroom. Bill handed the milk to Mary. Fred went back to the kitchen. Mary gave the milk to Bill. Jeff moved to the kitchen.
babilong_0k_qa5_sample_12
76
78
451
Write a function to remove all whitespaces from the given string using regex.
import re def remove_whitespaces(text1): return (re.sub(r'\s+', '',text1))
[ "assert remove_whitespaces(' Google Flutter ') == 'GoogleFlutter'", "assert remove_whitespaces(' Google Dart ') == 'GoogleDart'", "assert remove_whitespaces(' iOS Swift ') == 'iOSSwift'" ]
[]
John went to the bedroom. John picked up the football. John put down the football. Sandra went to the garden. Sandra picked up the milk. Sandra took the apple. Mary journeyed to the bathroom. Daniel went to the bedroom. Daniel went back to the hallway. Sandra dropped the milk there. John got the football. Daniel moved to the bedroom. John left the football. John went to the kitchen. Mary went to the kitchen. John went back to the office. Sandra moved to the kitchen. Daniel got the football. Daniel journeyed to the bathroom. Sandra put down the apple. Mary picked up the apple. John moved to the bathroom. Daniel travelled to the garden. Sandra journeyed to the bedroom. Daniel took the milk. Mary dropped the apple. John went back to the bedroom. Mary went back to the hallway. John moved to the bathroom. Daniel moved to the hallway. Daniel left the football. John journeyed to the hallway. John went to the bedroom. Daniel dropped the milk. Daniel went back to the office. Sandra travelled to the office. Mary journeyed to the bathroom. Sandra journeyed to the kitchen. Sandra got the apple. Sandra left the apple. Mary travelled to the hallway. Sandra took the apple. John travelled to the kitchen. Daniel moved to the garden. Mary went to the garden. Sandra journeyed to the garden. Sandra moved to the office. Sandra left the apple. Sandra moved to the kitchen. Sandra went back to the garden.
babilong_0k_qa3_sample_42
302
78
319
Write a function to find all five characters long word in the given string by using regex.
import re def find_long_word(text): return (re.findall(r"\b\w{5}\b", text))
[ "assert find_long_word('Please move back to strem') == ['strem']", "assert find_long_word('4K Ultra HD streaming player') == ['Ultra']", "assert find_long_word('Streaming Media Player') == ['Media']" ]
[]
Sandra travelled to the office. Mary grabbed the football there. Mary put down the football. Daniel picked up the football there. John travelled to the garden. Mary moved to the garden. John went to the office. Mary got the milk there. Mary left the milk there. Daniel put down the football. John went to the bedroom. Mary got the milk there. Daniel journeyed to the garden. Mary discarded the milk. Mary moved to the hallway. Daniel grabbed the milk there. Daniel travelled to the office. Mary picked up the apple there. Daniel put down the milk there. Daniel got the milk there. John travelled to the office. Sandra went to the hallway. Sandra went back to the bathroom. Mary went to the garden. Daniel discarded the milk. Daniel got the milk there. Mary went to the office. John went back to the hallway. John moved to the bathroom. John went back to the hallway. Sandra journeyed to the office. Daniel dropped the milk. Daniel picked up the milk there. Daniel moved to the bedroom.
babilong_0k_qa2_sample_98
212
79
436
Write a python function to print negative numbers in a list.
def neg_nos(list1): for num in list1: if num < 0: return num
[ "assert neg_nos([-1,4,5,-6]) == -1,-6", "assert neg_nos([-1,-2,3,4]) == -1,-2", "assert neg_nos([-7,-6,8,9]) == -7,-6" ]
[]
Jeff took the milk there. Jeff put down the milk. Fred took the milk there. Fred handed the milk to Jeff. Mary went to the office. Jeff gave the milk to Mary. Mary gave the milk to Fred. Fred passed the milk to Mary.
babilong_0k_qa5_sample_21
53
79
474
Write a function to replace characters in a string.
def replace_char(str1,ch,newch): str2 = str1.replace(ch, newch) return str2
[ "assert replace_char(\"polygon\",'y','l')==(\"pollgon\")", "assert replace_char(\"character\",'c','a')==(\"aharaater\")", "assert replace_char(\"python\",'l','a')==(\"python\")" ]
[]
Sandra journeyed to the kitchen. Daniel journeyed to the bathroom. Mary went to the garden. Mary travelled to the office.
babilong_0k_qa1_sample_42
28
79
118
[link text](https:// [link text](https:// [link text](https://)))write a function to convert a string to a list.
def string_to_list(string): lst = list(string.split(" ")) return lst
[ "assert string_to_list(\"python programming\")==['python','programming']", "assert string_to_list(\"lists tuples strings\")==['lists','tuples','strings']", "assert string_to_list(\"write a program\")==['write','a','program']" ]
[]
Mary journeyed to the garden. Fred took the apple there. Jeff went to the bedroom. Jeff travelled to the kitchen. Fred discarded the apple. Fred picked up the apple there. Fred travelled to the bedroom. Bill moved to the kitchen. Jeff took the football there. Jeff left the football. Bill picked up the football there. Bill passed the football to Jeff. Fred went back to the hallway. Jeff passed the football to Bill. Bill gave the football to Jeff. Jeff gave the football to Bill. Bill went back to the office. Mary went back to the kitchen. Mary travelled to the hallway. Fred handed the apple to Mary.
babilong_0k_qa5_sample_15
130
80
313
Write a python function to print positive numbers in a list.
def pos_nos(list1): for num in list1: if num >= 0: return num
[ "assert pos_nos([-1,-2,1,2]) == 1,2", "assert pos_nos([3,4,-5]) == 3,4", "assert pos_nos([-2,-3,1]) == 1" ]
[]
Daniel journeyed to the bathroom. Sandra went to the bathroom. Mary picked up the apple there. Sandra took the football there. Daniel journeyed to the bedroom. John went back to the bathroom. John went back to the garden. Daniel journeyed to the hallway. Sandra left the football. Sandra went to the office. Sandra went back to the bathroom. Mary left the apple. Mary went back to the kitchen. Sandra travelled to the kitchen. Daniel grabbed the milk there. Daniel moved to the office. Daniel put down the milk. Daniel travelled to the garden. Daniel went back to the kitchen. Daniel journeyed to the hallway.
babilong_0k_qa2_sample_36
129
80
72
Write a python function to check whether the given number can be represented as difference of two squares or not.
def dif_Square(n): if (n % 4 != 2): return True return False
[ "assert dif_Square(5) == True", "assert dif_Square(10) == False", "assert dif_Square(15) == True" ]
[]
The hallway is south of the office. The garden is north of the office.
babilong_0k_qa4_sample_88
17
81
82
Write a function to find the volume of a sphere.
import math def volume_sphere(r): volume=(4/3)*math.pi*r*r*r return volume
[ "assert volume_sphere(10)==4188.790204786391", "assert volume_sphere(25)==65449.84694978735", "assert volume_sphere(20)==33510.32163829113" ]
[]
John went to the garden. Sandra travelled to the garden. John travelled to the bedroom. John travelled to the office.
babilong_0k_qa1_sample_68
25
81
254
Write a function to find all words starting with 'a' or 'e' in a given string.
import re def words_ae(text): list = re.findall("[ae]\w+", text) return list
[ "assert words_ae(\"python programe\")==['ame']", "assert words_ae(\"python programe language\")==['ame','anguage']", "assert words_ae(\"assert statement\")==['assert', 'atement']" ]
[]
The kitchen is south of the hallway. The office is north of the hallway.
babilong_0k_qa4_sample_35
17
81
353
Write a function to remove a specified column from a given nested list.
def remove_column(list1, n): for i in list1: del i[n] return list1
[ "assert remove_column([[1, 2, 3], [2, 4, 5], [1, 1, 1]],0)==[[2, 3], [4, 5], [1, 1]]", "assert remove_column([[1, 2, 3], [-2, 4, -5], [1, -1, 1]],2)==[[1, 2], [-2, 4], [1, -1]]", "assert remove_column([[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]],0)==[[3], [7], [3], [15, 17], [7], [11]]" ]
[]
Daniel went to the office. John went back to the bedroom. Mary moved to the bathroom. John went back to the bathroom. Sandra went to the bathroom. Mary went back to the hallway. Mary went to the office. Daniel journeyed to the bedroom. Sandra went back to the office. John travelled to the office. Mary journeyed to the bathroom. John went to the kitchen. Daniel picked up the apple there. Mary went to the hallway. Daniel moved to the hallway. Daniel left the apple. Daniel journeyed to the bedroom. Mary got the apple. Sandra travelled to the garden. Mary put down the apple. Sandra travelled to the bedroom. Sandra went back to the garden. Daniel journeyed to the kitchen. Sandra got the football. John went back to the office. Daniel travelled to the office. Mary went to the garden. Mary travelled to the bedroom. Sandra moved to the bathroom. Sandra dropped the football. Mary grabbed the milk. Mary travelled to the hallway. Daniel journeyed to the kitchen. Sandra picked up the football. Mary put down the milk. Daniel went back to the office. Mary grabbed the milk. Daniel went back to the garden. Sandra went back to the garden. Mary got the apple. Sandra went to the kitchen. Mary dropped the apple. Mary put down the milk. Mary journeyed to the kitchen. Daniel went to the hallway. Sandra put down the football there. John travelled to the bathroom. Mary travelled to the garden. Daniel took the apple. Daniel picked up the milk. Mary went to the office. Daniel moved to the office. Sandra travelled to the bathroom. Mary moved to the bedroom. John went to the kitchen. Daniel journeyed to the hallway. Daniel moved to the office. Sandra journeyed to the kitchen. Daniel went to the garden. John took the football. Daniel put down the milk. Sandra journeyed to the bedroom. Daniel left the apple. Sandra moved to the hallway.
babilong_0k_qa3_sample_56
394
81
472
Write a python function to check whether the given list contains consecutive numbers or not.
def check_Consecutive(l): return sorted(l) == list(range(min(l),max(l)+1))
[ "assert check_Consecutive([1,2,3,4,5]) == True", "assert check_Consecutive([1,2,3,5,6]) == False", "assert check_Consecutive([1,2,1]) == False" ]
[]
Sandra went back to the bedroom. John moved to the garden.
babilong_0k_qa1_sample_49
15
81
15
Write a function to split a string at lowercase letters.
import re def split_lowerstring(text): return (re.findall('[a-z][^a-z]*', text))
[ "assert split_lowerstring(\"AbCd\")==['bC','d']", "assert split_lowerstring(\"Python\")==['y', 't', 'h', 'o', 'n']", "assert split_lowerstring(\"Programming\")==['r', 'o', 'g', 'r', 'a', 'm', 'm', 'i', 'n', 'g']" ]
[]
Daniel went back to the bedroom. Sandra went to the garden. Sandra moved to the kitchen. John travelled to the hallway. Daniel moved to the kitchen. John journeyed to the kitchen.
babilong_0k_qa1_sample_61
39
83
146
Write a function to find the ascii value of total characters in a string.
def ascii_value_string(str1): for i in range(len(str1)): return ord(str1[i])
[ "assert ascii_value_string(\"python\")==112", "assert ascii_value_string(\"Program\")==80", "assert ascii_value_string(\"Language\")==76" ]
[]
John journeyed to the kitchen. Daniel travelled to the office. Sandra moved to the kitchen. Sandra got the milk there. John moved to the bedroom. Mary went back to the kitchen. Sandra put down the milk. Mary took the milk there. John travelled to the bathroom. John went back to the hallway. Daniel went back to the kitchen. John travelled to the kitchen. Mary went back to the hallway. Mary left the milk there.
babilong_0k_qa2_sample_65
90
83
293
Write a function to find the third side of a right angled triangle.
import math def otherside_rightangle(w,h): s=math.sqrt((w*w)+(h*h)) return s
[ "assert otherside_rightangle(7,8)==10.63014581273465", "assert otherside_rightangle(3,4)==5", "assert otherside_rightangle(7,15)==16.55294535724685" ]
[]
The bathroom is west of the bedroom. The hallway is east of the bedroom.
babilong_0k_qa4_sample_91
17
83
116
Write a function to convert a given tuple of positive integers into an integer.
def tuple_to_int(nums): result = int(''.join(map(str,nums))) return result
[ "assert tuple_to_int((1,2,3))==123", "assert tuple_to_int((4,5,6))==456", "assert tuple_to_int((5,6,7))==567" ]
[]
Sandra moved to the bedroom. Daniel took the football. Mary journeyed to the garden. Mary travelled to the bedroom. Daniel grabbed the apple there. John moved to the hallway. Daniel moved to the office. John got the milk. Mary moved to the kitchen. Daniel moved to the garden. Daniel moved to the kitchen. John put down the milk. Sandra journeyed to the garden. Daniel discarded the apple. Daniel got the apple. John took the milk. John moved to the bathroom. Daniel left the football there.
babilong_0k_qa3_sample_47
107
84
190
Write a python function to count the number of integral co-ordinates that lie inside a square.
def count_Intgral_Points(x1,y1,x2,y2): return ((y2 - y1 - 1) * (x2 - x1 - 1))
[ "assert count_Intgral_Points(1,1,4,4) == 4", "assert count_Intgral_Points(1,2,1,2) == 1", "assert count_Intgral_Points(4,2,6,4) == 1" ]
[]
John went to the hallway. John went back to the bathroom. John grabbed the milk there. Sandra went back to the office. Sandra journeyed to the kitchen. Sandra got the apple there. Sandra dropped the apple there. John dropped the milk. Mary went back to the garden. Sandra journeyed to the hallway. Sandra got the football there. Mary moved to the kitchen.
babilong_0k_qa2_sample_9
77
84
154
Write a function to extract every specified element from a given two dimensional list.
def specified_element(nums, N): result = [i[N] for i in nums] return result
[ "assert specified_element([[1, 2, 3, 2], [4, 5, 6, 2], [7, 1, 9, 5]],0)==[1, 4, 7]", "assert specified_element([[1, 2, 3, 2], [4, 5, 6, 2], [7, 1, 9, 5]],2)==[3, 6, 9]", "assert specified_element([[1, 2, 3, 2], [4, 5, 6, 2], [7, 1, 9, 5]],3)==[2,2,5]" ]
[]
Fred went back to the garden. Fred took the milk there. Jeff travelled to the bathroom. Jeff went back to the kitchen. Jeff went to the garden. Fred gave the milk to Jeff. Jeff gave the milk to Fred. Fred gave the milk to Jeff. Fred went to the office. Fred went back to the hallway. Bill went to the bathroom. Jeff picked up the apple there. Mary moved to the kitchen. Jeff went to the hallway. Fred went back to the bedroom. Fred got the football there. Bill went to the garden. Fred went to the office. Jeff left the milk. Mary moved to the bedroom. Jeff left the apple there. Fred travelled to the bathroom. Fred put down the football. Jeff journeyed to the kitchen. Mary went back to the hallway. Fred grabbed the football there. Fred left the football. Fred got the football there. Bill went to the hallway. Jeff went back to the bedroom. Jeff journeyed to the office. Fred left the football. Mary got the milk there. Bill picked up the apple there. Bill put down the apple there. Mary passed the milk to Bill.
babilong_0k_qa5_sample_98
229
85
272
Write a function to perfom the rear element extraction from list of tuples records.
def rear_extract(test_list): res = [lis[-1] for lis in test_list] return (res)
[ "assert rear_extract([(1, 'Rash', 21), (2, 'Varsha', 20), (3, 'Kil', 19)]) == [21, 20, 19]", "assert rear_extract([(1, 'Sai', 36), (2, 'Ayesha', 25), (3, 'Salman', 45)]) == [36, 25, 45]", "assert rear_extract([(1, 'Sudeep', 14), (2, 'Vandana', 36), (3, 'Dawood', 56)]) == [14, 36, 56]" ]
[]
Bill went back to the kitchen. Bill took the apple there. Bill passed the apple to Mary. Mary handed the apple to Fred. Fred gave the apple to Mary. Mary journeyed to the office.
babilong_0k_qa5_sample_9
42
85
340
Write a python function to find the sum of the three lowest positive numbers from a given list of numbers.
def sum_three_smallest_nums(lst): return sum(sorted([x for x in lst if x > 0])[:3])
[ "assert sum_three_smallest_nums([10,20,30,40,50,60,7]) == 37", "assert sum_three_smallest_nums([1,2,3,4,5]) == 6", "assert sum_three_smallest_nums([0,1,2,3,4,5]) == 6" ]
[]
Mary went to the garden. John picked up the milk there. Mary journeyed to the bedroom. Sandra went back to the hallway. John discarded the milk. John journeyed to the bedroom. John got the football there. John moved to the bathroom. Sandra went to the office. Daniel went back to the hallway. John put down the football. Mary journeyed to the kitchen. Mary picked up the milk there. Mary moved to the hallway.
babilong_0k_qa2_sample_10
91
85
479
Write a python function to find the first digit of a given number.
def first_Digit(n) : while n >= 10: n = n / 10; return int(n)
[ "assert first_Digit(123) == 1", "assert first_Digit(456) == 4", "assert first_Digit(12) == 1" ]
[]
Sandra travelled to the bathroom. Mary picked up the apple. John journeyed to the kitchen. Daniel journeyed to the bathroom. Mary went to the office. Mary left the apple. John went back to the office. Mary grabbed the apple. Sandra travelled to the kitchen. Sandra moved to the office. John moved to the garden. Mary left the apple there. John travelled to the office. Sandra took the apple. Sandra travelled to the hallway. Sandra grabbed the football. Sandra discarded the football. Sandra put down the apple. Sandra moved to the bedroom. Mary journeyed to the kitchen. Sandra travelled to the kitchen. John journeyed to the bathroom. John went to the hallway. Sandra travelled to the hallway. John got the football there. John picked up the apple. John went back to the garden. John dropped the apple there. John picked up the apple. John grabbed the milk there. John put down the football. Sandra moved to the office. Sandra moved to the bedroom. Daniel went back to the bedroom. John travelled to the hallway. Daniel moved to the bathroom. Daniel moved to the kitchen. Daniel journeyed to the office. Daniel travelled to the kitchen. Mary went back to the hallway. Sandra moved to the kitchen. John discarded the milk. Mary went to the kitchen. John journeyed to the bedroom. Mary travelled to the hallway. Sandra went back to the office. Daniel went to the garden. Mary went to the bathroom. Mary went back to the bedroom. John discarded the apple. Mary moved to the hallway. John got the apple there. Daniel took the football. Sandra travelled to the bathroom. Mary travelled to the bedroom. Mary went to the garden. Mary journeyed to the kitchen. Daniel left the football. John discarded the apple there. Daniel grabbed the football. Mary went to the hallway. Daniel dropped the football. Mary went to the kitchen. Mary went to the garden. Daniel moved to the hallway. Mary grabbed the football there. Daniel got the milk. John moved to the office. Daniel left the milk. Mary discarded the football. Mary went back to the hallway. Mary picked up the milk. Mary went back to the garden. Mary went back to the bedroom.
babilong_0k_qa3_sample_39
448
86
214
Write a function to convert radians to degrees.
import math def degree_radian(radian): degree = radian*(180/math.pi) return degree
[ "assert degree_radian(90)==5156.620156177409", "assert degree_radian(60)==3437.746770784939", "assert degree_radian(120)==6875.493541569878" ]
[]
Mary moved to the kitchen. John got the milk there. Mary went to the garden. Sandra went back to the office. Daniel picked up the football there. John went back to the kitchen. Daniel went to the kitchen. John discarded the milk. Mary journeyed to the hallway. Daniel got the milk. Daniel left the milk there. Daniel travelled to the office. Daniel went to the garden. John took the milk there. Daniel dropped the football. Sandra moved to the garden. Sandra got the football. John went to the garden. John moved to the hallway. Sandra went back to the bedroom. Sandra dropped the football. Daniel went to the bedroom. John got the apple. John moved to the garden. Sandra travelled to the hallway. Sandra journeyed to the office. Daniel got the football. Daniel moved to the garden. John left the milk. Daniel picked up the milk there. Sandra went to the bedroom. Mary travelled to the kitchen. John discarded the apple. Mary moved to the garden. John journeyed to the bedroom. Sandra went back to the hallway. Daniel took the apple. Daniel discarded the milk. Mary grabbed the milk. Mary moved to the hallway. Sandra journeyed to the bedroom. Daniel put down the apple there. Daniel went back to the hallway. Daniel dropped the football. John went back to the bathroom. John went back to the hallway. Sandra travelled to the bathroom. Sandra went to the office. Sandra went to the bathroom. Daniel got the football. Mary journeyed to the kitchen. Mary dropped the milk there.
babilong_0k_qa3_sample_12
314
87
309
Write a python function to find the maximum of two numbers.
def maximum(a,b): if a >= b: return a else: return b
[ "assert maximum(5,10) == 10", "assert maximum(-1,-2) == -1", "assert maximum(9,7) == 9" ]
[]
Daniel went to the hallway. Mary moved to the office. Sandra picked up the football there. Mary grabbed the milk there. Mary got the apple there. Sandra went back to the hallway. John went to the office. Sandra left the football there. John travelled to the kitchen. Sandra moved to the kitchen. Daniel picked up the football there. Sandra went back to the office. Daniel moved to the bathroom. Sandra journeyed to the bedroom.
babilong_0k_qa2_sample_83
90
87
404
Write a python function to find the minimum of two numbers.
def minimum(a,b): if a <= b: return a else: return b
[ "assert minimum(1,2) == 1", "assert minimum(-5,-4) == -5", "assert minimum(0,0) == 0" ]
[]
Mary went back to the bedroom. Mary took the milk. Mary dropped the milk there. Daniel travelled to the bedroom. Daniel picked up the football. Daniel journeyed to the bathroom. Mary grabbed the milk. John travelled to the office. Daniel discarded the football there. Daniel took the football. Daniel took the apple. Sandra went back to the office. Daniel put down the football. Daniel discarded the apple. John journeyed to the garden. Mary dropped the milk. John went back to the kitchen. Sandra moved to the bedroom. John went to the office. Mary picked up the milk. Mary dropped the milk. Mary journeyed to the garden. Daniel went back to the kitchen. John journeyed to the kitchen. Mary went to the office. Sandra got the milk. Daniel travelled to the garden. John travelled to the garden. Sandra went to the bathroom. Daniel journeyed to the office. Mary journeyed to the garden. Sandra picked up the football. Sandra left the football. Sandra picked up the football. Sandra discarded the football there. Sandra discarded the milk. John moved to the kitchen. Sandra took the apple. Sandra got the milk. John travelled to the garden. Mary moved to the kitchen. Mary travelled to the bathroom. Sandra went back to the kitchen. Daniel moved to the hallway. Mary journeyed to the garden. Sandra dropped the milk. Daniel travelled to the kitchen. Mary journeyed to the hallway. Mary travelled to the office. Sandra went back to the garden. John moved to the office. Sandra journeyed to the bedroom. John moved to the bathroom. John grabbed the football. Daniel moved to the garden. Mary went back to the hallway. John put down the football. Sandra left the apple.
babilong_0k_qa3_sample_2
350
87
447
Write a function to find cubes of individual elements in a list using lambda function.
def cube_nums(nums): cube_nums = list(map(lambda x: x ** 3, nums)) return cube_nums
[ "assert cube_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])==[1, 8, 27, 64, 125, 216, 343, 512, 729, 1000]", "assert cube_nums([10,20,30])==([1000, 8000, 27000])", "assert cube_nums([12,15])==([1728, 3375])" ]
[]
Daniel moved to the garden. Sandra went back to the hallway. Sandra travelled to the kitchen. Daniel went to the bedroom. Mary moved to the office. John travelled to the garden. Mary travelled to the bathroom. Sandra went back to the garden. Mary picked up the apple. John went back to the kitchen. Mary discarded the apple. Daniel journeyed to the office. Daniel journeyed to the kitchen. John moved to the bedroom. Daniel journeyed to the hallway. Mary journeyed to the hallway. Daniel went back to the bathroom. Daniel picked up the apple. Mary took the football there. Daniel grabbed the milk. John moved to the office. Daniel went back to the office. Sandra went to the bathroom. Daniel went to the kitchen. Mary put down the football. Daniel went back to the garden. Mary journeyed to the kitchen. Sandra journeyed to the bedroom. Daniel travelled to the bathroom. Daniel went back to the hallway. Mary moved to the office. Daniel put down the apple. Daniel grabbed the apple. Daniel left the apple there. John journeyed to the bedroom. John travelled to the kitchen. John travelled to the hallway. John moved to the bedroom. Daniel got the football. Sandra journeyed to the garden. Sandra journeyed to the bathroom. Daniel picked up the apple. Sandra travelled to the bedroom. Daniel put down the milk.
babilong_0k_qa3_sample_70
277
87
162
Write a function to calculate the sum of the positive integers of n+(n-2)+(n-4)... (until n-x =< 0).
def sum_series(n): if n < 1: return 0 else: return n + sum_series(n - 2)
[ "assert sum_series(6)==12", "assert sum_series(10)==30", "assert sum_series(9)==25" ]
[]
Daniel went to the garden. Mary moved to the bedroom. Daniel journeyed to the bathroom. Sandra journeyed to the bathroom.
babilong_0k_qa1_sample_23
27
88
220
Write a function to replace maximum n occurrences of spaces, commas, or dots with a colon.
import re def replace_max_specialchar(text,n): return (re.sub("[ ,.]", ":", text, n))
[ "assert replace_max_specialchar('Python language, Programming language.',2)==('Python:language: Programming language.')", "assert replace_max_specialchar('a b c,d e f',3)==('a:b:c:d e f')", "assert replace_max_specialchar('ram reshma,ram rahim',1)==('ram:reshma,ram rahim')" ]
[]
Mary went to the bedroom. John moved to the bathroom. Sandra went back to the office. John travelled to the garden. Sandra journeyed to the kitchen. John journeyed to the hallway.
babilong_0k_qa1_sample_92
40
88
232
Write a function to get the n largest items from a dataset.
import heapq def larg_nnum(list1,n): largest=heapq.nlargest(n,list1) return largest
[ "assert larg_nnum([10, 20, 50, 70, 90, 20, 50, 40, 60, 80, 100],2)==[100,90]", "assert larg_nnum([10, 20, 50, 70, 90, 20, 50, 40, 60, 80, 100],5)==[100,90,80,70,60]", "assert larg_nnum([10, 20, 50, 70, 90, 20, 50, 40, 60, 80, 100],3)==[100,90,80]" ]
[]
Daniel moved to the office. John moved to the kitchen. John grabbed the apple. Daniel got the milk there. Daniel discarded the milk. John went to the bedroom. John dropped the apple. Daniel got the milk. John went back to the kitchen. John went to the bathroom. Daniel put down the milk. John travelled to the bedroom. Sandra went back to the kitchen. Sandra moved to the office. John took the apple. Daniel journeyed to the bathroom. Daniel moved to the kitchen. Sandra went back to the garden. John left the apple there. John picked up the apple. John went back to the bathroom. John put down the apple. Mary moved to the garden. John picked up the apple. Daniel travelled to the hallway. Mary travelled to the kitchen. Sandra journeyed to the bathroom. John travelled to the kitchen. Sandra moved to the bedroom. Sandra travelled to the office. John put down the apple. John went back to the office. Sandra went back to the garden. Mary picked up the apple. Mary travelled to the bathroom. Mary discarded the apple there. Sandra went back to the hallway. Mary went to the garden. Daniel went to the kitchen. John grabbed the milk. Sandra went to the garden. John went to the bedroom. Sandra went to the bathroom. Sandra moved to the bedroom. John picked up the football there. Sandra went to the office. John dropped the milk there. John got the milk. John went to the office. Daniel travelled to the office. Daniel travelled to the garden. Sandra journeyed to the bathroom. Mary journeyed to the kitchen. John dropped the milk. John took the milk. John left the milk there. John put down the football. Daniel journeyed to the office. John grabbed the milk. Sandra travelled to the bedroom. Daniel grabbed the football. Daniel travelled to the hallway. John left the milk there. Daniel travelled to the bathroom. John took the milk. Mary went back to the garden. Daniel picked up the apple. John went to the hallway. Daniel dropped the football. Daniel travelled to the kitchen.
babilong_0k_qa3_sample_30
422
88
233
Write a function to find the lateral surface area of a cylinder.
def lateralsuface_cylinder(r,h): lateralsurface= 2*3.1415*r*h return lateralsurface
[ "assert lateralsuface_cylinder(10,5)==314.15000000000003", "assert lateralsuface_cylinder(4,5)==125.66000000000001", "assert lateralsuface_cylinder(4,10)==251.32000000000002" ]
[]
The bathroom is east of the garden. The kitchen is west of the garden.
babilong_0k_qa4_sample_63
17
89
361
Write a function to remove empty lists from a given list of lists.
def remove_empty(list1): remove_empty = [x for x in list1 if x] return remove_empty
[ "assert remove_empty([[], [], [], 'Red', 'Green', [1,2], 'Blue', [], []])==['Red', 'Green', [1, 2], 'Blue']", "assert remove_empty([[], [], [],[],[], 'Green', [1,2], 'Blue', [], []])==[ 'Green', [1, 2], 'Blue']", "assert remove_empty([[], [], [], 'Python',[],[], 'programming', 'language',[],[],[], [], []])==['Python', 'programming', 'language']" ]
[]
John went to the garden. Sandra travelled to the garden. John travelled to the bedroom. John travelled to the office. John went back to the kitchen. Mary travelled to the hallway. Daniel travelled to the hallway. John travelled to the garden. Daniel journeyed to the office. Sandra went to the bathroom.
babilong_0k_qa1_sample_69
63
89
413
Write a function to extract the nth element from a given list of tuples.
def extract_nth_element(list1, n): result = [x[n] for x in list1] return result
[ "assert extract_nth_element([('Greyson Fulton', 98, 99), ('Brady Kent', 97, 96), ('Wyatt Knott', 91, 94), ('Beau Turnbull', 94, 98)] ,0)==['Greyson Fulton', 'Brady Kent', 'Wyatt Knott', 'Beau Turnbull']", "assert extract_nth_element([('Greyson Fulton', 98, 99), ('Brady Kent', 97, 96), ('Wyatt Knott', 91, 94), ('Beau Turnbull', 94, 98)] ,2)==[99, 96, 94, 98]", "assert extract_nth_element([('Greyson Fulton', 98, 99), ('Brady Kent', 97, 96), ('Wyatt Knott', 91, 94), ('Beau Turnbull', 94, 98)],1)==[98, 97, 91, 94]" ]
[]
Mary went back to the garden. Sandra went to the hallway. John travelled to the bathroom. Mary took the milk there. Sandra journeyed to the bedroom. Sandra moved to the hallway. Sandra went back to the bedroom. Daniel moved to the office. Mary discarded the milk. Sandra went to the garden. Sandra moved to the hallway. Sandra got the football. Mary travelled to the kitchen. John moved to the garden. John moved to the hallway. Sandra took the apple. Sandra discarded the football there. Sandra went to the bathroom. Daniel travelled to the hallway. John picked up the football there. Daniel moved to the kitchen. Daniel journeyed to the bedroom. Mary went back to the bathroom. John put down the football there. John took the football there. Mary moved to the bedroom. Sandra left the apple. Sandra took the apple there. Mary journeyed to the office. Sandra dropped the apple. Mary moved to the bathroom. Mary travelled to the garden. Mary went to the office. Sandra grabbed the apple there. Sandra put down the apple. John put down the football. Sandra travelled to the office. Daniel went to the hallway. Daniel went back to the garden. Sandra travelled to the hallway. Mary went back to the garden. Daniel went back to the bathroom. Mary moved to the bathroom. Daniel got the apple. John got the football there. Sandra journeyed to the garden. John moved to the office. Sandra went to the hallway. John went back to the hallway. Daniel left the apple. Mary grabbed the apple there. Daniel went back to the hallway. John dropped the football. Mary moved to the hallway. Sandra journeyed to the bedroom. Mary got the football there. Sandra moved to the office. Sandra travelled to the garden. Mary put down the football. John went back to the kitchen. Mary went to the bedroom. Daniel travelled to the bedroom. Daniel went back to the kitchen. Sandra got the milk. Sandra dropped the milk. John went back to the garden. John travelled to the hallway. Daniel went back to the bedroom. Daniel moved to the garden. Sandra took the milk. John took the football. Sandra discarded the milk there. Sandra went to the hallway. Mary put down the apple. Daniel went to the office. Daniel went to the bathroom. Mary travelled to the bathroom. Sandra moved to the bedroom. Sandra picked up the apple. Mary journeyed to the garden. John left the football. John journeyed to the garden. John took the milk. John put down the milk. John went to the bedroom. Daniel journeyed to the office. Sandra left the apple. Daniel went to the hallway. Mary travelled to the kitchen. John travelled to the office. Daniel picked up the football. Sandra grabbed the apple. John went back to the garden. Daniel dropped the football. John moved to the office. Sandra travelled to the bathroom. Daniel grabbed the football there. Mary travelled to the bathroom. John went to the hallway. Sandra put down the apple. Sandra went back to the hallway. Mary picked up the apple. Daniel dropped the football there. Mary dropped the apple. Mary grabbed the apple. John journeyed to the office. John moved to the hallway. Mary journeyed to the office. Mary left the apple. Daniel moved to the kitchen. Mary took the apple. Sandra journeyed to the kitchen. Sandra moved to the bathroom. Sandra journeyed to the kitchen. Daniel travelled to the garden. Daniel moved to the kitchen. John took the football. Sandra journeyed to the office. Mary went back to the kitchen. Mary moved to the garden. Mary left the apple. Daniel travelled to the hallway.
babilong_0k_qa3_sample_21
740
89
432
Write a function to find the median of a trapezium.
def median_trapezium(base1,base2,height): median = 0.5 * (base1+ base2) return median
[ "assert median_trapezium(15,25,35)==20", "assert median_trapezium(10,20,30)==15", "assert median_trapezium(6,9,4)==7.5" ]
[]
Sandra travelled to the garden. Mary took the football there. Sandra picked up the apple there. Daniel went to the office. Mary put down the football. Sandra travelled to the kitchen. Daniel got the milk there. Mary moved to the garden. Sandra travelled to the garden. Daniel discarded the milk. Daniel journeyed to the bathroom. Sandra went back to the kitchen.
babilong_0k_qa2_sample_75
76
89
85
Write a function to find the surface area of a sphere.
import math def surfacearea_sphere(r): surfacearea=4*math.pi*r*r return surfacearea
[ "assert surfacearea_sphere(10)==1256.6370614359173", "assert surfacearea_sphere(15)==2827.4333882308138", "assert surfacearea_sphere(20)==5026.548245743669" ]
[]
The hallway is north of the garden. The garden is north of the kitchen.
babilong_0k_qa4_sample_77
17
90
242
Write a function to count total characters in a string.
def count_charac(str1): total = 0 for i in str1: total = total + 1 return total
[ "assert count_charac(\"python programming\")==18", "assert count_charac(\"language\")==8", "assert count_charac(\"words\")==5" ]
[]
The bedroom is north of the bathroom. The bedroom is south of the kitchen.
babilong_0k_qa4_sample_62
17
90
252
Write a python function to convert complex numbers to polar coordinates.
import cmath def convert(numbers): num = cmath.polar(numbers) return (num)
[ "assert convert(1) == (1.0, 0.0)", "assert convert(4) == (4.0,0.0)", "assert convert(5) == (5.0,0.0)" ]
[]
Mary moved to the hallway. Daniel travelled to the hallway. John went back to the hallway. John went to the office. John moved to the kitchen. John travelled to the bathroom. Sandra travelled to the garden. Sandra went to the bathroom. Daniel moved to the bathroom. John went to the office.
babilong_0k_qa1_sample_75
62
90
End of preview. Expand in Data Studio

MBPP Long-Context Dataset

Overview

MBPP Long-Context is a benchmark dataset that combines coding problems from the MBPP (Mostly Basic Python Problems) dataset with long-context distractors from BABILong. This dataset evaluates code generation performance under long-context conditions, testing whether models can maintain coding ability with stuffed context.

Dataset Structure

Data Fields

Each sample contains:

Original MBPP Fields

  • task_id (int): Unique task identifier
  • text (str): Problem description
  • code (str): Reference solution
  • test_list (List[str]): Test cases (assertions)
  • test_setup_code (str): Optional setup code
  • challenge_test_list (List[str]): Additional test cases

Long-Context Fields

  • context (str): Prepended distractor text from BABILong, ranging from 0k to 1M.
  • context_id (str): BABILong source identifier (e.g., "babilong_128k_qa1_sample_42")
  • context_length_tokens (int): Token count using Llama tokenizer

Metadata

  • code_length_chars (int): Reference solution length for difficulty tracking

Data Splits

All configurations follow the original MBPP split structure:

  • test: 500 samples (primary evaluation set)
  • train: 374 samples
  • validation: 90 samples
  • prompt: 10 samples (few-shot examples)

Creating the dataset

To avoid confounding variables, this dataset uses stratified random assignment, where:

  1. Sort MBPP tasks by code length
  2. Get text from BABILong qa1-qa10 splits
  3. Duplicate contexts to match task count (974 samples)
  4. Shuffle contexts and assign to sorted tasks

Source Datasets

MBPP (Mostly Basic Python Problems)

BABILong

Downloads last month
291