Reasoning Model Tutorial
Collection
We train on a hybrid dataset of coding problems (based on MBPP), where each problem comes with a worked-out reasoning trace. • 5 items • Updated
task_id int64 604 974 | distilled_from stringclasses 3
values | split stringclasses 1
value | instruction stringlengths 38 250 | code stringlengths 115 900 | test_list listlengths 3 5 | mode stringclasses 2
values | conversations listlengths 2 2 | n_tokens int64 118 2.05k |
|---|---|---|---|---|---|---|---|---|
604 | 8B | train | Write a function to reverse words seperated by spaces in a given string. | def reverse_words(s):
words = s.split()
return ' '.join(reversed(words))
assert reverse_words("python program")==("program python")
assert reverse_words("java language")==("language java")
assert reverse_words("indian man")==("man indian") | [
"assert reverse_words(\"python program\")==(\"program python\")",
"assert reverse_words(\"java language\")==(\"language java\")",
"assert reverse_words(\"indian man\")==(\"man indian\")"
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to reverse words seperated by spaces in a given string.\n\nTest:\nassert reverse_words(\"python program\")==(\"program python\")\nassert reverse_words(\"java language\")==(\"language java\")\nassert reverse_words(\"in... | 566 |
604 | 8B | train | Write a function to reverse words seperated by spaces in a given string. | def reverse_words(s):
words = s.split()
return ' '.join(reversed(words))
assert reverse_words("python program")==("program python")
assert reverse_words("java language")==("language java")
assert reverse_words("indian man")==("man indian") | [
"assert reverse_words(\"python program\")==(\"program python\")",
"assert reverse_words(\"java language\")==(\"language java\")",
"assert reverse_words(\"indian man\")==(\"man indian\")"
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to reverse words seperated by spaces in a given string.\n\nTest:\nassert reverse_words(\"python program\")==(\"program python\")\nassert reverse_words(\"java language\")==(\"language java\")\nassert reverse_words(\"in... | 154 |
604 | 4B | train | Write a function to reverse words seperated by spaces in a given string. | def reverse_words(s):
return ' '.join(reversed(s.split()))
assert reverse_words("python program")==("program python")
assert reverse_words("java language")==("language java")
assert reverse_words("indian man")==("man indian") | [
"assert reverse_words(\"python program\")==(\"program python\")",
"assert reverse_words(\"java language\")==(\"language java\")",
"assert reverse_words(\"indian man\")==(\"man indian\")"
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to reverse words seperated by spaces in a given string.\n\nTest:\nassert reverse_words(\"python program\")==(\"program python\")\nassert reverse_words(\"java language\")==(\"language java\")\nassert reverse_words(\"in... | 488 |
604 | 4B | train | Write a function to reverse words seperated by spaces in a given string. | def reverse_words(s):
return ' '.join(reversed(s.split()))
assert reverse_words("python program")==("program python")
assert reverse_words("java language")==("language java")
assert reverse_words("indian man")==("man indian") | [
"assert reverse_words(\"python program\")==(\"program python\")",
"assert reverse_words(\"java language\")==(\"language java\")",
"assert reverse_words(\"indian man\")==(\"man indian\")"
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to reverse words seperated by spaces in a given string.\n\nTest:\nassert reverse_words(\"python program\")==(\"program python\")\nassert reverse_words(\"java language\")==(\"language java\")\nassert reverse_words(\"in... | 149 |
605 | 8B | train | Write a function to check if the given integer is a prime number. | def prime_num(n):
if n <= 1:
return False
if n <= 3:
return True
if n % 2 == 0 or n % 3 == 0:
return False
i = 5
while i * i <= n:
if n % i == 0 or n % (i + 2) == 0:
return False
i += 6
return True
assert prime_num(13)==True
assert prime_num(7... | [
"assert prime_num(13)==True",
"assert prime_num(7)==True",
"assert prime_num(-1010)==False"
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to check if the given integer is a prime number.\n\nTest:\nassert prime_num(13)==True\nassert prime_num(7)==True\nassert prime_num(-1010)==False"
},
{
"from": "gpt",
"value": "<think>\nOkay, I need to writ... | 831 |
605 | 8B | train | Write a function to check if the given integer is a prime number. | def prime_num(n):
if n <= 1:
return False
if n <= 3:
return True
if n % 2 == 0 or n % 3 == 0:
return False
i = 5
while i * i <= n:
if n % i == 0 or n % (i + 2) == 0:
return False
i += 6
return True
assert prime_num(13)==True
assert prime_num(7... | [
"assert prime_num(13)==True",
"assert prime_num(7)==True",
"assert prime_num(-1010)==False"
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to check if the given integer is a prime number.\n\nTest:\nassert prime_num(13)==True\nassert prime_num(7)==True\nassert prime_num(-1010)==False"
},
{
"from": "gpt",
"value": "<think></think>\n\n```python\... | 218 |
605 | 4B | train | Write a function to check if the given integer is a prime number. | def prime_num(n):
if n < 2:
return False
if n == 2:
return True
if n % 2 == 0:
return False
max_divisor = int(n**0.5) + 1
for i in range(3, max_divisor, 2):
if n % i == 0:
return False
return True
assert prime_num(13)==True
assert prime_num(7)==True
a... | [
"assert prime_num(13)==True",
"assert prime_num(7)==True",
"assert prime_num(-1010)==False"
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to check if the given integer is a prime number.\n\nTest:\nassert prime_num(13)==True\nassert prime_num(7)==True\nassert prime_num(-1010)==False"
},
{
"from": "gpt",
"value": "<think>\nOkay, I need to writ... | 908 |
605 | 4B | train | Write a function to check if the given integer is a prime number. | def prime_num(n):
if n < 2:
return False
if n == 2:
return True
if n % 2 == 0:
return False
max_divisor = int(n**0.5) + 1
for i in range(3, max_divisor, 2):
if n % i == 0:
return False
return True
assert prime_num(13)==True
assert prime_num(7)==True
a... | [
"assert prime_num(13)==True",
"assert prime_num(7)==True",
"assert prime_num(-1010)==False"
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to check if the given integer is a prime number.\n\nTest:\nassert prime_num(13)==True\nassert prime_num(7)==True\nassert prime_num(-1010)==False"
},
{
"from": "gpt",
"value": "<think></think>\n\n```python\... | 209 |
606 | 8B | train | Write a function to convert degrees to radians. | import math
def radian_degree(degrees):
return degrees * math.pi / 180
assert radian_degree(90)==1.5707963267948966
assert radian_degree(60)==1.0471975511965976
assert radian_degree(120)==2.0943951023931953 | [
"assert radian_degree(90)==1.5707963267948966",
"assert radian_degree(60)==1.0471975511965976",
"assert radian_degree(120)==2.0943951023931953"
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to convert degrees to radians.\n\nTest:\nassert radian_degree(90)==1.5707963267948966\nassert radian_degree(60)==1.0471975511965976\nassert radian_degree(120)==2.0943951023931953"
},
{
"from": "gpt",
"valu... | 591 |
606 | 8B | train | Write a function to convert degrees to radians. | import math
def radian_degree(degrees):
return degrees * math.pi / 180
assert radian_degree(90)==1.5707963267948966
assert radian_degree(60)==1.0471975511965976
assert radian_degree(120)==2.0943951023931953 | [
"assert radian_degree(90)==1.5707963267948966",
"assert radian_degree(60)==1.0471975511965976",
"assert radian_degree(120)==2.0943951023931953"
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to convert degrees to radians.\n\nTest:\nassert radian_degree(90)==1.5707963267948966\nassert radian_degree(60)==1.0471975511965976\nassert radian_degree(120)==2.0943951023931953"
},
{
"from": "gpt",
"valu... | 245 |
606 | 4B | train | Write a function to convert degrees to radians. | import math
def radian_degree(degrees):
return degrees * math.pi / 180
assert radian_degree(90)==1.5707963267948966
assert radian_degree(60)==1.0471975511965976
assert radian_degree(120)==2.0943951023931953 | [
"assert radian_degree(90)==1.5707963267948966",
"assert radian_degree(60)==1.0471975511965976",
"assert radian_degree(120)==2.0943951023931953"
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to convert degrees to radians.\n\nTest:\nassert radian_degree(90)==1.5707963267948966\nassert radian_degree(60)==1.0471975511965976\nassert radian_degree(120)==2.0943951023931953"
},
{
"from": "gpt",
"valu... | 586 |
606 | 4B | train | Write a function to convert degrees to radians. | import math
def radian_degree(degrees):
return degrees * math.pi / 180
assert radian_degree(90)==1.5707963267948966
assert radian_degree(60)==1.0471975511965976
assert radian_degree(120)==2.0943951023931953 | [
"assert radian_degree(90)==1.5707963267948966",
"assert radian_degree(60)==1.0471975511965976",
"assert radian_degree(120)==2.0943951023931953"
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to convert degrees to radians.\n\nTest:\nassert radian_degree(90)==1.5707963267948966\nassert radian_degree(60)==1.0471975511965976\nassert radian_degree(120)==2.0943951023931953"
},
{
"from": "gpt",
"valu... | 245 |
607 | 8B | train | Write a function to search a string for a regex pattern. The function should return the matching subtring, a start index and an end index. | import re
def find_literals(text, pattern):
regex = re.compile(re.escape(pattern))
match = regex.search(text)
if match:
return (match.group(), match.start(), match.end())
assert find_literals('The quick brown fox jumps over the lazy dog.', 'fox') == ('fox', 16, 19)
assert find_literals('Its been a... | [
"assert find_literals('The quick brown fox jumps over the lazy dog.', 'fox') == ('fox', 16, 19)",
"assert find_literals('Its been a very crazy procedure right', 'crazy') == ('crazy', 16, 21)",
"assert find_literals('Hardest choices required strongest will', 'will') == ('will', 35, 39)"
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to search a string for a regex pattern. The function should return the matching subtring, a start index and an end index.\n\nTest:\nassert find_literals('The quick brown fox jumps over the lazy dog.', 'fox') == ('fox'... | 1,991 |
607 | 8B | train | Write a function to search a string for a regex pattern. The function should return the matching subtring, a start index and an end index. | import re
def find_literals(text, pattern):
regex = re.compile(re.escape(pattern))
match = regex.search(text)
if match:
return (match.group(), match.start(), match.end())
assert find_literals('The quick brown fox jumps over the lazy dog.', 'fox') == ('fox', 16, 19)
assert find_literals('Its been a... | [
"assert find_literals('The quick brown fox jumps over the lazy dog.', 'fox') == ('fox', 16, 19)",
"assert find_literals('Its been a very crazy procedure right', 'crazy') == ('crazy', 16, 21)",
"assert find_literals('Hardest choices required strongest will', 'will') == ('will', 35, 39)"
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to search a string for a regex pattern. The function should return the matching subtring, a start index and an end index.\n\nTest:\nassert find_literals('The quick brown fox jumps over the lazy dog.', 'fox') == ('fox'... | 290 |
610 | 8B | train | Write a python function which takes a list and returns a list with the same elements, but the k'th element removed. | def remove_kth_element(lst, k):
index = k - 1
return lst[:index] + lst[index+1:]
assert remove_kth_element([1,1,2,3,4,4,5,1],3)==[1, 1, 3, 4, 4, 5, 1]
assert remove_kth_element([0, 0, 1, 2, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 4, 4],4)==[0, 0, 1, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 4, 4]
assert remove_kth_element([10, 10, ... | [
"assert remove_kth_element([1,1,2,3,4,4,5,1],3)==[1, 1, 3, 4, 4, 5, 1]",
"assert remove_kth_element([0, 0, 1, 2, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 4, 4],4)==[0, 0, 1, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 4, 4]",
"assert remove_kth_element([10, 10, 15, 19, 18, 18, 17, 26, 26, 17, 18, 10],5)==[10,10,15,19, 18, 17, 26, 26, 1... | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a python function which takes a list and returns a list with the same elements, but the k'th element removed.\n\nTest:\nassert remove_kth_element([1,1,2,3,4,4,5,1],3)==[1, 1, 3, 4, 4, 5, 1]\nassert remove_kth_element([0, 0, 1, 2... | 1,411 |
610 | 8B | train | Write a python function which takes a list and returns a list with the same elements, but the k'th element removed. | def remove_kth_element(lst, k):
index = k - 1
return lst[:index] + lst[index+1:]
assert remove_kth_element([1,1,2,3,4,4,5,1],3)==[1, 1, 3, 4, 4, 5, 1]
assert remove_kth_element([0, 0, 1, 2, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 4, 4],4)==[0, 0, 1, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 4, 4]
assert remove_kth_element([10, 10, ... | [
"assert remove_kth_element([1,1,2,3,4,4,5,1],3)==[1, 1, 3, 4, 4, 5, 1]",
"assert remove_kth_element([0, 0, 1, 2, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 4, 4],4)==[0, 0, 1, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 4, 4]",
"assert remove_kth_element([10, 10, 15, 19, 18, 18, 17, 26, 26, 17, 18, 10],5)==[10,10,15,19, 18, 17, 26, 26, 1... | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a python function which takes a list and returns a list with the same elements, but the k'th element removed.\n\nTest:\nassert remove_kth_element([1,1,2,3,4,4,5,1],3)==[1, 1, 3, 4, 4, 5, 1]\nassert remove_kth_element([0, 0, 1, 2... | 587 |
610 | 4B | train | Write a python function which takes a list and returns a list with the same elements, but the k'th element removed. | def remove_kth_element(lst, k):
return lst[:k-1] + lst[k:]
assert remove_kth_element([1,1,2,3,4,4,5,1],3)==[1, 1, 3, 4, 4, 5, 1]
assert remove_kth_element([0, 0, 1, 2, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 4, 4],4)==[0, 0, 1, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 4, 4]
assert remove_kth_element([10, 10, 15, 19, 18, 18, 17, 26, 26... | [
"assert remove_kth_element([1,1,2,3,4,4,5,1],3)==[1, 1, 3, 4, 4, 5, 1]",
"assert remove_kth_element([0, 0, 1, 2, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 4, 4],4)==[0, 0, 1, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 4, 4]",
"assert remove_kth_element([10, 10, 15, 19, 18, 18, 17, 26, 26, 17, 18, 10],5)==[10,10,15,19, 18, 17, 26, 26, 1... | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a python function which takes a list and returns a list with the same elements, but the k'th element removed.\n\nTest:\nassert remove_kth_element([1,1,2,3,4,4,5,1],3)==[1, 1, 3, 4, 4, 5, 1]\nassert remove_kth_element([0, 0, 1, 2... | 1,326 |
610 | 4B | train | Write a python function which takes a list and returns a list with the same elements, but the k'th element removed. | def remove_kth_element(lst, k):
return lst[:k-1] + lst[k:]
assert remove_kth_element([1,1,2,3,4,4,5,1],3)==[1, 1, 3, 4, 4, 5, 1]
assert remove_kth_element([0, 0, 1, 2, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 4, 4],4)==[0, 0, 1, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 4, 4]
assert remove_kth_element([10, 10, 15, 19, 18, 18, 17, 26, 26... | [
"assert remove_kth_element([1,1,2,3,4,4,5,1],3)==[1, 1, 3, 4, 4, 5, 1]",
"assert remove_kth_element([0, 0, 1, 2, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 4, 4],4)==[0, 0, 1, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 4, 4]",
"assert remove_kth_element([10, 10, 15, 19, 18, 18, 17, 26, 26, 17, 18, 10],5)==[10,10,15,19, 18, 17, 26, 26, 1... | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a python function which takes a list and returns a list with the same elements, but the k'th element removed.\n\nTest:\nassert remove_kth_element([1,1,2,3,4,4,5,1],3)==[1, 1, 3, 4, 4, 5, 1]\nassert remove_kth_element([0, 0, 1, 2... | 579 |
611 | 8B | train | Write a function which given a matrix represented as a list of lists returns the max of the n'th column. | def max_of_nth(tuples_list, n):
return max(t[n] for t in tuples_list)
assert max_of_nth([(5, 6, 7), (1, 3, 5), (8, 9, 19)], 2) == 19
assert max_of_nth([(6, 7, 8), (2, 4, 6), (9, 10, 20)], 1) == 10
assert max_of_nth([(7, 8, 9), (3, 5, 7), (10, 11, 21)], 1) == 11 | [
"assert max_of_nth([[5, 6, 7], [1, 3, 5], [8, 9, 19]], 2) == 19",
"assert max_of_nth([[6, 7, 8], [2, 4, 6], [9, 10, 20]], 1) == 10",
"assert max_of_nth([[7, 8, 9], [3, 5, 7], [10, 11, 21]], 1) == 11"
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function which given a matrix represented as a list of lists returns the max of the n'th column.\n\nTest:\nassert max_of_nth([[5, 6, 7], [1, 3, 5], [8, 9, 19]], 2) == 19\nassert max_of_nth([[6, 7, 8], [2, 4, 6], [9, 10, 20]], ... | 995 |
611 | 8B | train | Write a function which given a matrix represented as a list of lists returns the max of the n'th column. | def max_of_nth(tuples_list, n):
return max(t[n] for t in tuples_list)
assert max_of_nth([(5, 6, 7), (1, 3, 5), (8, 9, 19)], 2) == 19
assert max_of_nth([(6, 7, 8), (2, 4, 6), (9, 10, 20)], 1) == 10
assert max_of_nth([(7, 8, 9), (3, 5, 7), (10, 11, 21)], 1) == 11 | [
"assert max_of_nth([[5, 6, 7], [1, 3, 5], [8, 9, 19]], 2) == 19",
"assert max_of_nth([[6, 7, 8], [2, 4, 6], [9, 10, 20]], 1) == 10",
"assert max_of_nth([[7, 8, 9], [3, 5, 7], [10, 11, 21]], 1) == 11"
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function which given a matrix represented as a list of lists returns the max of the n'th column.\n\nTest:\nassert max_of_nth([[5, 6, 7], [1, 3, 5], [8, 9, 19]], 2) == 19\nassert max_of_nth([[6, 7, 8], [2, 4, 6], [9, 10, 20]], ... | 341 |
611 | 4B | train | Write a function which given a matrix represented as a list of lists returns the max of the n'th column. | def max_of_nth(tuples_list, n):
return max(tup[n] for tup in tuples_list)
assert max_of_nth([(5, 6, 7), (1, 3, 5), (8, 9, 19)], 2) == 19
assert max_of_nth([(6, 7, 8), (2, 4, 6), (9, 10, 20)], 1) == 10
assert max_of_nth([(7, 8, 9), (3, 5, 7), (10, 11, 21)], 1) == 11 | [
"assert max_of_nth([[5, 6, 7], [1, 3, 5], [8, 9, 19]], 2) == 19",
"assert max_of_nth([[6, 7, 8], [2, 4, 6], [9, 10, 20]], 1) == 10",
"assert max_of_nth([[7, 8, 9], [3, 5, 7], [10, 11, 21]], 1) == 11"
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function which given a matrix represented as a list of lists returns the max of the n'th column.\n\nTest:\nassert max_of_nth([[5, 6, 7], [1, 3, 5], [8, 9, 19]], 2) == 19\nassert max_of_nth([[6, 7, 8], [2, 4, 6], [9, 10, 20]], ... | 786 |
611 | 4B | train | Write a function which given a matrix represented as a list of lists returns the max of the n'th column. | def max_of_nth(tuples_list, n):
return max(tup[n] for tup in tuples_list)
assert max_of_nth([(5, 6, 7), (1, 3, 5), (8, 9, 19)], 2) == 19
assert max_of_nth([(6, 7, 8), (2, 4, 6), (9, 10, 20)], 1) == 10
assert max_of_nth([(7, 8, 9), (3, 5, 7), (10, 11, 21)], 1) == 11 | [
"assert max_of_nth([[5, 6, 7], [1, 3, 5], [8, 9, 19]], 2) == 19",
"assert max_of_nth([[6, 7, 8], [2, 4, 6], [9, 10, 20]], 1) == 10",
"assert max_of_nth([[7, 8, 9], [3, 5, 7], [10, 11, 21]], 1) == 11"
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function which given a matrix represented as a list of lists returns the max of the n'th column.\n\nTest:\nassert max_of_nth([[5, 6, 7], [1, 3, 5], [8, 9, 19]], 2) == 19\nassert max_of_nth([[6, 7, 8], [2, 4, 6], [9, 10, 20]], ... | 342 |
612 | 8B | train | Write a python function which takes a list of lists, where each sublist has two elements, and returns a list of two lists where the first list has the first element of each sublist and the second one has the second. | def merge(lists):
return [list(row) for row in zip(*lists)]
assert merge([['x', 'y'], ['a', 'b'], ['m', 'n']]) == [['x', 'a', 'm'], ['y', 'b', 'n']]
assert merge([[1, 2], [3, 4], [5, 6], [7, 8]]) == [[1, 3, 5, 7], [2, 4, 6, 8]]
assert merge([['x', 'y','z' ], ['a', 'b','c'], ['m', 'n','o']]) == [['x', 'a', 'm'], ['... | [
"assert merge([['x', 'y'], ['a', 'b'], ['m', 'n']]) == [['x', 'a', 'm'], ['y', 'b', 'n']]",
"assert merge([[1, 2], [3, 4], [5, 6], [7, 8]]) == [[1, 3, 5, 7], [2, 4, 6, 8]]",
"assert merge([['x', 'y','z' ], ['a', 'b','c'], ['m', 'n','o']]) == [['x', 'a', 'm'], ['y', 'b', 'n'],['z', 'c','o']]"
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a python function which takes a list of lists, where each sublist has two elements, and returns a list of two lists where the first list has the first element of each sublist and the second one has the second.\n\nTest:\nassert m... | 1,504 |
612 | 8B | train | Write a python function which takes a list of lists, where each sublist has two elements, and returns a list of two lists where the first list has the first element of each sublist and the second one has the second. | def merge(lists):
return [list(row) for row in zip(*lists)]
assert merge([['x', 'y'], ['a', 'b'], ['m', 'n']]) == [['x', 'a', 'm'], ['y', 'b', 'n']]
assert merge([[1, 2], [3, 4], [5, 6], [7, 8]]) == [[1, 3, 5, 7], [2, 4, 6, 8]]
assert merge([['x', 'y','z' ], ['a', 'b','c'], ['m', 'n','o']]) == [['x', 'a', 'm'], ['... | [
"assert merge([['x', 'y'], ['a', 'b'], ['m', 'n']]) == [['x', 'a', 'm'], ['y', 'b', 'n']]",
"assert merge([[1, 2], [3, 4], [5, 6], [7, 8]]) == [[1, 3, 5, 7], [2, 4, 6, 8]]",
"assert merge([['x', 'y','z' ], ['a', 'b','c'], ['m', 'n','o']]) == [['x', 'a', 'm'], ['y', 'b', 'n'],['z', 'c','o']]"
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a python function which takes a list of lists, where each sublist has two elements, and returns a list of two lists where the first list has the first element of each sublist and the second one has the second.\n\nTest:\nassert m... | 407 |
613 | 8B | train | Write a function to find the maximum value in record list as tuple attribute in the given tuple list. | def maximum_value(input_list):
result = []
for item in input_list:
key = item[0]
values = item[1]
max_val = max(values)
result.append((key, max_val))
return result
assert maximum_value([('key1', [3, 4, 5]), ('key2', [1, 4, 2]), ('key3', [9, 3])]) == [('key1', 5), ('key2', 4)... | [
"assert maximum_value([('key1', [3, 4, 5]), ('key2', [1, 4, 2]), ('key3', [9, 3])]) == [('key1', 5), ('key2', 4), ('key3', 9)]",
"assert maximum_value([('key1', [4, 5, 6]), ('key2', [2, 5, 3]), ('key3', [10, 4])]) == [('key1', 6), ('key2', 5), ('key3', 10)]",
"assert maximum_value([('key1', [5, 6, 7]), ('key2',... | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to find the maximum value in record list as tuple attribute in the given tuple list.\n\nTest:\nassert maximum_value([('key1', [3, 4, 5]), ('key2', [1, 4, 2]), ('key3', [9, 3])]) == [('key1', 5), ('key2', 4), ('key3', ... | 1,121 |
613 | 8B | train | Write a function to find the maximum value in record list as tuple attribute in the given tuple list. | def maximum_value(input_list):
result = []
for item in input_list:
key = item[0]
values = item[1]
max_val = max(values)
result.append((key, max_val))
return result
assert maximum_value([('key1', [3, 4, 5]), ('key2', [1, 4, 2]), ('key3', [9, 3])]) == [('key1', 5), ('key2', 4)... | [
"assert maximum_value([('key1', [3, 4, 5]), ('key2', [1, 4, 2]), ('key3', [9, 3])]) == [('key1', 5), ('key2', 4), ('key3', 9)]",
"assert maximum_value([('key1', [4, 5, 6]), ('key2', [2, 5, 3]), ('key3', [10, 4])]) == [('key1', 6), ('key2', 5), ('key3', 10)]",
"assert maximum_value([('key1', [5, 6, 7]), ('key2',... | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to find the maximum value in record list as tuple attribute in the given tuple list.\n\nTest:\nassert maximum_value([('key1', [3, 4, 5]), ('key2', [1, 4, 2]), ('key3', [9, 3])]) == [('key1', 5), ('key2', 4), ('key3', ... | 502 |
613 | 4B | train | Write a function to find the maximum value in record list as tuple attribute in the given tuple list. | def maximum_value(records):
result = []
for key, nums in records:
max_num = max(nums)
result.append( (key, max_num) )
return result
assert maximum_value([('key1', [3, 4, 5]), ('key2', [1, 4, 2]), ('key3', [9, 3])]) == [('key1', 5), ('key2', 4), ('key3', 9)]
assert maximum_value([('key1', [4... | [
"assert maximum_value([('key1', [3, 4, 5]), ('key2', [1, 4, 2]), ('key3', [9, 3])]) == [('key1', 5), ('key2', 4), ('key3', 9)]",
"assert maximum_value([('key1', [4, 5, 6]), ('key2', [2, 5, 3]), ('key3', [10, 4])]) == [('key1', 6), ('key2', 5), ('key3', 10)]",
"assert maximum_value([('key1', [5, 6, 7]), ('key2',... | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to find the maximum value in record list as tuple attribute in the given tuple list.\n\nTest:\nassert maximum_value([('key1', [3, 4, 5]), ('key2', [1, 4, 2]), ('key3', [9, 3])]) == [('key1', 5), ('key2', 4), ('key3', ... | 912 |
613 | 4B | train | Write a function to find the maximum value in record list as tuple attribute in the given tuple list. | def maximum_value(records):
result = []
for key, nums in records:
max_num = max(nums)
result.append( (key, max_num) )
return result
assert maximum_value([('key1', [3, 4, 5]), ('key2', [1, 4, 2]), ('key3', [9, 3])]) == [('key1', 5), ('key2', 4), ('key3', 9)]
assert maximum_value([('key1', [4... | [
"assert maximum_value([('key1', [3, 4, 5]), ('key2', [1, 4, 2]), ('key3', [9, 3])]) == [('key1', 5), ('key2', 4), ('key3', 9)]",
"assert maximum_value([('key1', [4, 5, 6]), ('key2', [2, 5, 3]), ('key3', [10, 4])]) == [('key1', 6), ('key2', 5), ('key3', 10)]",
"assert maximum_value([('key1', [5, 6, 7]), ('key2',... | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to find the maximum value in record list as tuple attribute in the given tuple list.\n\nTest:\nassert maximum_value([('key1', [3, 4, 5]), ('key2', [1, 4, 2]), ('key3', [9, 3])]) == [('key1', 5), ('key2', 4), ('key3', ... | 490 |
614 | 8B | train | Write a function to find the cumulative sum of all the values that are present in the given tuple list. | def cummulative_sum(tuples_list):
total = 0
for t in tuples_list:
for num in t:
total += num
return total
assert cummulative_sum([(1, 3), (5, 6, 7), (2, 6)]) == 30
assert cummulative_sum([(2, 4), (6, 7, 8), (3, 7)]) == 37
assert cummulative_sum([(3, 5), (7, 8, 9), (4, 8)]) == 44 | [
"assert cummulative_sum([(1, 3), (5, 6, 7), (2, 6)]) == 30",
"assert cummulative_sum([(2, 4), (6, 7, 8), (3, 7)]) == 37",
"assert cummulative_sum([(3, 5), (7, 8, 9), (4, 8)]) == 44"
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to find the cumulative sum of all the values that are present in the given tuple list.\n\nTest:\nassert cummulative_sum([(1, 3), (5, 6, 7), (2, 6)]) == 30\nassert cummulative_sum([(2, 4), (6, 7, 8), (3, 7)]) == 37\nas... | 726 |
614 | 8B | train | Write a function to find the cumulative sum of all the values that are present in the given tuple list. | def cummulative_sum(tuples_list):
total = 0
for t in tuples_list:
for num in t:
total += num
return total
assert cummulative_sum([(1, 3), (5, 6, 7), (2, 6)]) == 30
assert cummulative_sum([(2, 4), (6, 7, 8), (3, 7)]) == 37
assert cummulative_sum([(3, 5), (7, 8, 9), (4, 8)]) == 44 | [
"assert cummulative_sum([(1, 3), (5, 6, 7), (2, 6)]) == 30",
"assert cummulative_sum([(2, 4), (6, 7, 8), (3, 7)]) == 37",
"assert cummulative_sum([(3, 5), (7, 8, 9), (4, 8)]) == 44"
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to find the cumulative sum of all the values that are present in the given tuple list.\n\nTest:\nassert cummulative_sum([(1, 3), (5, 6, 7), (2, 6)]) == 30\nassert cummulative_sum([(2, 4), (6, 7, 8), (3, 7)]) == 37\nas... | 294 |
614 | 4B | train | Write a function to find the cumulative sum of all the values that are present in the given tuple list. | def cummulative_sum(tuples_list):
total = 0
for t in tuples_list:
total += sum(t)
return total
assert cummulative_sum([(1, 3), (5, 6, 7), (2, 6)]) == 30
assert cummulative_sum([(2, 4), (6, 7, 8), (3, 7)]) == 37
assert cummulative_sum([(3, 5), (7, 8, 9), (4, 8)]) == 44 | [
"assert cummulative_sum([(1, 3), (5, 6, 7), (2, 6)]) == 30",
"assert cummulative_sum([(2, 4), (6, 7, 8), (3, 7)]) == 37",
"assert cummulative_sum([(3, 5), (7, 8, 9), (4, 8)]) == 44"
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to find the cumulative sum of all the values that are present in the given tuple list.\n\nTest:\nassert cummulative_sum([(1, 3), (5, 6, 7), (2, 6)]) == 30\nassert cummulative_sum([(2, 4), (6, 7, 8), (3, 7)]) == 37\nas... | 782 |
614 | 4B | train | Write a function to find the cumulative sum of all the values that are present in the given tuple list. | def cummulative_sum(tuples_list):
total = 0
for t in tuples_list:
total += sum(t)
return total
assert cummulative_sum([(1, 3), (5, 6, 7), (2, 6)]) == 30
assert cummulative_sum([(2, 4), (6, 7, 8), (3, 7)]) == 37
assert cummulative_sum([(3, 5), (7, 8, 9), (4, 8)]) == 44 | [
"assert cummulative_sum([(1, 3), (5, 6, 7), (2, 6)]) == 30",
"assert cummulative_sum([(2, 4), (6, 7, 8), (3, 7)]) == 37",
"assert cummulative_sum([(3, 5), (7, 8, 9), (4, 8)]) == 44"
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to find the cumulative sum of all the values that are present in the given tuple list.\n\nTest:\nassert cummulative_sum([(1, 3), (5, 6, 7), (2, 6)]) == 30\nassert cummulative_sum([(2, 4), (6, 7, 8), (3, 7)]) == 37\nas... | 289 |
616 | 8B | train | Write a function which takes two tuples of the same length and performs the element wise modulo. | def tuple_modulo(t1, t2):
return tuple(a % b for a, b in zip(t1, t2))
assert tuple_modulo((10, 4, 5, 6), (5, 6, 7, 5)) == (0, 4, 5, 1)
assert tuple_modulo((11, 5, 6, 7), (6, 7, 8, 6)) == (5, 5, 6, 1)
assert tuple_modulo((12, 6, 7, 8), (7, 8, 9, 7)) == (5, 6, 7, 1) | [
"assert tuple_modulo((10, 4, 5, 6), (5, 6, 7, 5)) == (0, 4, 5, 1)",
"assert tuple_modulo((11, 5, 6, 7), (6, 7, 8, 6)) == (5, 5, 6, 1)",
"assert tuple_modulo((12, 6, 7, 8), (7, 8, 9, 7)) == (5, 6, 7, 1)"
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function which takes two tuples of the same length and performs the element wise modulo.\n\nTest:\nassert tuple_modulo((10, 4, 5, 6), (5, 6, 7, 5)) == (0, 4, 5, 1)\nassert tuple_modulo((11, 5, 6, 7), (6, 7, 8, 6)) == (5, 5, 6,... | 913 |
616 | 8B | train | Write a function which takes two tuples of the same length and performs the element wise modulo. | def tuple_modulo(t1, t2):
return tuple(a % b for a, b in zip(t1, t2))
assert tuple_modulo((10, 4, 5, 6), (5, 6, 7, 5)) == (0, 4, 5, 1)
assert tuple_modulo((11, 5, 6, 7), (6, 7, 8, 6)) == (5, 5, 6, 1)
assert tuple_modulo((12, 6, 7, 8), (7, 8, 9, 7)) == (5, 6, 7, 1) | [
"assert tuple_modulo((10, 4, 5, 6), (5, 6, 7, 5)) == (0, 4, 5, 1)",
"assert tuple_modulo((11, 5, 6, 7), (6, 7, 8, 6)) == (5, 5, 6, 1)",
"assert tuple_modulo((12, 6, 7, 8), (7, 8, 9, 7)) == (5, 6, 7, 1)"
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function which takes two tuples of the same length and performs the element wise modulo.\n\nTest:\nassert tuple_modulo((10, 4, 5, 6), (5, 6, 7, 5)) == (0, 4, 5, 1)\nassert tuple_modulo((11, 5, 6, 7), (6, 7, 8, 6)) == (5, 5, 6,... | 349 |
616 | 4B | train | Write a function which takes two tuples of the same length and performs the element wise modulo. | def tuple_modulo(t1, t2):
return tuple(a % b for a, b in zip(t1, t2))
assert tuple_modulo((10, 4, 5, 6), (5, 6, 7, 5)) == (0, 4, 5, 1)
assert tuple_modulo((11, 5, 6, 7), (6, 7, 8, 6)) == (5, 5, 6, 1)
assert tuple_modulo((12, 6, 7, 8), (7, 8, 9, 7)) == (5, 6, 7, 1) | [
"assert tuple_modulo((10, 4, 5, 6), (5, 6, 7, 5)) == (0, 4, 5, 1)",
"assert tuple_modulo((11, 5, 6, 7), (6, 7, 8, 6)) == (5, 5, 6, 1)",
"assert tuple_modulo((12, 6, 7, 8), (7, 8, 9, 7)) == (5, 6, 7, 1)"
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function which takes two tuples of the same length and performs the element wise modulo.\n\nTest:\nassert tuple_modulo((10, 4, 5, 6), (5, 6, 7, 5)) == (0, 4, 5, 1)\nassert tuple_modulo((11, 5, 6, 7), (6, 7, 8, 6)) == (5, 5, 6,... | 1,013 |
616 | 4B | train | Write a function which takes two tuples of the same length and performs the element wise modulo. | def tuple_modulo(t1, t2):
return tuple(a % b for a, b in zip(t1, t2))
assert tuple_modulo((10, 4, 5, 6), (5, 6, 7, 5)) == (0, 4, 5, 1)
assert tuple_modulo((11, 5, 6, 7), (6, 7, 8, 6)) == (5, 5, 6, 1)
assert tuple_modulo((12, 6, 7, 8), (7, 8, 9, 7)) == (5, 6, 7, 1) | [
"assert tuple_modulo((10, 4, 5, 6), (5, 6, 7, 5)) == (0, 4, 5, 1)",
"assert tuple_modulo((11, 5, 6, 7), (6, 7, 8, 6)) == (5, 5, 6, 1)",
"assert tuple_modulo((12, 6, 7, 8), (7, 8, 9, 7)) == (5, 6, 7, 1)"
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function which takes two tuples of the same length and performs the element wise modulo.\n\nTest:\nassert tuple_modulo((10, 4, 5, 6), (5, 6, 7, 5)) == (0, 4, 5, 1)\nassert tuple_modulo((11, 5, 6, 7), (6, 7, 8, 6)) == (5, 5, 6,... | 349 |
618 | 8B | train | Write a function to divide two lists element wise. | def div_list(list1, list2):
return list(map(lambda x, y: x / y, list1, list2))
assert div_list([4,5,6],[1, 2, 3])==[4.0,2.5,2.0]
assert div_list([3,2],[1,4])==[3.0, 0.5]
assert div_list([90,120],[50,70])==[1.8, 1.7142857142857142] | [
"assert div_list([4,5,6],[1, 2, 3])==[4.0,2.5,2.0]",
"assert div_list([3,2],[1,4])==[3.0, 0.5]",
"assert div_list([90,120],[50,70])==[1.8, 1.7142857142857142]"
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to divide two lists element wise.\n\nTest:\nassert div_list([4,5,6],[1, 2, 3])==[4.0,2.5,2.0]\nassert div_list([3,2],[1,4])==[3.0, 0.5]\nassert div_list([90,120],[50,70])==[1.8, 1.7142857142857142]"
},
{
"from... | 887 |
618 | 8B | train | Write a function to divide two lists element wise. | def div_list(list1, list2):
return list(map(lambda x, y: x / y, list1, list2))
assert div_list([4,5,6],[1, 2, 3])==[4.0,2.5,2.0]
assert div_list([3,2],[1,4])==[3.0, 0.5]
assert div_list([90,120],[50,70])==[1.8, 1.7142857142857142] | [
"assert div_list([4,5,6],[1, 2, 3])==[4.0,2.5,2.0]",
"assert div_list([3,2],[1,4])==[3.0, 0.5]",
"assert div_list([90,120],[50,70])==[1.8, 1.7142857142857142]"
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to divide two lists element wise.\n\nTest:\nassert div_list([4,5,6],[1, 2, 3])==[4.0,2.5,2.0]\nassert div_list([3,2],[1,4])==[3.0, 0.5]\nassert div_list([90,120],[50,70])==[1.8, 1.7142857142857142]"
},
{
"from... | 279 |
618 | 4B | train | Write a function to divide two lists element wise. | def div_list(list1, list2):
return list(map(lambda x, y: x / y, list1, list2))
assert div_list([4,5,6],[1, 2, 3])==[4.0,2.5,2.0]
assert div_list([3,2],[1,4])==[3.0, 0.5]
assert div_list([90,120],[50,70])==[1.8, 1.7142857142857142] | [
"assert div_list([4,5,6],[1, 2, 3])==[4.0,2.5,2.0]",
"assert div_list([3,2],[1,4])==[3.0, 0.5]",
"assert div_list([90,120],[50,70])==[1.8, 1.7142857142857142]"
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to divide two lists element wise.\n\nTest:\nassert div_list([4,5,6],[1, 2, 3])==[4.0,2.5,2.0]\nassert div_list([3,2],[1,4])==[3.0, 0.5]\nassert div_list([90,120],[50,70])==[1.8, 1.7142857142857142]"
},
{
"from... | 721 |
618 | 4B | train | Write a function to divide two lists element wise. | def div_list(list1, list2):
return list(map(lambda x, y: x / y, list1, list2))
assert div_list([4,5,6],[1, 2, 3])==[4.0,2.5,2.0]
assert div_list([3,2],[1,4])==[3.0, 0.5]
assert div_list([90,120],[50,70])==[1.8, 1.7142857142857142] | [
"assert div_list([4,5,6],[1, 2, 3])==[4.0,2.5,2.0]",
"assert div_list([3,2],[1,4])==[3.0, 0.5]",
"assert div_list([90,120],[50,70])==[1.8, 1.7142857142857142]"
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to divide two lists element wise.\n\nTest:\nassert div_list([4,5,6],[1, 2, 3])==[4.0,2.5,2.0]\nassert div_list([3,2],[1,4])==[3.0, 0.5]\nassert div_list([90,120],[50,70])==[1.8, 1.7142857142857142]"
},
{
"from... | 279 |
619 | 8B | train | Write a function to move all the numbers to the end of the given string. | def move_num(s):
result = []
numbers = []
for char in s:
if char.isdigit():
numbers.append(char)
else:
result.append(char)
return ''.join(result) + ''.join(numbers)
assert move_num('I1love143you55three3000thousand') == 'Iloveyouthreethousand1143553000'
assert mov... | [
"assert move_num('I1love143you55three3000thousand') == 'Iloveyouthreethousand1143553000'",
"assert move_num('Avengers124Assemble') == 'AvengersAssemble124'",
"assert move_num('Its11our12path13to14see15things16do17things') == 'Itsourpathtoseethingsdothings11121314151617'"
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to move all the numbers to the end of the given string.\n\nTest:\nassert move_num('I1love143you55three3000thousand') == 'Iloveyouthreethousand1143553000'\nassert move_num('Avengers124Assemble') == 'AvengersAssemble124... | 1,426 |
619 | 8B | train | Write a function to move all the numbers to the end of the given string. | def move_num(s):
result = []
numbers = []
for char in s:
if char.isdigit():
numbers.append(char)
else:
result.append(char)
return ''.join(result) + ''.join(numbers)
assert move_num('I1love143you55three3000thousand') == 'Iloveyouthreethousand1143553000'
assert mov... | [
"assert move_num('I1love143you55three3000thousand') == 'Iloveyouthreethousand1143553000'",
"assert move_num('Avengers124Assemble') == 'AvengersAssemble124'",
"assert move_num('Its11our12path13to14see15things16do17things') == 'Itsourpathtoseethingsdothings11121314151617'"
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to move all the numbers to the end of the given string.\n\nTest:\nassert move_num('I1love143you55three3000thousand') == 'Iloveyouthreethousand1143553000'\nassert move_num('Avengers124Assemble') == 'AvengersAssemble124... | 347 |
619 | 4B | train | Write a function to move all the numbers to the end of the given string. | def move_num(s):
non_digits = []
digits = []
for char in s:
if char.isdigit():
digits.append(char)
else:
non_digits.append(char)
return ''.join(non_digits) + ''.join(digits)
assert move_num('I1love143you55three3000thousand') == 'Iloveyouthreethousand1143553000'
a... | [
"assert move_num('I1love143you55three3000thousand') == 'Iloveyouthreethousand1143553000'",
"assert move_num('Avengers124Assemble') == 'AvengersAssemble124'",
"assert move_num('Its11our12path13to14see15things16do17things') == 'Itsourpathtoseethingsdothings11121314151617'"
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to move all the numbers to the end of the given string.\n\nTest:\nassert move_num('I1love143you55three3000thousand') == 'Iloveyouthreethousand1143553000'\nassert move_num('Avengers124Assemble') == 'AvengersAssemble124... | 1,735 |
619 | 4B | train | Write a function to move all the numbers to the end of the given string. | def move_num(s):
non_digits = []
digits = []
for char in s:
if char.isdigit():
digits.append(char)
else:
non_digits.append(char)
return ''.join(non_digits) + ''.join(digits)
assert move_num('I1love143you55three3000thousand') == 'Iloveyouthreethousand1143553000'
a... | [
"assert move_num('I1love143you55three3000thousand') == 'Iloveyouthreethousand1143553000'",
"assert move_num('Avengers124Assemble') == 'AvengersAssemble124'",
"assert move_num('Its11our12path13to14see15things16do17things') == 'Itsourpathtoseethingsdothings11121314151617'"
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to move all the numbers to the end of the given string.\n\nTest:\nassert move_num('I1love143you55three3000thousand') == 'Iloveyouthreethousand1143553000'\nassert move_num('Avengers124Assemble') == 'AvengersAssemble124... | 350 |
621 | 8B | train | Write a function to increment the numeric values in the given strings by k. | def increment_numerics(strings, k):
result = []
for s in strings:
if s.isdigit():
num = int(s)
result.append(str(num + k))
else:
result.append(s)
return result
assert increment_numerics(["MSM", "234", "is", "98", "123", "best", "4"] , 6) == ['MSM', '240',... | [
"assert increment_numerics([\"MSM\", \"234\", \"is\", \"98\", \"123\", \"best\", \"4\"] , 6) == ['MSM', '240', 'is', '104', '129', 'best', '10']",
"assert increment_numerics([\"Dart\", \"356\", \"is\", \"88\", \"169\", \"Super\", \"6\"] , 12) == ['Dart', '368', 'is', '100', '181', 'Super', '18']",
"assert incre... | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to increment the numeric values in the given strings by k.\n\nTest:\nassert increment_numerics([\"MSM\", \"234\", \"is\", \"98\", \"123\", \"best\", \"4\"] , 6) == ['MSM', '240', 'is', '104', '129', 'best', '10']\nass... | 1,404 |
621 | 8B | train | Write a function to increment the numeric values in the given strings by k. | def increment_numerics(strings, k):
result = []
for s in strings:
if s.isdigit():
num = int(s)
result.append(str(num + k))
else:
result.append(s)
return result
assert increment_numerics(["MSM", "234", "is", "98", "123", "best", "4"] , 6) == ['MSM', '240',... | [
"assert increment_numerics([\"MSM\", \"234\", \"is\", \"98\", \"123\", \"best\", \"4\"] , 6) == ['MSM', '240', 'is', '104', '129', 'best', '10']",
"assert increment_numerics([\"Dart\", \"356\", \"is\", \"88\", \"169\", \"Super\", \"6\"] , 12) == ['Dart', '368', 'is', '100', '181', 'Super', '18']",
"assert incre... | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to increment the numeric values in the given strings by k.\n\nTest:\nassert increment_numerics([\"MSM\", \"234\", \"is\", \"98\", \"123\", \"best\", \"4\"] , 6) == ['MSM', '240', 'is', '104', '129', 'best', '10']\nass... | 507 |
621 | 4B | train | Write a function to increment the numeric values in the given strings by k. | import re
def increment_numerics(strings, k):
result = []
for s in strings:
parts = re.findall(r'\d+|\D+', s)
processed_parts = []
for part in parts:
if part.isdigit():
num = int(part) + k
processed_parts.append(str(num))
else:
... | [
"assert increment_numerics([\"MSM\", \"234\", \"is\", \"98\", \"123\", \"best\", \"4\"] , 6) == ['MSM', '240', 'is', '104', '129', 'best', '10']",
"assert increment_numerics([\"Dart\", \"356\", \"is\", \"88\", \"169\", \"Super\", \"6\"] , 12) == ['Dart', '368', 'is', '100', '181', 'Super', '18']",
"assert incre... | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to increment the numeric values in the given strings by k.\n\nTest:\nassert increment_numerics([\"MSM\", \"234\", \"is\", \"98\", \"123\", \"best\", \"4\"] , 6) == ['MSM', '240', 'is', '104', '129', 'best', '10']\nass... | 1,651 |
621 | 4B | train | Write a function to increment the numeric values in the given strings by k. | import re
def increment_numerics(strings, k):
result = []
for s in strings:
parts = re.findall(r'\d+|\D+', s)
processed_parts = []
for part in parts:
if part.isdigit():
num = int(part) + k
processed_parts.append(str(num))
else:
... | [
"assert increment_numerics([\"MSM\", \"234\", \"is\", \"98\", \"123\", \"best\", \"4\"] , 6) == ['MSM', '240', 'is', '104', '129', 'best', '10']",
"assert increment_numerics([\"Dart\", \"356\", \"is\", \"88\", \"169\", \"Super\", \"6\"] , 12) == ['Dart', '368', 'is', '100', '181', 'Super', '18']",
"assert incre... | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to increment the numeric values in the given strings by k.\n\nTest:\nassert increment_numerics([\"MSM\", \"234\", \"is\", \"98\", \"123\", \"best\", \"4\"] , 6) == ['MSM', '240', 'is', '104', '129', 'best', '10']\nass... | 548 |
622 | 8B | train | Write a function to find the median of two sorted lists of same size. | def get_median(arr1, arr2, n):
merged = []
i = j = 0
while i < n and j < n:
if arr1[i] < arr2[j]:
merged.append(arr1[i])
i += 1
else:
merged.append(arr2[j])
j += 1
merged.extend(arr1[i:])
merged.extend(arr2[j:])
total_length = 2 * n... | [
"assert get_median([1, 12, 15, 26, 38], [2, 13, 17, 30, 45], 5) == 16.0",
"assert get_median([2, 4, 8, 9], [7, 13, 19, 28], 4) == 8.5",
"assert get_median([3, 6, 14, 23, 36, 42], [2, 18, 27, 39, 49, 55], 6) == 25.0"
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to find the median of two sorted lists of same size.\n\nTest:\nassert get_median([1, 12, 15, 26, 38], [2, 13, 17, 30, 45], 5) == 16.0\nassert get_median([2, 4, 8, 9], [7, 13, 19, 28], 4) == 8.5\nassert get_median([3, ... | 1,900 |
622 | 8B | train | Write a function to find the median of two sorted lists of same size. | def get_median(arr1, arr2, n):
merged = []
i = j = 0
while i < n and j < n:
if arr1[i] < arr2[j]:
merged.append(arr1[i])
i += 1
else:
merged.append(arr2[j])
j += 1
merged.extend(arr1[i:])
merged.extend(arr2[j:])
total_length = 2 * n... | [
"assert get_median([1, 12, 15, 26, 38], [2, 13, 17, 30, 45], 5) == 16.0",
"assert get_median([2, 4, 8, 9], [7, 13, 19, 28], 4) == 8.5",
"assert get_median([3, 6, 14, 23, 36, 42], [2, 18, 27, 39, 49, 55], 6) == 25.0"
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to find the median of two sorted lists of same size.\n\nTest:\nassert get_median([1, 12, 15, 26, 38], [2, 13, 17, 30, 45], 5) == 16.0\nassert get_median([2, 4, 8, 9], [7, 13, 19, 28], 4) == 8.5\nassert get_median([3, ... | 483 |
623 | 8B | train | Write a function to compute the n-th power of each number in a list. | def nth_nums(lst, n):
return list(map(lambda x: x ** n, lst))
assert nth_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],2)==[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
assert nth_nums([10,20,30],3)==([1000, 8000, 27000])
assert nth_nums([12,15],5)==([248832, 759375]) | [
"assert nth_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],2)==[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]",
"assert nth_nums([10,20,30],3)==([1000, 8000, 27000])",
"assert nth_nums([12,15],5)==([248832, 759375])"
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to compute the n-th power of each number in a list.\n\nTest:\nassert nth_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],2)==[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]\nassert nth_nums([10,20,30],3)==([1000, 8000, 27000])\nassert nt... | 1,033 |
623 | 8B | train | Write a function to compute the n-th power of each number in a list. | def nth_nums(lst, n):
return list(map(lambda x: x ** n, lst))
assert nth_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],2)==[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
assert nth_nums([10,20,30],3)==([1000, 8000, 27000])
assert nth_nums([12,15],5)==([248832, 759375]) | [
"assert nth_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],2)==[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]",
"assert nth_nums([10,20,30],3)==([1000, 8000, 27000])",
"assert nth_nums([12,15],5)==([248832, 759375])"
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to compute the n-th power of each number in a list.\n\nTest:\nassert nth_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],2)==[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]\nassert nth_nums([10,20,30],3)==([1000, 8000, 27000])\nassert nt... | 359 |
623 | 4B | train | Write a function to compute the n-th power of each number in a list. | def nth_nums(lst, n):
return list(map(lambda x: x ** n, lst))
assert nth_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],2)==[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
assert nth_nums([10,20,30],3)==([1000, 8000, 27000])
assert nth_nums([12,15],5)==([248832, 759375]) | [
"assert nth_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],2)==[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]",
"assert nth_nums([10,20,30],3)==([1000, 8000, 27000])",
"assert nth_nums([12,15],5)==([248832, 759375])"
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to compute the n-th power of each number in a list.\n\nTest:\nassert nth_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],2)==[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]\nassert nth_nums([10,20,30],3)==([1000, 8000, 27000])\nassert nt... | 833 |
623 | 4B | train | Write a function to compute the n-th power of each number in a list. | def nth_nums(lst, n):
return list(map(lambda x: x ** n, lst))
assert nth_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],2)==[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
assert nth_nums([10,20,30],3)==([1000, 8000, 27000])
assert nth_nums([12,15],5)==([248832, 759375]) | [
"assert nth_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],2)==[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]",
"assert nth_nums([10,20,30],3)==([1000, 8000, 27000])",
"assert nth_nums([12,15],5)==([248832, 759375])"
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to compute the n-th power of each number in a list.\n\nTest:\nassert nth_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],2)==[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]\nassert nth_nums([10,20,30],3)==([1000, 8000, 27000])\nassert nt... | 359 |
624 | 8B | train | Write a python function to convert a given string to uppercase. | def is_upper(s):
return s.upper()
assert is_upper("person") =="PERSON"
assert is_upper("final") == "FINAL"
assert is_upper("Valid") == "VALID" | [
"assert is_upper(\"person\") ==\"PERSON\"",
"assert is_upper(\"final\") == \"FINAL\"",
"assert is_upper(\"Valid\") == \"VALID\""
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a python function to convert a given string to uppercase.\n\nTest:\nassert is_upper(\"person\") ==\"PERSON\"\nassert is_upper(\"final\") == \"FINAL\"\nassert is_upper(\"Valid\") == \"VALID\""
},
{
"from": "gpt",
"val... | 406 |
624 | 8B | train | Write a python function to convert a given string to uppercase. | def is_upper(s):
return s.upper()
assert is_upper("person") =="PERSON"
assert is_upper("final") == "FINAL"
assert is_upper("Valid") == "VALID" | [
"assert is_upper(\"person\") ==\"PERSON\"",
"assert is_upper(\"final\") == \"FINAL\"",
"assert is_upper(\"Valid\") == \"VALID\""
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a python function to convert a given string to uppercase.\n\nTest:\nassert is_upper(\"person\") ==\"PERSON\"\nassert is_upper(\"final\") == \"FINAL\"\nassert is_upper(\"Valid\") == \"VALID\""
},
{
"from": "gpt",
"val... | 131 |
624 | 4B | train | Write a python function to convert a given string to uppercase. | def is_upper(s):
return s.upper()
assert is_upper("person") == "PERSON"
assert is_upper("final") == "FINAL"
assert is_upper("Valid") == "VALID" | [
"assert is_upper(\"person\") ==\"PERSON\"",
"assert is_upper(\"final\") == \"FINAL\"",
"assert is_upper(\"Valid\") == \"VALID\""
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a python function to convert a given string to uppercase.\n\nTest:\nassert is_upper(\"person\") ==\"PERSON\"\nassert is_upper(\"final\") == \"FINAL\"\nassert is_upper(\"Valid\") == \"VALID\""
},
{
"from": "gpt",
"val... | 414 |
624 | 4B | train | Write a python function to convert a given string to uppercase. | def is_upper(s):
return s.upper()
assert is_upper("person") == "PERSON"
assert is_upper("final") == "FINAL"
assert is_upper("Valid") == "VALID" | [
"assert is_upper(\"person\") ==\"PERSON\"",
"assert is_upper(\"final\") == \"FINAL\"",
"assert is_upper(\"Valid\") == \"VALID\""
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a python function to convert a given string to uppercase.\n\nTest:\nassert is_upper(\"person\") ==\"PERSON\"\nassert is_upper(\"final\") == \"FINAL\"\nassert is_upper(\"Valid\") == \"VALID\""
},
{
"from": "gpt",
"val... | 132 |
625 | 8B | train | Write a python function to interchange the first and last element in a given list. | def swap_List(lst):
return [lst[-1]] + lst[1:-1] + [lst[0]]
assert swap_List([1,2,3]) == [3,2,1]
assert swap_List([1,2,3,4,4]) == [4,2,3,4,1]
assert swap_List([4,5,6]) == [6,5,4] | [
"assert swap_List([1,2,3]) == [3,2,1]",
"assert swap_List([1,2,3,4,4]) == [4,2,3,4,1]",
"assert swap_List([4,5,6]) == [6,5,4]"
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a python function to interchange the first and last element in a given list.\n\nTest:\nassert swap_List([1,2,3]) == [3,2,1]\nassert swap_List([1,2,3,4,4]) == [4,2,3,4,1]\nassert swap_List([4,5,6]) == [6,5,4]"
},
{
"from"... | 1,049 |
625 | 8B | train | Write a python function to interchange the first and last element in a given list. | def swap_List(lst):
return [lst[-1]] + lst[1:-1] + [lst[0]]
assert swap_List([1,2,3]) == [3,2,1]
assert swap_List([1,2,3,4,4]) == [4,2,3,4,1]
assert swap_List([4,5,6]) == [6,5,4] | [
"assert swap_List([1,2,3]) == [3,2,1]",
"assert swap_List([1,2,3,4,4]) == [4,2,3,4,1]",
"assert swap_List([4,5,6]) == [6,5,4]"
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a python function to interchange the first and last element in a given list.\n\nTest:\nassert swap_List([1,2,3]) == [3,2,1]\nassert swap_List([1,2,3,4,4]) == [4,2,3,4,1]\nassert swap_List([4,5,6]) == [6,5,4]"
},
{
"from"... | 216 |
625 | 4B | train | Write a python function to interchange the first and last element in a given list. | def swap_List(lst):
if len(lst) < 2:
return lst
return [lst[-1]] + lst[1:-1] + [lst[0]]
assert swap_List([1,2,3]) == [3,2,1]
assert swap_List([1,2,3,4,4]) == [4,2,3,4,1]
assert swap_List([4,5,6]) == [6,5,4] | [
"assert swap_List([1,2,3]) == [3,2,1]",
"assert swap_List([1,2,3,4,4]) == [4,2,3,4,1]",
"assert swap_List([4,5,6]) == [6,5,4]"
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a python function to interchange the first and last element in a given list.\n\nTest:\nassert swap_List([1,2,3]) == [3,2,1]\nassert swap_List([1,2,3,4,4]) == [4,2,3,4,1]\nassert swap_List([4,5,6]) == [6,5,4]"
},
{
"from"... | 889 |
625 | 4B | train | Write a python function to interchange the first and last element in a given list. | def swap_List(lst):
if len(lst) < 2:
return lst
return [lst[-1]] + lst[1:-1] + [lst[0]]
assert swap_List([1,2,3]) == [3,2,1]
assert swap_List([1,2,3,4,4]) == [4,2,3,4,1]
assert swap_List([4,5,6]) == [6,5,4] | [
"assert swap_List([1,2,3]) == [3,2,1]",
"assert swap_List([1,2,3,4,4]) == [4,2,3,4,1]",
"assert swap_List([4,5,6]) == [6,5,4]"
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a python function to interchange the first and last element in a given list.\n\nTest:\nassert swap_List([1,2,3]) == [3,2,1]\nassert swap_List([1,2,3,4,4]) == [4,2,3,4,1]\nassert swap_List([4,5,6]) == [6,5,4]"
},
{
"from"... | 229 |
628 | 8B | train | Write a function to replace all spaces in the given string with '%20'. | def replace_spaces(s):
return s.replace(' ', '%20')
assert replace_spaces("My Name is Dawood") == 'My%20Name%20is%20Dawood'
assert replace_spaces("I am a Programmer") == 'I%20am%20a%20Programmer'
assert replace_spaces("I love Coding") == 'I%20love%20Coding' | [
"assert replace_spaces(\"My Name is Dawood\") == 'My%20Name%20is%20Dawood'",
"assert replace_spaces(\"I am a Programmer\") == 'I%20am%20a%20Programmer'",
"assert replace_spaces(\"I love Coding\") == 'I%20love%20Coding'"
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to replace all spaces in the given string with '%20'.\n\nTest:\nassert replace_spaces(\"My Name is Dawood\") == 'My%20Name%20is%20Dawood'\nassert replace_spaces(\"I am a Programmer\") == 'I%20am%20a%20Programmer'\nass... | 642 |
628 | 8B | train | Write a function to replace all spaces in the given string with '%20'. | def replace_spaces(s):
return s.replace(' ', '%20')
assert replace_spaces("My Name is Dawood") == 'My%20Name%20is%20Dawood'
assert replace_spaces("I am a Programmer") == 'I%20am%20a%20Programmer'
assert replace_spaces("I love Coding") == 'I%20love%20Coding' | [
"assert replace_spaces(\"My Name is Dawood\") == 'My%20Name%20is%20Dawood'",
"assert replace_spaces(\"I am a Programmer\") == 'I%20am%20a%20Programmer'",
"assert replace_spaces(\"I love Coding\") == 'I%20love%20Coding'"
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to replace all spaces in the given string with '%20'.\n\nTest:\nassert replace_spaces(\"My Name is Dawood\") == 'My%20Name%20is%20Dawood'\nassert replace_spaces(\"I am a Programmer\") == 'I%20am%20a%20Programmer'\nass... | 230 |
628 | 4B | train | Write a function to replace all spaces in the given string with '%20'. | def replace_spaces(s):
return s.replace(' ', '%20')
assert replace_spaces("My Name is Dawood") == 'My%20Name%20is%20Dawood'
assert replace_spaces("I am a Programmer") == 'I%20am%20a%20Programmer'
assert replace_spaces("I love Coding") == 'I%20love%20Coding' | [
"assert replace_spaces(\"My Name is Dawood\") == 'My%20Name%20is%20Dawood'",
"assert replace_spaces(\"I am a Programmer\") == 'I%20am%20a%20Programmer'",
"assert replace_spaces(\"I love Coding\") == 'I%20love%20Coding'"
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to replace all spaces in the given string with '%20'.\n\nTest:\nassert replace_spaces(\"My Name is Dawood\") == 'My%20Name%20is%20Dawood'\nassert replace_spaces(\"I am a Programmer\") == 'I%20am%20a%20Programmer'\nass... | 664 |
628 | 4B | train | Write a function to replace all spaces in the given string with '%20'. | def replace_spaces(s):
return s.replace(' ', '%20')
assert replace_spaces("My Name is Dawood") == 'My%20Name%20is%20Dawood'
assert replace_spaces("I am a Programmer") == 'I%20am%20a%20Programmer'
assert replace_spaces("I love Coding") == 'I%20love%20Coding' | [
"assert replace_spaces(\"My Name is Dawood\") == 'My%20Name%20is%20Dawood'",
"assert replace_spaces(\"I am a Programmer\") == 'I%20am%20a%20Programmer'",
"assert replace_spaces(\"I love Coding\") == 'I%20love%20Coding'"
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a function to replace all spaces in the given string with '%20'.\n\nTest:\nassert replace_spaces(\"My Name is Dawood\") == 'My%20Name%20is%20Dawood'\nassert replace_spaces(\"I am a Programmer\") == 'I%20am%20a%20Programmer'\nass... | 230 |
629 | 8B | train | Write a python function to find even numbers from a list of numbers. | def Split(mixed_list):
return [x for x in mixed_list if x % 2 == 0]
assert Split([1,2,3,4,5]) == [2,4]
assert Split([4,5,6,7,8,0,1]) == [4,6,8,0]
assert Split([8,12,15,19]) == [8,12] | [
"assert Split([1,2,3,4,5]) == [2,4]",
"assert Split([4,5,6,7,8,0,1]) == [4,6,8,0]",
"assert Split ([8,12,15,19]) == [8,12]"
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a python function to find even numbers from a list of numbers.\n\nTest:\nassert Split([1,2,3,4,5]) == [2,4]\nassert Split([4,5,6,7,8,0,1]) == [4,6,8,0]\nassert Split ([8,12,15,19]) == [8,12]"
},
{
"from": "gpt",
"val... | 715 |
629 | 8B | train | Write a python function to find even numbers from a list of numbers. | def Split(mixed_list):
return [x for x in mixed_list if x % 2 == 0]
assert Split([1,2,3,4,5]) == [2,4]
assert Split([4,5,6,7,8,0,1]) == [4,6,8,0]
assert Split([8,12,15,19]) == [8,12] | [
"assert Split([1,2,3,4,5]) == [2,4]",
"assert Split([4,5,6,7,8,0,1]) == [4,6,8,0]",
"assert Split ([8,12,15,19]) == [8,12]"
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a python function to find even numbers from a list of numbers.\n\nTest:\nassert Split([1,2,3,4,5]) == [2,4]\nassert Split([4,5,6,7,8,0,1]) == [4,6,8,0]\nassert Split ([8,12,15,19]) == [8,12]"
},
{
"from": "gpt",
"val... | 223 |
629 | 4B | train | Write a python function to find even numbers from a list of numbers. | def Split(mixed_list):
return [num for num in mixed_list if num % 2 == 0]
assert Split([1,2,3,4,5]) == [2,4]
assert Split([4,5,6,7,8,0,1]) == [4,6,8,0]
assert Split([8,12,15,19]) == [8,12] | [
"assert Split([1,2,3,4,5]) == [2,4]",
"assert Split([4,5,6,7,8,0,1]) == [4,6,8,0]",
"assert Split ([8,12,15,19]) == [8,12]"
] | thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a python function to find even numbers from a list of numbers.\n\nTest:\nassert Split([1,2,3,4,5]) == [2,4]\nassert Split([4,5,6,7,8,0,1]) == [4,6,8,0]\nassert Split ([8,12,15,19]) == [8,12]"
},
{
"from": "gpt",
"val... | 668 |
629 | 4B | train | Write a python function to find even numbers from a list of numbers. | def Split(mixed_list):
return [num for num in mixed_list if num % 2 == 0]
assert Split([1,2,3,4,5]) == [2,4]
assert Split([4,5,6,7,8,0,1]) == [4,6,8,0]
assert Split([8,12,15,19]) == [8,12] | [
"assert Split([1,2,3,4,5]) == [2,4]",
"assert Split([4,5,6,7,8,0,1]) == [4,6,8,0]",
"assert Split ([8,12,15,19]) == [8,12]"
] | non_thinking | [
{
"from": "human",
"value": "Task:\nYou are an expert Python programmer.\nWrite a python function to find even numbers from a list of numbers.\n\nTest:\nassert Split([1,2,3,4,5]) == [2,4]\nassert Split([4,5,6,7,8,0,1]) == [4,6,8,0]\nassert Split ([8,12,15,19]) == [8,12]"
},
{
"from": "gpt",
"val... | 223 |