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 sum_list(lst1,lst2):
res_list = [lst1[i] + lst2[i] for i in range(len(lst1))]
return res_list
|
transformation_operand_swap
|
def sum_list(lst1, lst2):
res_list = [lst1[i] + lst2[i] for i in range(len(lst1))]
return res_list
| 1 | 725 |
mbpp
|
def sum_list(lst1,lst2):
res_list = [lst1[i] + lst2[i] for i in range(len(lst1))]
return res_list
|
transformation_rename_variable_cb
|
def sum_list(lst1, lst2):
res_list = [lst1[i2] + lst2[i2] for i2 in range(len(lst1))]
return res_list
| 1 | 725 |
mbpp
|
def sum_list(lst1,lst2):
res_list = [lst1[i] + lst2[i] for i in range(len(lst1))]
return res_list
|
transformation_rename_variable_naive
|
def sum_list(VAR_0, lst2):
res_list = [VAR_0[i] + lst2[i] for i in range(len(VAR_0))]
return res_list
| 1 | 725 |
mbpp
|
def sum_list(lst1,lst2):
res_list = [lst1[i] + lst2[i] for i in range(len(lst1))]
return res_list
|
transformation_rename_variable_rn
|
def sum_list(FvcD, lst2):
res_list = [FvcD[i] + lst2[i] for i in range(len(FvcD))]
return res_list
| 1 | 725 |
mbpp
|
def sum_list(lst1,lst2):
res_list = [lst1[i] + lst2[i] for i in range(len(lst1))]
return res_list
|
transformation_add_sub_variable
|
def sum_list(lst1,lst2):
res_list = [lst1[i] - lst2[i] for i in range(len(lst1))]
return res_list
| 0 | 725 |
mbpp
|
def sum_list(lst1,lst2):
res_list = [lst1[i] + lst2[i] for i in range(len(lst1))]
return res_list
|
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 | 725 |
mbpp
|
def sum_list(lst1,lst2):
res_list = [lst1[i] + lst2[i] for i in range(len(lst1))]
return res_list
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 725 |
mbpp
|
def sum_list(lst1,lst2):
res_list = [lst1[i] + lst2[i] for i in range(len(lst1))]
return res_list
|
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 | 725 |
mbpp
|
def sum_list(lst1,lst2):
res_list = [lst1[i] + lst2[i] for i in range(len(lst1))]
return res_list
|
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 | 725 |
mbpp
|
def sum_list(lst1,lst2):
res_list = [lst1[i] + lst2[i] for i in range(len(lst1))]
return res_list
|
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 | 725 |
mbpp
|
def add_list(nums1,nums2):
result = map(lambda x, y: x + y, nums1, nums2)
return list(result)
|
transformation_dead_code_insert
|
def add_list(nums1, nums2):
while False:
return list(result)
result = map(lambda x, y: x + y, nums1, nums2)
return list(result)
| 1 | 726 |
mbpp
|
def add_list(nums1,nums2):
result = map(lambda x, y: x + y, nums1, nums2)
return list(result)
|
transformation_for_while_loop
|
def add_list(nums1, nums2):
result = map(lambda x, y: x + y, nums1, nums2)
return list(result)
| 1 | 726 |
mbpp
|
def add_list(nums1,nums2):
result = map(lambda x, y: x + y, nums1, nums2)
return list(result)
|
transformation_operand_swap
|
def add_list(nums1, nums2):
result = map(lambda x, y: x + y, nums1, nums2)
return list(result)
| 1 | 726 |
mbpp
|
def add_list(nums1,nums2):
result = map(lambda x, y: x + y, nums1, nums2)
return list(result)
|
transformation_rename_variable_cb
|
def add_list(nums1, result2):
result = map(lambda x, y: x + y, nums1, result2)
return list(result)
| 1 | 726 |
mbpp
|
def add_list(nums1,nums2):
result = map(lambda x, y: x + y, nums1, nums2)
return list(result)
|
transformation_rename_variable_naive
|
def add_list(nums1, nums2):
result = map(lambda VAR_0, y: VAR_0 + y, nums1, nums2)
return list(result)
| 1 | 726 |
mbpp
|
def add_list(nums1,nums2):
result = map(lambda x, y: x + y, nums1, nums2)
return list(result)
|
transformation_rename_variable_rn
|
def add_list(nums1, nums2):
result = map(lambda x, U: x + U, nums1, nums2)
return list(result)
| 1 | 726 |
mbpp
|
def add_list(nums1,nums2):
result = map(lambda x, y: x + y, nums1, nums2)
return list(result)
|
transformation_add_sub_variable
|
def add_list(nums1,nums2):
result = map(lambda x, y: x - y, nums1, nums2)
return list(result)
| 0 | 726 |
mbpp
|
def add_list(nums1,nums2):
result = map(lambda x, y: x + y, nums1, nums2)
return list(result)
|
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 | 726 |
mbpp
|
def add_list(nums1,nums2):
result = map(lambda x, y: x + y, nums1, nums2)
return list(result)
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 726 |
mbpp
|
def add_list(nums1,nums2):
result = map(lambda x, y: x + y, nums1, nums2)
return list(result)
|
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 | 726 |
mbpp
|
def add_list(nums1,nums2):
result = map(lambda x, y: x + y, nums1, nums2)
return list(result)
|
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 | 726 |
mbpp
|
def add_list(nums1,nums2):
result = map(lambda x, y: x + y, nums1, nums2)
return list(result)
|
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 | 726 |
mbpp
|
def consecutive_duplicates(nums):
from itertools import groupby
return [key for key, group in groupby(nums)]
|
transformation_dead_code_insert
|
def consecutive_duplicates(nums):
from itertools import groupby
_i_8 = 0
while _i_8 < _i_8:
return [key for key, group in groupby(nums)]
return [key for key, group in groupby(nums)]
| 1 | 727 |
mbpp
|
def consecutive_duplicates(nums):
from itertools import groupby
return [key for key, group in groupby(nums)]
|
transformation_for_while_loop
|
def consecutive_duplicates(nums):
from itertools import groupby
return [key for key, group in groupby(nums)]
| 1 | 727 |
mbpp
|
def consecutive_duplicates(nums):
from itertools import groupby
return [key for key, group in groupby(nums)]
|
transformation_operand_swap
|
def consecutive_duplicates(nums):
from itertools import groupby
return [key for key, group in groupby(nums)]
| 1 | 727 |
mbpp
|
def consecutive_duplicates(nums):
from itertools import groupby
return [key for key, group in groupby(nums)]
|
transformation_rename_variable_cb
|
def consecutive_duplicates(group2):
from itertools import groupby
return [key for key, group in groupby(group2)]
| 1 | 727 |
mbpp
|
def consecutive_duplicates(nums):
from itertools import groupby
return [key for key, group in groupby(nums)]
|
transformation_rename_variable_naive
|
def consecutive_duplicates(VAR_0):
from itertools import groupby
return [key for key, group in groupby(VAR_0)]
| 1 | 727 |
mbpp
|
def consecutive_duplicates(nums):
from itertools import groupby
return [key for key, group in groupby(nums)]
|
transformation_rename_variable_rn
|
def consecutive_duplicates(nums):
from itertools import groupby
return [G59 for G59, group in groupby(nums)]
| 1 | 727 |
mbpp
|
def consecutive_duplicates(nums):
from itertools import groupby
return [key for key, group in groupby(nums)]
|
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 | 727 |
mbpp
|
def consecutive_duplicates(nums):
from itertools import groupby
return [key for key, group in groupby(nums)]
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 727 |
mbpp
|
def consecutive_duplicates(nums):
from itertools import groupby
return [key for key, group in groupby(nums)]
|
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 | 727 |
mbpp
|
def consecutive_duplicates(nums):
from itertools import groupby
return [key for key, group in groupby(nums)]
|
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 | 727 |
mbpp
|
def consecutive_duplicates(nums):
from itertools import groupby
return [key for key, group in groupby(nums)]
|
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 | 727 |
mbpp
|
def lateralsurface_cone(r,h):
import math
l = math.sqrt(r * r + h * h)
LSA = math.pi * r * l
return LSA
|
transformation_dead_code_insert
|
def lateralsurface_cone(r, h):
import math
if False:
l = math.sqrt(r * r + h * h)
l = math.sqrt(r * r + h * h)
LSA = math.pi * r * l
return LSA
| 1 | 728 |
mbpp
|
def lateralsurface_cone(r,h):
import math
l = math.sqrt(r * r + h * h)
LSA = math.pi * r * l
return LSA
|
transformation_for_while_loop
|
def lateralsurface_cone(r, h):
import math
l = math.sqrt(r * r + h * h)
LSA = math.pi * r * l
return LSA
| 1 | 728 |
mbpp
|
def lateralsurface_cone(r,h):
import math
l = math.sqrt(r * r + h * h)
LSA = math.pi * r * l
return LSA
|
transformation_operand_swap
|
def lateralsurface_cone(r, h):
import math
l = math.sqrt(r * r + h * h)
LSA = math.pi * r * l
return LSA
| 1 | 728 |
mbpp
|
def lateralsurface_cone(r,h):
import math
l = math.sqrt(r * r + h * h)
LSA = math.pi * r * l
return LSA
|
transformation_rename_variable_cb
|
def lateralsurface_cone(p, h):
import math
l = math.sqrt(p * p + h * h)
LSA = math.pi * p * l
return LSA
| 1 | 728 |
mbpp
|
def lateralsurface_cone(r,h):
import math
l = math.sqrt(r * r + h * h)
LSA = math.pi * r * l
return LSA
|
transformation_rename_variable_naive
|
def lateralsurface_cone(VAR_0, h):
import math
l = math.sqrt(VAR_0 * VAR_0 + h * h)
LSA = math.pi * VAR_0 * l
return LSA
| 1 | 728 |
mbpp
|
def lateralsurface_cone(r,h):
import math
l = math.sqrt(r * r + h * h)
LSA = math.pi * r * l
return LSA
|
transformation_rename_variable_rn
|
def lateralsurface_cone(p, h):
import math
l = math.sqrt(p * p + h * h)
LSA = math.pi * p * l
return LSA
| 1 | 728 |
mbpp
|
def lateralsurface_cone(r,h):
import math
l = math.sqrt(r * r + h * h)
LSA = math.pi * r * l
return LSA
|
transformation_add_sub_variable
|
def lateralsurface_cone(r,h):
import math
l = math.sqrt(r * r - h * h)
LSA = math.pi * r * l
return LSA
| 0 | 728 |
mbpp
|
def lateralsurface_cone(r,h):
import math
l = math.sqrt(r * r + h * h)
LSA = math.pi * r * l
return LSA
|
transformation_mul_div_variable
|
def lateralsurface_cone(r,h):
import math
l = math.sqrt(r / r + h * h)
LSA = math.pi * r * l
return LSA
| 0 | 728 |
mbpp
|
def lateralsurface_cone(r,h):
import math
l = math.sqrt(r * r + h * h)
LSA = math.pi * r * l
return LSA
|
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 | 728 |
mbpp
|
def lateralsurface_cone(r,h):
import math
l = math.sqrt(r * r + h * h)
LSA = math.pi * r * l
return LSA
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 728 |
mbpp
|
def lateralsurface_cone(r,h):
import math
l = math.sqrt(r * r + h * h)
LSA = math.pi * r * l
return LSA
|
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 | 728 |
mbpp
|
def lateralsurface_cone(r,h):
import math
l = math.sqrt(r * r + h * h)
LSA = math.pi * r * l
return LSA
|
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 | 728 |
mbpp
|
def lateralsurface_cone(r,h):
import math
l = math.sqrt(r * r + h * h)
LSA = math.pi * r * l
return LSA
|
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 | 728 |
mbpp
|
def replace_specialchar(text):
import re
return (re.sub("[ ,.]", ":", text))
|
transformation_dead_code_insert
|
def replace_specialchar(text):
if False:
import re
import re
return re.sub("[ ,.]", ":", text)
| 1 | 729 |
mbpp
|
def replace_specialchar(text):
import re
return (re.sub("[ ,.]", ":", text))
|
transformation_for_while_loop
|
def replace_specialchar(text):
import re
return re.sub("[ ,.]", ":", text)
| 1 | 729 |
mbpp
|
def replace_specialchar(text):
import re
return (re.sub("[ ,.]", ":", text))
|
transformation_operand_swap
|
def replace_specialchar(text):
import re
return re.sub("[ ,.]", ":", text)
| 1 | 729 |
mbpp
|
def replace_specialchar(text):
import re
return (re.sub("[ ,.]", ":", text))
|
transformation_rename_variable_cb
|
def replace_specialchar(line):
import re
return re.sub("[ ,.]", ":", line)
| 1 | 729 |
mbpp
|
def replace_specialchar(text):
import re
return (re.sub("[ ,.]", ":", text))
|
transformation_rename_variable_naive
|
def replace_specialchar(VAR_0):
import re
return re.sub("[ ,.]", ":", VAR_0)
| 1 | 729 |
mbpp
|
def replace_specialchar(text):
import re
return (re.sub("[ ,.]", ":", text))
|
transformation_rename_variable_rn
|
def replace_specialchar(V9SR):
import re
return re.sub("[ ,.]", ":", V9SR)
| 1 | 729 |
mbpp
|
def replace_specialchar(text):
import re
return (re.sub("[ ,.]", ":", text))
|
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 | 729 |
mbpp
|
def replace_specialchar(text):
import re
return (re.sub("[ ,.]", ":", text))
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 729 |
mbpp
|
def replace_specialchar(text):
import re
return (re.sub("[ ,.]", ":", text))
|
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 | 729 |
mbpp
|
def replace_specialchar(text):
import re
return (re.sub("[ ,.]", ":", text))
|
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 | 729 |
mbpp
|
def replace_specialchar(text):
import re
return (re.sub("[ ,.]", ":", text))
|
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 | 729 |
mbpp
|
def find_first_occurrence(A, x):
(left, right) = (0, len(A) - 1)
result = -1
while left <= right:
mid = (left + right) // 2
if x == A[mid]:
result = mid
right = mid - 1
elif x < A[mid]:
right = mid - 1
else:
left = mid + 1
return result
|
transformation_dead_code_insert
|
def find_first_occurrence(A, x):
(left, right) = (0, len(A) - 1)
result = -1
while left <= right:
mid = (left + right) // 2
if x == A[mid]:
for _i_0 in range(0):
right = mid - 1
result = mid
right = mid - 1
elif x < A[mid]:
right = mid - 1
else:
left = mid + 1
return result
| 1 | 730 |
mbpp
|
def find_first_occurrence(A, x):
(left, right) = (0, len(A) - 1)
result = -1
while left <= right:
mid = (left + right) // 2
if x == A[mid]:
result = mid
right = mid - 1
elif x < A[mid]:
right = mid - 1
else:
left = mid + 1
return result
|
transformation_for_while_loop
|
def find_first_occurrence(A, x):
(left, right) = (0, len(A) - 1)
result = -1
while left <= right:
mid = (left + right) // 2
if x == A[mid]:
result = mid
right = mid - 1
elif x < A[mid]:
right = mid - 1
else:
left = mid + 1
return result
| 1 | 730 |
mbpp
|
def find_first_occurrence(A, x):
(left, right) = (0, len(A) - 1)
result = -1
while left <= right:
mid = (left + right) // 2
if x == A[mid]:
result = mid
right = mid - 1
elif x < A[mid]:
right = mid - 1
else:
left = mid + 1
return result
|
transformation_operand_swap
|
def find_first_occurrence(A, x):
(left, right) = (0, len(A) - 1)
result = -1
while right >= left:
mid = (left + right) // 2
if x == A[mid]:
result = mid
right = mid - 1
elif x < A[mid]:
right = mid - 1
else:
left = mid + 1
return result
| 1 | 730 |
mbpp
|
def find_first_occurrence(A, x):
(left, right) = (0, len(A) - 1)
result = -1
while left <= right:
mid = (left + right) // 2
if x == A[mid]:
result = mid
right = mid - 1
elif x < A[mid]:
right = mid - 1
else:
left = mid + 1
return result
|
transformation_rename_variable_cb
|
def find_first_occurrence(A, x):
(left, right) = (0, len(A) - 1)
result = -1
while left <= right:
left2 = (left + right) // 2
if x == A[left2]:
result = left2
right = left2 - 1
elif x < A[left2]:
right = left2 - 1
else:
left = left2 + 1
return result
| 1 | 730 |
mbpp
|
def find_first_occurrence(A, x):
(left, right) = (0, len(A) - 1)
result = -1
while left <= right:
mid = (left + right) // 2
if x == A[mid]:
result = mid
right = mid - 1
elif x < A[mid]:
right = mid - 1
else:
left = mid + 1
return result
|
transformation_rename_variable_naive
|
def find_first_occurrence(A, x):
(left, right) = (0, len(A) - 1)
result = -1
while left <= right:
VAR_0 = (left + right) // 2
if x == A[VAR_0]:
result = VAR_0
right = VAR_0 - 1
elif x < A[VAR_0]:
right = VAR_0 - 1
else:
left = VAR_0 + 1
return result
| 1 | 730 |
mbpp
|
def find_first_occurrence(A, x):
(left, right) = (0, len(A) - 1)
result = -1
while left <= right:
mid = (left + right) // 2
if x == A[mid]:
result = mid
right = mid - 1
elif x < A[mid]:
right = mid - 1
else:
left = mid + 1
return result
|
transformation_rename_variable_rn
|
def find_first_occurrence(A, x):
(left, right) = (0, len(A) - 1)
result = -1
while left <= right:
Ck4 = (left + right) // 2
if x == A[Ck4]:
result = Ck4
right = Ck4 - 1
elif x < A[Ck4]:
right = Ck4 - 1
else:
left = Ck4 + 1
return result
| 1 | 730 |
mbpp
|
def find_first_occurrence(A, x):
(left, right) = (0, len(A) - 1)
result = -1
while left <= right:
mid = (left + right) // 2
if x == A[mid]:
result = mid
right = mid - 1
elif x < A[mid]:
right = mid - 1
else:
left = mid + 1
return result
|
transformation_add_sub_variable
|
def find_first_occurrence(A, x):
(left, right) = (0, len(A) - 1)
result = -1
while left <= right:
mid = (left - right) // 2
if x == A[mid]:
result = mid
right = mid - 1
elif x < A[mid]:
right = mid - 1
else:
left = mid + 1
return result
| 0 | 730 |
mbpp
|
def find_first_occurrence(A, x):
(left, right) = (0, len(A) - 1)
result = -1
while left <= right:
mid = (left + right) // 2
if x == A[mid]:
result = mid
right = mid - 1
elif x < A[mid]:
right = mid - 1
else:
left = mid + 1
return result
|
transformation_sub_add_variable
|
def find_first_occurrence(A, x):
(left, right) = (0, len(A) + 1)
result = -1
while left <= right:
mid = (left + right) // 2
if x == A[mid]:
result = mid
right = mid - 1
elif x < A[mid]:
right = mid - 1
else:
left = mid + 1
return result
| 0 | 730 |
mbpp
|
def find_first_occurrence(A, x):
(left, right) = (0, len(A) - 1)
result = -1
while left <= right:
mid = (left + right) // 2
if x == A[mid]:
result = mid
right = mid - 1
elif x < A[mid]:
right = mid - 1
else:
left = mid + 1
return result
|
transformation_div_mul_variable
|
def find_first_occurrence(A, x):
(left, right) = (0, len(A) - 1)
result = -1
while left <= right:
mid = (left + right) */ 2
if x == A[mid]:
result = mid
right = mid - 1
elif x < A[mid]:
right = mid - 1
else:
left = mid + 1
return result
| 0 | 730 |
mbpp
|
def find_first_occurrence(A, x):
(left, right) = (0, len(A) - 1)
result = -1
while left <= right:
mid = (left + right) // 2
if x == A[mid]:
result = mid
right = mid - 1
elif x < A[mid]:
right = mid - 1
else:
left = mid + 1
return result
|
transformation_lesser_greater_variable
|
def find_first_occurrence(A, x):
(left, right) = (0, len(A) - 1)
result = -1
while left >= right:
mid = (left + right) // 2
if x == A[mid]:
result = mid
right = mid - 1
elif x < A[mid]:
right = mid - 1
else:
left = mid + 1
return result
| 0 | 730 |
mbpp
|
def find_first_occurrence(A, x):
(left, right) = (0, len(A) - 1)
result = -1
while left <= right:
mid = (left + right) // 2
if x == A[mid]:
result = mid
right = mid - 1
elif x < A[mid]:
right = mid - 1
else:
left = mid + 1
return result
|
transformation_equalto_exclamation_variable
|
def find_first_occurrence(A, x):
(left, right) = (0, len(A) - 1)
result = -1
while left <= right:
mid = (left + right) // 2
if x != A[mid]:
result = mid
right = mid - 1
elif x < A[mid]:
right = mid - 1
else:
left = mid + 1
return result
| 0 | 730 |
mbpp
|
def find_first_occurrence(A, x):
(left, right) = (0, len(A) - 1)
result = -1
while left <= right:
mid = (left + right) // 2
if x == A[mid]:
result = mid
right = mid - 1
elif x < A[mid]:
right = mid - 1
else:
left = mid + 1
return result
|
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 | 730 |
mbpp
|
def find_first_occurrence(A, x):
(left, right) = (0, len(A) - 1)
result = -1
while left <= right:
mid = (left + right) // 2
if x == A[mid]:
result = mid
right = mid - 1
elif x < A[mid]:
right = mid - 1
else:
left = mid + 1
return result
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 730 |
mbpp
|
def find_first_occurrence(A, x):
(left, right) = (0, len(A) - 1)
result = -1
while left <= right:
mid = (left + right) // 2
if x == A[mid]:
result = mid
right = mid - 1
elif x < A[mid]:
right = mid - 1
else:
left = mid + 1
return result
|
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 | 730 |
mbpp
|
def find_first_occurrence(A, x):
(left, right) = (0, len(A) - 1)
result = -1
while left <= right:
mid = (left + right) // 2
if x == A[mid]:
result = mid
right = mid - 1
elif x < A[mid]:
right = mid - 1
else:
left = mid + 1
return result
|
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 | 730 |
mbpp
|
def find_first_occurrence(A, x):
(left, right) = (0, len(A) - 1)
result = -1
while left <= right:
mid = (left + right) // 2
if x == A[mid]:
result = mid
right = mid - 1
elif x < A[mid]:
right = mid - 1
else:
left = mid + 1
return result
|
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 | 730 |
mbpp
|
def toggle_middle_bits(n):
def set_middle_bits(n):
n |= n >> 1;
n |= n >> 2;
n |= n >> 4;
n |= n >> 8;
n |= n >> 16;
return (n >> 1) ^ 1
if (n == 1):
return 1
return n ^ set_middle_bits(n)
|
transformation_dead_code_insert
|
def toggle_middle_bits(n):
def set_middle_bits(n):
n |= n >> 1
n |= n >> 2
n |= n >> 4
_i_1 = 0
if _i_1 < _i_1:
return n ^ set_middle_bits(n)
n |= n >> 8
n |= n >> 16
return (n >> 1) ^ 1
if n == 1:
return 1
return n ^ set_middle_bits(n)
| 1 | 732 |
mbpp
|
def toggle_middle_bits(n):
def set_middle_bits(n):
n |= n >> 1;
n |= n >> 2;
n |= n >> 4;
n |= n >> 8;
n |= n >> 16;
return (n >> 1) ^ 1
if (n == 1):
return 1
return n ^ set_middle_bits(n)
|
transformation_for_while_loop
|
def toggle_middle_bits(n):
def set_middle_bits(n):
n |= n >> 1
n |= n >> 2
n |= n >> 4
n |= n >> 8
n |= n >> 16
return (n >> 1) ^ 1
if n == 1:
return 1
return n ^ set_middle_bits(n)
| 1 | 732 |
mbpp
|
def toggle_middle_bits(n):
def set_middle_bits(n):
n |= n >> 1;
n |= n >> 2;
n |= n >> 4;
n |= n >> 8;
n |= n >> 16;
return (n >> 1) ^ 1
if (n == 1):
return 1
return n ^ set_middle_bits(n)
|
transformation_operand_swap
|
def toggle_middle_bits(n):
def set_middle_bits(n):
n |= n >> 1
n |= n >> 2
n |= n >> 4
n |= n >> 8
n |= n >> 16
return (n >> 1) ^ 1
if 1 == n:
return 1
return n ^ set_middle_bits(n)
| 1 | 732 |
mbpp
|
def toggle_middle_bits(n):
def set_middle_bits(n):
n |= n >> 1;
n |= n >> 2;
n |= n >> 4;
n |= n >> 8;
n |= n >> 16;
return (n >> 1) ^ 1
if (n == 1):
return 1
return n ^ set_middle_bits(n)
|
transformation_rename_variable_cb
|
def toggle_middle_bits(pri):
def set_middle_bits(pri):
pri |= pri >> 1
pri |= pri >> 2
pri |= pri >> 4
pri |= pri >> 8
pri |= pri >> 16
return (pri >> 1) ^ 1
if pri == 1:
return 1
return pri ^ set_middle_bits(pri)
| 1 | 732 |
mbpp
|
def toggle_middle_bits(n):
def set_middle_bits(n):
n |= n >> 1;
n |= n >> 2;
n |= n >> 4;
n |= n >> 8;
n |= n >> 16;
return (n >> 1) ^ 1
if (n == 1):
return 1
return n ^ set_middle_bits(n)
|
transformation_rename_variable_naive
|
def toggle_middle_bits(VAR_0):
def set_middle_bits(VAR_0):
VAR_0 |= VAR_0 >> 1
VAR_0 |= VAR_0 >> 2
VAR_0 |= VAR_0 >> 4
VAR_0 |= VAR_0 >> 8
VAR_0 |= VAR_0 >> 16
return (VAR_0 >> 1) ^ 1
if VAR_0 == 1:
return 1
return VAR_0 ^ set_middle_bits(VAR_0)
| 1 | 732 |
mbpp
|
def toggle_middle_bits(n):
def set_middle_bits(n):
n |= n >> 1;
n |= n >> 2;
n |= n >> 4;
n |= n >> 8;
n |= n >> 16;
return (n >> 1) ^ 1
if (n == 1):
return 1
return n ^ set_middle_bits(n)
|
transformation_rename_variable_rn
|
def toggle_middle_bits(s):
def set_middle_bits(s):
s |= s >> 1
s |= s >> 2
s |= s >> 4
s |= s >> 8
s |= s >> 16
return (s >> 1) ^ 1
if s == 1:
return 1
return s ^ set_middle_bits(s)
| 1 | 732 |
mbpp
|
def toggle_middle_bits(n):
def set_middle_bits(n):
n |= n >> 1;
n |= n >> 2;
n |= n >> 4;
n |= n >> 8;
n |= n >> 16;
return (n >> 1) ^ 1
if (n == 1):
return 1
return n ^ set_middle_bits(n)
|
transformation_greater_lesser_variable
|
def toggle_middle_bits(n):
def set_middle_bits(n):
n |= n <> 1;
n |= n >> 2;
n |= n >> 4;
n |= n >> 8;
n |= n >> 16;
return (n >> 1) ^ 1
if (n == 1):
return 1
return n ^ set_middle_bits(n)
| 0 | 732 |
mbpp
|
def toggle_middle_bits(n):
def set_middle_bits(n):
n |= n >> 1;
n |= n >> 2;
n |= n >> 4;
n |= n >> 8;
n |= n >> 16;
return (n >> 1) ^ 1
if (n == 1):
return 1
return n ^ set_middle_bits(n)
|
transformation_equalto_exclamation_variable
|
def toggle_middle_bits(n):
def set_middle_bits(n):
n |= n >> 1;
n |= n >> 2;
n |= n >> 4;
n |= n >> 8;
n |= n >> 16;
return (n >> 1) ^ 1
if (n != 1):
return 1
return n ^ set_middle_bits(n)
| 0 | 732 |
mbpp
|
def toggle_middle_bits(n):
def set_middle_bits(n):
n |= n >> 1;
n |= n >> 2;
n |= n >> 4;
n |= n >> 8;
n |= n >> 16;
return (n >> 1) ^ 1
if (n == 1):
return 1
return n ^ set_middle_bits(n)
|
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 | 732 |
mbpp
|
def toggle_middle_bits(n):
def set_middle_bits(n):
n |= n >> 1;
n |= n >> 2;
n |= n >> 4;
n |= n >> 8;
n |= n >> 16;
return (n >> 1) ^ 1
if (n == 1):
return 1
return n ^ set_middle_bits(n)
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 732 |
mbpp
|
def toggle_middle_bits(n):
def set_middle_bits(n):
n |= n >> 1;
n |= n >> 2;
n |= n >> 4;
n |= n >> 8;
n |= n >> 16;
return (n >> 1) ^ 1
if (n == 1):
return 1
return n ^ set_middle_bits(n)
|
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 | 732 |
mbpp
|
def toggle_middle_bits(n):
def set_middle_bits(n):
n |= n >> 1;
n |= n >> 2;
n |= n >> 4;
n |= n >> 8;
n |= n >> 16;
return (n >> 1) ^ 1
if (n == 1):
return 1
return n ^ set_middle_bits(n)
|
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 | 732 |
mbpp
|
def toggle_middle_bits(n):
def set_middle_bits(n):
n |= n >> 1;
n |= n >> 2;
n |= n >> 4;
n |= n >> 8;
n |= n >> 16;
return (n >> 1) ^ 1
if (n == 1):
return 1
return n ^ set_middle_bits(n)
|
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 | 732 |
mbpp
|
def left_insertion(a, x):
import bisect
i = bisect.bisect_left(a, x)
return i
|
transformation_dead_code_insert
|
def left_insertion(a, x):
import bisect
while False:
return i
i = bisect.bisect_left(a, x)
return i
| 1 | 733 |
mbpp
|
def left_insertion(a, x):
import bisect
i = bisect.bisect_left(a, x)
return i
|
transformation_for_while_loop
|
def left_insertion(a, x):
import bisect
i = bisect.bisect_left(a, x)
return i
| 1 | 733 |
mbpp
|
def left_insertion(a, x):
import bisect
i = bisect.bisect_left(a, x)
return i
|
transformation_operand_swap
|
def left_insertion(a, x):
import bisect
i = bisect.bisect_left(a, x)
return i
| 1 | 733 |
mbpp
|
def left_insertion(a, x):
import bisect
i = bisect.bisect_left(a, x)
return i
|
transformation_rename_variable_cb
|
def left_insertion(a, x):
import bisect
b = bisect.bisect_left(a, x)
return b
| 1 | 733 |
mbpp
|
def left_insertion(a, x):
import bisect
i = bisect.bisect_left(a, x)
return i
|
transformation_rename_variable_naive
|
def left_insertion(a, VAR_0):
import bisect
i = bisect.bisect_left(a, VAR_0)
return i
| 1 | 733 |
mbpp
|
def left_insertion(a, x):
import bisect
i = bisect.bisect_left(a, x)
return i
|
transformation_rename_variable_rn
|
def left_insertion(a, x):
import bisect
I = bisect.bisect_left(a, x)
return I
| 1 | 733 |
mbpp
|
def left_insertion(a, x):
import bisect
i = bisect.bisect_left(a, x)
return i
|
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 | 733 |
mbpp
|
def left_insertion(a, x):
import bisect
i = bisect.bisect_left(a, x)
return i
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 733 |
mbpp
|
def left_insertion(a, x):
import bisect
i = bisect.bisect_left(a, x)
return i
|
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 | 733 |
mbpp
|
def left_insertion(a, x):
import bisect
i = bisect.bisect_left(a, x)
return i
|
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 | 733 |
mbpp
|
def left_insertion(a, x):
import bisect
i = bisect.bisect_left(a, x)
return i
|
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 | 733 |
mbpp
|
def tuple_to_dict(test_tup):
res = dict(test_tup[idx : idx + 2] for idx in range(0, len(test_tup), 2))
return (res)
|
transformation_dead_code_insert
|
def tuple_to_dict(test_tup):
_i_1 = 0
while _i_1 > _i_1:
return res
res = dict(test_tup[idx : idx + 2] for idx in range(0, len(test_tup), 2))
return res
| 1 | 737 |
mbpp
|
def tuple_to_dict(test_tup):
res = dict(test_tup[idx : idx + 2] for idx in range(0, len(test_tup), 2))
return (res)
|
transformation_for_while_loop
|
def tuple_to_dict(test_tup):
res = dict(test_tup[idx : idx + 2] for idx in range(0, len(test_tup), 2))
return res
| 1 | 737 |
mbpp
|
def tuple_to_dict(test_tup):
res = dict(test_tup[idx : idx + 2] for idx in range(0, len(test_tup), 2))
return (res)
|
transformation_operand_swap
|
def tuple_to_dict(test_tup):
res = dict(test_tup[idx : idx + 2] for idx in range(0, len(test_tup), 2))
return res
| 1 | 737 |
mbpp
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.