original_code stringclasses 565
values | transformation stringclasses 24
values | transformed_code stringlengths 35 955 | label int64 0 1 | groups int64 1 971 | dataset stringclasses 1
value |
|---|---|---|---|---|---|
def heap_sort(arr):
heapify(arr)
end = len(arr) - 1
while end > 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
return arr
def heapify(arr):
start = len(arr) // 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return | transformation_div_mul_variable | def heap_sort(arr):
heapify(arr)
end = len(arr) - 1
while end > 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
return arr
def heapify(arr):
start = len(arr) */ 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return | 0 | 937 | mbpp |
def heap_sort(arr):
heapify(arr)
end = len(arr) - 1
while end > 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
return arr
def heapify(arr):
start = len(arr) // 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return | transformation_lesser_greater_variable | def heap_sort(arr):
heapify(arr)
end = len(arr) - 1
while end > 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
return arr
def heapify(arr):
start = len(arr) // 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root * 2 + 1 >= end:
child = root * 2 + 1
if child + 1 <= end and arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return | 0 | 937 | mbpp |
def heap_sort(arr):
heapify(arr)
end = len(arr) - 1
while end > 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
return arr
def heapify(arr):
start = len(arr) // 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return | transformation_greater_lesser_variable | def heap_sort(arr):
heapify(arr)
end = len(arr) - 1
while end < 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
return arr
def heapify(arr):
start = len(arr) // 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return | 0 | 937 | mbpp |
def heap_sort(arr):
heapify(arr)
end = len(arr) - 1
while end > 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
return arr
def heapify(arr):
start = len(arr) // 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return | transformation_and_or_variable | def heap_sort(arr):
heapify(arr)
end = len(arr) - 1
while end > 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
return arr
def heapify(arr):
start = len(arr) // 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end or arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return | 0 | 937 | mbpp |
def heap_sort(arr):
heapify(arr)
end = len(arr) - 1
while end > 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
return arr
def heapify(arr):
start = len(arr) // 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return | transformation_dissimilar_code_injection_0 | def min_cost(cost, m, n):
R = 3
C = 3
tc = [[0 for x in range(C)] for x in range(R)]
tc[0][0] = cost[0][0]
for i in range(1, m+1):
tc[i][0] = tc[i-1][0] + cost[i][0]
for j in range(1, n+1):
tc[0][j] = tc[0][j-1] + cost[0][j]
for i in range(1, m+1):
for j in range(1, n+1):
tc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j]
return tc[m][n] | 0 | 937 | mbpp |
def heap_sort(arr):
heapify(arr)
end = len(arr) - 1
while end > 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
return arr
def heapify(arr):
start = len(arr) // 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return | transformation_dissimilar_code_injection_1 | def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res) | 0 | 937 | mbpp |
def heap_sort(arr):
heapify(arr)
end = len(arr) - 1
while end > 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
return arr
def heapify(arr):
start = len(arr) // 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return | transformation_dissimilar_code_injection_2 | def is_not_prime(n):
import math
result = False
for i in range(2,int(math.sqrt(n)) + 1):
if n % i == 0:
result = True
return result | 0 | 937 | mbpp |
def heap_sort(arr):
heapify(arr)
end = len(arr) - 1
while end > 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
return arr
def heapify(arr):
start = len(arr) // 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return | transformation_dissimilar_code_injection_3 | def heap_queue_largest(nums,n):
import heapq as hq
largest_nums = hq.nlargest(n, nums)
return largest_nums | 0 | 937 | mbpp |
def heap_sort(arr):
heapify(arr)
end = len(arr) - 1
while end > 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
return arr
def heapify(arr):
start = len(arr) // 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return | transformation_dissimilar_code_injection_4 | def count_ways(n):
A = [0] * (n + 1)
B = [0] * (n + 1)
A[0] = 1
A[1] = 0
B[0] = 0
B[1] = 1
for i in range(2, n+1):
A[i] = A[i - 2] + 2 * B[i - 1]
B[i] = A[i - 1] + B[i - 2]
return A[n] | 0 | 937 | mbpp |
def count_elim(num):
count_elim = 0
for n in num:
if isinstance(n, tuple):
break
count_elim += 1
return count_elim | transformation_dead_code_insert | def count_elim(num):
_i_3 = 0
while _i_3 < _i_3:
count_elim = 0
count_elim = 0
for n in num:
if isinstance(n, tuple):
break
count_elim += 1
return count_elim | 1 | 938 | mbpp |
def count_elim(num):
count_elim = 0
for n in num:
if isinstance(n, tuple):
break
count_elim += 1
return count_elim | transformation_for_while_loop | def count_elim(num):
count_elim = 0
_n_i = 0
while _n_i < len(num):
n = num[_n_i]
if isinstance(n, tuple):
break
count_elim += 1
_n_i += 1
return count_elim | 1 | 938 | mbpp |
def count_elim(num):
count_elim = 0
for n in num:
if isinstance(n, tuple):
break
count_elim += 1
return count_elim | transformation_operand_swap | def count_elim(num):
count_elim = 0
for n in num:
if isinstance(n, tuple):
break
count_elim += 1
return count_elim | 1 | 938 | mbpp |
def count_elim(num):
count_elim = 0
for n in num:
if isinstance(n, tuple):
break
count_elim += 1
return count_elim | transformation_rename_variable_cb | def count_elim(num):
count_elim = 0
for i in num:
if isinstance(i, tuple):
break
count_elim += 1
return count_elim | 1 | 938 | mbpp |
def count_elim(num):
count_elim = 0
for n in num:
if isinstance(n, tuple):
break
count_elim += 1
return count_elim | transformation_rename_variable_naive | def count_elim(VAR_0):
count_elim = 0
for n in VAR_0:
if isinstance(n, tuple):
break
count_elim += 1
return count_elim | 1 | 938 | mbpp |
def count_elim(num):
count_elim = 0
for n in num:
if isinstance(n, tuple):
break
count_elim += 1
return count_elim | transformation_rename_variable_rn | def count_elim(xL1):
count_elim = 0
for n in xL1:
if isinstance(n, tuple):
break
count_elim += 1
return count_elim | 1 | 938 | mbpp |
def count_elim(num):
count_elim = 0
for n in num:
if isinstance(n, tuple):
break
count_elim += 1
return count_elim | transformation_add_sub_variable | def count_elim(num):
count_elim = 0
for n in num:
if isinstance(n, tuple):
break
count_elim -= 1
return count_elim | 0 | 938 | mbpp |
def count_elim(num):
count_elim = 0
for n in num:
if isinstance(n, tuple):
break
count_elim += 1
return count_elim | transformation_dissimilar_code_injection_0 | def min_cost(cost, m, n):
R = 3
C = 3
tc = [[0 for x in range(C)] for x in range(R)]
tc[0][0] = cost[0][0]
for i in range(1, m+1):
tc[i][0] = tc[i-1][0] + cost[i][0]
for j in range(1, n+1):
tc[0][j] = tc[0][j-1] + cost[0][j]
for i in range(1, m+1):
for j in range(1, n+1):
tc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j]
return tc[m][n] | 0 | 938 | mbpp |
def count_elim(num):
count_elim = 0
for n in num:
if isinstance(n, tuple):
break
count_elim += 1
return count_elim | transformation_dissimilar_code_injection_1 | def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res) | 0 | 938 | mbpp |
def count_elim(num):
count_elim = 0
for n in num:
if isinstance(n, tuple):
break
count_elim += 1
return count_elim | transformation_dissimilar_code_injection_2 | def is_not_prime(n):
import math
result = False
for i in range(2,int(math.sqrt(n)) + 1):
if n % i == 0:
result = True
return result | 0 | 938 | mbpp |
def count_elim(num):
count_elim = 0
for n in num:
if isinstance(n, tuple):
break
count_elim += 1
return count_elim | transformation_dissimilar_code_injection_3 | def heap_queue_largest(nums,n):
import heapq as hq
largest_nums = hq.nlargest(n, nums)
return largest_nums | 0 | 938 | mbpp |
def count_elim(num):
count_elim = 0
for n in num:
if isinstance(n, tuple):
break
count_elim += 1
return count_elim | transformation_dissimilar_code_injection_4 | def count_ways(n):
A = [0] * (n + 1)
B = [0] * (n + 1)
A[0] = 1
A[1] = 0
B[0] = 0
B[1] = 1
for i in range(2, n+1):
A[i] = A[i - 2] + 2 * B[i - 1]
B[i] = A[i - 1] + B[i - 2]
return A[n] | 0 | 938 | mbpp |
def check_element(test_tup, check_list):
res = False
for ele in check_list:
if ele in test_tup:
res = True
break
return (res) | transformation_dead_code_insert | def check_element(test_tup, check_list):
res = False
for ele in check_list:
_i_7 = 0
while _i_7 > _i_7:
return res
if ele in test_tup:
res = True
break
return res | 1 | 939 | mbpp |
def check_element(test_tup, check_list):
res = False
for ele in check_list:
if ele in test_tup:
res = True
break
return (res) | transformation_for_while_loop | def check_element(test_tup, check_list):
res = False
_ele_i = 0
while _ele_i < len(check_list):
ele = check_list[_ele_i]
if ele in test_tup:
res = True
break
_ele_i += 1
return res | 1 | 939 | mbpp |
def check_element(test_tup, check_list):
res = False
for ele in check_list:
if ele in test_tup:
res = True
break
return (res) | transformation_operand_swap | def check_element(test_tup, check_list):
res = False
for ele in check_list:
if ele in test_tup:
res = True
break
return res | 1 | 939 | mbpp |
def check_element(test_tup, check_list):
res = False
for ele in check_list:
if ele in test_tup:
res = True
break
return (res) | transformation_rename_variable_naive | def check_element(test_tup, check_list):
VAR_0 = False
for ele in check_list:
if ele in test_tup:
VAR_0 = True
break
return VAR_0 | 1 | 939 | mbpp |
def check_element(test_tup, check_list):
res = False
for ele in check_list:
if ele in test_tup:
res = True
break
return (res) | transformation_rename_variable_rn | def check_element(test_tup, check_list):
kd6 = False
for ele in check_list:
if ele in test_tup:
kd6 = True
break
return kd6 | 1 | 939 | mbpp |
def check_element(test_tup, check_list):
res = False
for ele in check_list:
if ele in test_tup:
res = True
break
return (res) | transformation_true_false_variable | def check_element(test_tup, check_list):
res = False
for ele in check_list:
if ele in test_tup:
res = False
break
return (res) | 0 | 939 | mbpp |
def check_element(test_tup, check_list):
res = False
for ele in check_list:
if ele in test_tup:
res = True
break
return (res) | transformation_false_true_variable | def check_element(test_tup, check_list):
res = True
for ele in check_list:
if ele in test_tup:
res = True
break
return (res) | 0 | 939 | mbpp |
def check_element(test_tup, check_list):
res = False
for ele in check_list:
if ele in test_tup:
res = True
break
return (res) | transformation_dissimilar_code_injection_0 | def min_cost(cost, m, n):
R = 3
C = 3
tc = [[0 for x in range(C)] for x in range(R)]
tc[0][0] = cost[0][0]
for i in range(1, m+1):
tc[i][0] = tc[i-1][0] + cost[i][0]
for j in range(1, n+1):
tc[0][j] = tc[0][j-1] + cost[0][j]
for i in range(1, m+1):
for j in range(1, n+1):
tc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j]
return tc[m][n] | 0 | 939 | mbpp |
def check_element(test_tup, check_list):
res = False
for ele in check_list:
if ele in test_tup:
res = True
break
return (res) | transformation_dissimilar_code_injection_1 | def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res) | 0 | 939 | mbpp |
def check_element(test_tup, check_list):
res = False
for ele in check_list:
if ele in test_tup:
res = True
break
return (res) | transformation_dissimilar_code_injection_2 | def is_not_prime(n):
import math
result = False
for i in range(2,int(math.sqrt(n)) + 1):
if n % i == 0:
result = True
return result | 0 | 939 | mbpp |
def check_element(test_tup, check_list):
res = False
for ele in check_list:
if ele in test_tup:
res = True
break
return (res) | transformation_dissimilar_code_injection_3 | def heap_queue_largest(nums,n):
import heapq as hq
largest_nums = hq.nlargest(n, nums)
return largest_nums | 0 | 939 | mbpp |
def check_element(test_tup, check_list):
res = False
for ele in check_list:
if ele in test_tup:
res = True
break
return (res) | transformation_dissimilar_code_injection_4 | def count_ways(n):
A = [0] * (n + 1)
B = [0] * (n + 1)
A[0] = 1
A[1] = 0
B[0] = 0
B[1] = 1
for i in range(2, n+1):
A[i] = A[i - 2] + 2 * B[i - 1]
B[i] = A[i - 1] + B[i - 2]
return A[n] | 0 | 939 | mbpp |
def combine_lists(num1,num2):
from heapq import merge
combine_lists=list(merge(num1, num2))
return combine_lists | transformation_dead_code_insert | def combine_lists(num1, num2):
from heapq import merge
_i_0 = 0
if _i_0 > _i_0:
from heapq import merge
combine_lists = list(merge(num1, num2))
return combine_lists | 1 | 940 | mbpp |
def combine_lists(num1,num2):
from heapq import merge
combine_lists=list(merge(num1, num2))
return combine_lists | transformation_for_while_loop | def combine_lists(num1, num2):
from heapq import merge
combine_lists = list(merge(num1, num2))
return combine_lists | 1 | 940 | mbpp |
def combine_lists(num1,num2):
from heapq import merge
combine_lists=list(merge(num1, num2))
return combine_lists | transformation_operand_swap | def combine_lists(num1, num2):
from heapq import merge
combine_lists = list(merge(num1, num2))
return combine_lists | 1 | 940 | mbpp |
def combine_lists(num1,num2):
from heapq import merge
combine_lists=list(merge(num1, num2))
return combine_lists | transformation_rename_variable_cb | def combine_lists(num1, other):
from heapq import merge
combine_lists = list(merge(num1, other))
return combine_lists | 1 | 940 | mbpp |
def combine_lists(num1,num2):
from heapq import merge
combine_lists=list(merge(num1, num2))
return combine_lists | transformation_rename_variable_naive | def combine_lists(VAR_0, num2):
from heapq import merge
combine_lists = list(merge(VAR_0, num2))
return combine_lists | 1 | 940 | mbpp |
def combine_lists(num1,num2):
from heapq import merge
combine_lists=list(merge(num1, num2))
return combine_lists | transformation_rename_variable_rn | def combine_lists(v06E, num2):
from heapq import merge
combine_lists = list(merge(v06E, num2))
return combine_lists | 1 | 940 | mbpp |
def combine_lists(num1,num2):
from heapq import merge
combine_lists=list(merge(num1, num2))
return combine_lists | transformation_dissimilar_code_injection_0 | def min_cost(cost, m, n):
R = 3
C = 3
tc = [[0 for x in range(C)] for x in range(R)]
tc[0][0] = cost[0][0]
for i in range(1, m+1):
tc[i][0] = tc[i-1][0] + cost[i][0]
for j in range(1, n+1):
tc[0][j] = tc[0][j-1] + cost[0][j]
for i in range(1, m+1):
for j in range(1, n+1):
tc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j]
return tc[m][n] | 0 | 940 | mbpp |
def combine_lists(num1,num2):
from heapq import merge
combine_lists=list(merge(num1, num2))
return combine_lists | transformation_dissimilar_code_injection_1 | def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res) | 0 | 940 | mbpp |
def combine_lists(num1,num2):
from heapq import merge
combine_lists=list(merge(num1, num2))
return combine_lists | transformation_dissimilar_code_injection_2 | def is_not_prime(n):
import math
result = False
for i in range(2,int(math.sqrt(n)) + 1):
if n % i == 0:
result = True
return result | 0 | 940 | mbpp |
def combine_lists(num1,num2):
from heapq import merge
combine_lists=list(merge(num1, num2))
return combine_lists | transformation_dissimilar_code_injection_3 | def heap_queue_largest(nums,n):
import heapq as hq
largest_nums = hq.nlargest(n, nums)
return largest_nums | 0 | 940 | mbpp |
def combine_lists(num1,num2):
from heapq import merge
combine_lists=list(merge(num1, num2))
return combine_lists | transformation_dissimilar_code_injection_4 | def count_ways(n):
A = [0] * (n + 1)
B = [0] * (n + 1)
A[0] = 1
A[1] = 0
B[0] = 0
B[1] = 1
for i in range(2, n+1):
A[i] = A[i - 2] + 2 * B[i - 1]
B[i] = A[i - 1] + B[i - 2]
return A[n] | 0 | 940 | mbpp |
def num_position(text):
import re
for m in re.finditer("\d+", text):
return m.start() | transformation_dead_code_insert | def num_position(text):
if False:
import re
import re
for m in re.finditer("d+", text):
return m.start() | 1 | 941 | mbpp |
def num_position(text):
import re
for m in re.finditer("\d+", text):
return m.start() | transformation_for_while_loop | def num_position(text):
import re
_m_i = 0
while _m_i < len(re.finditer("d+", text)):
m = re.finditer("d+", text)[_m_i]
return m.start()
_m_i += 1 | 1 | 941 | mbpp |
def num_position(text):
import re
for m in re.finditer("\d+", text):
return m.start() | transformation_operand_swap | def num_position(text):
import re
for m in re.finditer("d+", text):
return m.start() | 1 | 941 | mbpp |
def num_position(text):
import re
for m in re.finditer("\d+", text):
return m.start() | transformation_rename_variable_naive | def num_position(text):
import re
for VAR_0 in re.finditer("d+", text):
return VAR_0.start() | 1 | 941 | mbpp |
def num_position(text):
import re
for m in re.finditer("\d+", text):
return m.start() | transformation_rename_variable_rn | def num_position(text):
import re
for L in re.finditer("d+", text):
return L.start() | 1 | 941 | mbpp |
def num_position(text):
import re
for m in re.finditer("\d+", text):
return m.start() | transformation_add_sub_variable | def num_position(text):
import re
for m in re.finditer("\d-", text):
return m.start() | 0 | 941 | mbpp |
def num_position(text):
import re
for m in re.finditer("\d+", text):
return m.start() | transformation_dissimilar_code_injection_0 | def min_cost(cost, m, n):
R = 3
C = 3
tc = [[0 for x in range(C)] for x in range(R)]
tc[0][0] = cost[0][0]
for i in range(1, m+1):
tc[i][0] = tc[i-1][0] + cost[i][0]
for j in range(1, n+1):
tc[0][j] = tc[0][j-1] + cost[0][j]
for i in range(1, m+1):
for j in range(1, n+1):
tc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j]
return tc[m][n] | 0 | 941 | mbpp |
def num_position(text):
import re
for m in re.finditer("\d+", text):
return m.start() | transformation_dissimilar_code_injection_1 | def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res) | 0 | 941 | mbpp |
def num_position(text):
import re
for m in re.finditer("\d+", text):
return m.start() | transformation_dissimilar_code_injection_2 | def is_not_prime(n):
import math
result = False
for i in range(2,int(math.sqrt(n)) + 1):
if n % i == 0:
result = True
return result | 0 | 941 | mbpp |
def num_position(text):
import re
for m in re.finditer("\d+", text):
return m.start() | transformation_dissimilar_code_injection_3 | def heap_queue_largest(nums,n):
import heapq as hq
largest_nums = hq.nlargest(n, nums)
return largest_nums | 0 | 941 | mbpp |
def num_position(text):
import re
for m in re.finditer("\d+", text):
return m.start() | transformation_dissimilar_code_injection_4 | def count_ways(n):
A = [0] * (n + 1)
B = [0] * (n + 1)
A[0] = 1
A[1] = 0
B[0] = 0
B[1] = 1
for i in range(2, n+1):
A[i] = A[i - 2] + 2 * B[i - 1]
B[i] = A[i - 1] + B[i - 2]
return A[n] | 0 | 941 | mbpp |
def tuple_to_set(t):
s = set(t)
return (s) | transformation_dead_code_insert | def tuple_to_set(t):
for _i_6 in range(0):
return s
s = set(t)
return s | 1 | 942 | mbpp |
def tuple_to_set(t):
s = set(t)
return (s) | transformation_for_while_loop | def tuple_to_set(t):
s = set(t)
return s | 1 | 942 | mbpp |
def tuple_to_set(t):
s = set(t)
return (s) | transformation_operand_swap | def tuple_to_set(t):
s = set(t)
return s | 1 | 942 | mbpp |
def tuple_to_set(t):
s = set(t)
return (s) | transformation_rename_variable_cb | def tuple_to_set(s2):
s = set(s2)
return s | 1 | 942 | mbpp |
def tuple_to_set(t):
s = set(t)
return (s) | transformation_rename_variable_naive | def tuple_to_set(t):
VAR_0 = set(t)
return VAR_0 | 1 | 942 | mbpp |
def tuple_to_set(t):
s = set(t)
return (s) | transformation_rename_variable_rn | def tuple_to_set(a):
s = set(a)
return s | 1 | 942 | mbpp |
def tuple_to_set(t):
s = set(t)
return (s) | transformation_dissimilar_code_injection_0 | def min_cost(cost, m, n):
R = 3
C = 3
tc = [[0 for x in range(C)] for x in range(R)]
tc[0][0] = cost[0][0]
for i in range(1, m+1):
tc[i][0] = tc[i-1][0] + cost[i][0]
for j in range(1, n+1):
tc[0][j] = tc[0][j-1] + cost[0][j]
for i in range(1, m+1):
for j in range(1, n+1):
tc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j]
return tc[m][n] | 0 | 942 | mbpp |
def tuple_to_set(t):
s = set(t)
return (s) | transformation_dissimilar_code_injection_1 | def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res) | 0 | 942 | mbpp |
def tuple_to_set(t):
s = set(t)
return (s) | transformation_dissimilar_code_injection_2 | def is_not_prime(n):
import math
result = False
for i in range(2,int(math.sqrt(n)) + 1):
if n % i == 0:
result = True
return result | 0 | 942 | mbpp |
def tuple_to_set(t):
s = set(t)
return (s) | transformation_dissimilar_code_injection_3 | def heap_queue_largest(nums,n):
import heapq as hq
largest_nums = hq.nlargest(n, nums)
return largest_nums | 0 | 942 | mbpp |
def tuple_to_set(t):
s = set(t)
return (s) | transformation_dissimilar_code_injection_4 | def count_ways(n):
A = [0] * (n + 1)
B = [0] * (n + 1)
A[0] = 1
A[1] = 0
B[0] = 0
B[1] = 1
for i in range(2, n+1):
A[i] = A[i - 2] + 2 * B[i - 1]
B[i] = A[i - 1] + B[i - 2]
return A[n] | 0 | 942 | mbpp |
def most_common_elem(s,a):
from collections import Counter
most_common_elem=Counter(s).most_common(a)
return most_common_elem | transformation_dead_code_insert | def most_common_elem(s, a):
while False:
from collections import Counter
from collections import Counter
most_common_elem = Counter(s).most_common(a)
return most_common_elem | 1 | 943 | mbpp |
def most_common_elem(s,a):
from collections import Counter
most_common_elem=Counter(s).most_common(a)
return most_common_elem | transformation_for_while_loop | def most_common_elem(s, a):
from collections import Counter
most_common_elem = Counter(s).most_common(a)
return most_common_elem | 1 | 943 | mbpp |
def most_common_elem(s,a):
from collections import Counter
most_common_elem=Counter(s).most_common(a)
return most_common_elem | transformation_operand_swap | def most_common_elem(s, a):
from collections import Counter
most_common_elem = Counter(s).most_common(a)
return most_common_elem | 1 | 943 | mbpp |
def most_common_elem(s,a):
from collections import Counter
most_common_elem=Counter(s).most_common(a)
return most_common_elem | transformation_rename_variable_cb | def most_common_elem(c, a):
from collections import Counter
most_common_elem = Counter(c).most_common(a)
return most_common_elem | 1 | 943 | mbpp |
def most_common_elem(s,a):
from collections import Counter
most_common_elem=Counter(s).most_common(a)
return most_common_elem | transformation_rename_variable_naive | def most_common_elem(VAR_0, a):
from collections import Counter
most_common_elem = Counter(VAR_0).most_common(a)
return most_common_elem | 1 | 943 | mbpp |
def most_common_elem(s,a):
from collections import Counter
most_common_elem=Counter(s).most_common(a)
return most_common_elem | transformation_rename_variable_rn | def most_common_elem(s, L):
from collections import Counter
most_common_elem = Counter(s).most_common(L)
return most_common_elem | 1 | 943 | mbpp |
def most_common_elem(s,a):
from collections import Counter
most_common_elem=Counter(s).most_common(a)
return most_common_elem | transformation_dissimilar_code_injection_0 | def min_cost(cost, m, n):
R = 3
C = 3
tc = [[0 for x in range(C)] for x in range(R)]
tc[0][0] = cost[0][0]
for i in range(1, m+1):
tc[i][0] = tc[i-1][0] + cost[i][0]
for j in range(1, n+1):
tc[0][j] = tc[0][j-1] + cost[0][j]
for i in range(1, m+1):
for j in range(1, n+1):
tc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j]
return tc[m][n] | 0 | 943 | mbpp |
def most_common_elem(s,a):
from collections import Counter
most_common_elem=Counter(s).most_common(a)
return most_common_elem | transformation_dissimilar_code_injection_1 | def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res) | 0 | 943 | mbpp |
def most_common_elem(s,a):
from collections import Counter
most_common_elem=Counter(s).most_common(a)
return most_common_elem | transformation_dissimilar_code_injection_2 | def is_not_prime(n):
import math
result = False
for i in range(2,int(math.sqrt(n)) + 1):
if n % i == 0:
result = True
return result | 0 | 943 | mbpp |
def most_common_elem(s,a):
from collections import Counter
most_common_elem=Counter(s).most_common(a)
return most_common_elem | transformation_dissimilar_code_injection_3 | def heap_queue_largest(nums,n):
import heapq as hq
largest_nums = hq.nlargest(n, nums)
return largest_nums | 0 | 943 | mbpp |
def most_common_elem(s,a):
from collections import Counter
most_common_elem=Counter(s).most_common(a)
return most_common_elem | transformation_dissimilar_code_injection_4 | def count_ways(n):
A = [0] * (n + 1)
B = [0] * (n + 1)
A[0] = 1
A[1] = 0
B[0] = 0
B[1] = 1
for i in range(2, n+1):
A[i] = A[i - 2] + 2 * B[i - 1]
B[i] = A[i - 1] + B[i - 2]
return A[n] | 0 | 943 | mbpp |
def len_log(list1):
min=len(list1[0])
for i in list1:
if len(i)<min:
min=len(i)
return min | transformation_dead_code_insert | def len_log(list1):
min = len(list1[0])
for i in list1:
if False:
if len(i) < min:
min = len(i)
if len(i) < min:
min = len(i)
return min | 1 | 944 | mbpp |
def len_log(list1):
min=len(list1[0])
for i in list1:
if len(i)<min:
min=len(i)
return min | transformation_for_while_loop | def len_log(list1):
min = len(list1[0])
_i_i = 0
while _i_i < len(list1):
i = list1[_i_i]
if len(i) < min:
min = len(i)
_i_i += 1
return min | 1 | 944 | mbpp |
def len_log(list1):
min=len(list1[0])
for i in list1:
if len(i)<min:
min=len(i)
return min | transformation_operand_swap | def len_log(list1):
min = len(list1[0])
for i in list1:
if min > len(i):
min = len(i)
return min | 1 | 944 | mbpp |
def len_log(list1):
min=len(list1[0])
for i in list1:
if len(i)<min:
min=len(i)
return min | transformation_rename_variable_cb | def len_log(list1):
l = len(list1[0])
for i in list1:
if len(i) < l:
l = len(i)
return l | 1 | 944 | mbpp |
def len_log(list1):
min=len(list1[0])
for i in list1:
if len(i)<min:
min=len(i)
return min | transformation_rename_variable_naive | def len_log(list1):
VAR_0 = len(list1[0])
for i in list1:
if len(i) < VAR_0:
VAR_0 = len(i)
return VAR_0 | 1 | 944 | mbpp |
def len_log(list1):
min=len(list1[0])
for i in list1:
if len(i)<min:
min=len(i)
return min | transformation_rename_variable_rn | def len_log(list1):
C5y = len(list1[0])
for i in list1:
if len(i) < C5y:
C5y = len(i)
return C5y | 1 | 944 | mbpp |
def len_log(list1):
min=len(list1[0])
for i in list1:
if len(i)<min:
min=len(i)
return min | transformation_lesser_greater_variable | def len_log(list1):
min=len(list1[0])
for i in list1:
if len(i)>min:
min=len(i)
return min | 0 | 944 | mbpp |
def len_log(list1):
min=len(list1[0])
for i in list1:
if len(i)<min:
min=len(i)
return min | transformation_dissimilar_code_injection_0 | def min_cost(cost, m, n):
R = 3
C = 3
tc = [[0 for x in range(C)] for x in range(R)]
tc[0][0] = cost[0][0]
for i in range(1, m+1):
tc[i][0] = tc[i-1][0] + cost[i][0]
for j in range(1, n+1):
tc[0][j] = tc[0][j-1] + cost[0][j]
for i in range(1, m+1):
for j in range(1, n+1):
tc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j]
return tc[m][n] | 0 | 944 | mbpp |
def len_log(list1):
min=len(list1[0])
for i in list1:
if len(i)<min:
min=len(i)
return min | transformation_dissimilar_code_injection_1 | def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res) | 0 | 944 | mbpp |
def len_log(list1):
min=len(list1[0])
for i in list1:
if len(i)<min:
min=len(i)
return min | transformation_dissimilar_code_injection_2 | def is_not_prime(n):
import math
result = False
for i in range(2,int(math.sqrt(n)) + 1):
if n % i == 0:
result = True
return result | 0 | 944 | mbpp |
def len_log(list1):
min=len(list1[0])
for i in list1:
if len(i)<min:
min=len(i)
return min | transformation_dissimilar_code_injection_3 | def heap_queue_largest(nums,n):
import heapq as hq
largest_nums = hq.nlargest(n, nums)
return largest_nums | 0 | 944 | mbpp |
def len_log(list1):
min=len(list1[0])
for i in list1:
if len(i)<min:
min=len(i)
return min | transformation_dissimilar_code_injection_4 | def count_ways(n):
A = [0] * (n + 1)
B = [0] * (n + 1)
A[0] = 1
A[1] = 0
B[0] = 0
B[1] = 1
for i in range(2, n+1):
A[i] = A[i - 2] + 2 * B[i - 1]
B[i] = A[i - 1] + B[i - 2]
return A[n] | 0 | 944 | mbpp |
def get_item(tup1,index):
item = tup1[index]
return item | transformation_dead_code_insert | def get_item(tup1, index):
_i_9 = 0
while _i_9 > _i_9:
item = tup1[index]
item = tup1[index]
return item | 1 | 945 | mbpp |
def get_item(tup1,index):
item = tup1[index]
return item | transformation_for_while_loop | def get_item(tup1, index):
item = tup1[index]
return item | 1 | 945 | mbpp |
def get_item(tup1,index):
item = tup1[index]
return item | transformation_operand_swap | def get_item(tup1, index):
item = tup1[index]
return item | 1 | 945 | mbpp |
def get_item(tup1,index):
item = tup1[index]
return item | transformation_rename_variable_cb | def get_item(tup1, index):
line = tup1[index]
return line | 1 | 945 | mbpp |
def get_item(tup1,index):
item = tup1[index]
return item | transformation_rename_variable_naive | def get_item(tup1, VAR_0):
item = tup1[VAR_0]
return item | 1 | 945 | mbpp |
def get_item(tup1,index):
item = tup1[index]
return item | transformation_rename_variable_rn | def get_item(tup1, index):
y1X3 = tup1[index]
return y1X3 | 1 | 945 | mbpp |
def get_item(tup1,index):
item = tup1[index]
return item | transformation_dissimilar_code_injection_0 | def min_cost(cost, m, n):
R = 3
C = 3
tc = [[0 for x in range(C)] for x in range(R)]
tc[0][0] = cost[0][0]
for i in range(1, m+1):
tc[i][0] = tc[i-1][0] + cost[i][0]
for j in range(1, n+1):
tc[0][j] = tc[0][j-1] + cost[0][j]
for i in range(1, m+1):
for j in range(1, n+1):
tc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j]
return tc[m][n] | 0 | 945 | mbpp |
def get_item(tup1,index):
item = tup1[index]
return item | transformation_dissimilar_code_injection_1 | def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res) | 0 | 945 | mbpp |
def get_item(tup1,index):
item = tup1[index]
return item | transformation_dissimilar_code_injection_2 | def is_not_prime(n):
import math
result = False
for i in range(2,int(math.sqrt(n)) + 1):
if n % i == 0:
result = True
return result | 0 | 945 | mbpp |
def get_item(tup1,index):
item = tup1[index]
return item | transformation_dissimilar_code_injection_3 | def heap_queue_largest(nums,n):
import heapq as hq
largest_nums = hq.nlargest(n, nums)
return largest_nums | 0 | 945 | mbpp |
def get_item(tup1,index):
item = tup1[index]
return item | transformation_dissimilar_code_injection_4 | def count_ways(n):
A = [0] * (n + 1)
B = [0] * (n + 1)
A[0] = 1
A[1] = 0
B[0] = 0
B[1] = 1
for i in range(2, n+1):
A[i] = A[i - 2] + 2 * B[i - 1]
B[i] = A[i - 1] + B[i - 2]
return A[n] | 0 | 945 | mbpp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.