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 remove_duplicate(list1): import itertools list.sort(list1) remove_duplicate = list(list1 for list1,_ in itertools.groupby(list1)) return remove_duplicate
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
709
mbpp
def check_valid(test_tup): res = not any(map(lambda ele: not ele, test_tup)) return (res)
transformation_dead_code_insert
def check_valid(test_tup): for _i_2 in range(0): return res res = not any(map(lambda ele: not ele, test_tup)) return res
1
710
mbpp
def check_valid(test_tup): res = not any(map(lambda ele: not ele, test_tup)) return (res)
transformation_for_while_loop
def check_valid(test_tup): res = not any(map(lambda ele: not ele, test_tup)) return res
1
710
mbpp
def check_valid(test_tup): res = not any(map(lambda ele: not ele, test_tup)) return (res)
transformation_operand_swap
def check_valid(test_tup): res = not any(map(lambda ele: not ele, test_tup)) return res
1
710
mbpp
def check_valid(test_tup): res = not any(map(lambda ele: not ele, test_tup)) return (res)
transformation_rename_variable_cb
def check_valid(lines): res = not any(map(lambda ele: not ele, lines)) return res
1
710
mbpp
def check_valid(test_tup): res = not any(map(lambda ele: not ele, test_tup)) return (res)
transformation_rename_variable_naive
def check_valid(test_tup): res = not any(map(lambda VAR_0: not VAR_0, test_tup)) return res
1
710
mbpp
def check_valid(test_tup): res = not any(map(lambda ele: not ele, test_tup)) return (res)
transformation_rename_variable_rn
def check_valid(test_tup): res = not any(map(lambda au4: not au4, test_tup)) return res
1
710
mbpp
def check_valid(test_tup): res = not any(map(lambda ele: not ele, 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
710
mbpp
def check_valid(test_tup): res = not any(map(lambda ele: not ele, 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
710
mbpp
def check_valid(test_tup): res = not any(map(lambda ele: not ele, 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
710
mbpp
def check_valid(test_tup): res = not any(map(lambda ele: not ele, 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
710
mbpp
def check_valid(test_tup): res = not any(map(lambda ele: not ele, 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
710
mbpp
def rombus_perimeter(a): perimeter=4*a return perimeter
transformation_dead_code_insert
def rombus_perimeter(a): _i_0 = 0 if _i_0 > _i_0: return perimeter perimeter = 4 * a return perimeter
1
713
mbpp
def rombus_perimeter(a): perimeter=4*a return perimeter
transformation_for_while_loop
def rombus_perimeter(a): perimeter = 4 * a return perimeter
1
713
mbpp
def rombus_perimeter(a): perimeter=4*a return perimeter
transformation_operand_swap
def rombus_perimeter(a): perimeter = 4 * a return perimeter
1
713
mbpp
def rombus_perimeter(a): perimeter=4*a return perimeter
transformation_rename_variable_cb
def rombus_perimeter(a): a2 = 4 * a return a2
1
713
mbpp
def rombus_perimeter(a): perimeter=4*a return perimeter
transformation_rename_variable_naive
def rombus_perimeter(VAR_0): perimeter = 4 * VAR_0 return perimeter
1
713
mbpp
def rombus_perimeter(a): perimeter=4*a return perimeter
transformation_rename_variable_rn
def rombus_perimeter(a): O6en1884Y = 4 * a return O6en1884Y
1
713
mbpp
def rombus_perimeter(a): perimeter=4*a return perimeter
transformation_mul_div_variable
def rombus_perimeter(a): perimeter=4/a return perimeter
0
713
mbpp
def rombus_perimeter(a): perimeter=4*a return perimeter
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
713
mbpp
def rombus_perimeter(a): perimeter=4*a return perimeter
transformation_dissimilar_code_injection_1
def similar_elements(test_tup1, test_tup2): res = tuple(set(test_tup1) & set(test_tup2)) return (res)
0
713
mbpp
def rombus_perimeter(a): perimeter=4*a return perimeter
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
713
mbpp
def rombus_perimeter(a): perimeter=4*a return perimeter
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
713
mbpp
def rombus_perimeter(a): perimeter=4*a return perimeter
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
713
mbpp
def alternate_elements(list1): result=[] for item in list1[::2]: result.append(item) return result
transformation_dead_code_insert
def alternate_elements(list1): for _i_2 in range(0): for item in list1[::2]: result.append(item) result = [] for item in list1[::2]: result.append(item) return result
1
715
mbpp
def alternate_elements(list1): result=[] for item in list1[::2]: result.append(item) return result
transformation_for_while_loop
def alternate_elements(list1): result = [] _item_i = 0 while _item_i < len(list1[::2]): item = list1[::2][_item_i] result.append(item) _item_i += 1 return result
1
715
mbpp
def alternate_elements(list1): result=[] for item in list1[::2]: result.append(item) return result
transformation_operand_swap
def alternate_elements(list1): result = [] for item in list1[::2]: result.append(item) return result
1
715
mbpp
def alternate_elements(list1): result=[] for item in list1[::2]: result.append(item) return result
transformation_rename_variable_cb
def alternate_elements(list1): result2 = [] for item in list1[::2]: result2.append(item) return result2
1
715
mbpp
def alternate_elements(list1): result=[] for item in list1[::2]: result.append(item) return result
transformation_rename_variable_naive
def alternate_elements(list1): VAR_0 = [] for item in list1[::2]: VAR_0.append(item) return VAR_0
1
715
mbpp
def alternate_elements(list1): result=[] for item in list1[::2]: result.append(item) return result
transformation_rename_variable_rn
def alternate_elements(list1): d6k7w2 = [] for item in list1[::2]: d6k7w2.append(item) return d6k7w2
1
715
mbpp
def alternate_elements(list1): result=[] for item in list1[::2]: result.append(item) 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
715
mbpp
def alternate_elements(list1): result=[] for item in list1[::2]: result.append(item) 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
715
mbpp
def alternate_elements(list1): result=[] for item in list1[::2]: result.append(item) 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
715
mbpp
def alternate_elements(list1): result=[] for item in list1[::2]: result.append(item) 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
715
mbpp
def alternate_elements(list1): result=[] for item in list1[::2]: result.append(item) 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
715
mbpp
def maxAverageOfPath(cost, N): M = 100 dp = [[0 for i in range(N + 1)] for j in range(N + 1)] dp[0][0] = cost[0][0] for i in range(1, N): dp[i][0] = dp[i - 1][0] + cost[i][0] for j in range(1, N): dp[0][j] = dp[0][j - 1] + cost[0][j] for i in range(1, N): for j in range(1, N): dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + cost[i][j] return dp[N - 1][N - 1] / (2 * N - 1)
transformation_dead_code_insert
def maxAverageOfPath(cost, N): M = 100 dp = [[0 for i in range(N + 1)] for j in range(N + 1)] dp[0][0] = cost[0][0] for i in range(1, N): while False: M = 100 dp[i][0] = dp[i - 1][0] + cost[i][0] for j in range(1, N): dp[0][j] = dp[0][j - 1] + cost[0][j] for i in range(1, N): for j in range(1, N): dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + cost[i][j] return dp[N - 1][N - 1] / (2 * N - 1)
1
718
mbpp
def maxAverageOfPath(cost, N): M = 100 dp = [[0 for i in range(N + 1)] for j in range(N + 1)] dp[0][0] = cost[0][0] for i in range(1, N): dp[i][0] = dp[i - 1][0] + cost[i][0] for j in range(1, N): dp[0][j] = dp[0][j - 1] + cost[0][j] for i in range(1, N): for j in range(1, N): dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + cost[i][j] return dp[N - 1][N - 1] / (2 * N - 1)
transformation_for_while_loop
def maxAverageOfPath(cost, N): M = 100 dp = [[0 for i in range(N + 1)] for j in range(N + 1)] dp[0][0] = cost[0][0] i = 1 while i < N: dp[i][0] = dp[i - 1][0] + cost[i][0] i += 1 for j in range(1, N): dp[0][j] = dp[0][j - 1] + cost[0][j] for i in range(1, N): for j in range(1, N): dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + cost[i][j] return dp[N - 1][N - 1] / (2 * N - 1)
1
718
mbpp
def maxAverageOfPath(cost, N): M = 100 dp = [[0 for i in range(N + 1)] for j in range(N + 1)] dp[0][0] = cost[0][0] for i in range(1, N): dp[i][0] = dp[i - 1][0] + cost[i][0] for j in range(1, N): dp[0][j] = dp[0][j - 1] + cost[0][j] for i in range(1, N): for j in range(1, N): dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + cost[i][j] return dp[N - 1][N - 1] / (2 * N - 1)
transformation_operand_swap
def maxAverageOfPath(cost, N): M = 100 dp = [[0 for i in range(N + 1)] for j in range(N + 1)] dp[0][0] = cost[0][0] for i in range(1, N): dp[i][0] = dp[i - 1][0] + cost[i][0] for j in range(1, N): dp[0][j] = dp[0][j - 1] + cost[0][j] for i in range(1, N): for j in range(1, N): dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + cost[i][j] return dp[N - 1][N - 1] / (2 * N - 1)
1
718
mbpp
def maxAverageOfPath(cost, N): M = 100 dp = [[0 for i in range(N + 1)] for j in range(N + 1)] dp[0][0] = cost[0][0] for i in range(1, N): dp[i][0] = dp[i - 1][0] + cost[i][0] for j in range(1, N): dp[0][j] = dp[0][j - 1] + cost[0][j] for i in range(1, N): for j in range(1, N): dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + cost[i][j] return dp[N - 1][N - 1] / (2 * N - 1)
transformation_rename_variable_cb
def maxAverageOfPath(cost, N): M = 100 dp = [[0 for i2 in range(N + 1)] for j in range(N + 1)] dp[0][0] = cost[0][0] for i2 in range(1, N): dp[i2][0] = dp[i2 - 1][0] + cost[i2][0] for j in range(1, N): dp[0][j] = dp[0][j - 1] + cost[0][j] for i2 in range(1, N): for j in range(1, N): dp[i2][j] = max(dp[i2 - 1][j], dp[i2][j - 1]) + cost[i2][j] return dp[N - 1][N - 1] / (2 * N - 1)
1
718
mbpp
def maxAverageOfPath(cost, N): M = 100 dp = [[0 for i in range(N + 1)] for j in range(N + 1)] dp[0][0] = cost[0][0] for i in range(1, N): dp[i][0] = dp[i - 1][0] + cost[i][0] for j in range(1, N): dp[0][j] = dp[0][j - 1] + cost[0][j] for i in range(1, N): for j in range(1, N): dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + cost[i][j] return dp[N - 1][N - 1] / (2 * N - 1)
transformation_rename_variable_naive
def maxAverageOfPath(cost, VAR_0): M = 100 dp = [[0 for i in range(VAR_0 + 1)] for j in range(VAR_0 + 1)] dp[0][0] = cost[0][0] for i in range(1, VAR_0): dp[i][0] = dp[i - 1][0] + cost[i][0] for j in range(1, VAR_0): dp[0][j] = dp[0][j - 1] + cost[0][j] for i in range(1, VAR_0): for j in range(1, VAR_0): dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + cost[i][j] return dp[VAR_0 - 1][VAR_0 - 1] / (2 * VAR_0 - 1)
1
718
mbpp
def maxAverageOfPath(cost, N): M = 100 dp = [[0 for i in range(N + 1)] for j in range(N + 1)] dp[0][0] = cost[0][0] for i in range(1, N): dp[i][0] = dp[i - 1][0] + cost[i][0] for j in range(1, N): dp[0][j] = dp[0][j - 1] + cost[0][j] for i in range(1, N): for j in range(1, N): dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + cost[i][j] return dp[N - 1][N - 1] / (2 * N - 1)
transformation_rename_variable_rn
def maxAverageOfPath(cost, N): M = 100 dp = [[0 for e in range(N + 1)] for j in range(N + 1)] dp[0][0] = cost[0][0] for e in range(1, N): dp[e][0] = dp[e - 1][0] + cost[e][0] for j in range(1, N): dp[0][j] = dp[0][j - 1] + cost[0][j] for e in range(1, N): for j in range(1, N): dp[e][j] = max(dp[e - 1][j], dp[e][j - 1]) + cost[e][j] return dp[N - 1][N - 1] / (2 * N - 1)
1
718
mbpp
def maxAverageOfPath(cost, N): M = 100 dp = [[0 for i in range(N + 1)] for j in range(N + 1)] dp[0][0] = cost[0][0] for i in range(1, N): dp[i][0] = dp[i - 1][0] + cost[i][0] for j in range(1, N): dp[0][j] = dp[0][j - 1] + cost[0][j] for i in range(1, N): for j in range(1, N): dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + cost[i][j] return dp[N - 1][N - 1] / (2 * N - 1)
transformation_add_sub_variable
def maxAverageOfPath(cost, N): M = 100 dp = [[0 for i in range(N - 1)] for j in range(N + 1)] dp[0][0] = cost[0][0] for i in range(1, N): dp[i][0] = dp[i - 1][0] + cost[i][0] for j in range(1, N): dp[0][j] = dp[0][j - 1] + cost[0][j] for i in range(1, N): for j in range(1, N): dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + cost[i][j] return dp[N - 1][N - 1] / (2 * N - 1)
0
718
mbpp
def maxAverageOfPath(cost, N): M = 100 dp = [[0 for i in range(N + 1)] for j in range(N + 1)] dp[0][0] = cost[0][0] for i in range(1, N): dp[i][0] = dp[i - 1][0] + cost[i][0] for j in range(1, N): dp[0][j] = dp[0][j - 1] + cost[0][j] for i in range(1, N): for j in range(1, N): dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + cost[i][j] return dp[N - 1][N - 1] / (2 * N - 1)
transformation_sub_add_variable
def maxAverageOfPath(cost, N): M = 100 dp = [[0 for i in range(N + 1)] for j in range(N + 1)] dp[0][0] = cost[0][0] for i in range(1, N): dp[i][0] = dp[i + 1][0] + cost[i][0] for j in range(1, N): dp[0][j] = dp[0][j - 1] + cost[0][j] for i in range(1, N): for j in range(1, N): dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + cost[i][j] return dp[N - 1][N - 1] / (2 * N - 1)
0
718
mbpp
def maxAverageOfPath(cost, N): M = 100 dp = [[0 for i in range(N + 1)] for j in range(N + 1)] dp[0][0] = cost[0][0] for i in range(1, N): dp[i][0] = dp[i - 1][0] + cost[i][0] for j in range(1, N): dp[0][j] = dp[0][j - 1] + cost[0][j] for i in range(1, N): for j in range(1, N): dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + cost[i][j] return dp[N - 1][N - 1] / (2 * N - 1)
transformation_mul_div_variable
def maxAverageOfPath(cost, N): M = 100 dp = [[0 for i in range(N + 1)] for j in range(N + 1)] dp[0][0] = cost[0][0] for i in range(1, N): dp[i][0] = dp[i - 1][0] + cost[i][0] for j in range(1, N): dp[0][j] = dp[0][j - 1] + cost[0][j] for i in range(1, N): for j in range(1, N): dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + cost[i][j] return dp[N - 1][N - 1] / (2 / N - 1)
0
718
mbpp
def maxAverageOfPath(cost, N): M = 100 dp = [[0 for i in range(N + 1)] for j in range(N + 1)] dp[0][0] = cost[0][0] for i in range(1, N): dp[i][0] = dp[i - 1][0] + cost[i][0] for j in range(1, N): dp[0][j] = dp[0][j - 1] + cost[0][j] for i in range(1, N): for j in range(1, N): dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + cost[i][j] return dp[N - 1][N - 1] / (2 * N - 1)
transformation_div_mul_variable
def maxAverageOfPath(cost, N): M = 100 dp = [[0 for i in range(N + 1)] for j in range(N + 1)] dp[0][0] = cost[0][0] for i in range(1, N): dp[i][0] = dp[i - 1][0] + cost[i][0] for j in range(1, N): dp[0][j] = dp[0][j - 1] + cost[0][j] for i in range(1, N): for j in range(1, N): dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + cost[i][j] return dp[N - 1][N - 1] * (2 * N - 1)
0
718
mbpp
def maxAverageOfPath(cost, N): M = 100 dp = [[0 for i in range(N + 1)] for j in range(N + 1)] dp[0][0] = cost[0][0] for i in range(1, N): dp[i][0] = dp[i - 1][0] + cost[i][0] for j in range(1, N): dp[0][j] = dp[0][j - 1] + cost[0][j] for i in range(1, N): for j in range(1, N): dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + cost[i][j] return dp[N - 1][N - 1] / (2 * N - 1)
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
718
mbpp
def maxAverageOfPath(cost, N): M = 100 dp = [[0 for i in range(N + 1)] for j in range(N + 1)] dp[0][0] = cost[0][0] for i in range(1, N): dp[i][0] = dp[i - 1][0] + cost[i][0] for j in range(1, N): dp[0][j] = dp[0][j - 1] + cost[0][j] for i in range(1, N): for j in range(1, N): dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + cost[i][j] return dp[N - 1][N - 1] / (2 * N - 1)
transformation_dissimilar_code_injection_1
def similar_elements(test_tup1, test_tup2): res = tuple(set(test_tup1) & set(test_tup2)) return (res)
0
718
mbpp
def maxAverageOfPath(cost, N): M = 100 dp = [[0 for i in range(N + 1)] for j in range(N + 1)] dp[0][0] = cost[0][0] for i in range(1, N): dp[i][0] = dp[i - 1][0] + cost[i][0] for j in range(1, N): dp[0][j] = dp[0][j - 1] + cost[0][j] for i in range(1, N): for j in range(1, N): dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + cost[i][j] return dp[N - 1][N - 1] / (2 * N - 1)
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
718
mbpp
def maxAverageOfPath(cost, N): M = 100 dp = [[0 for i in range(N + 1)] for j in range(N + 1)] dp[0][0] = cost[0][0] for i in range(1, N): dp[i][0] = dp[i - 1][0] + cost[i][0] for j in range(1, N): dp[0][j] = dp[0][j - 1] + cost[0][j] for i in range(1, N): for j in range(1, N): dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + cost[i][j] return dp[N - 1][N - 1] / (2 * N - 1)
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
718
mbpp
def maxAverageOfPath(cost, N): M = 100 dp = [[0 for i in range(N + 1)] for j in range(N + 1)] dp[0][0] = cost[0][0] for i in range(1, N): dp[i][0] = dp[i - 1][0] + cost[i][0] for j in range(1, N): dp[0][j] = dp[0][j - 1] + cost[0][j] for i in range(1, N): for j in range(1, N): dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + cost[i][j] return dp[N - 1][N - 1] / (2 * N - 1)
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
718
mbpp
def filter_data(students,h,w): result = {k: s for k, s in students.items() if s[0] >=h and s[1] >=w} return result
transformation_dead_code_insert
def filter_data(students, h, w): if False: return result result = {k: s for k, s in students.items() if s[0] >= h and s[1] >= w} return result
1
719
mbpp
def filter_data(students,h,w): result = {k: s for k, s in students.items() if s[0] >=h and s[1] >=w} return result
transformation_for_while_loop
def filter_data(students, h, w): result = {k: s for k, s in students.items() if s[0] >= h and s[1] >= w} return result
1
719
mbpp
def filter_data(students,h,w): result = {k: s for k, s in students.items() if s[0] >=h and s[1] >=w} return result
transformation_operand_swap
def filter_data(students, h, w): result = {k: s for k, s in students.items() if h <= s[0] and s[1] >= w} return result
1
719
mbpp
def filter_data(students,h,w): result = {k: s for k, s in students.items() if s[0] >=h and s[1] >=w} return result
transformation_rename_variable_cb
def filter_data(students, h, w): result = {k: v for k, v in students.items() if v[0] >= h and v[1] >= w} return result
1
719
mbpp
def filter_data(students,h,w): result = {k: s for k, s in students.items() if s[0] >=h and s[1] >=w} return result
transformation_rename_variable_naive
def filter_data(students, h, w): result = { k: VAR_0 for k, VAR_0 in students.items() if VAR_0[0] >= h and VAR_0[1] >= w } return result
1
719
mbpp
def filter_data(students,h,w): result = {k: s for k, s in students.items() if s[0] >=h and s[1] >=w} return result
transformation_rename_variable_rn
def filter_data(students, h, w): result = {k: X for k, X in students.items() if X[0] >= h and X[1] >= w} return result
1
719
mbpp
def filter_data(students,h,w): result = {k: s for k, s in students.items() if s[0] >=h and s[1] >=w} return result
transformation_greater_lesser_variable
def filter_data(students,h,w): result = {k: s for k, s in students.items() if s[0] <=h and s[1] >=w} return result
0
719
mbpp
def filter_data(students,h,w): result = {k: s for k, s in students.items() if s[0] >=h and s[1] >=w} return result
transformation_and_or_variable
def filter_data(students,h,w): result = {k: s for k, s in students.items() if s[0] >=h or s[1] >=w} return result
0
719
mbpp
def filter_data(students,h,w): result = {k: s for k, s in students.items() if s[0] >=h and s[1] >=w} 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
719
mbpp
def filter_data(students,h,w): result = {k: s for k, s in students.items() if s[0] >=h and s[1] >=w} 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
719
mbpp
def filter_data(students,h,w): result = {k: s for k, s in students.items() if s[0] >=h and s[1] >=w} 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
719
mbpp
def filter_data(students,h,w): result = {k: s for k, s in students.items() if s[0] >=h and s[1] >=w} 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
719
mbpp
def filter_data(students,h,w): result = {k: s for k, s in students.items() if s[0] >=h and s[1] >=w} 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
719
mbpp
def power_base_sum(base, power): return sum([int(i) for i in str(pow(base, power))])
transformation_dead_code_insert
def power_base_sum(base, power): return sum([int(i) for i in str(pow(base, power))])
1
721
mbpp
def power_base_sum(base, power): return sum([int(i) for i in str(pow(base, power))])
transformation_for_while_loop
def power_base_sum(base, power): return sum([int(i) for i in str(pow(base, power))])
1
721
mbpp
def power_base_sum(base, power): return sum([int(i) for i in str(pow(base, power))])
transformation_operand_swap
def power_base_sum(base, power): return sum([int(i) for i in str(pow(base, power))])
1
721
mbpp
def power_base_sum(base, power): return sum([int(i) for i in str(pow(base, power))])
transformation_rename_variable_cb
def power_base_sum(base, power): return sum([int(pr) for pr in str(pow(base, power))])
1
721
mbpp
def power_base_sum(base, power): return sum([int(i) for i in str(pow(base, power))])
transformation_rename_variable_naive
def power_base_sum(base, VAR_0): return sum([int(i) for i in str(pow(base, VAR_0))])
1
721
mbpp
def power_base_sum(base, power): return sum([int(i) for i in str(pow(base, power))])
transformation_rename_variable_rn
def power_base_sum(HkK5, power): return sum([int(i) for i in str(pow(HkK5, power))])
1
721
mbpp
def power_base_sum(base, power): return sum([int(i) for i in str(pow(base, power))])
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
721
mbpp
def power_base_sum(base, power): return sum([int(i) for i in str(pow(base, power))])
transformation_dissimilar_code_injection_1
def similar_elements(test_tup1, test_tup2): res = tuple(set(test_tup1) & set(test_tup2)) return (res)
0
721
mbpp
def power_base_sum(base, power): return sum([int(i) for i in str(pow(base, power))])
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
721
mbpp
def power_base_sum(base, power): return sum([int(i) for i in str(pow(base, power))])
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
721
mbpp
def power_base_sum(base, power): return sum([int(i) for i in str(pow(base, power))])
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
721
mbpp
def extract_quotation(text1): import re return (re.findall(r'"(.*?)"', text1))
transformation_dead_code_insert
def extract_quotation(text1): for _i_7 in range(0): return re.findall(r'"(.*?)"', text1) import re return re.findall(r'"(.*?)"', text1)
1
722
mbpp
def extract_quotation(text1): import re return (re.findall(r'"(.*?)"', text1))
transformation_for_while_loop
def extract_quotation(text1): import re return re.findall(r'"(.*?)"', text1)
1
722
mbpp
def extract_quotation(text1): import re return (re.findall(r'"(.*?)"', text1))
transformation_operand_swap
def extract_quotation(text1): import re return re.findall(r'"(.*?)"', text1)
1
722
mbpp
def extract_quotation(text1): import re return (re.findall(r'"(.*?)"', text1))
transformation_rename_variable_cb
def extract_quotation(line): import re return re.findall(r'"(.*?)"', line)
1
722
mbpp
def extract_quotation(text1): import re return (re.findall(r'"(.*?)"', text1))
transformation_rename_variable_naive
def extract_quotation(VAR_0): import re return re.findall(r'"(.*?)"', VAR_0)
1
722
mbpp
def extract_quotation(text1): import re return (re.findall(r'"(.*?)"', text1))
transformation_rename_variable_rn
def extract_quotation(Ki53S): import re return re.findall(r'"(.*?)"', Ki53S)
1
722
mbpp
def extract_quotation(text1): import re return (re.findall(r'"(.*?)"', text1))
transformation_mul_div_variable
def extract_quotation(text1): import re return (re.findall(r'"(./?)"', text1))
0
722
mbpp
def extract_quotation(text1): import re return (re.findall(r'"(.*?)"', text1))
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
722
mbpp
def extract_quotation(text1): import re return (re.findall(r'"(.*?)"', text1))
transformation_dissimilar_code_injection_1
def similar_elements(test_tup1, test_tup2): res = tuple(set(test_tup1) & set(test_tup2)) return (res)
0
722
mbpp
def extract_quotation(text1): import re return (re.findall(r'"(.*?)"', text1))
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
722
mbpp
def extract_quotation(text1): import re return (re.findall(r'"(.*?)"', text1))
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
722
mbpp
def extract_quotation(text1): import re return (re.findall(r'"(.*?)"', text1))
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
722
mbpp
def remove_char(S): import re result = re.sub('[\W_]+', '', S) return result
transformation_dead_code_insert
def remove_char(S): while False: return result import re result = re.sub("[W_]+", "", S) return result
1
724
mbpp
def remove_char(S): import re result = re.sub('[\W_]+', '', S) return result
transformation_for_while_loop
def remove_char(S): import re result = re.sub("[W_]+", "", S) return result
1
724
mbpp
def remove_char(S): import re result = re.sub('[\W_]+', '', S) return result
transformation_operand_swap
def remove_char(S): import re result = re.sub("[W_]+", "", S) return result
1
724
mbpp
def remove_char(S): import re result = re.sub('[\W_]+', '', S) return result
transformation_rename_variable_cb
def remove_char(result2): import re result = re.sub("[W_]+", "", result2) return result
1
724
mbpp
def remove_char(S): import re result = re.sub('[\W_]+', '', S) return result
transformation_rename_variable_naive
def remove_char(VAR_0): import re result = re.sub("[W_]+", "", VAR_0) return result
1
724
mbpp
def remove_char(S): import re result = re.sub('[\W_]+', '', S) return result
transformation_rename_variable_rn
def remove_char(S): import re Dy2vex = re.sub("[W_]+", "", S) return Dy2vex
1
724
mbpp
def remove_char(S): import re result = re.sub('[\W_]+', '', S) return result
transformation_add_sub_variable
def remove_char(S): import re result = re.sub('[\W_]-', '', S) return result
0
724
mbpp
def remove_char(S): import re result = re.sub('[\W_]+', '', S) 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
724
mbpp
def remove_char(S): import re result = re.sub('[\W_]+', '', S) 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
724
mbpp
def remove_char(S): import re result = re.sub('[\W_]+', '', S) 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
724
mbpp
def remove_char(S): import re result = re.sub('[\W_]+', '', S) 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
724
mbpp
def remove_char(S): import re result = re.sub('[\W_]+', '', S) 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
724
mbpp
def sum_list(lst1,lst2): res_list = [lst1[i] + lst2[i] for i in range(len(lst1))] return res_list
transformation_dead_code_insert
def sum_list(lst1, lst2): while False: return res_list 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_for_while_loop
def sum_list(lst1, lst2): res_list = [lst1[i] + lst2[i] for i in range(len(lst1))] return res_list
1
725
mbpp