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 tuple_to_dict(test_tup): res = dict(test_tup[idx : idx + 2] for idx in range(0, len(test_tup), 2)) return (res)
transformation_rename_variable_cb
def tuple_to_dict(t): res = dict(t[idx : idx + 2] for idx in range(0, len(t), 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_rename_variable_naive
def tuple_to_dict(test_tup): res = dict(test_tup[VAR_0 : VAR_0 + 2] for VAR_0 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_rename_variable_rn
def tuple_to_dict(Qb4T8155): res = dict(Qb4T8155[idx : idx + 2] for idx in range(0, len(Qb4T8155), 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_add_sub_variable
def tuple_to_dict(test_tup): res = dict(test_tup[idx : idx - 2] for idx in range(0, len(test_tup), 2)) return (res)
0
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_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
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_dissimilar_code_injection_1
def similar_elements(test_tup1, test_tup2): res = tuple(set(test_tup1) & set(test_tup2)) return (res)
0
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_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
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_dissimilar_code_injection_3
def heap_queue_largest(nums,n): import heapq as hq largest_nums = hq.nlargest(n, nums) return largest_nums
0
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_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
737
mbpp
def all_Characters_Same(s) : n = len(s) for i in range(1,n) : if s[i] != s[0] : return False return True
transformation_dead_code_insert
def all_Characters_Same(s): n = len(s) for i in range(1, n): _i_1 = 0 if _i_1 > _i_1: n = len(s) if s[i] != s[0]: return False return True
1
738
mbpp
def all_Characters_Same(s) : n = len(s) for i in range(1,n) : if s[i] != s[0] : return False return True
transformation_for_while_loop
def all_Characters_Same(s): n = len(s) i = 1 while i < n: if s[i] != s[0]: return False i += 1 return True
1
738
mbpp
def all_Characters_Same(s) : n = len(s) for i in range(1,n) : if s[i] != s[0] : return False return True
transformation_operand_swap
def all_Characters_Same(s): n = len(s) for i in range(1, n): if s[0] != s[i]: return False return True
1
738
mbpp
def all_Characters_Same(s) : n = len(s) for i in range(1,n) : if s[i] != s[0] : return False return True
transformation_rename_variable_cb
def all_Characters_Same(lines): n = len(lines) for i in range(1, n): if lines[i] != lines[0]: return False return True
1
738
mbpp
def all_Characters_Same(s) : n = len(s) for i in range(1,n) : if s[i] != s[0] : return False return True
transformation_rename_variable_naive
def all_Characters_Same(VAR_0): n = len(VAR_0) for i in range(1, n): if VAR_0[i] != VAR_0[0]: return False return True
1
738
mbpp
def all_Characters_Same(s) : n = len(s) for i in range(1,n) : if s[i] != s[0] : return False return True
transformation_rename_variable_rn
def all_Characters_Same(b): n = len(b) for i in range(1, n): if b[i] != b[0]: return False return True
1
738
mbpp
def all_Characters_Same(s) : n = len(s) for i in range(1,n) : if s[i] != s[0] : return False return True
transformation_exclamation_equalto_variable
def all_Characters_Same(s) : n = len(s) for i in range(1,n) : if s[i] == s[0] : return False return True
0
738
mbpp
def all_Characters_Same(s) : n = len(s) for i in range(1,n) : if s[i] != s[0] : return False return True
transformation_true_false_variable
def all_Characters_Same(s) : n = len(s) for i in range(1,n) : if s[i] != s[0] : return False return False
0
738
mbpp
def all_Characters_Same(s) : n = len(s) for i in range(1,n) : if s[i] != s[0] : return False return True
transformation_false_true_variable
def all_Characters_Same(s) : n = len(s) for i in range(1,n) : if s[i] != s[0] : return True return True
0
738
mbpp
def all_Characters_Same(s) : n = len(s) for i in range(1,n) : if s[i] != s[0] : return False return True
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
738
mbpp
def all_Characters_Same(s) : n = len(s) for i in range(1,n) : if s[i] != s[0] : return False return True
transformation_dissimilar_code_injection_1
def similar_elements(test_tup1, test_tup2): res = tuple(set(test_tup1) & set(test_tup2)) return (res)
0
738
mbpp
def all_Characters_Same(s) : n = len(s) for i in range(1,n) : if s[i] != s[0] : return False return True
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
738
mbpp
def all_Characters_Same(s) : n = len(s) for i in range(1,n) : if s[i] != s[0] : return False return True
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
738
mbpp
def all_Characters_Same(s) : n = len(s) for i in range(1,n) : if s[i] != s[0] : return False return True
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
738
mbpp
def rotate_right(list1,m,n): result = list1[-(m):]+list1[:-(n)] return result
transformation_dead_code_insert
def rotate_right(list1, m, n): if False: return result result = list1[-(m):] + list1[:-(n)] return result
1
740
mbpp
def rotate_right(list1,m,n): result = list1[-(m):]+list1[:-(n)] return result
transformation_for_while_loop
def rotate_right(list1, m, n): result = list1[-(m):] + list1[:-(n)] return result
1
740
mbpp
def rotate_right(list1,m,n): result = list1[-(m):]+list1[:-(n)] return result
transformation_operand_swap
def rotate_right(list1, m, n): result = list1[-(m):] + list1[:-(n)] return result
1
740
mbpp
def rotate_right(list1,m,n): result = list1[-(m):]+list1[:-(n)] return result
transformation_rename_variable_cb
def rotate_right(result2, m, n): result = result2[-(m):] + result2[:-(n)] return result
1
740
mbpp
def rotate_right(list1,m,n): result = list1[-(m):]+list1[:-(n)] return result
transformation_rename_variable_naive
def rotate_right(VAR_0, m, n): result = VAR_0[-(m):] + VAR_0[:-(n)] return result
1
740
mbpp
def rotate_right(list1,m,n): result = list1[-(m):]+list1[:-(n)] return result
transformation_rename_variable_rn
def rotate_right(TPGe1, m, n): result = TPGe1[-(m):] + TPGe1[:-(n)] return result
1
740
mbpp
def rotate_right(list1,m,n): result = list1[-(m):]+list1[:-(n)] return result
transformation_add_sub_variable
def rotate_right(list1,m,n): result = list1[-(m):]-list1[:-(n)] return result
0
740
mbpp
def rotate_right(list1,m,n): result = list1[-(m):]+list1[:-(n)] return result
transformation_sub_add_variable
def rotate_right(list1,m,n): result = list1[+(m):]+list1[:-(n)] return result
0
740
mbpp
def rotate_right(list1,m,n): result = list1[-(m):]+list1[:-(n)] 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
740
mbpp
def rotate_right(list1,m,n): result = list1[-(m):]+list1[:-(n)] 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
740
mbpp
def rotate_right(list1,m,n): result = list1[-(m):]+list1[:-(n)] 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
740
mbpp
def rotate_right(list1,m,n): result = list1[-(m):]+list1[:-(n)] 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
740
mbpp
def rotate_right(list1,m,n): result = list1[-(m):]+list1[:-(n)] 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
740
mbpp
def divisible_by_digits(startnum, endnum): return [n for n in range(startnum, endnum+1) \ if not any(map(lambda x: int(x) == 0 or n%int(x) != 0, str(n)))]
transformation_dead_code_insert
def divisible_by_digits(startnum, endnum): return [ n for n in range(startnum, endnum + 1) if not any(map(lambda x: int(x) == 0 or n % int(x) != 0, str(n))) ]
1
742
mbpp
def divisible_by_digits(startnum, endnum): return [n for n in range(startnum, endnum+1) \ if not any(map(lambda x: int(x) == 0 or n%int(x) != 0, str(n)))]
transformation_for_while_loop
def divisible_by_digits(startnum, endnum): return [ n for n in range(startnum, endnum + 1) if not any(map(lambda x: int(x) == 0 or n % int(x) != 0, str(n))) ]
1
742
mbpp
def divisible_by_digits(startnum, endnum): return [n for n in range(startnum, endnum+1) \ if not any(map(lambda x: int(x) == 0 or n%int(x) != 0, str(n)))]
transformation_operand_swap
def divisible_by_digits(startnum, endnum): return [ n for n in range(startnum, endnum + 1) if not any(map(lambda x: 0 == int(x) or n % int(x) != 0, str(n))) ]
1
742
mbpp
def divisible_by_digits(startnum, endnum): return [n for n in range(startnum, endnum+1) \ if not any(map(lambda x: int(x) == 0 or n%int(x) != 0, str(n)))]
transformation_rename_variable_cb
def divisible_by_digits(startnum, endnum): return [ x2 for x2 in range(startnum, endnum + 1) if not any(map(lambda x: int(x) == 0 or x2 % int(x) != 0, str(x2))) ]
1
742
mbpp
def divisible_by_digits(startnum, endnum): return [n for n in range(startnum, endnum+1) \ if not any(map(lambda x: int(x) == 0 or n%int(x) != 0, str(n)))]
transformation_rename_variable_naive
def divisible_by_digits(startnum, endnum): return [ VAR_0 for VAR_0 in range(startnum, endnum + 1) if not any(map(lambda x: int(x) == 0 or VAR_0 % int(x) != 0, str(VAR_0))) ]
1
742
mbpp
def divisible_by_digits(startnum, endnum): return [n for n in range(startnum, endnum+1) \ if not any(map(lambda x: int(x) == 0 or n%int(x) != 0, str(n)))]
transformation_rename_variable_rn
def divisible_by_digits(startnum, endnum): return [ d for d in range(startnum, endnum + 1) if not any(map(lambda x: int(x) == 0 or d % int(x) != 0, str(d))) ]
1
742
mbpp
def divisible_by_digits(startnum, endnum): return [n for n in range(startnum, endnum+1) \ if not any(map(lambda x: int(x) == 0 or n%int(x) != 0, str(n)))]
transformation_add_sub_variable
def divisible_by_digits(startnum, endnum): return [n for n in range(startnum, endnum-1) \ if not any(map(lambda x: int(x) == 0 or n%int(x) != 0, str(n)))]
0
742
mbpp
def divisible_by_digits(startnum, endnum): return [n for n in range(startnum, endnum+1) \ if not any(map(lambda x: int(x) == 0 or n%int(x) != 0, str(n)))]
transformation_equalto_exclamation_variable
def divisible_by_digits(startnum, endnum): return [n for n in range(startnum, endnum+1) \ if not any(map(lambda x: int(x) != 0 or n%int(x) != 0, str(n)))]
0
742
mbpp
def divisible_by_digits(startnum, endnum): return [n for n in range(startnum, endnum+1) \ if not any(map(lambda x: int(x) == 0 or n%int(x) != 0, str(n)))]
transformation_exclamation_equalto_variable
def divisible_by_digits(startnum, endnum): return [n for n in range(startnum, endnum+1) \ if not any(map(lambda x: int(x) == 0 or n%int(x) == 0, str(n)))]
0
742
mbpp
def divisible_by_digits(startnum, endnum): return [n for n in range(startnum, endnum+1) \ if not any(map(lambda x: int(x) == 0 or n%int(x) != 0, str(n)))]
transformation_or_and_variable
def divisible_by_digits(startnum, endnum): return [n for n in range(startnum, endnum+1) \ if not any(map(lambda x: int(x) == 0 and n%int(x) != 0, str(n)))]
0
742
mbpp
def divisible_by_digits(startnum, endnum): return [n for n in range(startnum, endnum+1) \ if not any(map(lambda x: int(x) == 0 or n%int(x) != 0, str(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
742
mbpp
def divisible_by_digits(startnum, endnum): return [n for n in range(startnum, endnum+1) \ if not any(map(lambda x: int(x) == 0 or n%int(x) != 0, str(n)))]
transformation_dissimilar_code_injection_1
def similar_elements(test_tup1, test_tup2): res = tuple(set(test_tup1) & set(test_tup2)) return (res)
0
742
mbpp
def divisible_by_digits(startnum, endnum): return [n for n in range(startnum, endnum+1) \ if not any(map(lambda x: int(x) == 0 or n%int(x) != 0, str(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
742
mbpp
def divisible_by_digits(startnum, endnum): return [n for n in range(startnum, endnum+1) \ if not any(map(lambda x: int(x) == 0 or n%int(x) != 0, str(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
742
mbpp
def divisible_by_digits(startnum, endnum): return [n for n in range(startnum, endnum+1) \ if not any(map(lambda x: int(x) == 0 or n%int(x) != 0, str(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
742
mbpp
def sector_area(r,a): pi=22/7 if a >= 360: return None sectorarea = (pi*r**2) * (a/360) return sectorarea
transformation_dead_code_insert
def sector_area(r, a): for _i_5 in range(0): return sectorarea pi = 22 / 7 if a >= 360: return None sectorarea = (pi * r ** 2) * (a / 360) return sectorarea
1
743
mbpp
def sector_area(r,a): pi=22/7 if a >= 360: return None sectorarea = (pi*r**2) * (a/360) return sectorarea
transformation_for_while_loop
def sector_area(r, a): pi = 22 / 7 if a >= 360: return None sectorarea = (pi * r ** 2) * (a / 360) return sectorarea
1
743
mbpp
def sector_area(r,a): pi=22/7 if a >= 360: return None sectorarea = (pi*r**2) * (a/360) return sectorarea
transformation_operand_swap
def sector_area(r, a): pi = 22 / 7 if 360 <= a: return None sectorarea = (pi * r ** 2) * (a / 360) return sectorarea
1
743
mbpp
def sector_area(r,a): pi=22/7 if a >= 360: return None sectorarea = (pi*r**2) * (a/360) return sectorarea
transformation_rename_variable_cb
def sector_area(r, pi2): pi = 22 / 7 if pi2 >= 360: return None sectorarea = (pi * r ** 2) * (pi2 / 360) return sectorarea
1
743
mbpp
def sector_area(r,a): pi=22/7 if a >= 360: return None sectorarea = (pi*r**2) * (a/360) return sectorarea
transformation_rename_variable_naive
def sector_area(r, VAR_0): pi = 22 / 7 if VAR_0 >= 360: return None sectorarea = (pi * r ** 2) * (VAR_0 / 360) return sectorarea
1
743
mbpp
def sector_area(r,a): pi=22/7 if a >= 360: return None sectorarea = (pi*r**2) * (a/360) return sectorarea
transformation_rename_variable_rn
def sector_area(r, E): pi = 22 / 7 if E >= 360: return None sectorarea = (pi * r ** 2) * (E / 360) return sectorarea
1
743
mbpp
def sector_area(r,a): pi=22/7 if a >= 360: return None sectorarea = (pi*r**2) * (a/360) return sectorarea
transformation_mul_div_variable
def sector_area(r,a): pi=22/7 if a >= 360: return None sectorarea = (pi/r**2) * (a/360) return sectorarea
0
743
mbpp
def sector_area(r,a): pi=22/7 if a >= 360: return None sectorarea = (pi*r**2) * (a/360) return sectorarea
transformation_div_mul_variable
def sector_area(r,a): pi=22*7 if a >= 360: return None sectorarea = (pi*r**2) * (a/360) return sectorarea
0
743
mbpp
def sector_area(r,a): pi=22/7 if a >= 360: return None sectorarea = (pi*r**2) * (a/360) return sectorarea
transformation_greater_lesser_variable
def sector_area(r,a): pi=22/7 if a <= 360: return None sectorarea = (pi*r**2) * (a/360) return sectorarea
0
743
mbpp
def sector_area(r,a): pi=22/7 if a >= 360: return None sectorarea = (pi*r**2) * (a/360) return sectorarea
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
743
mbpp
def sector_area(r,a): pi=22/7 if a >= 360: return None sectorarea = (pi*r**2) * (a/360) return sectorarea
transformation_dissimilar_code_injection_1
def similar_elements(test_tup1, test_tup2): res = tuple(set(test_tup1) & set(test_tup2)) return (res)
0
743
mbpp
def sector_area(r,a): pi=22/7 if a >= 360: return None sectorarea = (pi*r**2) * (a/360) return sectorarea
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
743
mbpp
def sector_area(r,a): pi=22/7 if a >= 360: return None sectorarea = (pi*r**2) * (a/360) return sectorarea
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
743
mbpp
def sector_area(r,a): pi=22/7 if a >= 360: return None sectorarea = (pi*r**2) * (a/360) return sectorarea
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
743
mbpp
def lcs_of_three(X, Y, Z, m, n, o): L = [[[0 for i in range(o+1)] for j in range(n+1)] for k in range(m+1)] for i in range(m+1): for j in range(n+1): for k in range(o+1): if (i == 0 or j == 0 or k == 0): L[i][j][k] = 0 elif (X[i-1] == Y[j-1] and X[i-1] == Z[k-1]): L[i][j][k] = L[i-1][j-1][k-1] + 1 else: L[i][j][k] = max(max(L[i-1][j][k], L[i][j-1][k]), L[i][j][k-1]) return L[m][n][o]
transformation_dead_code_insert
def lcs_of_three(X, Y, Z, m, n, o): for _i_3 in range(0): L[i][j][k] = max(max(L[i - 1][j][k], L[i][j - 1][k]), L[i][j][k - 1]) L = [[[0 for i in range(o + 1)] for j in range(n + 1)] for k in range(m + 1)] for i in range(m + 1): for j in range(n + 1): for k in range(o + 1): if i == 0 or j == 0 or k == 0: L[i][j][k] = 0 elif X[i - 1] == Y[j - 1] and X[i - 1] == Z[k - 1]: L[i][j][k] = L[i - 1][j - 1][k - 1] + 1 else: L[i][j][k] = max( max(L[i - 1][j][k], L[i][j - 1][k]), L[i][j][k - 1] ) return L[m][n][o]
1
744
mbpp
def lcs_of_three(X, Y, Z, m, n, o): L = [[[0 for i in range(o+1)] for j in range(n+1)] for k in range(m+1)] for i in range(m+1): for j in range(n+1): for k in range(o+1): if (i == 0 or j == 0 or k == 0): L[i][j][k] = 0 elif (X[i-1] == Y[j-1] and X[i-1] == Z[k-1]): L[i][j][k] = L[i-1][j-1][k-1] + 1 else: L[i][j][k] = max(max(L[i-1][j][k], L[i][j-1][k]), L[i][j][k-1]) return L[m][n][o]
transformation_for_while_loop
def lcs_of_three(X, Y, Z, m, n, o): L = [[[0 for i in range(o + 1)] for j in range(n + 1)] for k in range(m + 1)] i = 0 while i < m + 1: for j in range(n + 1): for k in range(o + 1): if i == 0 or j == 0 or k == 0: L[i][j][k] = 0 elif X[i - 1] == Y[j - 1] and X[i - 1] == Z[k - 1]: L[i][j][k] = L[i - 1][j - 1][k - 1] + 1 else: L[i][j][k] = max( max(L[i - 1][j][k], L[i][j - 1][k]), L[i][j][k - 1] ) i += 1 return L[m][n][o]
1
744
mbpp
def lcs_of_three(X, Y, Z, m, n, o): L = [[[0 for i in range(o+1)] for j in range(n+1)] for k in range(m+1)] for i in range(m+1): for j in range(n+1): for k in range(o+1): if (i == 0 or j == 0 or k == 0): L[i][j][k] = 0 elif (X[i-1] == Y[j-1] and X[i-1] == Z[k-1]): L[i][j][k] = L[i-1][j-1][k-1] + 1 else: L[i][j][k] = max(max(L[i-1][j][k], L[i][j-1][k]), L[i][j][k-1]) return L[m][n][o]
transformation_operand_swap
def lcs_of_three(X, Y, Z, m, n, o): L = [[[0 for i in range(o + 1)] for j in range(n + 1)] for k in range(m + 1)] for i in range(m + 1): for j in range(n + 1): for k in range(o + 1): if i == 0 or j == 0 or 0 == k: L[i][j][k] = 0 elif X[i - 1] == Y[j - 1] and X[i - 1] == Z[k - 1]: L[i][j][k] = L[i - 1][j - 1][k - 1] + 1 else: L[i][j][k] = max( max(L[i - 1][j][k], L[i][j - 1][k]), L[i][j][k - 1] ) return L[m][n][o]
1
744
mbpp
def lcs_of_three(X, Y, Z, m, n, o): L = [[[0 for i in range(o+1)] for j in range(n+1)] for k in range(m+1)] for i in range(m+1): for j in range(n+1): for k in range(o+1): if (i == 0 or j == 0 or k == 0): L[i][j][k] = 0 elif (X[i-1] == Y[j-1] and X[i-1] == Z[k-1]): L[i][j][k] = L[i-1][j-1][k-1] + 1 else: L[i][j][k] = max(max(L[i-1][j][k], L[i][j-1][k]), L[i][j][k-1]) return L[m][n][o]
transformation_rename_variable_cb
def lcs_of_three(X, Y, Z, m, n, o): L = [[[0 for i2 in range(o + 1)] for j in range(n + 1)] for k in range(m + 1)] for i2 in range(m + 1): for j in range(n + 1): for k in range(o + 1): if i2 == 0 or j == 0 or k == 0: L[i2][j][k] = 0 elif X[i2 - 1] == Y[j - 1] and X[i2 - 1] == Z[k - 1]: L[i2][j][k] = L[i2 - 1][j - 1][k - 1] + 1 else: L[i2][j][k] = max( max(L[i2 - 1][j][k], L[i2][j - 1][k]), L[i2][j][k - 1] ) return L[m][n][o]
1
744
mbpp
def lcs_of_three(X, Y, Z, m, n, o): L = [[[0 for i in range(o+1)] for j in range(n+1)] for k in range(m+1)] for i in range(m+1): for j in range(n+1): for k in range(o+1): if (i == 0 or j == 0 or k == 0): L[i][j][k] = 0 elif (X[i-1] == Y[j-1] and X[i-1] == Z[k-1]): L[i][j][k] = L[i-1][j-1][k-1] + 1 else: L[i][j][k] = max(max(L[i-1][j][k], L[i][j-1][k]), L[i][j][k-1]) return L[m][n][o]
transformation_rename_variable_naive
def lcs_of_three(X, Y, Z, m, n, o): L = [[[0 for VAR_0 in range(o + 1)] for j in range(n + 1)] for k in range(m + 1)] for VAR_0 in range(m + 1): for j in range(n + 1): for k in range(o + 1): if VAR_0 == 0 or j == 0 or k == 0: L[VAR_0][j][k] = 0 elif X[VAR_0 - 1] == Y[j - 1] and X[VAR_0 - 1] == Z[k - 1]: L[VAR_0][j][k] = L[VAR_0 - 1][j - 1][k - 1] + 1 else: L[VAR_0][j][k] = max( max(L[VAR_0 - 1][j][k], L[VAR_0][j - 1][k]), L[VAR_0][j][k - 1] ) return L[m][n][o]
1
744
mbpp
def lcs_of_three(X, Y, Z, m, n, o): L = [[[0 for i in range(o+1)] for j in range(n+1)] for k in range(m+1)] for i in range(m+1): for j in range(n+1): for k in range(o+1): if (i == 0 or j == 0 or k == 0): L[i][j][k] = 0 elif (X[i-1] == Y[j-1] and X[i-1] == Z[k-1]): L[i][j][k] = L[i-1][j-1][k-1] + 1 else: L[i][j][k] = max(max(L[i-1][j][k], L[i][j-1][k]), L[i][j][k-1]) return L[m][n][o]
transformation_rename_variable_rn
def lcs_of_three(X, Y, Z, m, n, o): L = [[[0 for H in range(o + 1)] for j in range(n + 1)] for k in range(m + 1)] for H in range(m + 1): for j in range(n + 1): for k in range(o + 1): if H == 0 or j == 0 or k == 0: L[H][j][k] = 0 elif X[H - 1] == Y[j - 1] and X[H - 1] == Z[k - 1]: L[H][j][k] = L[H - 1][j - 1][k - 1] + 1 else: L[H][j][k] = max( max(L[H - 1][j][k], L[H][j - 1][k]), L[H][j][k - 1] ) return L[m][n][o]
1
744
mbpp
def lcs_of_three(X, Y, Z, m, n, o): L = [[[0 for i in range(o+1)] for j in range(n+1)] for k in range(m+1)] for i in range(m+1): for j in range(n+1): for k in range(o+1): if (i == 0 or j == 0 or k == 0): L[i][j][k] = 0 elif (X[i-1] == Y[j-1] and X[i-1] == Z[k-1]): L[i][j][k] = L[i-1][j-1][k-1] + 1 else: L[i][j][k] = max(max(L[i-1][j][k], L[i][j-1][k]), L[i][j][k-1]) return L[m][n][o]
transformation_add_sub_variable
def lcs_of_three(X, Y, Z, m, n, o): L = [[[0 for i in range(o-1)] for j in range(n+1)] for k in range(m+1)] for i in range(m+1): for j in range(n+1): for k in range(o+1): if (i == 0 or j == 0 or k == 0): L[i][j][k] = 0 elif (X[i-1] == Y[j-1] and X[i-1] == Z[k-1]): L[i][j][k] = L[i-1][j-1][k-1] + 1 else: L[i][j][k] = max(max(L[i-1][j][k], L[i][j-1][k]), L[i][j][k-1]) return L[m][n][o]
0
744
mbpp
def lcs_of_three(X, Y, Z, m, n, o): L = [[[0 for i in range(o+1)] for j in range(n+1)] for k in range(m+1)] for i in range(m+1): for j in range(n+1): for k in range(o+1): if (i == 0 or j == 0 or k == 0): L[i][j][k] = 0 elif (X[i-1] == Y[j-1] and X[i-1] == Z[k-1]): L[i][j][k] = L[i-1][j-1][k-1] + 1 else: L[i][j][k] = max(max(L[i-1][j][k], L[i][j-1][k]), L[i][j][k-1]) return L[m][n][o]
transformation_sub_add_variable
def lcs_of_three(X, Y, Z, m, n, o): L = [[[0 for i in range(o+1)] for j in range(n+1)] for k in range(m+1)] for i in range(m+1): for j in range(n+1): for k in range(o+1): if (i == 0 or j == 0 or k == 0): L[i][j][k] = 0 elif (X[i+1] == Y[j-1] and X[i-1] == Z[k-1]): L[i][j][k] = L[i-1][j-1][k-1] + 1 else: L[i][j][k] = max(max(L[i-1][j][k], L[i][j-1][k]), L[i][j][k-1]) return L[m][n][o]
0
744
mbpp
def lcs_of_three(X, Y, Z, m, n, o): L = [[[0 for i in range(o+1)] for j in range(n+1)] for k in range(m+1)] for i in range(m+1): for j in range(n+1): for k in range(o+1): if (i == 0 or j == 0 or k == 0): L[i][j][k] = 0 elif (X[i-1] == Y[j-1] and X[i-1] == Z[k-1]): L[i][j][k] = L[i-1][j-1][k-1] + 1 else: L[i][j][k] = max(max(L[i-1][j][k], L[i][j-1][k]), L[i][j][k-1]) return L[m][n][o]
transformation_equalto_exclamation_variable
def lcs_of_three(X, Y, Z, m, n, o): L = [[[0 for i in range(o+1)] for j in range(n+1)] for k in range(m+1)] for i in range(m+1): for j in range(n+1): for k in range(o+1): if (i != 0 or j == 0 or k == 0): L[i][j][k] = 0 elif (X[i-1] == Y[j-1] and X[i-1] == Z[k-1]): L[i][j][k] = L[i-1][j-1][k-1] + 1 else: L[i][j][k] = max(max(L[i-1][j][k], L[i][j-1][k]), L[i][j][k-1]) return L[m][n][o]
0
744
mbpp
def lcs_of_three(X, Y, Z, m, n, o): L = [[[0 for i in range(o+1)] for j in range(n+1)] for k in range(m+1)] for i in range(m+1): for j in range(n+1): for k in range(o+1): if (i == 0 or j == 0 or k == 0): L[i][j][k] = 0 elif (X[i-1] == Y[j-1] and X[i-1] == Z[k-1]): L[i][j][k] = L[i-1][j-1][k-1] + 1 else: L[i][j][k] = max(max(L[i-1][j][k], L[i][j-1][k]), L[i][j][k-1]) return L[m][n][o]
transformation_and_or_variable
def lcs_of_three(X, Y, Z, m, n, o): L = [[[0 for i in range(o+1)] for j in range(n+1)] for k in range(m+1)] for i in range(m+1): for j in range(n+1): for k in range(o+1): if (i == 0 or j == 0 or k == 0): L[i][j][k] = 0 elif (X[i-1] == Y[j-1] or X[i-1] == Z[k-1]): L[i][j][k] = L[i-1][j-1][k-1] + 1 else: L[i][j][k] = max(max(L[i-1][j][k], L[i][j-1][k]), L[i][j][k-1]) return L[m][n][o]
0
744
mbpp
def lcs_of_three(X, Y, Z, m, n, o): L = [[[0 for i in range(o+1)] for j in range(n+1)] for k in range(m+1)] for i in range(m+1): for j in range(n+1): for k in range(o+1): if (i == 0 or j == 0 or k == 0): L[i][j][k] = 0 elif (X[i-1] == Y[j-1] and X[i-1] == Z[k-1]): L[i][j][k] = L[i-1][j-1][k-1] + 1 else: L[i][j][k] = max(max(L[i-1][j][k], L[i][j-1][k]), L[i][j][k-1]) return L[m][n][o]
transformation_or_and_variable
def lcs_of_three(X, Y, Z, m, n, o): L = [[[0 for i in range(o+1)] for j in range(n+1)] for k in range(m+1)] for i in range(m+1): for j in range(n+1): for k in range(o+1): if (i == 0 and j == 0 or k == 0): L[i][j][k] = 0 elif (X[i-1] == Y[j-1] and X[i-1] == Z[k-1]): L[i][j][k] = L[i-1][j-1][k-1] + 1 else: L[i][j][k] = max(max(L[i-1][j][k], L[i][j-1][k]), L[i][j][k-1]) return L[m][n][o]
0
744
mbpp
def lcs_of_three(X, Y, Z, m, n, o): L = [[[0 for i in range(o+1)] for j in range(n+1)] for k in range(m+1)] for i in range(m+1): for j in range(n+1): for k in range(o+1): if (i == 0 or j == 0 or k == 0): L[i][j][k] = 0 elif (X[i-1] == Y[j-1] and X[i-1] == Z[k-1]): L[i][j][k] = L[i-1][j-1][k-1] + 1 else: L[i][j][k] = max(max(L[i-1][j][k], L[i][j-1][k]), L[i][j][k-1]) return L[m][n][o]
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
744
mbpp
def lcs_of_three(X, Y, Z, m, n, o): L = [[[0 for i in range(o+1)] for j in range(n+1)] for k in range(m+1)] for i in range(m+1): for j in range(n+1): for k in range(o+1): if (i == 0 or j == 0 or k == 0): L[i][j][k] = 0 elif (X[i-1] == Y[j-1] and X[i-1] == Z[k-1]): L[i][j][k] = L[i-1][j-1][k-1] + 1 else: L[i][j][k] = max(max(L[i-1][j][k], L[i][j-1][k]), L[i][j][k-1]) return L[m][n][o]
transformation_dissimilar_code_injection_1
def similar_elements(test_tup1, test_tup2): res = tuple(set(test_tup1) & set(test_tup2)) return (res)
0
744
mbpp
def lcs_of_three(X, Y, Z, m, n, o): L = [[[0 for i in range(o+1)] for j in range(n+1)] for k in range(m+1)] for i in range(m+1): for j in range(n+1): for k in range(o+1): if (i == 0 or j == 0 or k == 0): L[i][j][k] = 0 elif (X[i-1] == Y[j-1] and X[i-1] == Z[k-1]): L[i][j][k] = L[i-1][j-1][k-1] + 1 else: L[i][j][k] = max(max(L[i-1][j][k], L[i][j-1][k]), L[i][j][k-1]) return L[m][n][o]
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
744
mbpp
def lcs_of_three(X, Y, Z, m, n, o): L = [[[0 for i in range(o+1)] for j in range(n+1)] for k in range(m+1)] for i in range(m+1): for j in range(n+1): for k in range(o+1): if (i == 0 or j == 0 or k == 0): L[i][j][k] = 0 elif (X[i-1] == Y[j-1] and X[i-1] == Z[k-1]): L[i][j][k] = L[i-1][j-1][k-1] + 1 else: L[i][j][k] = max(max(L[i-1][j][k], L[i][j-1][k]), L[i][j][k-1]) return L[m][n][o]
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
744
mbpp
def lcs_of_three(X, Y, Z, m, n, o): L = [[[0 for i in range(o+1)] for j in range(n+1)] for k in range(m+1)] for i in range(m+1): for j in range(n+1): for k in range(o+1): if (i == 0 or j == 0 or k == 0): L[i][j][k] = 0 elif (X[i-1] == Y[j-1] and X[i-1] == Z[k-1]): L[i][j][k] = L[i-1][j-1][k-1] + 1 else: L[i][j][k] = max(max(L[i-1][j][k], L[i][j-1][k]), L[i][j][k-1]) return L[m][n][o]
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
744
mbpp
def sort_numeric_strings(nums_str): result = [int(x) for x in nums_str] result.sort() return result
transformation_dead_code_insert
def sort_numeric_strings(nums_str): result = [int(x) for x in nums_str] _i_5 = 0 if _i_5 < _i_5: result = [int(x) for x in nums_str] result.sort() return result
1
746
mbpp
def sort_numeric_strings(nums_str): result = [int(x) for x in nums_str] result.sort() return result
transformation_for_while_loop
def sort_numeric_strings(nums_str): result = [int(x) for x in nums_str] result.sort() return result
1
746
mbpp
def sort_numeric_strings(nums_str): result = [int(x) for x in nums_str] result.sort() return result
transformation_operand_swap
def sort_numeric_strings(nums_str): result = [int(x) for x in nums_str] result.sort() return result
1
746
mbpp
def sort_numeric_strings(nums_str): result = [int(x) for x in nums_str] result.sort() return result
transformation_rename_variable_cb
def sort_numeric_strings(nums_str): it = [int(x) for x in nums_str] it.sort() return it
1
746
mbpp
def sort_numeric_strings(nums_str): result = [int(x) for x in nums_str] result.sort() return result
transformation_rename_variable_naive
def sort_numeric_strings(nums_str): VAR_0 = [int(x) for x in nums_str] VAR_0.sort() return VAR_0
1
746
mbpp
def sort_numeric_strings(nums_str): result = [int(x) for x in nums_str] result.sort() return result
transformation_rename_variable_rn
def sort_numeric_strings(nums_str): o31e9S = [int(x) for x in nums_str] o31e9S.sort() return o31e9S
1
746
mbpp
def sort_numeric_strings(nums_str): result = [int(x) for x in nums_str] result.sort() 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
746
mbpp
def sort_numeric_strings(nums_str): result = [int(x) for x in nums_str] result.sort() 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
746
mbpp
def sort_numeric_strings(nums_str): result = [int(x) for x in nums_str] result.sort() 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
746
mbpp
def sort_numeric_strings(nums_str): result = [int(x) for x in nums_str] result.sort() 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
746
mbpp
def sort_numeric_strings(nums_str): result = [int(x) for x in nums_str] result.sort() 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
746
mbpp
def add_tuple(test_list, test_tup): test_list += test_tup return (test_list)
transformation_dead_code_insert
def add_tuple(test_list, test_tup): while False: return test_list test_list += test_tup return test_list
1
747
mbpp
def add_tuple(test_list, test_tup): test_list += test_tup return (test_list)
transformation_for_while_loop
def add_tuple(test_list, test_tup): test_list += test_tup return test_list
1
747
mbpp
def add_tuple(test_list, test_tup): test_list += test_tup return (test_list)
transformation_operand_swap
def add_tuple(test_list, test_tup): test_list += test_tup return test_list
1
747
mbpp
def add_tuple(test_list, test_tup): test_list += test_tup return (test_list)
transformation_rename_variable_cb
def add_tuple(line, test_tup): line += test_tup return line
1
747
mbpp
def add_tuple(test_list, test_tup): test_list += test_tup return (test_list)
transformation_rename_variable_naive
def add_tuple(VAR_0, test_tup): VAR_0 += test_tup return VAR_0
1
747
mbpp
def add_tuple(test_list, test_tup): test_list += test_tup return (test_list)
transformation_rename_variable_rn
def add_tuple(S2A6te11X, test_tup): S2A6te11X += test_tup return S2A6te11X
1
747
mbpp
def add_tuple(test_list, test_tup): test_list += test_tup return (test_list)
transformation_add_sub_variable
def add_tuple(test_list, test_tup): test_list -= test_tup return (test_list)
0
747
mbpp
def add_tuple(test_list, test_tup): test_list += test_tup return (test_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
747
mbpp