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 find_rect_num(n):
return n*(n + 1) | transformation_dissimilar_code_injection_4 | def count_ways(n):
A = [0] * (n + 1)
B = [0] * (n + 1)
A[0] = 1
A[1] = 0
B[0] = 0
B[1] = 1
for i in range(2, n+1):
A[i] = A[i - 2] + 2 * B[i - 1]
B[i] = A[i - 1] + B[i - 2]
return A[n] | 0 | 34 | mbpp |
def find_Nth_Digit(p,q,N) :
while (N > 0) :
N -= 1;
p *= 10;
res = p // q;
p %= q;
return res; | transformation_dead_code_insert | def find_Nth_Digit(p, q, N):
while N > 0:
N -= 1
_i_5 = 0
while _i_5 > _i_5:
N -= 1
p *= 10
res = p // q
p %= q
return res | 1 | 35 | mbpp |
def find_Nth_Digit(p,q,N) :
while (N > 0) :
N -= 1;
p *= 10;
res = p // q;
p %= q;
return res; | transformation_for_while_loop | def find_Nth_Digit(p, q, N):
while N > 0:
N -= 1
p *= 10
res = p // q
p %= q
return res | 1 | 35 | mbpp |
def find_Nth_Digit(p,q,N) :
while (N > 0) :
N -= 1;
p *= 10;
res = p // q;
p %= q;
return res; | transformation_operand_swap | def find_Nth_Digit(p, q, N):
while 0 < N:
N -= 1
p *= 10
res = p // q
p %= q
return res | 1 | 35 | mbpp |
def find_Nth_Digit(p,q,N) :
while (N > 0) :
N -= 1;
p *= 10;
res = p // q;
p %= q;
return res; | transformation_rename_variable_naive | def find_Nth_Digit(VAR_0, q, N):
while N > 0:
N -= 1
VAR_0 *= 10
res = VAR_0 // q
VAR_0 %= q
return res | 1 | 35 | mbpp |
def find_Nth_Digit(p,q,N) :
while (N > 0) :
N -= 1;
p *= 10;
res = p // q;
p %= q;
return res; | transformation_rename_variable_rn | def find_Nth_Digit(R, q, N):
while N > 0:
N -= 1
R *= 10
res = R // q
R %= q
return res | 1 | 35 | mbpp |
def find_Nth_Digit(p,q,N) :
while (N > 0) :
N -= 1;
p *= 10;
res = p // q;
p %= q;
return res; | transformation_sub_add_variable | def find_Nth_Digit(p,q,N) :
while (N > 0) :
N += 1;
p *= 10;
res = p // q;
p %= q;
return res; | 0 | 35 | mbpp |
def find_Nth_Digit(p,q,N) :
while (N > 0) :
N -= 1;
p *= 10;
res = p // q;
p %= q;
return res; | transformation_mul_div_variable | def find_Nth_Digit(p,q,N) :
while (N > 0) :
N -= 1;
p /= 10;
res = p // q;
p %= q;
return res; | 0 | 35 | mbpp |
def find_Nth_Digit(p,q,N) :
while (N > 0) :
N -= 1;
p *= 10;
res = p // q;
p %= q;
return res; | transformation_div_mul_variable | def find_Nth_Digit(p,q,N) :
while (N > 0) :
N -= 1;
p *= 10;
res = p */ q;
p %= q;
return res; | 0 | 35 | mbpp |
def find_Nth_Digit(p,q,N) :
while (N > 0) :
N -= 1;
p *= 10;
res = p // q;
p %= q;
return res; | transformation_greater_lesser_variable | def find_Nth_Digit(p,q,N) :
while (N < 0) :
N -= 1;
p *= 10;
res = p // q;
p %= q;
return res; | 0 | 35 | mbpp |
def find_Nth_Digit(p,q,N) :
while (N > 0) :
N -= 1;
p *= 10;
res = p // q;
p %= q;
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 | 35 | mbpp |
def find_Nth_Digit(p,q,N) :
while (N > 0) :
N -= 1;
p *= 10;
res = p // q;
p %= q;
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 | 35 | mbpp |
def find_Nth_Digit(p,q,N) :
while (N > 0) :
N -= 1;
p *= 10;
res = p // q;
p %= q;
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 | 35 | mbpp |
def find_Nth_Digit(p,q,N) :
while (N > 0) :
N -= 1;
p *= 10;
res = p // q;
p %= q;
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 | 35 | mbpp |
def find_Nth_Digit(p,q,N) :
while (N > 0) :
N -= 1;
p *= 10;
res = p // q;
p %= q;
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 | 35 | mbpp |
def sort_mixed_list(mixed_list):
int_part = sorted([i for i in mixed_list if type(i) is int])
str_part = sorted([i for i in mixed_list if type(i) is str])
return int_part + str_part | transformation_dead_code_insert | def sort_mixed_list(mixed_list):
_i_4 = 0
while _i_4 > _i_4:
return int_part + str_part
int_part = sorted([i for i in mixed_list if type(i) is int])
str_part = sorted([i for i in mixed_list if type(i) is str])
return int_part + str_part | 1 | 36 | mbpp |
def sort_mixed_list(mixed_list):
int_part = sorted([i for i in mixed_list if type(i) is int])
str_part = sorted([i for i in mixed_list if type(i) is str])
return int_part + str_part | transformation_for_while_loop | def sort_mixed_list(mixed_list):
int_part = sorted([i for i in mixed_list if type(i) is int])
str_part = sorted([i for i in mixed_list if type(i) is str])
return int_part + str_part | 1 | 36 | mbpp |
def sort_mixed_list(mixed_list):
int_part = sorted([i for i in mixed_list if type(i) is int])
str_part = sorted([i for i in mixed_list if type(i) is str])
return int_part + str_part | transformation_operand_swap | def sort_mixed_list(mixed_list):
int_part = sorted([i for i in mixed_list if type(i) is int])
str_part = sorted([i for i in mixed_list if type(i) is str])
return int_part + str_part | 1 | 36 | mbpp |
def sort_mixed_list(mixed_list):
int_part = sorted([i for i in mixed_list if type(i) is int])
str_part = sorted([i for i in mixed_list if type(i) is str])
return int_part + str_part | transformation_rename_variable_cb | def sort_mixed_list(mixed_list):
int_part = sorted([s for s in mixed_list if type(s) is int])
str_part = sorted([s for s in mixed_list if type(s) is str])
return int_part + str_part | 1 | 36 | mbpp |
def sort_mixed_list(mixed_list):
int_part = sorted([i for i in mixed_list if type(i) is int])
str_part = sorted([i for i in mixed_list if type(i) is str])
return int_part + str_part | transformation_rename_variable_naive | def sort_mixed_list(mixed_list):
int_part = sorted([VAR_0 for VAR_0 in mixed_list if type(VAR_0) is int])
str_part = sorted([VAR_0 for VAR_0 in mixed_list if type(VAR_0) is str])
return int_part + str_part | 1 | 36 | mbpp |
def sort_mixed_list(mixed_list):
int_part = sorted([i for i in mixed_list if type(i) is int])
str_part = sorted([i for i in mixed_list if type(i) is str])
return int_part + str_part | transformation_rename_variable_rn | def sort_mixed_list(mixed_list):
int_part = sorted([s for s in mixed_list if type(s) is int])
str_part = sorted([s for s in mixed_list if type(s) is str])
return int_part + str_part | 1 | 36 | mbpp |
def sort_mixed_list(mixed_list):
int_part = sorted([i for i in mixed_list if type(i) is int])
str_part = sorted([i for i in mixed_list if type(i) is str])
return int_part + str_part | transformation_add_sub_variable | def sort_mixed_list(mixed_list):
int_part = sorted([i for i in mixed_list if type(i) is int])
str_part = sorted([i for i in mixed_list if type(i) is str])
return int_part - str_part | 0 | 36 | mbpp |
def sort_mixed_list(mixed_list):
int_part = sorted([i for i in mixed_list if type(i) is int])
str_part = sorted([i for i in mixed_list if type(i) is str])
return int_part + str_part | transformation_is_isnot_variable | def sort_mixed_list(mixed_list):
int_part = sorted([i for i in mixed_list if type(i) is not int])
str_part = sorted([i for i in mixed_list if type(i) is str])
return int_part + str_part | 0 | 36 | mbpp |
def sort_mixed_list(mixed_list):
int_part = sorted([i for i in mixed_list if type(i) is int])
str_part = sorted([i for i in mixed_list if type(i) is str])
return int_part + str_part | 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 | 36 | mbpp |
def sort_mixed_list(mixed_list):
int_part = sorted([i for i in mixed_list if type(i) is int])
str_part = sorted([i for i in mixed_list if type(i) is str])
return int_part + str_part | transformation_dissimilar_code_injection_1 | def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res) | 0 | 36 | mbpp |
def sort_mixed_list(mixed_list):
int_part = sorted([i for i in mixed_list if type(i) is int])
str_part = sorted([i for i in mixed_list if type(i) is str])
return int_part + str_part | 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 | 36 | mbpp |
def sort_mixed_list(mixed_list):
int_part = sorted([i for i in mixed_list if type(i) is int])
str_part = sorted([i for i in mixed_list if type(i) is str])
return int_part + str_part | 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 | 36 | mbpp |
def sort_mixed_list(mixed_list):
int_part = sorted([i for i in mixed_list if type(i) is int])
str_part = sorted([i for i in mixed_list if type(i) is str])
return int_part + str_part | 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 | 36 | mbpp |
def div_even_odd(list1):
first_even = next((el for el in list1 if el%2==0),-1)
first_odd = next((el for el in list1 if el%2!=0),-1)
return (first_even/first_odd) | transformation_dead_code_insert | def div_even_odd(list1):
_i_1 = 0
while _i_1 > _i_1:
first_even = next((el for el in list1 if el % 2 == 0), -1)
first_even = next((el for el in list1 if el % 2 == 0), -1)
first_odd = next((el for el in list1 if el % 2 != 0), -1)
return first_even / first_odd | 1 | 37 | mbpp |
def div_even_odd(list1):
first_even = next((el for el in list1 if el%2==0),-1)
first_odd = next((el for el in list1 if el%2!=0),-1)
return (first_even/first_odd) | transformation_for_while_loop | def div_even_odd(list1):
first_even = next((el for el in list1 if el % 2 == 0), -1)
first_odd = next((el for el in list1 if el % 2 != 0), -1)
return first_even / first_odd | 1 | 37 | mbpp |
def div_even_odd(list1):
first_even = next((el for el in list1 if el%2==0),-1)
first_odd = next((el for el in list1 if el%2!=0),-1)
return (first_even/first_odd) | transformation_operand_swap | def div_even_odd(list1):
first_even = next((el for el in list1 if 0 == el % 2), -1)
first_odd = next((el for el in list1 if el % 2 != 0), -1)
return first_even / first_odd | 1 | 37 | mbpp |
def div_even_odd(list1):
first_even = next((el for el in list1 if el%2==0),-1)
first_odd = next((el for el in list1 if el%2!=0),-1)
return (first_even/first_odd) | transformation_rename_variable_cb | def div_even_odd(list1):
first_even = next((i for i in list1 if i % 2 == 0), -1)
first_odd = next((i for i in list1 if i % 2 != 0), -1)
return first_even / first_odd | 1 | 37 | mbpp |
def div_even_odd(list1):
first_even = next((el for el in list1 if el%2==0),-1)
first_odd = next((el for el in list1 if el%2!=0),-1)
return (first_even/first_odd) | transformation_rename_variable_naive | def div_even_odd(list1):
first_even = next((VAR_0 for VAR_0 in list1 if VAR_0 % 2 == 0), -1)
first_odd = next((VAR_0 for VAR_0 in list1 if VAR_0 % 2 != 0), -1)
return first_even / first_odd | 1 | 37 | mbpp |
def div_even_odd(list1):
first_even = next((el for el in list1 if el%2==0),-1)
first_odd = next((el for el in list1 if el%2!=0),-1)
return (first_even/first_odd) | transformation_rename_variable_rn | def div_even_odd(list1):
first_even = next((r0 for r0 in list1 if r0 % 2 == 0), -1)
first_odd = next((r0 for r0 in list1 if r0 % 2 != 0), -1)
return first_even / first_odd | 1 | 37 | mbpp |
def div_even_odd(list1):
first_even = next((el for el in list1 if el%2==0),-1)
first_odd = next((el for el in list1 if el%2!=0),-1)
return (first_even/first_odd) | transformation_sub_add_variable | def div_even_odd(list1):
first_even = next((el for el in list1 if el%2==0),+1)
first_odd = next((el for el in list1 if el%2!=0),-1)
return (first_even/first_odd) | 0 | 37 | mbpp |
def div_even_odd(list1):
first_even = next((el for el in list1 if el%2==0),-1)
first_odd = next((el for el in list1 if el%2!=0),-1)
return (first_even/first_odd) | transformation_div_mul_variable | def div_even_odd(list1):
first_even = next((el for el in list1 if el%2==0),-1)
first_odd = next((el for el in list1 if el%2!=0),-1)
return (first_even*first_odd) | 0 | 37 | mbpp |
def div_even_odd(list1):
first_even = next((el for el in list1 if el%2==0),-1)
first_odd = next((el for el in list1 if el%2!=0),-1)
return (first_even/first_odd) | transformation_equalto_exclamation_variable | def div_even_odd(list1):
first_even = next((el for el in list1 if el%2!=0),-1)
first_odd = next((el for el in list1 if el%2!=0),-1)
return (first_even/first_odd) | 0 | 37 | mbpp |
def div_even_odd(list1):
first_even = next((el for el in list1 if el%2==0),-1)
first_odd = next((el for el in list1 if el%2!=0),-1)
return (first_even/first_odd) | transformation_exclamation_equalto_variable | def div_even_odd(list1):
first_even = next((el for el in list1 if el%2==0),-1)
first_odd = next((el for el in list1 if el%2==0),-1)
return (first_even/first_odd) | 0 | 37 | mbpp |
def div_even_odd(list1):
first_even = next((el for el in list1 if el%2==0),-1)
first_odd = next((el for el in list1 if el%2!=0),-1)
return (first_even/first_odd) | 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 | 37 | mbpp |
def div_even_odd(list1):
first_even = next((el for el in list1 if el%2==0),-1)
first_odd = next((el for el in list1 if el%2!=0),-1)
return (first_even/first_odd) | transformation_dissimilar_code_injection_1 | def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res) | 0 | 37 | mbpp |
def div_even_odd(list1):
first_even = next((el for el in list1 if el%2==0),-1)
first_odd = next((el for el in list1 if el%2!=0),-1)
return (first_even/first_odd) | 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 | 37 | mbpp |
def div_even_odd(list1):
first_even = next((el for el in list1 if el%2==0),-1)
first_odd = next((el for el in list1 if el%2!=0),-1)
return (first_even/first_odd) | 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 | 37 | mbpp |
def div_even_odd(list1):
first_even = next((el for el in list1 if el%2==0),-1)
first_odd = next((el for el in list1 if el%2!=0),-1)
return (first_even/first_odd) | 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 | 37 | mbpp |
def rearange_string(S):
import heapq
from collections import Counter
ctr = Counter(S)
heap = [(-value, key) for key, value in ctr.items()]
heapq.heapify(heap)
if (-heap[0][0]) * 2 > len(S) + 1:
return ""
ans = []
while len(heap) >= 2:
nct1, char1 = heapq.heappop(heap)
nct2, char2 = heapq.heappop(heap)
ans.extend([char1, char2])
if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1))
if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2))
return "".join(ans) + (heap[0][1] if heap else "") | transformation_dead_code_insert | def rearange_string(S):
import heapq
from collections import Counter
ctr = Counter(S)
_i_6 = 0
while _i_6 < _i_6:
ctr = Counter(S)
heap = [(-value, key) for key, value in ctr.items()]
heapq.heapify(heap)
if (-heap[0][0]) * 2 > len(S) + 1:
return ""
ans = []
while len(heap) >= 2:
nct1, char1 = heapq.heappop(heap)
nct2, char2 = heapq.heappop(heap)
ans.extend([char1, char2])
if nct1 + 1:
heapq.heappush(heap, (nct1 + 1, char1))
if nct2 + 1:
heapq.heappush(heap, (nct2 + 1, char2))
return "".join(ans) + (heap[0][1] if heap else "") | 1 | 38 | mbpp |
def rearange_string(S):
import heapq
from collections import Counter
ctr = Counter(S)
heap = [(-value, key) for key, value in ctr.items()]
heapq.heapify(heap)
if (-heap[0][0]) * 2 > len(S) + 1:
return ""
ans = []
while len(heap) >= 2:
nct1, char1 = heapq.heappop(heap)
nct2, char2 = heapq.heappop(heap)
ans.extend([char1, char2])
if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1))
if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2))
return "".join(ans) + (heap[0][1] if heap else "") | transformation_for_while_loop | def rearange_string(S):
import heapq
from collections import Counter
ctr = Counter(S)
heap = [(-value, key) for key, value in ctr.items()]
heapq.heapify(heap)
if (-heap[0][0]) * 2 > len(S) + 1:
return ""
ans = []
while len(heap) >= 2:
nct1, char1 = heapq.heappop(heap)
nct2, char2 = heapq.heappop(heap)
ans.extend([char1, char2])
if nct1 + 1:
heapq.heappush(heap, (nct1 + 1, char1))
if nct2 + 1:
heapq.heappush(heap, (nct2 + 1, char2))
return "".join(ans) + (heap[0][1] if heap else "") | 1 | 38 | mbpp |
def rearange_string(S):
import heapq
from collections import Counter
ctr = Counter(S)
heap = [(-value, key) for key, value in ctr.items()]
heapq.heapify(heap)
if (-heap[0][0]) * 2 > len(S) + 1:
return ""
ans = []
while len(heap) >= 2:
nct1, char1 = heapq.heappop(heap)
nct2, char2 = heapq.heappop(heap)
ans.extend([char1, char2])
if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1))
if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2))
return "".join(ans) + (heap[0][1] if heap else "") | transformation_operand_swap | def rearange_string(S):
import heapq
from collections import Counter
ctr = Counter(S)
heap = [(-value, key) for key, value in ctr.items()]
heapq.heapify(heap)
if len(S) + 1 < (-heap[0][0]) * 2:
return ""
ans = []
while len(heap) >= 2:
nct1, char1 = heapq.heappop(heap)
nct2, char2 = heapq.heappop(heap)
ans.extend([char1, char2])
if nct1 + 1:
heapq.heappush(heap, (nct1 + 1, char1))
if nct2 + 1:
heapq.heappush(heap, (nct2 + 1, char2))
return "".join(ans) + (heap[0][1] if heap else "") | 1 | 38 | mbpp |
def rearange_string(S):
import heapq
from collections import Counter
ctr = Counter(S)
heap = [(-value, key) for key, value in ctr.items()]
heapq.heapify(heap)
if (-heap[0][0]) * 2 > len(S) + 1:
return ""
ans = []
while len(heap) >= 2:
nct1, char1 = heapq.heappop(heap)
nct2, char2 = heapq.heappop(heap)
ans.extend([char1, char2])
if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1))
if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2))
return "".join(ans) + (heap[0][1] if heap else "") | transformation_rename_variable_cb | def rearange_string(S):
import heapq
from collections import Counter
ctr = Counter(S)
q = [(-value, key) for key, value in ctr.items()]
heapq.heapify(q)
if (-q[0][0]) * 2 > len(S) + 1:
return ""
ans = []
while len(q) >= 2:
nct1, char1 = heapq.heappop(q)
nct2, char2 = heapq.heappop(q)
ans.extend([char1, char2])
if nct1 + 1:
heapq.heappush(q, (nct1 + 1, char1))
if nct2 + 1:
heapq.heappush(q, (nct2 + 1, char2))
return "".join(ans) + (q[0][1] if q else "") | 1 | 38 | mbpp |
def rearange_string(S):
import heapq
from collections import Counter
ctr = Counter(S)
heap = [(-value, key) for key, value in ctr.items()]
heapq.heapify(heap)
if (-heap[0][0]) * 2 > len(S) + 1:
return ""
ans = []
while len(heap) >= 2:
nct1, char1 = heapq.heappop(heap)
nct2, char2 = heapq.heappop(heap)
ans.extend([char1, char2])
if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1))
if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2))
return "".join(ans) + (heap[0][1] if heap else "") | transformation_rename_variable_naive | def rearange_string(S):
import heapq
from collections import Counter
ctr = Counter(S)
VAR_0 = [(-value, key) for key, value in ctr.items()]
heapq.heapify(VAR_0)
if (-VAR_0[0][0]) * 2 > len(S) + 1:
return ""
ans = []
while len(VAR_0) >= 2:
nct1, char1 = heapq.heappop(VAR_0)
nct2, char2 = heapq.heappop(VAR_0)
ans.extend([char1, char2])
if nct1 + 1:
heapq.heappush(VAR_0, (nct1 + 1, char1))
if nct2 + 1:
heapq.heappush(VAR_0, (nct2 + 1, char2))
return "".join(ans) + (VAR_0[0][1] if VAR_0 else "") | 1 | 38 | mbpp |
def rearange_string(S):
import heapq
from collections import Counter
ctr = Counter(S)
heap = [(-value, key) for key, value in ctr.items()]
heapq.heapify(heap)
if (-heap[0][0]) * 2 > len(S) + 1:
return ""
ans = []
while len(heap) >= 2:
nct1, char1 = heapq.heappop(heap)
nct2, char2 = heapq.heappop(heap)
ans.extend([char1, char2])
if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1))
if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2))
return "".join(ans) + (heap[0][1] if heap else "") | transformation_rename_variable_rn | def rearange_string(S):
import heapq
from collections import Counter
ctr = Counter(S)
E59V = [(-value, key) for key, value in ctr.items()]
heapq.heapify(E59V)
if (-E59V[0][0]) * 2 > len(S) + 1:
return ""
ans = []
while len(E59V) >= 2:
nct1, char1 = heapq.heappop(E59V)
nct2, char2 = heapq.heappop(E59V)
ans.extend([char1, char2])
if nct1 + 1:
heapq.heappush(E59V, (nct1 + 1, char1))
if nct2 + 1:
heapq.heappush(E59V, (nct2 + 1, char2))
return "".join(ans) + (E59V[0][1] if E59V else "") | 1 | 38 | mbpp |
def rearange_string(S):
import heapq
from collections import Counter
ctr = Counter(S)
heap = [(-value, key) for key, value in ctr.items()]
heapq.heapify(heap)
if (-heap[0][0]) * 2 > len(S) + 1:
return ""
ans = []
while len(heap) >= 2:
nct1, char1 = heapq.heappop(heap)
nct2, char2 = heapq.heappop(heap)
ans.extend([char1, char2])
if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1))
if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2))
return "".join(ans) + (heap[0][1] if heap else "") | transformation_add_sub_variable | def rearange_string(S):
import heapq
from collections import Counter
ctr = Counter(S)
heap = [(-value, key) for key, value in ctr.items()]
heapq.heapify(heap)
if (-heap[0][0]) * 2 > len(S) - 1:
return ""
ans = []
while len(heap) >= 2:
nct1, char1 = heapq.heappop(heap)
nct2, char2 = heapq.heappop(heap)
ans.extend([char1, char2])
if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1))
if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2))
return "".join(ans) + (heap[0][1] if heap else "") | 0 | 38 | mbpp |
def rearange_string(S):
import heapq
from collections import Counter
ctr = Counter(S)
heap = [(-value, key) for key, value in ctr.items()]
heapq.heapify(heap)
if (-heap[0][0]) * 2 > len(S) + 1:
return ""
ans = []
while len(heap) >= 2:
nct1, char1 = heapq.heappop(heap)
nct2, char2 = heapq.heappop(heap)
ans.extend([char1, char2])
if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1))
if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2))
return "".join(ans) + (heap[0][1] if heap else "") | transformation_sub_add_variable | def rearange_string(S):
import heapq
from collections import Counter
ctr = Counter(S)
heap = [(+value, key) for key, value in ctr.items()]
heapq.heapify(heap)
if (-heap[0][0]) * 2 > len(S) + 1:
return ""
ans = []
while len(heap) >= 2:
nct1, char1 = heapq.heappop(heap)
nct2, char2 = heapq.heappop(heap)
ans.extend([char1, char2])
if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1))
if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2))
return "".join(ans) + (heap[0][1] if heap else "") | 0 | 38 | mbpp |
def rearange_string(S):
import heapq
from collections import Counter
ctr = Counter(S)
heap = [(-value, key) for key, value in ctr.items()]
heapq.heapify(heap)
if (-heap[0][0]) * 2 > len(S) + 1:
return ""
ans = []
while len(heap) >= 2:
nct1, char1 = heapq.heappop(heap)
nct2, char2 = heapq.heappop(heap)
ans.extend([char1, char2])
if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1))
if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2))
return "".join(ans) + (heap[0][1] if heap else "") | transformation_mul_div_variable | def rearange_string(S):
import heapq
from collections import Counter
ctr = Counter(S)
heap = [(-value, key) for key, value in ctr.items()]
heapq.heapify(heap)
if (-heap[0][0]) / 2 > len(S) + 1:
return ""
ans = []
while len(heap) >= 2:
nct1, char1 = heapq.heappop(heap)
nct2, char2 = heapq.heappop(heap)
ans.extend([char1, char2])
if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1))
if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2))
return "".join(ans) + (heap[0][1] if heap else "") | 0 | 38 | mbpp |
def rearange_string(S):
import heapq
from collections import Counter
ctr = Counter(S)
heap = [(-value, key) for key, value in ctr.items()]
heapq.heapify(heap)
if (-heap[0][0]) * 2 > len(S) + 1:
return ""
ans = []
while len(heap) >= 2:
nct1, char1 = heapq.heappop(heap)
nct2, char2 = heapq.heappop(heap)
ans.extend([char1, char2])
if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1))
if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2))
return "".join(ans) + (heap[0][1] if heap else "") | transformation_greater_lesser_variable | def rearange_string(S):
import heapq
from collections import Counter
ctr = Counter(S)
heap = [(-value, key) for key, value in ctr.items()]
heapq.heapify(heap)
if (-heap[0][0]) * 2 < len(S) + 1:
return ""
ans = []
while len(heap) >= 2:
nct1, char1 = heapq.heappop(heap)
nct2, char2 = heapq.heappop(heap)
ans.extend([char1, char2])
if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1))
if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2))
return "".join(ans) + (heap[0][1] if heap else "") | 0 | 38 | mbpp |
def rearange_string(S):
import heapq
from collections import Counter
ctr = Counter(S)
heap = [(-value, key) for key, value in ctr.items()]
heapq.heapify(heap)
if (-heap[0][0]) * 2 > len(S) + 1:
return ""
ans = []
while len(heap) >= 2:
nct1, char1 = heapq.heappop(heap)
nct2, char2 = heapq.heappop(heap)
ans.extend([char1, char2])
if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1))
if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2))
return "".join(ans) + (heap[0][1] if heap else "") | 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 | 38 | mbpp |
def rearange_string(S):
import heapq
from collections import Counter
ctr = Counter(S)
heap = [(-value, key) for key, value in ctr.items()]
heapq.heapify(heap)
if (-heap[0][0]) * 2 > len(S) + 1:
return ""
ans = []
while len(heap) >= 2:
nct1, char1 = heapq.heappop(heap)
nct2, char2 = heapq.heappop(heap)
ans.extend([char1, char2])
if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1))
if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2))
return "".join(ans) + (heap[0][1] if heap else "") | transformation_dissimilar_code_injection_1 | def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res) | 0 | 38 | mbpp |
def rearange_string(S):
import heapq
from collections import Counter
ctr = Counter(S)
heap = [(-value, key) for key, value in ctr.items()]
heapq.heapify(heap)
if (-heap[0][0]) * 2 > len(S) + 1:
return ""
ans = []
while len(heap) >= 2:
nct1, char1 = heapq.heappop(heap)
nct2, char2 = heapq.heappop(heap)
ans.extend([char1, char2])
if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1))
if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2))
return "".join(ans) + (heap[0][1] if heap else "") | 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 | 38 | mbpp |
def rearange_string(S):
import heapq
from collections import Counter
ctr = Counter(S)
heap = [(-value, key) for key, value in ctr.items()]
heapq.heapify(heap)
if (-heap[0][0]) * 2 > len(S) + 1:
return ""
ans = []
while len(heap) >= 2:
nct1, char1 = heapq.heappop(heap)
nct2, char2 = heapq.heappop(heap)
ans.extend([char1, char2])
if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1))
if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2))
return "".join(ans) + (heap[0][1] if heap else "") | 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 | 38 | mbpp |
def rearange_string(S):
import heapq
from collections import Counter
ctr = Counter(S)
heap = [(-value, key) for key, value in ctr.items()]
heapq.heapify(heap)
if (-heap[0][0]) * 2 > len(S) + 1:
return ""
ans = []
while len(heap) >= 2:
nct1, char1 = heapq.heappop(heap)
nct2, char2 = heapq.heappop(heap)
ans.extend([char1, char2])
if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1))
if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2))
return "".join(ans) + (heap[0][1] if heap else "") | 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 | 38 | mbpp |
def filter_evennumbers(nums):
even_nums = list(filter(lambda x: x%2 == 0, nums))
return even_nums | transformation_dead_code_insert | def filter_evennumbers(nums):
_i_9 = 0
while _i_9 > _i_9:
return even_nums
even_nums = list(filter(lambda x: x % 2 == 0, nums))
return even_nums | 1 | 40 | mbpp |
def filter_evennumbers(nums):
even_nums = list(filter(lambda x: x%2 == 0, nums))
return even_nums | transformation_for_while_loop | def filter_evennumbers(nums):
even_nums = list(filter(lambda x: x % 2 == 0, nums))
return even_nums | 1 | 40 | mbpp |
def filter_evennumbers(nums):
even_nums = list(filter(lambda x: x%2 == 0, nums))
return even_nums | transformation_operand_swap | def filter_evennumbers(nums):
even_nums = list(filter(lambda x: 0 == x % 2, nums))
return even_nums | 1 | 40 | mbpp |
def filter_evennumbers(nums):
even_nums = list(filter(lambda x: x%2 == 0, nums))
return even_nums | transformation_rename_variable_cb | def filter_evennumbers(nums):
even_nums = list(filter(lambda x2: x2 % 2 == 0, nums))
return even_nums | 1 | 40 | mbpp |
def filter_evennumbers(nums):
even_nums = list(filter(lambda x: x%2 == 0, nums))
return even_nums | transformation_rename_variable_naive | def filter_evennumbers(VAR_0):
even_nums = list(filter(lambda x: x % 2 == 0, VAR_0))
return even_nums | 1 | 40 | mbpp |
def filter_evennumbers(nums):
even_nums = list(filter(lambda x: x%2 == 0, nums))
return even_nums | transformation_rename_variable_rn | def filter_evennumbers(nums):
even_nums = list(filter(lambda d: d % 2 == 0, nums))
return even_nums | 1 | 40 | mbpp |
def filter_evennumbers(nums):
even_nums = list(filter(lambda x: x%2 == 0, nums))
return even_nums | transformation_equalto_exclamation_variable | def filter_evennumbers(nums):
even_nums = list(filter(lambda x: x%2 != 0, nums))
return even_nums | 0 | 40 | mbpp |
def filter_evennumbers(nums):
even_nums = list(filter(lambda x: x%2 == 0, nums))
return even_nums | 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 | 40 | mbpp |
def filter_evennumbers(nums):
even_nums = list(filter(lambda x: x%2 == 0, nums))
return even_nums | transformation_dissimilar_code_injection_1 | def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res) | 0 | 40 | mbpp |
def filter_evennumbers(nums):
even_nums = list(filter(lambda x: x%2 == 0, nums))
return even_nums | 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 | 40 | mbpp |
def filter_evennumbers(nums):
even_nums = list(filter(lambda x: x%2 == 0, nums))
return even_nums | 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 | 40 | mbpp |
def filter_evennumbers(nums):
even_nums = list(filter(lambda x: x%2 == 0, nums))
return even_nums | 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 | 40 | mbpp |
def test_distinct(data):
if len(data) == len(set(data)):
return True
else:
return False; | transformation_dead_code_insert | def test_distinct(data):
if len(data) == len(set(data)):
for _i_2 in range(0):
return True
return True
else:
return False | 1 | 45 | mbpp |
def test_distinct(data):
if len(data) == len(set(data)):
return True
else:
return False; | transformation_for_while_loop | def test_distinct(data):
if len(data) == len(set(data)):
return True
else:
return False | 1 | 45 | mbpp |
def test_distinct(data):
if len(data) == len(set(data)):
return True
else:
return False; | transformation_operand_swap | def test_distinct(data):
if len(set(data)) == len(data):
return True
else:
return False | 1 | 45 | mbpp |
def test_distinct(data):
if len(data) == len(set(data)):
return True
else:
return False; | transformation_rename_variable_cb | def test_distinct(lines):
if len(lines) == len(set(lines)):
return True
else:
return False | 1 | 45 | mbpp |
def test_distinct(data):
if len(data) == len(set(data)):
return True
else:
return False; | transformation_rename_variable_naive | def test_distinct(VAR_0):
if len(VAR_0) == len(set(VAR_0)):
return True
else:
return False | 1 | 45 | mbpp |
def test_distinct(data):
if len(data) == len(set(data)):
return True
else:
return False; | transformation_rename_variable_rn | def test_distinct(xHd3):
if len(xHd3) == len(set(xHd3)):
return True
else:
return False | 1 | 45 | mbpp |
def test_distinct(data):
if len(data) == len(set(data)):
return True
else:
return False; | transformation_equalto_exclamation_variable | def test_distinct(data):
if len(data) != len(set(data)):
return True
else:
return False; | 0 | 45 | mbpp |
def test_distinct(data):
if len(data) == len(set(data)):
return True
else:
return False; | transformation_true_false_variable | def test_distinct(data):
if len(data) == len(set(data)):
return False
else:
return False; | 0 | 45 | mbpp |
def test_distinct(data):
if len(data) == len(set(data)):
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 | 45 | mbpp |
def test_distinct(data):
if len(data) == len(set(data)):
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 | 45 | mbpp |
def test_distinct(data):
if len(data) == len(set(data)):
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 | 45 | mbpp |
def test_distinct(data):
if len(data) == len(set(data)):
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 | 45 | mbpp |
def test_distinct(data):
if len(data) == len(set(data)):
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 | 45 | mbpp |
def compute_Last_Digit(A,B):
variable = 1
if (A == B):
return 1
elif ((B - A) >= 5):
return 0
else:
for i in range(A + 1,B + 1):
variable = (variable * (i % 10)) % 10
return variable % 10 | transformation_dead_code_insert | def compute_Last_Digit(A, B):
variable = 1
if A == B:
return 1
elif (B - A) >= 5:
_i_8 = 0
while _i_8 > _i_8:
return 0
return 0
else:
for i in range(A + 1, B + 1):
variable = (variable * (i % 10)) % 10
return variable % 10 | 1 | 46 | mbpp |
def compute_Last_Digit(A,B):
variable = 1
if (A == B):
return 1
elif ((B - A) >= 5):
return 0
else:
for i in range(A + 1,B + 1):
variable = (variable * (i % 10)) % 10
return variable % 10 | transformation_for_while_loop | def compute_Last_Digit(A, B):
variable = 1
if A == B:
return 1
elif (B - A) >= 5:
return 0
else:
i = A + 1
while i < B + 1:
variable = (variable * (i % 10)) % 10
i += 1
return variable % 10 | 1 | 46 | mbpp |
def compute_Last_Digit(A,B):
variable = 1
if (A == B):
return 1
elif ((B - A) >= 5):
return 0
else:
for i in range(A + 1,B + 1):
variable = (variable * (i % 10)) % 10
return variable % 10 | transformation_operand_swap | def compute_Last_Digit(A, B):
variable = 1
if B == A:
return 1
elif (B - A) >= 5:
return 0
else:
for i in range(A + 1, B + 1):
variable = (variable * (i % 10)) % 10
return variable % 10 | 1 | 46 | mbpp |
def compute_Last_Digit(A,B):
variable = 1
if (A == B):
return 1
elif ((B - A) >= 5):
return 0
else:
for i in range(A + 1,B + 1):
variable = (variable * (i % 10)) % 10
return variable % 10 | transformation_rename_variable_cb | def compute_Last_Digit(A, B2):
variable = 1
if A == B2:
return 1
elif (B2 - A) >= 5:
return 0
else:
for i in range(A + 1, B2 + 1):
variable = (variable * (i % 10)) % 10
return variable % 10 | 1 | 46 | mbpp |
def compute_Last_Digit(A,B):
variable = 1
if (A == B):
return 1
elif ((B - A) >= 5):
return 0
else:
for i in range(A + 1,B + 1):
variable = (variable * (i % 10)) % 10
return variable % 10 | transformation_rename_variable_naive | def compute_Last_Digit(VAR_0, B):
variable = 1
if VAR_0 == B:
return 1
elif (B - VAR_0) >= 5:
return 0
else:
for i in range(VAR_0 + 1, B + 1):
variable = (variable * (i % 10)) % 10
return variable % 10 | 1 | 46 | mbpp |
def compute_Last_Digit(A,B):
variable = 1
if (A == B):
return 1
elif ((B - A) >= 5):
return 0
else:
for i in range(A + 1,B + 1):
variable = (variable * (i % 10)) % 10
return variable % 10 | transformation_rename_variable_rn | def compute_Last_Digit(A, B):
C1oziIb0 = 1
if A == B:
return 1
elif (B - A) >= 5:
return 0
else:
for i in range(A + 1, B + 1):
C1oziIb0 = (C1oziIb0 * (i % 10)) % 10
return C1oziIb0 % 10 | 1 | 46 | mbpp |
def compute_Last_Digit(A,B):
variable = 1
if (A == B):
return 1
elif ((B - A) >= 5):
return 0
else:
for i in range(A + 1,B + 1):
variable = (variable * (i % 10)) % 10
return variable % 10 | transformation_add_sub_variable | def compute_Last_Digit(A,B):
variable = 1
if (A == B):
return 1
elif ((B - A) >= 5):
return 0
else:
for i in range(A - 1,B + 1):
variable = (variable * (i % 10)) % 10
return variable % 10 | 0 | 46 | mbpp |
def compute_Last_Digit(A,B):
variable = 1
if (A == B):
return 1
elif ((B - A) >= 5):
return 0
else:
for i in range(A + 1,B + 1):
variable = (variable * (i % 10)) % 10
return variable % 10 | transformation_sub_add_variable | def compute_Last_Digit(A,B):
variable = 1
if (A == B):
return 1
elif ((B + A) >= 5):
return 0
else:
for i in range(A + 1,B + 1):
variable = (variable * (i % 10)) % 10
return variable % 10 | 0 | 46 | mbpp |
def compute_Last_Digit(A,B):
variable = 1
if (A == B):
return 1
elif ((B - A) >= 5):
return 0
else:
for i in range(A + 1,B + 1):
variable = (variable * (i % 10)) % 10
return variable % 10 | transformation_mul_div_variable | def compute_Last_Digit(A,B):
variable = 1
if (A == B):
return 1
elif ((B - A) >= 5):
return 0
else:
for i in range(A + 1,B + 1):
variable = (variable / (i % 10)) % 10
return variable % 10 | 0 | 46 | mbpp |
def compute_Last_Digit(A,B):
variable = 1
if (A == B):
return 1
elif ((B - A) >= 5):
return 0
else:
for i in range(A + 1,B + 1):
variable = (variable * (i % 10)) % 10
return variable % 10 | transformation_greater_lesser_variable | def compute_Last_Digit(A,B):
variable = 1
if (A == B):
return 1
elif ((B - A) <= 5):
return 0
else:
for i in range(A + 1,B + 1):
variable = (variable * (i % 10)) % 10
return variable % 10 | 0 | 46 | mbpp |
def compute_Last_Digit(A,B):
variable = 1
if (A == B):
return 1
elif ((B - A) >= 5):
return 0
else:
for i in range(A + 1,B + 1):
variable = (variable * (i % 10)) % 10
return variable % 10 | transformation_equalto_exclamation_variable | def compute_Last_Digit(A,B):
variable = 1
if (A != B):
return 1
elif ((B - A) >= 5):
return 0
else:
for i in range(A + 1,B + 1):
variable = (variable * (i % 10)) % 10
return variable % 10 | 0 | 46 | mbpp |
def compute_Last_Digit(A,B):
variable = 1
if (A == B):
return 1
elif ((B - A) >= 5):
return 0
else:
for i in range(A + 1,B + 1):
variable = (variable * (i % 10)) % 10
return variable % 10 | 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 | 46 | mbpp |
def compute_Last_Digit(A,B):
variable = 1
if (A == B):
return 1
elif ((B - A) >= 5):
return 0
else:
for i in range(A + 1,B + 1):
variable = (variable * (i % 10)) % 10
return variable % 10 | transformation_dissimilar_code_injection_1 | def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res) | 0 | 46 | mbpp |
def compute_Last_Digit(A,B):
variable = 1
if (A == B):
return 1
elif ((B - A) >= 5):
return 0
else:
for i in range(A + 1,B + 1):
variable = (variable * (i % 10)) % 10
return variable % 10 | 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 | 46 | mbpp |
def compute_Last_Digit(A,B):
variable = 1
if (A == B):
return 1
elif ((B - A) >= 5):
return 0
else:
for i in range(A + 1,B + 1):
variable = (variable * (i % 10)) % 10
return variable % 10 | 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 | 46 | mbpp |
def compute_Last_Digit(A,B):
variable = 1
if (A == B):
return 1
elif ((B - A) >= 5):
return 0
else:
for i in range(A + 1,B + 1):
variable = (variable * (i % 10)) % 10
return variable % 10 | 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 | 46 | mbpp |
def odd_bit_set_number(n):
count = 0;res = 0;temp = n
while temp > 0:
if count % 2 == 0:
res |= (1 << count)
count += 1
temp >>= 1
return (n | res) | transformation_dead_code_insert | def odd_bit_set_number(n):
count = 0
res = 0
temp = n
while temp > 0:
if count % 2 == 0:
_i_5 = 0
while _i_5 < _i_5:
res |= 1 << count
res |= 1 << count
count += 1
temp >>= 1
return n | res | 1 | 47 | mbpp |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.