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_IP(Ip): import re regex = '''^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)$''' if(re.search(regex, Ip)): return ("Valid IP address") else: return ("Invalid IP address")
transformation_for_while_loop
def check_IP(Ip): import re regex = """^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)$""" if re.search(regex, Ip): return "Valid IP address" else: return "Invalid IP address"
1
666
mbpp
def check_IP(Ip): import re regex = '''^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)$''' if(re.search(regex, Ip)): return ("Valid IP address") else: return ("Invalid IP address")
transformation_operand_swap
def check_IP(Ip): import re regex = """^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)$""" if re.search(regex, Ip): return "Valid IP address" else: return "Invalid IP address"
1
666
mbpp
def check_IP(Ip): import re regex = '''^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)$''' if(re.search(regex, Ip)): return ("Valid IP address") else: return ("Invalid IP address")
transformation_rename_variable_cb
def check_IP(line): import re regex = """^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)$""" if re.search(regex, line): return "Valid IP address" else: return "Invalid IP address"
1
666
mbpp
def check_IP(Ip): import re regex = '''^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)$''' if(re.search(regex, Ip)): return ("Valid IP address") else: return ("Invalid IP address")
transformation_rename_variable_naive
def check_IP(VAR_0): import re regex = """^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)$""" if re.search(regex, VAR_0): return "Valid IP address" else: return "Invalid IP address"
1
666
mbpp
def check_IP(Ip): import re regex = '''^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)$''' if(re.search(regex, Ip)): return ("Valid IP address") else: return ("Invalid IP address")
transformation_rename_variable_rn
def check_IP(F6): import re regex = """^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)$""" if re.search(regex, F6): return "Valid IP address" else: return "Invalid IP address"
1
666
mbpp
def check_IP(Ip): import re regex = '''^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)$''' if(re.search(regex, Ip)): return ("Valid IP address") else: return ("Invalid IP address")
transformation_sub_add_variable
def check_IP(Ip): import re regex = '''^(25[0+5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)$''' if(re.search(regex, Ip)): return ("Valid IP address") else: return ("Invalid IP address")
0
666
mbpp
def check_IP(Ip): import re regex = '''^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)$''' if(re.search(regex, Ip)): return ("Valid IP address") else: return ("Invalid IP address")
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
666
mbpp
def check_IP(Ip): import re regex = '''^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)$''' if(re.search(regex, Ip)): return ("Valid IP address") else: return ("Invalid IP address")
transformation_dissimilar_code_injection_1
def similar_elements(test_tup1, test_tup2): res = tuple(set(test_tup1) & set(test_tup2)) return (res)
0
666
mbpp
def check_IP(Ip): import re regex = '''^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)$''' if(re.search(regex, Ip)): return ("Valid IP address") else: return ("Invalid IP address")
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
666
mbpp
def check_IP(Ip): import re regex = '''^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)$''' if(re.search(regex, Ip)): return ("Valid IP address") else: return ("Invalid IP address")
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
666
mbpp
def check_IP(Ip): import re regex = '''^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)$''' if(re.search(regex, Ip)): return ("Valid IP address") else: return ("Invalid IP address")
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
666
mbpp
def set_Right_most_Unset_Bit(n): import math def get_Pos_Of_Right_most_Set_Bit(n): return int(math.log2(n&-n)+1) if (n == 0): return 1 if ((n & (n + 1)) == 0): return n pos = get_Pos_Of_Right_most_Set_Bit(~n) return ((1 << (pos - 1)) | n)
transformation_dead_code_insert
def set_Right_most_Unset_Bit(n): import math def get_Pos_Of_Right_most_Set_Bit(n): return int(math.log2(n & -n) + 1) _i_7 = 0 while _i_7 < _i_7: return 1 if n == 0: return 1 if (n & (n + 1)) == 0: return n pos = get_Pos_Of_Right_most_Set_Bit(~n) return (1 << (pos - 1)) | n
1
668
mbpp
def set_Right_most_Unset_Bit(n): import math def get_Pos_Of_Right_most_Set_Bit(n): return int(math.log2(n&-n)+1) if (n == 0): return 1 if ((n & (n + 1)) == 0): return n pos = get_Pos_Of_Right_most_Set_Bit(~n) return ((1 << (pos - 1)) | n)
transformation_for_while_loop
def set_Right_most_Unset_Bit(n): import math def get_Pos_Of_Right_most_Set_Bit(n): return int(math.log2(n & -n) + 1) if n == 0: return 1 if (n & (n + 1)) == 0: return n pos = get_Pos_Of_Right_most_Set_Bit(~n) return (1 << (pos - 1)) | n
1
668
mbpp
def set_Right_most_Unset_Bit(n): import math def get_Pos_Of_Right_most_Set_Bit(n): return int(math.log2(n&-n)+1) if (n == 0): return 1 if ((n & (n + 1)) == 0): return n pos = get_Pos_Of_Right_most_Set_Bit(~n) return ((1 << (pos - 1)) | n)
transformation_operand_swap
def set_Right_most_Unset_Bit(n): import math def get_Pos_Of_Right_most_Set_Bit(n): return int(math.log2(n & -n) + 1) if 0 == n: return 1 if (n & (n + 1)) == 0: return n pos = get_Pos_Of_Right_most_Set_Bit(~n) return (1 << (pos - 1)) | n
1
668
mbpp
def set_Right_most_Unset_Bit(n): import math def get_Pos_Of_Right_most_Set_Bit(n): return int(math.log2(n&-n)+1) if (n == 0): return 1 if ((n & (n + 1)) == 0): return n pos = get_Pos_Of_Right_most_Set_Bit(~n) return ((1 << (pos - 1)) | n)
transformation_rename_variable_cb
def set_Right_most_Unset_Bit(i): import math def get_Pos_Of_Right_most_Set_Bit(i): return int(math.log2(i & -i) + 1) if i == 0: return 1 if (i & (i + 1)) == 0: return i pos = get_Pos_Of_Right_most_Set_Bit(~i) return (1 << (pos - 1)) | i
1
668
mbpp
def set_Right_most_Unset_Bit(n): import math def get_Pos_Of_Right_most_Set_Bit(n): return int(math.log2(n&-n)+1) if (n == 0): return 1 if ((n & (n + 1)) == 0): return n pos = get_Pos_Of_Right_most_Set_Bit(~n) return ((1 << (pos - 1)) | n)
transformation_rename_variable_naive
def set_Right_most_Unset_Bit(VAR_0): import math def get_Pos_Of_Right_most_Set_Bit(VAR_0): return int(math.log2(VAR_0 & -VAR_0) + 1) if VAR_0 == 0: return 1 if (VAR_0 & (VAR_0 + 1)) == 0: return VAR_0 pos = get_Pos_Of_Right_most_Set_Bit(~VAR_0) return (1 << (pos - 1)) | VAR_0
1
668
mbpp
def set_Right_most_Unset_Bit(n): import math def get_Pos_Of_Right_most_Set_Bit(n): return int(math.log2(n&-n)+1) if (n == 0): return 1 if ((n & (n + 1)) == 0): return n pos = get_Pos_Of_Right_most_Set_Bit(~n) return ((1 << (pos - 1)) | n)
transformation_rename_variable_rn
def set_Right_most_Unset_Bit(l): import math def get_Pos_Of_Right_most_Set_Bit(l): return int(math.log2(l & -l) + 1) if l == 0: return 1 if (l & (l + 1)) == 0: return l pos = get_Pos_Of_Right_most_Set_Bit(~l) return (1 << (pos - 1)) | l
1
668
mbpp
def set_Right_most_Unset_Bit(n): import math def get_Pos_Of_Right_most_Set_Bit(n): return int(math.log2(n&-n)+1) if (n == 0): return 1 if ((n & (n + 1)) == 0): return n pos = get_Pos_Of_Right_most_Set_Bit(~n) return ((1 << (pos - 1)) | n)
transformation_add_sub_variable
def set_Right_most_Unset_Bit(n): import math def get_Pos_Of_Right_most_Set_Bit(n): return int(math.log2(n&-n)-1) if (n == 0): return 1 if ((n & (n + 1)) == 0): return n pos = get_Pos_Of_Right_most_Set_Bit(~n) return ((1 << (pos - 1)) | n)
0
668
mbpp
def set_Right_most_Unset_Bit(n): import math def get_Pos_Of_Right_most_Set_Bit(n): return int(math.log2(n&-n)+1) if (n == 0): return 1 if ((n & (n + 1)) == 0): return n pos = get_Pos_Of_Right_most_Set_Bit(~n) return ((1 << (pos - 1)) | n)
transformation_sub_add_variable
def set_Right_most_Unset_Bit(n): import math def get_Pos_Of_Right_most_Set_Bit(n): return int(math.log2(n&+n)+1) if (n == 0): return 1 if ((n & (n + 1)) == 0): return n pos = get_Pos_Of_Right_most_Set_Bit(~n) return ((1 << (pos - 1)) | n)
0
668
mbpp
def set_Right_most_Unset_Bit(n): import math def get_Pos_Of_Right_most_Set_Bit(n): return int(math.log2(n&-n)+1) if (n == 0): return 1 if ((n & (n + 1)) == 0): return n pos = get_Pos_Of_Right_most_Set_Bit(~n) return ((1 << (pos - 1)) | n)
transformation_lesser_greater_variable
def set_Right_most_Unset_Bit(n): import math def get_Pos_Of_Right_most_Set_Bit(n): return int(math.log2(n&-n)+1) if (n == 0): return 1 if ((n & (n + 1)) == 0): return n pos = get_Pos_Of_Right_most_Set_Bit(~n) return ((1 >< (pos - 1)) | n)
0
668
mbpp
def set_Right_most_Unset_Bit(n): import math def get_Pos_Of_Right_most_Set_Bit(n): return int(math.log2(n&-n)+1) if (n == 0): return 1 if ((n & (n + 1)) == 0): return n pos = get_Pos_Of_Right_most_Set_Bit(~n) return ((1 << (pos - 1)) | n)
transformation_equalto_exclamation_variable
def set_Right_most_Unset_Bit(n): import math def get_Pos_Of_Right_most_Set_Bit(n): return int(math.log2(n&-n)+1) if (n != 0): return 1 if ((n & (n + 1)) == 0): return n pos = get_Pos_Of_Right_most_Set_Bit(~n) return ((1 << (pos - 1)) | n)
0
668
mbpp
def set_Right_most_Unset_Bit(n): import math def get_Pos_Of_Right_most_Set_Bit(n): return int(math.log2(n&-n)+1) if (n == 0): return 1 if ((n & (n + 1)) == 0): return n pos = get_Pos_Of_Right_most_Set_Bit(~n) return ((1 << (pos - 1)) | 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
668
mbpp
def set_Right_most_Unset_Bit(n): import math def get_Pos_Of_Right_most_Set_Bit(n): return int(math.log2(n&-n)+1) if (n == 0): return 1 if ((n & (n + 1)) == 0): return n pos = get_Pos_Of_Right_most_Set_Bit(~n) return ((1 << (pos - 1)) | n)
transformation_dissimilar_code_injection_1
def similar_elements(test_tup1, test_tup2): res = tuple(set(test_tup1) & set(test_tup2)) return (res)
0
668
mbpp
def set_Right_most_Unset_Bit(n): import math def get_Pos_Of_Right_most_Set_Bit(n): return int(math.log2(n&-n)+1) if (n == 0): return 1 if ((n & (n + 1)) == 0): return n pos = get_Pos_Of_Right_most_Set_Bit(~n) return ((1 << (pos - 1)) | 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
668
mbpp
def set_Right_most_Unset_Bit(n): import math def get_Pos_Of_Right_most_Set_Bit(n): return int(math.log2(n&-n)+1) if (n == 0): return 1 if ((n & (n + 1)) == 0): return n pos = get_Pos_Of_Right_most_Set_Bit(~n) return ((1 << (pos - 1)) | 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
668
mbpp
def set_Right_most_Unset_Bit(n): import math def get_Pos_Of_Right_most_Set_Bit(n): return int(math.log2(n&-n)+1) if (n == 0): return 1 if ((n & (n + 1)) == 0): return n pos = get_Pos_Of_Right_most_Set_Bit(~n) return ((1 << (pos - 1)) | 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
668
mbpp
def remove_duplicate(string): from collections import OrderedDict result = ' '.join(OrderedDict((w,w) for w in string.split()).keys()) return result
transformation_dead_code_insert
def remove_duplicate(string): _i_8 = 0 if _i_8 < _i_8: from collections import OrderedDict from collections import OrderedDict result = " ".join(OrderedDict((w, w) for w in string.split()).keys()) return result
1
671
mbpp
def remove_duplicate(string): from collections import OrderedDict result = ' '.join(OrderedDict((w,w) for w in string.split()).keys()) return result
transformation_for_while_loop
def remove_duplicate(string): from collections import OrderedDict result = " ".join(OrderedDict((w, w) for w in string.split()).keys()) return result
1
671
mbpp
def remove_duplicate(string): from collections import OrderedDict result = ' '.join(OrderedDict((w,w) for w in string.split()).keys()) return result
transformation_operand_swap
def remove_duplicate(string): from collections import OrderedDict result = " ".join(OrderedDict((w, w) for w in string.split()).keys()) return result
1
671
mbpp
def remove_duplicate(string): from collections import OrderedDict result = ' '.join(OrderedDict((w,w) for w in string.split()).keys()) return result
transformation_rename_variable_cb
def remove_duplicate(string): from collections import OrderedDict result = " ".join(OrderedDict((key, key) for key in string.split()).keys()) return result
1
671
mbpp
def remove_duplicate(string): from collections import OrderedDict result = ' '.join(OrderedDict((w,w) for w in string.split()).keys()) return result
transformation_rename_variable_naive
def remove_duplicate(string): from collections import OrderedDict result = " ".join(OrderedDict((VAR_0, VAR_0) for VAR_0 in string.split()).keys()) return result
1
671
mbpp
def remove_duplicate(string): from collections import OrderedDict result = ' '.join(OrderedDict((w,w) for w in string.split()).keys()) return result
transformation_rename_variable_rn
def remove_duplicate(string): from collections import OrderedDict result = " ".join(OrderedDict((z, z) for z in string.split()).keys()) return result
1
671
mbpp
def remove_duplicate(string): from collections import OrderedDict result = ' '.join(OrderedDict((w,w) for w in string.split()).keys()) 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
671
mbpp
def remove_duplicate(string): from collections import OrderedDict result = ' '.join(OrderedDict((w,w) for w in string.split()).keys()) 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
671
mbpp
def remove_duplicate(string): from collections import OrderedDict result = ' '.join(OrderedDict((w,w) for w in string.split()).keys()) 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
671
mbpp
def remove_duplicate(string): from collections import OrderedDict result = ' '.join(OrderedDict((w,w) for w in string.split()).keys()) 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
671
mbpp
def remove_duplicate(string): from collections import OrderedDict result = ' '.join(OrderedDict((w,w) for w in string.split()).keys()) 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
671
mbpp
def remove_extra_char(text1): import re pattern = re.compile('[\W_]+') return (pattern.sub('', text1))
transformation_dead_code_insert
def remove_extra_char(text1): import re for _i_4 in range(0): pattern = re.compile("[W_]+") pattern = re.compile("[W_]+") return pattern.sub("", text1)
1
673
mbpp
def remove_extra_char(text1): import re pattern = re.compile('[\W_]+') return (pattern.sub('', text1))
transformation_for_while_loop
def remove_extra_char(text1): import re pattern = re.compile("[W_]+") return pattern.sub("", text1)
1
673
mbpp
def remove_extra_char(text1): import re pattern = re.compile('[\W_]+') return (pattern.sub('', text1))
transformation_operand_swap
def remove_extra_char(text1): import re pattern = re.compile("[W_]+") return pattern.sub("", text1)
1
673
mbpp
def remove_extra_char(text1): import re pattern = re.compile('[\W_]+') return (pattern.sub('', text1))
transformation_rename_variable_cb
def remove_extra_char(line): import re pattern = re.compile("[W_]+") return pattern.sub("", line)
1
673
mbpp
def remove_extra_char(text1): import re pattern = re.compile('[\W_]+') return (pattern.sub('', text1))
transformation_rename_variable_naive
def remove_extra_char(text1): import re VAR_0 = re.compile("[W_]+") return VAR_0.sub("", text1)
1
673
mbpp
def remove_extra_char(text1): import re pattern = re.compile('[\W_]+') return (pattern.sub('', text1))
transformation_rename_variable_rn
def remove_extra_char(pYp58): import re pattern = re.compile("[W_]+") return pattern.sub("", pYp58)
1
673
mbpp
def remove_extra_char(text1): import re pattern = re.compile('[\W_]+') return (pattern.sub('', text1))
transformation_add_sub_variable
def remove_extra_char(text1): import re pattern = re.compile('[\W_]-') return (pattern.sub('', text1))
0
673
mbpp
def remove_extra_char(text1): import re pattern = re.compile('[\W_]+') return (pattern.sub('', 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
673
mbpp
def remove_extra_char(text1): import re pattern = re.compile('[\W_]+') return (pattern.sub('', text1))
transformation_dissimilar_code_injection_1
def similar_elements(test_tup1, test_tup2): res = tuple(set(test_tup1) & set(test_tup2)) return (res)
0
673
mbpp
def remove_extra_char(text1): import re pattern = re.compile('[\W_]+') return (pattern.sub('', 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
673
mbpp
def remove_extra_char(text1): import re pattern = re.compile('[\W_]+') return (pattern.sub('', 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
673
mbpp
def remove_extra_char(text1): import re pattern = re.compile('[\W_]+') return (pattern.sub('', 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
673
mbpp
def validity_triangle(a,b,c): total = a + b + c if total == 180: return True else: return False
transformation_dead_code_insert
def validity_triangle(a, b, c): while False: return False total = a + b + c if total == 180: return True else: return False
1
674
mbpp
def validity_triangle(a,b,c): total = a + b + c if total == 180: return True else: return False
transformation_for_while_loop
def validity_triangle(a, b, c): total = a + b + c if total == 180: return True else: return False
1
674
mbpp
def validity_triangle(a,b,c): total = a + b + c if total == 180: return True else: return False
transformation_operand_swap
def validity_triangle(a, b, c): total = a + b + c if 180 == total: return True else: return False
1
674
mbpp
def validity_triangle(a,b,c): total = a + b + c if total == 180: return True else: return False
transformation_rename_variable_cb
def validity_triangle(a, b, c): angle = a + b + c if angle == 180: return True else: return False
1
674
mbpp
def validity_triangle(a,b,c): total = a + b + c if total == 180: return True else: return False
transformation_rename_variable_naive
def validity_triangle(VAR_0, b, c): total = VAR_0 + b + c if total == 180: return True else: return False
1
674
mbpp
def validity_triangle(a,b,c): total = a + b + c if total == 180: return True else: return False
transformation_rename_variable_rn
def validity_triangle(a, b, g): total = a + b + g if total == 180: return True else: return False
1
674
mbpp
def validity_triangle(a,b,c): total = a + b + c if total == 180: return True else: return False
transformation_add_sub_variable
def validity_triangle(a,b,c): total = a - b + c if total == 180: return True else: return False
0
674
mbpp
def validity_triangle(a,b,c): total = a + b + c if total == 180: return True else: return False
transformation_equalto_exclamation_variable
def validity_triangle(a,b,c): total = a + b + c if total != 180: return True else: return False
0
674
mbpp
def validity_triangle(a,b,c): total = a + b + c if total == 180: return True else: return False
transformation_true_false_variable
def validity_triangle(a,b,c): total = a + b + c if total == 180: return False else: return False
0
674
mbpp
def validity_triangle(a,b,c): total = a + b + c if total == 180: return True else: return False
transformation_false_true_variable
def validity_triangle(a,b,c): total = a + b + c if total == 180: return True else: return True
0
674
mbpp
def validity_triangle(a,b,c): total = a + b + c if total == 180: return True else: return False
transformation_dissimilar_code_injection_0
def min_cost(cost, m, n): R = 3 C = 3 tc = [[0 for x in range(C)] for x in range(R)] tc[0][0] = cost[0][0] for i in range(1, m+1): tc[i][0] = tc[i-1][0] + cost[i][0] for j in range(1, n+1): tc[0][j] = tc[0][j-1] + cost[0][j] for i in range(1, m+1): for j in range(1, n+1): tc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j] return tc[m][n]
0
674
mbpp
def validity_triangle(a,b,c): total = a + b + c if total == 180: return True else: return False
transformation_dissimilar_code_injection_1
def similar_elements(test_tup1, test_tup2): res = tuple(set(test_tup1) & set(test_tup2)) return (res)
0
674
mbpp
def validity_triangle(a,b,c): total = a + b + c if total == 180: return True else: return False
transformation_dissimilar_code_injection_2
def is_not_prime(n): import math result = False for i in range(2,int(math.sqrt(n)) + 1): if n % i == 0: result = True return result
0
674
mbpp
def validity_triangle(a,b,c): total = a + b + c if total == 180: return True else: return False
transformation_dissimilar_code_injection_3
def heap_queue_largest(nums,n): import heapq as hq largest_nums = hq.nlargest(n, nums) return largest_nums
0
674
mbpp
def validity_triangle(a,b,c): total = a + b + c if total == 180: return True else: return False
transformation_dissimilar_code_injection_4
def count_ways(n): A = [0] * (n + 1) B = [0] * (n + 1) A[0] = 1 A[1] = 0 B[0] = 0 B[1] = 1 for i in range(2, n+1): A[i] = A[i - 2] + 2 * B[i - 1] B[i] = A[i - 1] + B[i - 2] return A[n]
0
674
mbpp
def access_key(ditionary,key): return list(ditionary)[key]
transformation_dead_code_insert
def access_key(ditionary, key): _i_0 = 0 while _i_0 < _i_0: return list(ditionary)[key] return list(ditionary)[key]
1
676
mbpp
def access_key(ditionary,key): return list(ditionary)[key]
transformation_for_while_loop
def access_key(ditionary, key): return list(ditionary)[key]
1
676
mbpp
def access_key(ditionary,key): return list(ditionary)[key]
transformation_operand_swap
def access_key(ditionary, key): return list(ditionary)[key]
1
676
mbpp
def access_key(ditionary,key): return list(ditionary)[key]
transformation_rename_variable_cb
def access_key(obj, key): return list(obj)[key]
1
676
mbpp
def access_key(ditionary,key): return list(ditionary)[key]
transformation_rename_variable_naive
def access_key(ditionary, VAR_0): return list(ditionary)[VAR_0]
1
676
mbpp
def access_key(ditionary,key): return list(ditionary)[key]
transformation_rename_variable_rn
def access_key(z5r9K20WF, key): return list(z5r9K20WF)[key]
1
676
mbpp
def access_key(ditionary,key): return list(ditionary)[key]
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
676
mbpp
def access_key(ditionary,key): return list(ditionary)[key]
transformation_dissimilar_code_injection_1
def similar_elements(test_tup1, test_tup2): res = tuple(set(test_tup1) & set(test_tup2)) return (res)
0
676
mbpp
def access_key(ditionary,key): return list(ditionary)[key]
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
676
mbpp
def access_key(ditionary,key): return list(ditionary)[key]
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
676
mbpp
def access_key(ditionary,key): return list(ditionary)[key]
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
676
mbpp
def sum_Square(n) : i = 1 while i*i <= n : j = 1 while (j*j <= n) : if (i*i+j*j == n) : return True j = j+1 i = i+1 return False
transformation_dead_code_insert
def sum_Square(n): i = 1 while i * i <= n: _i_3 = 0 while _i_3 < _i_3: i = i + 1 j = 1 while j * j <= n: if i * i + j * j == n: return True j = j + 1 i = i + 1 return False
1
680
mbpp
def sum_Square(n) : i = 1 while i*i <= n : j = 1 while (j*j <= n) : if (i*i+j*j == n) : return True j = j+1 i = i+1 return False
transformation_for_while_loop
def sum_Square(n): i = 1 while i * i <= n: j = 1 while j * j <= n: if i * i + j * j == n: return True j = j + 1 i = i + 1 return False
1
680
mbpp
def sum_Square(n) : i = 1 while i*i <= n : j = 1 while (j*j <= n) : if (i*i+j*j == n) : return True j = j+1 i = i+1 return False
transformation_operand_swap
def sum_Square(n): i = 1 while n >= i * i: j = 1 while j * j <= n: if i * i + j * j == n: return True j = j + 1 i = i + 1 return False
1
680
mbpp
def sum_Square(n) : i = 1 while i*i <= n : j = 1 while (j*j <= n) : if (i*i+j*j == n) : return True j = j+1 i = i+1 return False
transformation_rename_variable_cb
def sum_Square(n): j2 = 1 while j2 * j2 <= n: j = 1 while j * j <= n: if j2 * j2 + j * j == n: return True j = j + 1 j2 = j2 + 1 return False
1
680
mbpp
def sum_Square(n) : i = 1 while i*i <= n : j = 1 while (j*j <= n) : if (i*i+j*j == n) : return True j = j+1 i = i+1 return False
transformation_rename_variable_naive
def sum_Square(n): i = 1 while i * i <= n: VAR_0 = 1 while VAR_0 * VAR_0 <= n: if i * i + VAR_0 * VAR_0 == n: return True VAR_0 = VAR_0 + 1 i = i + 1 return False
1
680
mbpp
def sum_Square(n) : i = 1 while i*i <= n : j = 1 while (j*j <= n) : if (i*i+j*j == n) : return True j = j+1 i = i+1 return False
transformation_rename_variable_rn
def sum_Square(n): i = 1 while i * i <= n: n2 = 1 while n2 * n2 <= n: if i * i + n2 * n2 == n: return True n2 = n2 + 1 i = i + 1 return False
1
680
mbpp
def sum_Square(n) : i = 1 while i*i <= n : j = 1 while (j*j <= n) : if (i*i+j*j == n) : return True j = j+1 i = i+1 return False
transformation_add_sub_variable
def sum_Square(n) : i = 1 while i*i <= n : j = 1 while (j*j <= n) : if (i*i-j*j == n) : return True j = j+1 i = i+1 return False
0
680
mbpp
def sum_Square(n) : i = 1 while i*i <= n : j = 1 while (j*j <= n) : if (i*i+j*j == n) : return True j = j+1 i = i+1 return False
transformation_mul_div_variable
def sum_Square(n) : i = 1 while i/i <= n : j = 1 while (j*j <= n) : if (i*i+j*j == n) : return True j = j+1 i = i+1 return False
0
680
mbpp
def sum_Square(n) : i = 1 while i*i <= n : j = 1 while (j*j <= n) : if (i*i+j*j == n) : return True j = j+1 i = i+1 return False
transformation_lesser_greater_variable
def sum_Square(n) : i = 1 while i*i >= n : j = 1 while (j*j <= n) : if (i*i+j*j == n) : return True j = j+1 i = i+1 return False
0
680
mbpp
def sum_Square(n) : i = 1 while i*i <= n : j = 1 while (j*j <= n) : if (i*i+j*j == n) : return True j = j+1 i = i+1 return False
transformation_equalto_exclamation_variable
def sum_Square(n) : i = 1 while i*i <= n : j = 1 while (j*j <= n) : if (i*i+j*j != n) : return True j = j+1 i = i+1 return False
0
680
mbpp
def sum_Square(n) : i = 1 while i*i <= n : j = 1 while (j*j <= n) : if (i*i+j*j == n) : return True j = j+1 i = i+1 return False
transformation_true_false_variable
def sum_Square(n) : i = 1 while i*i <= n : j = 1 while (j*j <= n) : if (i*i+j*j == n) : return False j = j+1 i = i+1 return False
0
680
mbpp
def sum_Square(n) : i = 1 while i*i <= n : j = 1 while (j*j <= n) : if (i*i+j*j == n) : return True j = j+1 i = i+1 return False
transformation_false_true_variable
def sum_Square(n) : i = 1 while i*i <= n : j = 1 while (j*j <= n) : if (i*i+j*j == n) : return True j = j+1 i = i+1 return True
0
680
mbpp
def sum_Square(n) : i = 1 while i*i <= n : j = 1 while (j*j <= n) : if (i*i+j*j == n) : return True j = j+1 i = i+1 return False
transformation_dissimilar_code_injection_0
def min_cost(cost, m, n): R = 3 C = 3 tc = [[0 for x in range(C)] for x in range(R)] tc[0][0] = cost[0][0] for i in range(1, m+1): tc[i][0] = tc[i-1][0] + cost[i][0] for j in range(1, n+1): tc[0][j] = tc[0][j-1] + cost[0][j] for i in range(1, m+1): for j in range(1, n+1): tc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j] return tc[m][n]
0
680
mbpp
def sum_Square(n) : i = 1 while i*i <= n : j = 1 while (j*j <= n) : if (i*i+j*j == n) : return True j = j+1 i = i+1 return False
transformation_dissimilar_code_injection_1
def similar_elements(test_tup1, test_tup2): res = tuple(set(test_tup1) & set(test_tup2)) return (res)
0
680
mbpp
def sum_Square(n) : i = 1 while i*i <= n : j = 1 while (j*j <= n) : if (i*i+j*j == n) : return True j = j+1 i = i+1 return False
transformation_dissimilar_code_injection_2
def is_not_prime(n): import math result = False for i in range(2,int(math.sqrt(n)) + 1): if n % i == 0: result = True return result
0
680
mbpp
def sum_Square(n) : i = 1 while i*i <= n : j = 1 while (j*j <= n) : if (i*i+j*j == n) : return True j = j+1 i = i+1 return False
transformation_dissimilar_code_injection_3
def heap_queue_largest(nums,n): import heapq as hq largest_nums = hq.nlargest(n, nums) return largest_nums
0
680
mbpp
def sum_Square(n) : i = 1 while i*i <= n : j = 1 while (j*j <= n) : if (i*i+j*j == n) : return True j = j+1 i = i+1 return False
transformation_dissimilar_code_injection_4
def count_ways(n): A = [0] * (n + 1) B = [0] * (n + 1) A[0] = 1 A[1] = 0 B[0] = 0 B[1] = 1 for i in range(2, n+1): A[i] = A[i - 2] + 2 * B[i - 1] B[i] = A[i - 1] + B[i - 2] return A[n]
0
680
mbpp
def count_Char(str,x): count = 0 for i in range(len(str)): if (str[i] == x) : count += 1 n = 10 repititions = n // len(str) count = count * repititions l = n % len(str) for i in range(l): if (str[i] == x): count += 1 return count
transformation_dead_code_insert
def count_Char(str, x): count = 0 for i in range(len(str)): if str[i] == x: for _i_5 in range(0): for i in range(l): if str[i] == x: count += 1 count += 1 n = 10 repititions = n // len(str) count = count * repititions l = n % len(str) for i in range(l): if str[i] == x: count += 1 return count
1
681
mbpp
def count_Char(str,x): count = 0 for i in range(len(str)): if (str[i] == x) : count += 1 n = 10 repititions = n // len(str) count = count * repititions l = n % len(str) for i in range(l): if (str[i] == x): count += 1 return count
transformation_for_while_loop
def count_Char(str, x): count = 0 i = 0 while i < len(str): if str[i] == x: count += 1 i += 1 n = 10 repititions = n // len(str) count = count * repititions l = n % len(str) for i in range(l): if str[i] == x: count += 1 return count
1
681
mbpp
def count_Char(str,x): count = 0 for i in range(len(str)): if (str[i] == x) : count += 1 n = 10 repititions = n // len(str) count = count * repititions l = n % len(str) for i in range(l): if (str[i] == x): count += 1 return count
transformation_operand_swap
def count_Char(str, x): count = 0 for i in range(len(str)): if x == str[i]: count += 1 n = 10 repititions = n // len(str) count = count * repititions l = n % len(str) for i in range(l): if str[i] == x: count += 1 return count
1
681
mbpp
def count_Char(str,x): count = 0 for i in range(len(str)): if (str[i] == x) : count += 1 n = 10 repititions = n // len(str) count = count * repititions l = n % len(str) for i in range(l): if (str[i] == x): count += 1 return count
transformation_rename_variable_cb
def count_Char(str, x): n2 = 0 for i in range(len(str)): if str[i] == x: n2 += 1 n = 10 repititions = n // len(str) n2 = n2 * repititions l = n % len(str) for i in range(l): if str[i] == x: n2 += 1 return n2
1
681
mbpp
def count_Char(str,x): count = 0 for i in range(len(str)): if (str[i] == x) : count += 1 n = 10 repititions = n // len(str) count = count * repititions l = n % len(str) for i in range(l): if (str[i] == x): count += 1 return count
transformation_rename_variable_naive
def count_Char(str, x): VAR_0 = 0 for i in range(len(str)): if str[i] == x: VAR_0 += 1 n = 10 repititions = n // len(str) VAR_0 = VAR_0 * repititions l = n % len(str) for i in range(l): if str[i] == x: VAR_0 += 1 return VAR_0
1
681
mbpp
def count_Char(str,x): count = 0 for i in range(len(str)): if (str[i] == x) : count += 1 n = 10 repititions = n // len(str) count = count * repititions l = n % len(str) for i in range(l): if (str[i] == x): count += 1 return count
transformation_rename_variable_rn
def count_Char(str, x): Kuvkx = 0 for i in range(len(str)): if str[i] == x: Kuvkx += 1 n = 10 repititions = n // len(str) Kuvkx = Kuvkx * repititions l = n % len(str) for i in range(l): if str[i] == x: Kuvkx += 1 return Kuvkx
1
681
mbpp
def count_Char(str,x): count = 0 for i in range(len(str)): if (str[i] == x) : count += 1 n = 10 repititions = n // len(str) count = count * repititions l = n % len(str) for i in range(l): if (str[i] == x): count += 1 return count
transformation_add_sub_variable
def count_Char(str,x): count = 0 for i in range(len(str)): if (str[i] == x) : count -= 1 n = 10 repititions = n // len(str) count = count * repititions l = n % len(str) for i in range(l): if (str[i] == x): count += 1 return count
0
681
mbpp
def count_Char(str,x): count = 0 for i in range(len(str)): if (str[i] == x) : count += 1 n = 10 repititions = n // len(str) count = count * repititions l = n % len(str) for i in range(l): if (str[i] == x): count += 1 return count
transformation_mul_div_variable
def count_Char(str,x): count = 0 for i in range(len(str)): if (str[i] == x) : count += 1 n = 10 repititions = n // len(str) count = count / repititions l = n % len(str) for i in range(l): if (str[i] == x): count += 1 return count
0
681
mbpp