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 is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is None:
return 0
return max(get_height(root.left), get_height(root.right)) + 1
if root is None:
return True
lh = get_height(root.left)
rh = get_height(root.right)
if (abs(lh - rh) <= 1) and is_tree_balanced(
root.left) is True and is_tree_balanced( root.right) is True:
return True
return False
|
transformation_is_isnot_variable
|
def is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is not None:
return 0
return max(get_height(root.left), get_height(root.right)) + 1
if root is None:
return True
lh = get_height(root.left)
rh = get_height(root.right)
if (abs(lh - rh) <= 1) and is_tree_balanced(
root.left) is True and is_tree_balanced( root.right) is True:
return True
return False
| 0 | 364 |
mbpp
|
def is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is None:
return 0
return max(get_height(root.left), get_height(root.right)) + 1
if root is None:
return True
lh = get_height(root.left)
rh = get_height(root.right)
if (abs(lh - rh) <= 1) and is_tree_balanced(
root.left) is True and is_tree_balanced( root.right) is True:
return True
return False
|
transformation_true_false_variable
|
def is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is None:
return 0
return max(get_height(root.left), get_height(root.right)) + 1
if root is None:
return False
lh = get_height(root.left)
rh = get_height(root.right)
if (abs(lh - rh) <= 1) and is_tree_balanced(
root.left) is True and is_tree_balanced( root.right) is True:
return True
return False
| 0 | 364 |
mbpp
|
def is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is None:
return 0
return max(get_height(root.left), get_height(root.right)) + 1
if root is None:
return True
lh = get_height(root.left)
rh = get_height(root.right)
if (abs(lh - rh) <= 1) and is_tree_balanced(
root.left) is True and is_tree_balanced( root.right) is True:
return True
return False
|
transformation_false_true_variable
|
def is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is None:
return 0
return max(get_height(root.left), get_height(root.right)) + 1
if root is None:
return True
lh = get_height(root.left)
rh = get_height(root.right)
if (abs(lh - rh) <= 1) and is_tree_balanced(
root.left) is True and is_tree_balanced( root.right) is True:
return True
return True
| 0 | 364 |
mbpp
|
def is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is None:
return 0
return max(get_height(root.left), get_height(root.right)) + 1
if root is None:
return True
lh = get_height(root.left)
rh = get_height(root.right)
if (abs(lh - rh) <= 1) and is_tree_balanced(
root.left) is True and is_tree_balanced( root.right) is True:
return True
return False
|
transformation_and_or_variable
|
def is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is None:
return 0
return max(get_height(root.left), get_height(root.right)) + 1
if root is None:
return True
lh = get_height(root.left)
rh = get_height(root.right)
if (abs(lh - rh) <= 1) or is_tree_balanced(
root.left) is True and is_tree_balanced( root.right) is True:
return True
return False
| 0 | 364 |
mbpp
|
def is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is None:
return 0
return max(get_height(root.left), get_height(root.right)) + 1
if root is None:
return True
lh = get_height(root.left)
rh = get_height(root.right)
if (abs(lh - rh) <= 1) and is_tree_balanced(
root.left) is True and is_tree_balanced( root.right) is True:
return True
return False
|
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 | 364 |
mbpp
|
def is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is None:
return 0
return max(get_height(root.left), get_height(root.right)) + 1
if root is None:
return True
lh = get_height(root.left)
rh = get_height(root.right)
if (abs(lh - rh) <= 1) and is_tree_balanced(
root.left) is True and is_tree_balanced( root.right) is True:
return True
return False
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 364 |
mbpp
|
def is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is None:
return 0
return max(get_height(root.left), get_height(root.right)) + 1
if root is None:
return True
lh = get_height(root.left)
rh = get_height(root.right)
if (abs(lh - rh) <= 1) and is_tree_balanced(
root.left) is True and is_tree_balanced( root.right) is True:
return True
return False
|
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 | 364 |
mbpp
|
def is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is None:
return 0
return max(get_height(root.left), get_height(root.right)) + 1
if root is None:
return True
lh = get_height(root.left)
rh = get_height(root.right)
if (abs(lh - rh) <= 1) and is_tree_balanced(
root.left) is True and is_tree_balanced( root.right) is True:
return True
return False
|
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 | 364 |
mbpp
|
def is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is None:
return 0
return max(get_height(root.left), get_height(root.right)) + 1
if root is None:
return True
lh = get_height(root.left)
rh = get_height(root.right)
if (abs(lh - rh) <= 1) and is_tree_balanced(
root.left) is True and is_tree_balanced( root.right) is True:
return True
return False
|
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 | 364 |
mbpp
|
def lateralsurface_cuboid(l,w,h):
LSA = 2*h*(l+w)
return LSA
|
transformation_dead_code_insert
|
def lateralsurface_cuboid(l, w, h):
_i_3 = 0
while _i_3 > _i_3:
LSA = 2 * h * (l + w)
LSA = 2 * h * (l + w)
return LSA
| 1 | 366 |
mbpp
|
def lateralsurface_cuboid(l,w,h):
LSA = 2*h*(l+w)
return LSA
|
transformation_for_while_loop
|
def lateralsurface_cuboid(l, w, h):
LSA = 2 * h * (l + w)
return LSA
| 1 | 366 |
mbpp
|
def lateralsurface_cuboid(l,w,h):
LSA = 2*h*(l+w)
return LSA
|
transformation_operand_swap
|
def lateralsurface_cuboid(l, w, h):
LSA = 2 * h * (l + w)
return LSA
| 1 | 366 |
mbpp
|
def lateralsurface_cuboid(l,w,h):
LSA = 2*h*(l+w)
return LSA
|
transformation_rename_variable_cb
|
def lateralsurface_cuboid(l, c, h):
LSA = 2 * h * (l + c)
return LSA
| 1 | 366 |
mbpp
|
def lateralsurface_cuboid(l,w,h):
LSA = 2*h*(l+w)
return LSA
|
transformation_rename_variable_naive
|
def lateralsurface_cuboid(l, VAR_0, h):
LSA = 2 * h * (l + VAR_0)
return LSA
| 1 | 366 |
mbpp
|
def lateralsurface_cuboid(l,w,h):
LSA = 2*h*(l+w)
return LSA
|
transformation_rename_variable_rn
|
def lateralsurface_cuboid(K, w, h):
LSA = 2 * h * (K + w)
return LSA
| 1 | 366 |
mbpp
|
def lateralsurface_cuboid(l,w,h):
LSA = 2*h*(l+w)
return LSA
|
transformation_add_sub_variable
|
def lateralsurface_cuboid(l,w,h):
LSA = 2*h*(l-w)
return LSA
| 0 | 366 |
mbpp
|
def lateralsurface_cuboid(l,w,h):
LSA = 2*h*(l+w)
return LSA
|
transformation_mul_div_variable
|
def lateralsurface_cuboid(l,w,h):
LSA = 2/h*(l+w)
return LSA
| 0 | 366 |
mbpp
|
def lateralsurface_cuboid(l,w,h):
LSA = 2*h*(l+w)
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 | 366 |
mbpp
|
def lateralsurface_cuboid(l,w,h):
LSA = 2*h*(l+w)
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 | 366 |
mbpp
|
def lateralsurface_cuboid(l,w,h):
LSA = 2*h*(l+w)
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 | 366 |
mbpp
|
def lateralsurface_cuboid(l,w,h):
LSA = 2*h*(l+w)
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 | 366 |
mbpp
|
def lateralsurface_cuboid(l,w,h):
LSA = 2*h*(l+w)
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 | 366 |
mbpp
|
def heap_assending(nums):
import heapq as hq
hq.heapify(nums)
s_result = [hq.heappop(nums) for i in range(len(nums))]
return s_result
|
transformation_dead_code_insert
|
def heap_assending(nums):
_i_6 = 0
if _i_6 > _i_6:
return s_result
import heapq as hq
hq.heapify(nums)
s_result = [hq.heappop(nums) for i in range(len(nums))]
return s_result
| 1 | 369 |
mbpp
|
def heap_assending(nums):
import heapq as hq
hq.heapify(nums)
s_result = [hq.heappop(nums) for i in range(len(nums))]
return s_result
|
transformation_for_while_loop
|
def heap_assending(nums):
import heapq as hq
hq.heapify(nums)
s_result = [hq.heappop(nums) for i in range(len(nums))]
return s_result
| 1 | 369 |
mbpp
|
def heap_assending(nums):
import heapq as hq
hq.heapify(nums)
s_result = [hq.heappop(nums) for i in range(len(nums))]
return s_result
|
transformation_operand_swap
|
def heap_assending(nums):
import heapq as hq
hq.heapify(nums)
s_result = [hq.heappop(nums) for i in range(len(nums))]
return s_result
| 1 | 369 |
mbpp
|
def heap_assending(nums):
import heapq as hq
hq.heapify(nums)
s_result = [hq.heappop(nums) for i in range(len(nums))]
return s_result
|
transformation_rename_variable_cb
|
def heap_assending(s):
import heapq as hq
hq.heapify(s)
s_result = [hq.heappop(s) for i in range(len(s))]
return s_result
| 1 | 369 |
mbpp
|
def heap_assending(nums):
import heapq as hq
hq.heapify(nums)
s_result = [hq.heappop(nums) for i in range(len(nums))]
return s_result
|
transformation_rename_variable_naive
|
def heap_assending(VAR_0):
import heapq as hq
hq.heapify(VAR_0)
s_result = [hq.heappop(VAR_0) for i in range(len(VAR_0))]
return s_result
| 1 | 369 |
mbpp
|
def heap_assending(nums):
import heapq as hq
hq.heapify(nums)
s_result = [hq.heappop(nums) for i in range(len(nums))]
return s_result
|
transformation_rename_variable_rn
|
def heap_assending(dJ5d):
import heapq as hq
hq.heapify(dJ5d)
s_result = [hq.heappop(dJ5d) for i in range(len(dJ5d))]
return s_result
| 1 | 369 |
mbpp
|
def heap_assending(nums):
import heapq as hq
hq.heapify(nums)
s_result = [hq.heappop(nums) for i in range(len(nums))]
return s_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 | 369 |
mbpp
|
def heap_assending(nums):
import heapq as hq
hq.heapify(nums)
s_result = [hq.heappop(nums) for i in range(len(nums))]
return s_result
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 369 |
mbpp
|
def heap_assending(nums):
import heapq as hq
hq.heapify(nums)
s_result = [hq.heappop(nums) for i in range(len(nums))]
return s_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 | 369 |
mbpp
|
def heap_assending(nums):
import heapq as hq
hq.heapify(nums)
s_result = [hq.heappop(nums) for i in range(len(nums))]
return s_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 | 369 |
mbpp
|
def heap_assending(nums):
import heapq as hq
hq.heapify(nums)
s_result = [hq.heappop(nums) for i in range(len(nums))]
return s_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 | 369 |
mbpp
|
def round_num(n,m):
a = (n //m) * m
b = a + m
return (b if n - a > b - n else a)
|
transformation_dead_code_insert
|
def round_num(n, m):
a = (n // m) * m
for _i_9 in range(0):
a = (n // m) * m
b = a + m
return b if n - a > b - n else a
| 1 | 372 |
mbpp
|
def round_num(n,m):
a = (n //m) * m
b = a + m
return (b if n - a > b - n else a)
|
transformation_for_while_loop
|
def round_num(n, m):
a = (n // m) * m
b = a + m
return b if n - a > b - n else a
| 1 | 372 |
mbpp
|
def round_num(n,m):
a = (n //m) * m
b = a + m
return (b if n - a > b - n else a)
|
transformation_operand_swap
|
def round_num(n, m):
a = (n // m) * m
b = a + m
return b if b - n < n - a else a
| 1 | 372 |
mbpp
|
def round_num(n,m):
a = (n //m) * m
b = a + m
return (b if n - a > b - n else a)
|
transformation_rename_variable_cb
|
def round_num(n, m):
b2 = (n // m) * m
b = b2 + m
return b if n - b2 > b - n else b2
| 1 | 372 |
mbpp
|
def round_num(n,m):
a = (n //m) * m
b = a + m
return (b if n - a > b - n else a)
|
transformation_rename_variable_naive
|
def round_num(n, VAR_0):
a = (n // VAR_0) * VAR_0
b = a + VAR_0
return b if n - a > b - n else a
| 1 | 372 |
mbpp
|
def round_num(n,m):
a = (n //m) * m
b = a + m
return (b if n - a > b - n else a)
|
transformation_rename_variable_rn
|
def round_num(n, m):
i = (n // m) * m
b = i + m
return b if n - i > b - n else i
| 1 | 372 |
mbpp
|
def round_num(n,m):
a = (n //m) * m
b = a + m
return (b if n - a > b - n else a)
|
transformation_add_sub_variable
|
def round_num(n,m):
a = (n //m) * m
b = a - m
return (b if n - a > b - n else a)
| 0 | 372 |
mbpp
|
def round_num(n,m):
a = (n //m) * m
b = a + m
return (b if n - a > b - n else a)
|
transformation_sub_add_variable
|
def round_num(n,m):
a = (n //m) * m
b = a + m
return (b if n + a > b - n else a)
| 0 | 372 |
mbpp
|
def round_num(n,m):
a = (n //m) * m
b = a + m
return (b if n - a > b - n else a)
|
transformation_mul_div_variable
|
def round_num(n,m):
a = (n //m) / m
b = a + m
return (b if n - a > b - n else a)
| 0 | 372 |
mbpp
|
def round_num(n,m):
a = (n //m) * m
b = a + m
return (b if n - a > b - n else a)
|
transformation_div_mul_variable
|
def round_num(n,m):
a = (n */m) * m
b = a + m
return (b if n - a > b - n else a)
| 0 | 372 |
mbpp
|
def round_num(n,m):
a = (n //m) * m
b = a + m
return (b if n - a > b - n else a)
|
transformation_greater_lesser_variable
|
def round_num(n,m):
a = (n //m) * m
b = a + m
return (b if n - a < b - n else a)
| 0 | 372 |
mbpp
|
def round_num(n,m):
a = (n //m) * m
b = a + m
return (b if n - a > b - n else a)
|
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 | 372 |
mbpp
|
def round_num(n,m):
a = (n //m) * m
b = a + m
return (b if n - a > b - n else a)
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 372 |
mbpp
|
def round_num(n,m):
a = (n //m) * m
b = a + m
return (b if n - a > b - n else a)
|
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 | 372 |
mbpp
|
def round_num(n,m):
a = (n //m) * m
b = a + m
return (b if n - a > b - n else a)
|
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 | 372 |
mbpp
|
def round_num(n,m):
a = (n //m) * m
b = a + m
return (b if n - a > b - n else a)
|
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 | 372 |
mbpp
|
def remove_replica(test_tup):
temp = set()
res = tuple(ele if ele not in temp and not temp.add(ele)
else 'MSP' for ele in test_tup)
return (res)
|
transformation_dead_code_insert
|
def remove_replica(test_tup):
_i_0 = 0
if _i_0 < _i_0:
return res
temp = set()
res = tuple(
ele if ele not in temp and not temp.add(ele) else "MSP" for ele in test_tup
)
return res
| 1 | 373 |
mbpp
|
def remove_replica(test_tup):
temp = set()
res = tuple(ele if ele not in temp and not temp.add(ele)
else 'MSP' for ele in test_tup)
return (res)
|
transformation_for_while_loop
|
def remove_replica(test_tup):
temp = set()
res = tuple(
ele if ele not in temp and not temp.add(ele) else "MSP" for ele in test_tup
)
return res
| 1 | 373 |
mbpp
|
def remove_replica(test_tup):
temp = set()
res = tuple(ele if ele not in temp and not temp.add(ele)
else 'MSP' for ele in test_tup)
return (res)
|
transformation_operand_swap
|
def remove_replica(test_tup):
temp = set()
res = tuple(
ele if ele not in temp and not temp.add(ele) else "MSP" for ele in test_tup
)
return res
| 1 | 373 |
mbpp
|
def remove_replica(test_tup):
temp = set()
res = tuple(ele if ele not in temp and not temp.add(ele)
else 'MSP' for ele in test_tup)
return (res)
|
transformation_rename_variable_cb
|
def remove_replica(test_tup):
temp = set()
res = tuple(r if r not in temp and not temp.add(r) else "MSP" for r in test_tup)
return res
| 1 | 373 |
mbpp
|
def remove_replica(test_tup):
temp = set()
res = tuple(ele if ele not in temp and not temp.add(ele)
else 'MSP' for ele in test_tup)
return (res)
|
transformation_rename_variable_naive
|
def remove_replica(test_tup):
temp = set()
res = tuple(
VAR_0 if VAR_0 not in temp and not temp.add(VAR_0) else "MSP"
for VAR_0 in test_tup
)
return res
| 1 | 373 |
mbpp
|
def remove_replica(test_tup):
temp = set()
res = tuple(ele if ele not in temp and not temp.add(ele)
else 'MSP' for ele in test_tup)
return (res)
|
transformation_rename_variable_rn
|
def remove_replica(test_tup):
temp = set()
res = tuple(
O0T if O0T not in temp and not temp.add(O0T) else "MSP" for O0T in test_tup
)
return res
| 1 | 373 |
mbpp
|
def remove_replica(test_tup):
temp = set()
res = tuple(ele if ele not in temp and not temp.add(ele)
else 'MSP' for ele in test_tup)
return (res)
|
transformation_and_or_variable
|
def remove_replica(test_tup):
temp = set()
res = tuple(ele if ele not in temp or not temp.add(ele)
else 'MSP' for ele in test_tup)
return (res)
| 0 | 373 |
mbpp
|
def remove_replica(test_tup):
temp = set()
res = tuple(ele if ele not in temp and not temp.add(ele)
else 'MSP' for ele in test_tup)
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 | 373 |
mbpp
|
def remove_replica(test_tup):
temp = set()
res = tuple(ele if ele not in temp and not temp.add(ele)
else 'MSP' for ele in test_tup)
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 | 373 |
mbpp
|
def remove_replica(test_tup):
temp = set()
res = tuple(ele if ele not in temp and not temp.add(ele)
else 'MSP' for ele in test_tup)
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 | 373 |
mbpp
|
def remove_replica(test_tup):
temp = set()
res = tuple(ele if ele not in temp and not temp.add(ele)
else 'MSP' for ele in test_tup)
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 | 373 |
mbpp
|
def remove_replica(test_tup):
temp = set()
res = tuple(ele if ele not in temp and not temp.add(ele)
else 'MSP' for ele in test_tup)
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 | 373 |
mbpp
|
def remove_Char(s,c) :
counts = s.count(c)
s = list(s)
while counts :
s.remove(c)
counts -= 1
s = '' . join(s)
return (s)
|
transformation_dead_code_insert
|
def remove_Char(s, c):
counts = s.count(c)
s = list(s)
_i_8 = 0
if _i_8 > _i_8:
s = list(s)
while counts:
s.remove(c)
counts -= 1
s = "".join(s)
return s
| 1 | 374 |
mbpp
|
def remove_Char(s,c) :
counts = s.count(c)
s = list(s)
while counts :
s.remove(c)
counts -= 1
s = '' . join(s)
return (s)
|
transformation_for_while_loop
|
def remove_Char(s, c):
counts = s.count(c)
s = list(s)
while counts:
s.remove(c)
counts -= 1
s = "".join(s)
return s
| 1 | 374 |
mbpp
|
def remove_Char(s,c) :
counts = s.count(c)
s = list(s)
while counts :
s.remove(c)
counts -= 1
s = '' . join(s)
return (s)
|
transformation_operand_swap
|
def remove_Char(s, c):
counts = s.count(c)
s = list(s)
while counts:
s.remove(c)
counts -= 1
s = "".join(s)
return s
| 1 | 374 |
mbpp
|
def remove_Char(s,c) :
counts = s.count(c)
s = list(s)
while counts :
s.remove(c)
counts -= 1
s = '' . join(s)
return (s)
|
transformation_rename_variable_cb
|
def remove_Char(li, c):
counts = li.count(c)
li = list(li)
while counts:
li.remove(c)
counts -= 1
li = "".join(li)
return li
| 1 | 374 |
mbpp
|
def remove_Char(s,c) :
counts = s.count(c)
s = list(s)
while counts :
s.remove(c)
counts -= 1
s = '' . join(s)
return (s)
|
transformation_rename_variable_naive
|
def remove_Char(VAR_0, c):
counts = VAR_0.count(c)
VAR_0 = list(VAR_0)
while counts:
VAR_0.remove(c)
counts -= 1
VAR_0 = "".join(VAR_0)
return VAR_0
| 1 | 374 |
mbpp
|
def remove_Char(s,c) :
counts = s.count(c)
s = list(s)
while counts :
s.remove(c)
counts -= 1
s = '' . join(s)
return (s)
|
transformation_rename_variable_rn
|
def remove_Char(R, c):
counts = R.count(c)
R = list(R)
while counts:
R.remove(c)
counts -= 1
R = "".join(R)
return R
| 1 | 374 |
mbpp
|
def remove_Char(s,c) :
counts = s.count(c)
s = list(s)
while counts :
s.remove(c)
counts -= 1
s = '' . join(s)
return (s)
|
transformation_sub_add_variable
|
def remove_Char(s,c) :
counts = s.count(c)
s = list(s)
while counts :
s.remove(c)
counts += 1
s = '' . join(s)
return (s)
| 0 | 374 |
mbpp
|
def remove_Char(s,c) :
counts = s.count(c)
s = list(s)
while counts :
s.remove(c)
counts -= 1
s = '' . join(s)
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 | 374 |
mbpp
|
def remove_Char(s,c) :
counts = s.count(c)
s = list(s)
while counts :
s.remove(c)
counts -= 1
s = '' . join(s)
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 | 374 |
mbpp
|
def remove_Char(s,c) :
counts = s.count(c)
s = list(s)
while counts :
s.remove(c)
counts -= 1
s = '' . join(s)
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 | 374 |
mbpp
|
def remove_Char(s,c) :
counts = s.count(c)
s = list(s)
while counts :
s.remove(c)
counts -= 1
s = '' . join(s)
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 | 374 |
mbpp
|
def remove_Char(s,c) :
counts = s.count(c)
s = list(s)
while counts :
s.remove(c)
counts -= 1
s = '' . join(s)
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 | 374 |
mbpp
|
def surfacearea_cuboid(l,w,h):
SA = 2*(l*w + l * h + w * h)
return SA
|
transformation_dead_code_insert
|
def surfacearea_cuboid(l, w, h):
_i_5 = 0
if _i_5 > _i_5:
return SA
SA = 2 * (l * w + l * h + w * h)
return SA
| 1 | 376 |
mbpp
|
def surfacearea_cuboid(l,w,h):
SA = 2*(l*w + l * h + w * h)
return SA
|
transformation_for_while_loop
|
def surfacearea_cuboid(l, w, h):
SA = 2 * (l * w + l * h + w * h)
return SA
| 1 | 376 |
mbpp
|
def surfacearea_cuboid(l,w,h):
SA = 2*(l*w + l * h + w * h)
return SA
|
transformation_operand_swap
|
def surfacearea_cuboid(l, w, h):
SA = 2 * (l * w + l * h + w * h)
return SA
| 1 | 376 |
mbpp
|
def surfacearea_cuboid(l,w,h):
SA = 2*(l*w + l * h + w * h)
return SA
|
transformation_rename_variable_cb
|
def surfacearea_cuboid(l, h2, h):
SA = 2 * (l * h2 + l * h + h2 * h)
return SA
| 1 | 376 |
mbpp
|
def surfacearea_cuboid(l,w,h):
SA = 2*(l*w + l * h + w * h)
return SA
|
transformation_rename_variable_naive
|
def surfacearea_cuboid(l, VAR_0, h):
SA = 2 * (l * VAR_0 + l * h + VAR_0 * h)
return SA
| 1 | 376 |
mbpp
|
def surfacearea_cuboid(l,w,h):
SA = 2*(l*w + l * h + w * h)
return SA
|
transformation_rename_variable_rn
|
def surfacearea_cuboid(k, w, h):
SA = 2 * (k * w + k * h + w * h)
return SA
| 1 | 376 |
mbpp
|
def surfacearea_cuboid(l,w,h):
SA = 2*(l*w + l * h + w * h)
return SA
|
transformation_add_sub_variable
|
def surfacearea_cuboid(l,w,h):
SA = 2*(l*w - l * h + w * h)
return SA
| 0 | 376 |
mbpp
|
def surfacearea_cuboid(l,w,h):
SA = 2*(l*w + l * h + w * h)
return SA
|
transformation_mul_div_variable
|
def surfacearea_cuboid(l,w,h):
SA = 2/(l*w + l * h + w * h)
return SA
| 0 | 376 |
mbpp
|
def surfacearea_cuboid(l,w,h):
SA = 2*(l*w + l * h + w * h)
return SA
|
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 | 376 |
mbpp
|
def surfacearea_cuboid(l,w,h):
SA = 2*(l*w + l * h + w * h)
return SA
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 376 |
mbpp
|
def surfacearea_cuboid(l,w,h):
SA = 2*(l*w + l * h + w * h)
return SA
|
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 | 376 |
mbpp
|
def surfacearea_cuboid(l,w,h):
SA = 2*(l*w + l * h + w * h)
return SA
|
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 | 376 |
mbpp
|
def surfacearea_cuboid(l,w,h):
SA = 2*(l*w + l * h + w * h)
return SA
|
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 | 376 |
mbpp
|
def index_on_inner_list(list_data, index_no):
from operator import itemgetter
result = sorted(list_data, key=itemgetter(index_no))
return result
|
transformation_dead_code_insert
|
def index_on_inner_list(list_data, index_no):
from operator import itemgetter
_i_9 = 0
if _i_9 > _i_9:
result = sorted(list_data, key=itemgetter(index_no))
result = sorted(list_data, key=itemgetter(index_no))
return result
| 1 | 378 |
mbpp
|
def index_on_inner_list(list_data, index_no):
from operator import itemgetter
result = sorted(list_data, key=itemgetter(index_no))
return result
|
transformation_for_while_loop
|
def index_on_inner_list(list_data, index_no):
from operator import itemgetter
result = sorted(list_data, key=itemgetter(index_no))
return result
| 1 | 378 |
mbpp
|
def index_on_inner_list(list_data, index_no):
from operator import itemgetter
result = sorted(list_data, key=itemgetter(index_no))
return result
|
transformation_operand_swap
|
def index_on_inner_list(list_data, index_no):
from operator import itemgetter
result = sorted(list_data, key=itemgetter(index_no))
return result
| 1 | 378 |
mbpp
|
def index_on_inner_list(list_data, index_no):
from operator import itemgetter
result = sorted(list_data, key=itemgetter(index_no))
return result
|
transformation_rename_variable_cb
|
def index_on_inner_list(list_data, key2):
from operator import itemgetter
result = sorted(list_data, key=itemgetter(key2))
return result
| 1 | 378 |
mbpp
|
def index_on_inner_list(list_data, index_no):
from operator import itemgetter
result = sorted(list_data, key=itemgetter(index_no))
return result
|
transformation_rename_variable_naive
|
def index_on_inner_list(VAR_0, index_no):
from operator import itemgetter
result = sorted(VAR_0, key=itemgetter(index_no))
return result
| 1 | 378 |
mbpp
|
def index_on_inner_list(list_data, index_no):
from operator import itemgetter
result = sorted(list_data, key=itemgetter(index_no))
return result
|
transformation_rename_variable_rn
|
def index_on_inner_list(d6m7zi271, index_no):
from operator import itemgetter
result = sorted(d6m7zi271, key=itemgetter(index_no))
return result
| 1 | 378 |
mbpp
|
def index_on_inner_list(list_data, index_no):
from operator import itemgetter
result = sorted(list_data, key=itemgetter(index_no))
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 | 378 |
mbpp
|
def index_on_inner_list(list_data, index_no):
from operator import itemgetter
result = sorted(list_data, key=itemgetter(index_no))
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 | 378 |
mbpp
|
def index_on_inner_list(list_data, index_no):
from operator import itemgetter
result = sorted(list_data, key=itemgetter(index_no))
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 | 378 |
mbpp
|
def index_on_inner_list(list_data, index_no):
from operator import itemgetter
result = sorted(list_data, key=itemgetter(index_no))
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 | 378 |
mbpp
|
def index_on_inner_list(list_data, index_no):
from operator import itemgetter
result = sorted(list_data, key=itemgetter(index_no))
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 | 378 |
mbpp
|
def find_rotation_count(A):
(left, right) = (0, len(A) - 1)
while left <= right:
if A[left] <= A[right]:
return left
mid = (left + right) // 2
next = (mid + 1) % len(A)
prev = (mid - 1 + len(A)) % len(A)
if A[mid] <= A[next] and A[mid] <= A[prev]:
return mid
elif A[mid] <= A[right]:
right = mid - 1
elif A[mid] >= A[left]:
left = mid + 1
return -1
|
transformation_dead_code_insert
|
def find_rotation_count(A):
(left, right) = (0, len(A) - 1)
while left <= right:
if A[left] <= A[right]:
return left
mid = (left + right) // 2
next = (mid + 1) % len(A)
while False:
left = mid + 1
prev = (mid - 1 + len(A)) % len(A)
if A[mid] <= A[next] and A[mid] <= A[prev]:
return mid
elif A[mid] <= A[right]:
right = mid - 1
elif A[mid] >= A[left]:
left = mid + 1
return -1
| 1 | 379 |
mbpp
|
def find_rotation_count(A):
(left, right) = (0, len(A) - 1)
while left <= right:
if A[left] <= A[right]:
return left
mid = (left + right) // 2
next = (mid + 1) % len(A)
prev = (mid - 1 + len(A)) % len(A)
if A[mid] <= A[next] and A[mid] <= A[prev]:
return mid
elif A[mid] <= A[right]:
right = mid - 1
elif A[mid] >= A[left]:
left = mid + 1
return -1
|
transformation_for_while_loop
|
def find_rotation_count(A):
(left, right) = (0, len(A) - 1)
while left <= right:
if A[left] <= A[right]:
return left
mid = (left + right) // 2
next = (mid + 1) % len(A)
prev = (mid - 1 + len(A)) % len(A)
if A[mid] <= A[next] and A[mid] <= A[prev]:
return mid
elif A[mid] <= A[right]:
right = mid - 1
elif A[mid] >= A[left]:
left = mid + 1
return -1
| 1 | 379 |
mbpp
|
def find_rotation_count(A):
(left, right) = (0, len(A) - 1)
while left <= right:
if A[left] <= A[right]:
return left
mid = (left + right) // 2
next = (mid + 1) % len(A)
prev = (mid - 1 + len(A)) % len(A)
if A[mid] <= A[next] and A[mid] <= A[prev]:
return mid
elif A[mid] <= A[right]:
right = mid - 1
elif A[mid] >= A[left]:
left = mid + 1
return -1
|
transformation_operand_swap
|
def find_rotation_count(A):
(left, right) = (0, len(A) - 1)
while right >= left:
if A[left] <= A[right]:
return left
mid = (left + right) // 2
next = (mid + 1) % len(A)
prev = (mid - 1 + len(A)) % len(A)
if A[mid] <= A[next] and A[mid] <= A[prev]:
return mid
elif A[mid] <= A[right]:
right = mid - 1
elif A[mid] >= A[left]:
left = mid + 1
return -1
| 1 | 379 |
mbpp
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.