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 check_K(test_tup, K): res = False for ele in test_tup: if ele == K: res = True break return (res)
transformation_for_while_loop
def check_K(test_tup, K): res = False _ele_i = 0 while _ele_i < len(test_tup): ele = test_tup[_ele_i] if ele == K: res = True break _ele_i += 1 return res
1
805
mbpp
def check_K(test_tup, K): res = False for ele in test_tup: if ele == K: res = True break return (res)
transformation_operand_swap
def check_K(test_tup, K): res = False for ele in test_tup: if K == ele: res = True break return res
1
805
mbpp
def check_K(test_tup, K): res = False for ele in test_tup: if ele == K: res = True break return (res)
transformation_rename_variable_cb
def check_K(test_tup, K): K2 = False for ele in test_tup: if ele == K: K2 = True break return K2
1
805
mbpp
def check_K(test_tup, K): res = False for ele in test_tup: if ele == K: res = True break return (res)
transformation_rename_variable_naive
def check_K(test_tup, K): VAR_0 = False for ele in test_tup: if ele == K: VAR_0 = True break return VAR_0
1
805
mbpp
def check_K(test_tup, K): res = False for ele in test_tup: if ele == K: res = True break return (res)
transformation_rename_variable_rn
def check_K(test_tup, K): U3s = False for ele in test_tup: if ele == K: U3s = True break return U3s
1
805
mbpp
def check_K(test_tup, K): res = False for ele in test_tup: if ele == K: res = True break return (res)
transformation_equalto_exclamation_variable
def check_K(test_tup, K): res = False for ele in test_tup: if ele != K: res = True break return (res)
0
805
mbpp
def check_K(test_tup, K): res = False for ele in test_tup: if ele == K: res = True break return (res)
transformation_true_false_variable
def check_K(test_tup, K): res = False for ele in test_tup: if ele == K: res = False break return (res)
0
805
mbpp
def check_K(test_tup, K): res = False for ele in test_tup: if ele == K: res = True break return (res)
transformation_false_true_variable
def check_K(test_tup, K): res = True for ele in test_tup: if ele == K: res = True break return (res)
0
805
mbpp
def check_K(test_tup, K): res = False for ele in test_tup: if ele == K: res = True break return (res)
transformation_dissimilar_code_injection_0
def min_cost(cost, m, n): R = 3 C = 3 tc = [[0 for x in range(C)] for x in range(R)] tc[0][0] = cost[0][0] for i in range(1, m+1): tc[i][0] = tc[i-1][0] + cost[i][0] for j in range(1, n+1): tc[0][j] = tc[0][j-1] + cost[0][j] for i in range(1, m+1): for j in range(1, n+1): tc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j] return tc[m][n]
0
805
mbpp
def check_K(test_tup, K): res = False for ele in test_tup: if ele == K: res = True break return (res)
transformation_dissimilar_code_injection_1
def similar_elements(test_tup1, test_tup2): res = tuple(set(test_tup1) & set(test_tup2)) return (res)
0
805
mbpp
def check_K(test_tup, K): res = False for ele in test_tup: if ele == K: res = True break return (res)
transformation_dissimilar_code_injection_2
def is_not_prime(n): import math result = False for i in range(2,int(math.sqrt(n)) + 1): if n % i == 0: result = True return result
0
805
mbpp
def check_K(test_tup, K): res = False for ele in test_tup: if ele == K: res = True break return (res)
transformation_dissimilar_code_injection_3
def heap_queue_largest(nums,n): import heapq as hq largest_nums = hq.nlargest(n, nums) return largest_nums
0
805
mbpp
def check_K(test_tup, K): res = False for ele in test_tup: if ele == K: res = True break return (res)
transformation_dissimilar_code_injection_4
def count_ways(n): A = [0] * (n + 1) B = [0] * (n + 1) A[0] = 1 A[1] = 0 B[0] = 0 B[1] = 1 for i in range(2, n+1): A[i] = A[i - 2] + 2 * B[i - 1] B[i] = A[i - 1] + B[i - 2] return A[n]
0
805
mbpp
def check_smaller(test_tup1, test_tup2): res = all(x > y for x, y in zip(test_tup1, test_tup2)) return (res)
transformation_dead_code_insert
def check_smaller(test_tup1, test_tup2): for _i_9 in range(0): return res res = all(x > y for x, y in zip(test_tup1, test_tup2)) return res
1
806
mbpp
def check_smaller(test_tup1, test_tup2): res = all(x > y for x, y in zip(test_tup1, test_tup2)) return (res)
transformation_for_while_loop
def check_smaller(test_tup1, test_tup2): res = all(x > y for x, y in zip(test_tup1, test_tup2)) return res
1
806
mbpp
def check_smaller(test_tup1, test_tup2): res = all(x > y for x, y in zip(test_tup1, test_tup2)) return (res)
transformation_operand_swap
def check_smaller(test_tup1, test_tup2): res = all(y < x for x, y in zip(test_tup1, test_tup2)) return res
1
806
mbpp
def check_smaller(test_tup1, test_tup2): res = all(x > y for x, y in zip(test_tup1, test_tup2)) return (res)
transformation_rename_variable_cb
def check_smaller(test, test_tup2): res = all(x > y for x, y in zip(test, test_tup2)) return res
1
806
mbpp
def check_smaller(test_tup1, test_tup2): res = all(x > y for x, y in zip(test_tup1, test_tup2)) return (res)
transformation_rename_variable_naive
def check_smaller(test_tup1, test_tup2): res = all(VAR_0 > y for VAR_0, y in zip(test_tup1, test_tup2)) return res
1
806
mbpp
def check_smaller(test_tup1, test_tup2): res = all(x > y for x, y in zip(test_tup1, test_tup2)) return (res)
transformation_rename_variable_rn
def check_smaller(test_tup1, test_tup2): res = all(x > t for x, t in zip(test_tup1, test_tup2)) return res
1
806
mbpp
def check_smaller(test_tup1, test_tup2): res = all(x > y for x, y in zip(test_tup1, test_tup2)) return (res)
transformation_greater_lesser_variable
def check_smaller(test_tup1, test_tup2): res = all(x < y for x, y in zip(test_tup1, test_tup2)) return (res)
0
806
mbpp
def check_smaller(test_tup1, test_tup2): res = all(x > y for x, y in zip(test_tup1, test_tup2)) 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
806
mbpp
def check_smaller(test_tup1, test_tup2): res = all(x > y for x, y in zip(test_tup1, test_tup2)) 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
806
mbpp
def check_smaller(test_tup1, test_tup2): res = all(x > y for x, y in zip(test_tup1, test_tup2)) 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
806
mbpp
def check_smaller(test_tup1, test_tup2): res = all(x > y for x, y in zip(test_tup1, test_tup2)) 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
806
mbpp
def check_smaller(test_tup1, test_tup2): res = all(x > y for x, y in zip(test_tup1, test_tup2)) 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
806
mbpp
def count_variable(a,b,c,d): from collections import Counter c = Counter(p=a, q=b, r=c, s=d) return list(c.elements())
transformation_dead_code_insert
def count_variable(a, b, c, d): for _i_1 in range(0): from collections import Counter from collections import Counter c = Counter(p=a, q=b, r=c, s=d) return list(c.elements())
1
807
mbpp
def count_variable(a,b,c,d): from collections import Counter c = Counter(p=a, q=b, r=c, s=d) return list(c.elements())
transformation_for_while_loop
def count_variable(a, b, c, d): from collections import Counter c = Counter(p=a, q=b, r=c, s=d) return list(c.elements())
1
807
mbpp
def count_variable(a,b,c,d): from collections import Counter c = Counter(p=a, q=b, r=c, s=d) return list(c.elements())
transformation_operand_swap
def count_variable(a, b, c, d): from collections import Counter c = Counter(p=a, q=b, r=c, s=d) return list(c.elements())
1
807
mbpp
def count_variable(a,b,c,d): from collections import Counter c = Counter(p=a, q=b, r=c, s=d) return list(c.elements())
transformation_rename_variable_cb
def count_variable(a, b, c2, d): from collections import Counter c2 = Counter(p=a, q=b, r=c2, s=d) return list(c2.elements())
1
807
mbpp
def count_variable(a,b,c,d): from collections import Counter c = Counter(p=a, q=b, r=c, s=d) return list(c.elements())
transformation_rename_variable_naive
def count_variable(a, b, VAR_0, d): from collections import Counter VAR_0 = Counter(p=a, q=b, r=VAR_0, s=d) return list(VAR_0.elements())
1
807
mbpp
def count_variable(a,b,c,d): from collections import Counter c = Counter(p=a, q=b, r=c, s=d) return list(c.elements())
transformation_rename_variable_rn
def count_variable(a, b, E, d): from collections import Counter E = Counter(p=a, q=b, r=E, s=d) return list(E.elements())
1
807
mbpp
def count_variable(a,b,c,d): from collections import Counter c = Counter(p=a, q=b, r=c, s=d) return list(c.elements())
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
807
mbpp
def count_variable(a,b,c,d): from collections import Counter c = Counter(p=a, q=b, r=c, s=d) return list(c.elements())
transformation_dissimilar_code_injection_1
def similar_elements(test_tup1, test_tup2): res = tuple(set(test_tup1) & set(test_tup2)) return (res)
0
807
mbpp
def count_variable(a,b,c,d): from collections import Counter c = Counter(p=a, q=b, r=c, s=d) return list(c.elements())
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
807
mbpp
def count_variable(a,b,c,d): from collections import Counter c = Counter(p=a, q=b, r=c, s=d) return list(c.elements())
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
807
mbpp
def count_variable(a,b,c,d): from collections import Counter c = Counter(p=a, q=b, r=c, s=d) return list(c.elements())
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
807
mbpp
def road_rd(street): import re return (re.sub('Road$', 'Rd.', street))
transformation_dead_code_insert
def road_rd(street): import re for _i_3 in range(0): import re return re.sub("Road$", "Rd.", street)
1
809
mbpp
def road_rd(street): import re return (re.sub('Road$', 'Rd.', street))
transformation_for_while_loop
def road_rd(street): import re return re.sub("Road$", "Rd.", street)
1
809
mbpp
def road_rd(street): import re return (re.sub('Road$', 'Rd.', street))
transformation_operand_swap
def road_rd(street): import re return re.sub("Road$", "Rd.", street)
1
809
mbpp
def road_rd(street): import re return (re.sub('Road$', 'Rd.', street))
transformation_rename_variable_cb
def road_rd(line): import re return re.sub("Road$", "Rd.", line)
1
809
mbpp
def road_rd(street): import re return (re.sub('Road$', 'Rd.', street))
transformation_rename_variable_naive
def road_rd(VAR_0): import re return re.sub("Road$", "Rd.", VAR_0)
1
809
mbpp
def road_rd(street): import re return (re.sub('Road$', 'Rd.', street))
transformation_rename_variable_rn
def road_rd(L9u3cP): import re return re.sub("Road$", "Rd.", L9u3cP)
1
809
mbpp
def road_rd(street): import re return (re.sub('Road$', 'Rd.', street))
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
809
mbpp
def road_rd(street): import re return (re.sub('Road$', 'Rd.', street))
transformation_dissimilar_code_injection_1
def similar_elements(test_tup1, test_tup2): res = tuple(set(test_tup1) & set(test_tup2)) return (res)
0
809
mbpp
def road_rd(street): import re return (re.sub('Road$', 'Rd.', street))
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
809
mbpp
def road_rd(street): import re return (re.sub('Road$', 'Rd.', street))
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
809
mbpp
def road_rd(street): import re return (re.sub('Road$', 'Rd.', street))
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
809
mbpp
def string_length(str1): count = 0 for char in str1: count += 1 return count
transformation_dead_code_insert
def string_length(str1): count = 0 _i_7 = 0 while _i_7 > _i_7: return count for char in str1: count += 1 return count
1
810
mbpp
def string_length(str1): count = 0 for char in str1: count += 1 return count
transformation_for_while_loop
def string_length(str1): count = 0 _char_i = 0 while _char_i < len(str1): char = str1[_char_i] count += 1 _char_i += 1 return count
1
810
mbpp
def string_length(str1): count = 0 for char in str1: count += 1 return count
transformation_operand_swap
def string_length(str1): count = 0 for char in str1: count += 1 return count
1
810
mbpp
def string_length(str1): count = 0 for char in str1: count += 1 return count
transformation_rename_variable_cb
def string_length(str1): char2 = 0 for char in str1: char2 += 1 return char2
1
810
mbpp
def string_length(str1): count = 0 for char in str1: count += 1 return count
transformation_rename_variable_naive
def string_length(str1): VAR_0 = 0 for char in str1: VAR_0 += 1 return VAR_0
1
810
mbpp
def string_length(str1): count = 0 for char in str1: count += 1 return count
transformation_rename_variable_rn
def string_length(str1): M9Re9 = 0 for char in str1: M9Re9 += 1 return M9Re9
1
810
mbpp
def string_length(str1): count = 0 for char in str1: count += 1 return count
transformation_add_sub_variable
def string_length(str1): count = 0 for char in str1: count -= 1 return count
0
810
mbpp
def string_length(str1): count = 0 for char in str1: count += 1 return count
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
810
mbpp
def string_length(str1): count = 0 for char in str1: count += 1 return count
transformation_dissimilar_code_injection_1
def similar_elements(test_tup1, test_tup2): res = tuple(set(test_tup1) & set(test_tup2)) return (res)
0
810
mbpp
def string_length(str1): count = 0 for char in str1: count += 1 return count
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
810
mbpp
def string_length(str1): count = 0 for char in str1: count += 1 return count
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
810
mbpp
def string_length(str1): count = 0 for char in str1: count += 1 return count
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
810
mbpp
def rombus_area(p,q): area=(p*q)/2 return area
transformation_dead_code_insert
def rombus_area(p, q): _i_8 = 0 if _i_8 < _i_8: area = (p * q) / 2 area = (p * q) / 2 return area
1
811
mbpp
def rombus_area(p,q): area=(p*q)/2 return area
transformation_for_while_loop
def rombus_area(p, q): area = (p * q) / 2 return area
1
811
mbpp
def rombus_area(p,q): area=(p*q)/2 return area
transformation_operand_swap
def rombus_area(p, q): area = (p * q) / 2 return area
1
811
mbpp
def rombus_area(p,q): area=(p*q)/2 return area
transformation_rename_variable_cb
def rombus_area(p2, q): area = (p2 * q) / 2 return area
1
811
mbpp
def rombus_area(p,q): area=(p*q)/2 return area
transformation_rename_variable_naive
def rombus_area(VAR_0, q): area = (VAR_0 * q) / 2 return area
1
811
mbpp
def rombus_area(p,q): area=(p*q)/2 return area
transformation_rename_variable_rn
def rombus_area(p, f): area = (p * f) / 2 return area
1
811
mbpp
def rombus_area(p,q): area=(p*q)/2 return area
transformation_mul_div_variable
def rombus_area(p,q): area=(p/q)/2 return area
0
811
mbpp
def rombus_area(p,q): area=(p*q)/2 return area
transformation_div_mul_variable
def rombus_area(p,q): area=(p*q)*2 return area
0
811
mbpp
def rombus_area(p,q): area=(p*q)/2 return area
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
811
mbpp
def rombus_area(p,q): area=(p*q)/2 return area
transformation_dissimilar_code_injection_1
def similar_elements(test_tup1, test_tup2): res = tuple(set(test_tup1) & set(test_tup2)) return (res)
0
811
mbpp
def rombus_area(p,q): area=(p*q)/2 return area
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
811
mbpp
def rombus_area(p,q): area=(p*q)/2 return area
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
811
mbpp
def rombus_area(p,q): area=(p*q)/2 return area
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
811
mbpp
def sort_by_dnf(arr, n): low=0 mid=0 high=n-1 while mid <= high: if arr[mid] == 0: arr[low], arr[mid] = arr[mid], arr[low] low = low + 1 mid = mid + 1 elif arr[mid] == 1: mid = mid + 1 else: arr[mid], arr[high] = arr[high], arr[mid] high = high - 1 return arr
transformation_dead_code_insert
def sort_by_dnf(arr, n): low = 0 while False: mid = mid + 1 mid = 0 high = n - 1 while mid <= high: if arr[mid] == 0: arr[low], arr[mid] = arr[mid], arr[low] low = low + 1 mid = mid + 1 elif arr[mid] == 1: mid = mid + 1 else: arr[mid], arr[high] = arr[high], arr[mid] high = high - 1 return arr
1
812
mbpp
def sort_by_dnf(arr, n): low=0 mid=0 high=n-1 while mid <= high: if arr[mid] == 0: arr[low], arr[mid] = arr[mid], arr[low] low = low + 1 mid = mid + 1 elif arr[mid] == 1: mid = mid + 1 else: arr[mid], arr[high] = arr[high], arr[mid] high = high - 1 return arr
transformation_for_while_loop
def sort_by_dnf(arr, n): low = 0 mid = 0 high = n - 1 while mid <= high: if arr[mid] == 0: arr[low], arr[mid] = arr[mid], arr[low] low = low + 1 mid = mid + 1 elif arr[mid] == 1: mid = mid + 1 else: arr[mid], arr[high] = arr[high], arr[mid] high = high - 1 return arr
1
812
mbpp
def sort_by_dnf(arr, n): low=0 mid=0 high=n-1 while mid <= high: if arr[mid] == 0: arr[low], arr[mid] = arr[mid], arr[low] low = low + 1 mid = mid + 1 elif arr[mid] == 1: mid = mid + 1 else: arr[mid], arr[high] = arr[high], arr[mid] high = high - 1 return arr
transformation_operand_swap
def sort_by_dnf(arr, n): low = 0 mid = 0 high = n - 1 while high >= mid: if arr[mid] == 0: arr[low], arr[mid] = arr[mid], arr[low] low = low + 1 mid = mid + 1 elif arr[mid] == 1: mid = mid + 1 else: arr[mid], arr[high] = arr[high], arr[mid] high = high - 1 return arr
1
812
mbpp
def sort_by_dnf(arr, n): low=0 mid=0 high=n-1 while mid <= high: if arr[mid] == 0: arr[low], arr[mid] = arr[mid], arr[low] low = low + 1 mid = mid + 1 elif arr[mid] == 1: mid = mid + 1 else: arr[mid], arr[high] = arr[high], arr[mid] high = high - 1 return arr
transformation_rename_variable_cb
def sort_by_dnf(arr, n): low = 0 low2 = 0 high = n - 1 while low2 <= high: if arr[low2] == 0: arr[low], arr[low2] = arr[low2], arr[low] low = low + 1 low2 = low2 + 1 elif arr[low2] == 1: low2 = low2 + 1 else: arr[low2], arr[high] = arr[high], arr[low2] high = high - 1 return arr
1
812
mbpp
def sort_by_dnf(arr, n): low=0 mid=0 high=n-1 while mid <= high: if arr[mid] == 0: arr[low], arr[mid] = arr[mid], arr[low] low = low + 1 mid = mid + 1 elif arr[mid] == 1: mid = mid + 1 else: arr[mid], arr[high] = arr[high], arr[mid] high = high - 1 return arr
transformation_rename_variable_naive
def sort_by_dnf(arr, n): low = 0 VAR_0 = 0 high = n - 1 while VAR_0 <= high: if arr[VAR_0] == 0: arr[low], arr[VAR_0] = arr[VAR_0], arr[low] low = low + 1 VAR_0 = VAR_0 + 1 elif arr[VAR_0] == 1: VAR_0 = VAR_0 + 1 else: arr[VAR_0], arr[high] = arr[high], arr[VAR_0] high = high - 1 return arr
1
812
mbpp
def sort_by_dnf(arr, n): low=0 mid=0 high=n-1 while mid <= high: if arr[mid] == 0: arr[low], arr[mid] = arr[mid], arr[low] low = low + 1 mid = mid + 1 elif arr[mid] == 1: mid = mid + 1 else: arr[mid], arr[high] = arr[high], arr[mid] high = high - 1 return arr
transformation_rename_variable_rn
def sort_by_dnf(arr, n): low = 0 Bu8 = 0 high = n - 1 while Bu8 <= high: if arr[Bu8] == 0: arr[low], arr[Bu8] = arr[Bu8], arr[low] low = low + 1 Bu8 = Bu8 + 1 elif arr[Bu8] == 1: Bu8 = Bu8 + 1 else: arr[Bu8], arr[high] = arr[high], arr[Bu8] high = high - 1 return arr
1
812
mbpp
def sort_by_dnf(arr, n): low=0 mid=0 high=n-1 while mid <= high: if arr[mid] == 0: arr[low], arr[mid] = arr[mid], arr[low] low = low + 1 mid = mid + 1 elif arr[mid] == 1: mid = mid + 1 else: arr[mid], arr[high] = arr[high], arr[mid] high = high - 1 return arr
transformation_add_sub_variable
def sort_by_dnf(arr, n): low=0 mid=0 high=n-1 while mid <= high: if arr[mid] == 0: arr[low], arr[mid] = arr[mid], arr[low] low = low - 1 mid = mid + 1 elif arr[mid] == 1: mid = mid + 1 else: arr[mid], arr[high] = arr[high], arr[mid] high = high - 1 return arr
0
812
mbpp
def sort_by_dnf(arr, n): low=0 mid=0 high=n-1 while mid <= high: if arr[mid] == 0: arr[low], arr[mid] = arr[mid], arr[low] low = low + 1 mid = mid + 1 elif arr[mid] == 1: mid = mid + 1 else: arr[mid], arr[high] = arr[high], arr[mid] high = high - 1 return arr
transformation_sub_add_variable
def sort_by_dnf(arr, n): low=0 mid=0 high=n+1 while mid <= high: if arr[mid] == 0: arr[low], arr[mid] = arr[mid], arr[low] low = low + 1 mid = mid + 1 elif arr[mid] == 1: mid = mid + 1 else: arr[mid], arr[high] = arr[high], arr[mid] high = high - 1 return arr
0
812
mbpp
def sort_by_dnf(arr, n): low=0 mid=0 high=n-1 while mid <= high: if arr[mid] == 0: arr[low], arr[mid] = arr[mid], arr[low] low = low + 1 mid = mid + 1 elif arr[mid] == 1: mid = mid + 1 else: arr[mid], arr[high] = arr[high], arr[mid] high = high - 1 return arr
transformation_lesser_greater_variable
def sort_by_dnf(arr, n): low=0 mid=0 high=n-1 while mid >= high: if arr[mid] == 0: arr[low], arr[mid] = arr[mid], arr[low] low = low + 1 mid = mid + 1 elif arr[mid] == 1: mid = mid + 1 else: arr[mid], arr[high] = arr[high], arr[mid] high = high - 1 return arr
0
812
mbpp
def sort_by_dnf(arr, n): low=0 mid=0 high=n-1 while mid <= high: if arr[mid] == 0: arr[low], arr[mid] = arr[mid], arr[low] low = low + 1 mid = mid + 1 elif arr[mid] == 1: mid = mid + 1 else: arr[mid], arr[high] = arr[high], arr[mid] high = high - 1 return arr
transformation_equalto_exclamation_variable
def sort_by_dnf(arr, n): low=0 mid=0 high=n-1 while mid <= high: if arr[mid] != 0: arr[low], arr[mid] = arr[mid], arr[low] low = low + 1 mid = mid + 1 elif arr[mid] == 1: mid = mid + 1 else: arr[mid], arr[high] = arr[high], arr[mid] high = high - 1 return arr
0
812
mbpp
def sort_by_dnf(arr, n): low=0 mid=0 high=n-1 while mid <= high: if arr[mid] == 0: arr[low], arr[mid] = arr[mid], arr[low] low = low + 1 mid = mid + 1 elif arr[mid] == 1: mid = mid + 1 else: arr[mid], arr[high] = arr[high], arr[mid] high = high - 1 return arr
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
812
mbpp
def sort_by_dnf(arr, n): low=0 mid=0 high=n-1 while mid <= high: if arr[mid] == 0: arr[low], arr[mid] = arr[mid], arr[low] low = low + 1 mid = mid + 1 elif arr[mid] == 1: mid = mid + 1 else: arr[mid], arr[high] = arr[high], arr[mid] high = high - 1 return arr
transformation_dissimilar_code_injection_1
def similar_elements(test_tup1, test_tup2): res = tuple(set(test_tup1) & set(test_tup2)) return (res)
0
812
mbpp
def sort_by_dnf(arr, n): low=0 mid=0 high=n-1 while mid <= high: if arr[mid] == 0: arr[low], arr[mid] = arr[mid], arr[low] low = low + 1 mid = mid + 1 elif arr[mid] == 1: mid = mid + 1 else: arr[mid], arr[high] = arr[high], arr[mid] high = high - 1 return arr
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
812
mbpp
def sort_by_dnf(arr, n): low=0 mid=0 high=n-1 while mid <= high: if arr[mid] == 0: arr[low], arr[mid] = arr[mid], arr[low] low = low + 1 mid = mid + 1 elif arr[mid] == 1: mid = mid + 1 else: arr[mid], arr[high] = arr[high], arr[mid] high = high - 1 return arr
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
812
mbpp
def sort_by_dnf(arr, n): low=0 mid=0 high=n-1 while mid <= high: if arr[mid] == 0: arr[low], arr[mid] = arr[mid], arr[low] low = low + 1 mid = mid + 1 elif arr[mid] == 1: mid = mid + 1 else: arr[mid], arr[high] = arr[high], arr[mid] high = high - 1 return arr
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
812
mbpp
def div_of_nums(nums,m,n): result = list(filter(lambda x: (x % m == 0 or x % n == 0), nums)) return result
transformation_dead_code_insert
def div_of_nums(nums, m, n): _i_7 = 0 if _i_7 < _i_7: return result result = list(filter(lambda x: (x % m == 0 or x % n == 0), nums)) return result
1
814
mbpp
def div_of_nums(nums,m,n): result = list(filter(lambda x: (x % m == 0 or x % n == 0), nums)) return result
transformation_for_while_loop
def div_of_nums(nums, m, n): result = list(filter(lambda x: (x % m == 0 or x % n == 0), nums)) return result
1
814
mbpp
def div_of_nums(nums,m,n): result = list(filter(lambda x: (x % m == 0 or x % n == 0), nums)) return result
transformation_operand_swap
def div_of_nums(nums, m, n): result = list(filter(lambda x: (0 == x % m or x % n == 0), nums)) return result
1
814
mbpp
def div_of_nums(nums,m,n): result = list(filter(lambda x: (x % m == 0 or x % n == 0), nums)) return result
transformation_rename_variable_cb
def div_of_nums(nums, m, n): result = list(filter(lambda i: (i % m == 0 or i % n == 0), nums)) return result
1
814
mbpp
def div_of_nums(nums,m,n): result = list(filter(lambda x: (x % m == 0 or x % n == 0), nums)) return result
transformation_rename_variable_naive
def div_of_nums(nums, m, n): result = list(filter(lambda VAR_0: (VAR_0 % m == 0 or VAR_0 % n == 0), nums)) return result
1
814
mbpp
def div_of_nums(nums,m,n): result = list(filter(lambda x: (x % m == 0 or x % n == 0), nums)) return result
transformation_rename_variable_rn
def div_of_nums(nums, m, n): result = list(filter(lambda E: (E % m == 0 or E % n == 0), nums)) return result
1
814
mbpp
def div_of_nums(nums,m,n): result = list(filter(lambda x: (x % m == 0 or x % n == 0), nums)) return result
transformation_equalto_exclamation_variable
def div_of_nums(nums,m,n): result = list(filter(lambda x: (x % m != 0 or x % n == 0), nums)) return result
0
814
mbpp
def div_of_nums(nums,m,n): result = list(filter(lambda x: (x % m == 0 or x % n == 0), nums)) return result
transformation_or_and_variable
def div_of_nums(nums,m,n): result = list(filter(lambda x: (x % m == 0 and x % n == 0), nums)) return result
0
814
mbpp
def div_of_nums(nums,m,n): result = list(filter(lambda x: (x % m == 0 or x % n == 0), nums)) 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
814
mbpp
def div_of_nums(nums,m,n): result = list(filter(lambda x: (x % m == 0 or x % n == 0), nums)) 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
814
mbpp
def div_of_nums(nums,m,n): result = list(filter(lambda x: (x % m == 0 or x % n == 0), nums)) 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
814
mbpp
def div_of_nums(nums,m,n): result = list(filter(lambda x: (x % m == 0 or x % n == 0), nums)) 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
814
mbpp
def div_of_nums(nums,m,n): result = list(filter(lambda x: (x % m == 0 or x % n == 0), nums)) 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
814
mbpp