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 cal_sum(n):
a = 3
b = 0
c = 2
if (n == 0):
return 3
if (n == 1):
return 3
if (n == 2):
return 5
sum = 5
while (n > 2):
d = a + b
sum = sum + d
a = b
b = c
c = d
n = n-1
return sum
|
transformation_rename_variable_rn
|
def cal_sum(J):
a = 3
b = 0
c = 2
if J == 0:
return 3
if J == 1:
return 3
if J == 2:
return 5
sum = 5
while J > 2:
d = a + b
sum = sum + d
a = b
b = c
c = d
J = J - 1
return sum
| 1 | 445 |
mbpp
|
def cal_sum(n):
a = 3
b = 0
c = 2
if (n == 0):
return 3
if (n == 1):
return 3
if (n == 2):
return 5
sum = 5
while (n > 2):
d = a + b
sum = sum + d
a = b
b = c
c = d
n = n-1
return sum
|
transformation_add_sub_variable
|
def cal_sum(n):
a = 3
b = 0
c = 2
if (n == 0):
return 3
if (n == 1):
return 3
if (n == 2):
return 5
sum = 5
while (n > 2):
d = a - b
sum = sum + d
a = b
b = c
c = d
n = n-1
return sum
| 0 | 445 |
mbpp
|
def cal_sum(n):
a = 3
b = 0
c = 2
if (n == 0):
return 3
if (n == 1):
return 3
if (n == 2):
return 5
sum = 5
while (n > 2):
d = a + b
sum = sum + d
a = b
b = c
c = d
n = n-1
return sum
|
transformation_sub_add_variable
|
def cal_sum(n):
a = 3
b = 0
c = 2
if (n == 0):
return 3
if (n == 1):
return 3
if (n == 2):
return 5
sum = 5
while (n > 2):
d = a + b
sum = sum + d
a = b
b = c
c = d
n = n+1
return sum
| 0 | 445 |
mbpp
|
def cal_sum(n):
a = 3
b = 0
c = 2
if (n == 0):
return 3
if (n == 1):
return 3
if (n == 2):
return 5
sum = 5
while (n > 2):
d = a + b
sum = sum + d
a = b
b = c
c = d
n = n-1
return sum
|
transformation_greater_lesser_variable
|
def cal_sum(n):
a = 3
b = 0
c = 2
if (n == 0):
return 3
if (n == 1):
return 3
if (n == 2):
return 5
sum = 5
while (n < 2):
d = a + b
sum = sum + d
a = b
b = c
c = d
n = n-1
return sum
| 0 | 445 |
mbpp
|
def cal_sum(n):
a = 3
b = 0
c = 2
if (n == 0):
return 3
if (n == 1):
return 3
if (n == 2):
return 5
sum = 5
while (n > 2):
d = a + b
sum = sum + d
a = b
b = c
c = d
n = n-1
return sum
|
transformation_equalto_exclamation_variable
|
def cal_sum(n):
a = 3
b = 0
c = 2
if (n != 0):
return 3
if (n == 1):
return 3
if (n == 2):
return 5
sum = 5
while (n > 2):
d = a + b
sum = sum + d
a = b
b = c
c = d
n = n-1
return sum
| 0 | 445 |
mbpp
|
def cal_sum(n):
a = 3
b = 0
c = 2
if (n == 0):
return 3
if (n == 1):
return 3
if (n == 2):
return 5
sum = 5
while (n > 2):
d = a + b
sum = sum + d
a = b
b = c
c = d
n = n-1
return sum
|
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 | 445 |
mbpp
|
def cal_sum(n):
a = 3
b = 0
c = 2
if (n == 0):
return 3
if (n == 1):
return 3
if (n == 2):
return 5
sum = 5
while (n > 2):
d = a + b
sum = sum + d
a = b
b = c
c = d
n = n-1
return sum
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 445 |
mbpp
|
def cal_sum(n):
a = 3
b = 0
c = 2
if (n == 0):
return 3
if (n == 1):
return 3
if (n == 2):
return 5
sum = 5
while (n > 2):
d = a + b
sum = sum + d
a = b
b = c
c = d
n = n-1
return sum
|
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 | 445 |
mbpp
|
def cal_sum(n):
a = 3
b = 0
c = 2
if (n == 0):
return 3
if (n == 1):
return 3
if (n == 2):
return 5
sum = 5
while (n > 2):
d = a + b
sum = sum + d
a = b
b = c
c = d
n = n-1
return sum
|
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 | 445 |
mbpp
|
def cal_sum(n):
a = 3
b = 0
c = 2
if (n == 0):
return 3
if (n == 1):
return 3
if (n == 2):
return 5
sum = 5
while (n > 2):
d = a + b
sum = sum + d
a = b
b = c
c = d
n = n-1
return sum
|
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 | 445 |
mbpp
|
def check_Triangle(x1,y1,x2,y2,x3,y3):
a = (x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2))
if a == 0:
return ('No')
else:
return ('Yes')
|
transformation_dead_code_insert
|
def check_Triangle(x1, y1, x2, y2, x3, y3):
a = x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)
if a == 0:
_i_9 = 0
while _i_9 < _i_9:
return "No"
return "No"
else:
return "Yes"
| 1 | 446 |
mbpp
|
def check_Triangle(x1,y1,x2,y2,x3,y3):
a = (x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2))
if a == 0:
return ('No')
else:
return ('Yes')
|
transformation_for_while_loop
|
def check_Triangle(x1, y1, x2, y2, x3, y3):
a = x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)
if a == 0:
return "No"
else:
return "Yes"
| 1 | 446 |
mbpp
|
def check_Triangle(x1,y1,x2,y2,x3,y3):
a = (x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2))
if a == 0:
return ('No')
else:
return ('Yes')
|
transformation_operand_swap
|
def check_Triangle(x1, y1, x2, y2, x3, y3):
a = x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)
if 0 == a:
return "No"
else:
return "Yes"
| 1 | 446 |
mbpp
|
def check_Triangle(x1,y1,x2,y2,x3,y3):
a = (x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2))
if a == 0:
return ('No')
else:
return ('Yes')
|
transformation_rename_variable_cb
|
def check_Triangle(x1, y1, x2, y, x3, y3):
a = x1 * (y - y3) + x2 * (y3 - y1) + x3 * (y1 - y)
if a == 0:
return "No"
else:
return "Yes"
| 1 | 446 |
mbpp
|
def check_Triangle(x1,y1,x2,y2,x3,y3):
a = (x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2))
if a == 0:
return ('No')
else:
return ('Yes')
|
transformation_rename_variable_naive
|
def check_Triangle(x1, y1, x2, y2, x3, VAR_0):
a = x1 * (y2 - VAR_0) + x2 * (VAR_0 - y1) + x3 * (y1 - y2)
if a == 0:
return "No"
else:
return "Yes"
| 1 | 446 |
mbpp
|
def check_Triangle(x1,y1,x2,y2,x3,y3):
a = (x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2))
if a == 0:
return ('No')
else:
return ('Yes')
|
transformation_rename_variable_rn
|
def check_Triangle(x1, a9, x2, y2, x3, y3):
a = x1 * (y2 - y3) + x2 * (y3 - a9) + x3 * (a9 - y2)
if a == 0:
return "No"
else:
return "Yes"
| 1 | 446 |
mbpp
|
def check_Triangle(x1,y1,x2,y2,x3,y3):
a = (x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2))
if a == 0:
return ('No')
else:
return ('Yes')
|
transformation_add_sub_variable
|
def check_Triangle(x1,y1,x2,y2,x3,y3):
a = (x1*(y2-y3)-x2*(y3-y1)+x3*(y1-y2))
if a == 0:
return ('No')
else:
return ('Yes')
| 0 | 446 |
mbpp
|
def check_Triangle(x1,y1,x2,y2,x3,y3):
a = (x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2))
if a == 0:
return ('No')
else:
return ('Yes')
|
transformation_sub_add_variable
|
def check_Triangle(x1,y1,x2,y2,x3,y3):
a = (x1*(y2+y3)+x2*(y3-y1)+x3*(y1-y2))
if a == 0:
return ('No')
else:
return ('Yes')
| 0 | 446 |
mbpp
|
def check_Triangle(x1,y1,x2,y2,x3,y3):
a = (x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2))
if a == 0:
return ('No')
else:
return ('Yes')
|
transformation_mul_div_variable
|
def check_Triangle(x1,y1,x2,y2,x3,y3):
a = (x1/(y2-y3)+x2*(y3-y1)+x3*(y1-y2))
if a == 0:
return ('No')
else:
return ('Yes')
| 0 | 446 |
mbpp
|
def check_Triangle(x1,y1,x2,y2,x3,y3):
a = (x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2))
if a == 0:
return ('No')
else:
return ('Yes')
|
transformation_equalto_exclamation_variable
|
def check_Triangle(x1,y1,x2,y2,x3,y3):
a = (x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2))
if a != 0:
return ('No')
else:
return ('Yes')
| 0 | 446 |
mbpp
|
def check_Triangle(x1,y1,x2,y2,x3,y3):
a = (x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2))
if a == 0:
return ('No')
else:
return ('Yes')
|
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 | 446 |
mbpp
|
def check_Triangle(x1,y1,x2,y2,x3,y3):
a = (x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2))
if a == 0:
return ('No')
else:
return ('Yes')
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 446 |
mbpp
|
def check_Triangle(x1,y1,x2,y2,x3,y3):
a = (x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2))
if a == 0:
return ('No')
else:
return ('Yes')
|
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 | 446 |
mbpp
|
def check_Triangle(x1,y1,x2,y2,x3,y3):
a = (x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2))
if a == 0:
return ('No')
else:
return ('Yes')
|
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 | 446 |
mbpp
|
def check_Triangle(x1,y1,x2,y2,x3,y3):
a = (x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2))
if a == 0:
return ('No')
else:
return ('Yes')
|
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 | 446 |
mbpp
|
def check_monthnumb_number(monthnum2):
if(monthnum2==1 or monthnum2==3 or monthnum2==5 or monthnum2==7 or monthnum2==8 or monthnum2==10 or monthnum2==12):
return True
else:
return False
|
transformation_dead_code_insert
|
def check_monthnumb_number(monthnum2):
if (
monthnum2 == 1
or monthnum2 == 3
or monthnum2 == 5
or monthnum2 == 7
or monthnum2 == 8
or monthnum2 == 10
or monthnum2 == 12
):
for _i_7 in range(0):
return False
return True
else:
return False
| 1 | 452 |
mbpp
|
def check_monthnumb_number(monthnum2):
if(monthnum2==1 or monthnum2==3 or monthnum2==5 or monthnum2==7 or monthnum2==8 or monthnum2==10 or monthnum2==12):
return True
else:
return False
|
transformation_for_while_loop
|
def check_monthnumb_number(monthnum2):
if (
monthnum2 == 1
or monthnum2 == 3
or monthnum2 == 5
or monthnum2 == 7
or monthnum2 == 8
or monthnum2 == 10
or monthnum2 == 12
):
return True
else:
return False
| 1 | 452 |
mbpp
|
def check_monthnumb_number(monthnum2):
if(monthnum2==1 or monthnum2==3 or monthnum2==5 or monthnum2==7 or monthnum2==8 or monthnum2==10 or monthnum2==12):
return True
else:
return False
|
transformation_operand_swap
|
def check_monthnumb_number(monthnum2):
if (
monthnum2 == 1
or monthnum2 == 3
or monthnum2 == 5
or monthnum2 == 7
or monthnum2 == 8
or monthnum2 == 10
or 12 == monthnum2
):
return True
else:
return False
| 1 | 452 |
mbpp
|
def check_monthnumb_number(monthnum2):
if(monthnum2==1 or monthnum2==3 or monthnum2==5 or monthnum2==7 or monthnum2==8 or monthnum2==10 or monthnum2==12):
return True
else:
return False
|
transformation_rename_variable_cb
|
def check_monthnumb_number(m):
if m == 1 or m == 3 or m == 5 or m == 7 or m == 8 or m == 10 or m == 12:
return True
else:
return False
| 1 | 452 |
mbpp
|
def check_monthnumb_number(monthnum2):
if(monthnum2==1 or monthnum2==3 or monthnum2==5 or monthnum2==7 or monthnum2==8 or monthnum2==10 or monthnum2==12):
return True
else:
return False
|
transformation_rename_variable_naive
|
def check_monthnumb_number(VAR_0):
if (
VAR_0 == 1
or VAR_0 == 3
or VAR_0 == 5
or VAR_0 == 7
or VAR_0 == 8
or VAR_0 == 10
or VAR_0 == 12
):
return True
else:
return False
| 1 | 452 |
mbpp
|
def check_monthnumb_number(monthnum2):
if(monthnum2==1 or monthnum2==3 or monthnum2==5 or monthnum2==7 or monthnum2==8 or monthnum2==10 or monthnum2==12):
return True
else:
return False
|
transformation_rename_variable_rn
|
def check_monthnumb_number(w097E7Ie8):
if (
w097E7Ie8 == 1
or w097E7Ie8 == 3
or w097E7Ie8 == 5
or w097E7Ie8 == 7
or w097E7Ie8 == 8
or w097E7Ie8 == 10
or w097E7Ie8 == 12
):
return True
else:
return False
| 1 | 452 |
mbpp
|
def check_monthnumb_number(monthnum2):
if(monthnum2==1 or monthnum2==3 or monthnum2==5 or monthnum2==7 or monthnum2==8 or monthnum2==10 or monthnum2==12):
return True
else:
return False
|
transformation_equalto_exclamation_variable
|
def check_monthnumb_number(monthnum2):
if(monthnum2!=1 or monthnum2==3 or monthnum2==5 or monthnum2==7 or monthnum2==8 or monthnum2==10 or monthnum2==12):
return True
else:
return False
| 0 | 452 |
mbpp
|
def check_monthnumb_number(monthnum2):
if(monthnum2==1 or monthnum2==3 or monthnum2==5 or monthnum2==7 or monthnum2==8 or monthnum2==10 or monthnum2==12):
return True
else:
return False
|
transformation_true_false_variable
|
def check_monthnumb_number(monthnum2):
if(monthnum2==1 or monthnum2==3 or monthnum2==5 or monthnum2==7 or monthnum2==8 or monthnum2==10 or monthnum2==12):
return False
else:
return False
| 0 | 452 |
mbpp
|
def check_monthnumb_number(monthnum2):
if(monthnum2==1 or monthnum2==3 or monthnum2==5 or monthnum2==7 or monthnum2==8 or monthnum2==10 or monthnum2==12):
return True
else:
return False
|
transformation_false_true_variable
|
def check_monthnumb_number(monthnum2):
if(monthnum2==1 or monthnum2==3 or monthnum2==5 or monthnum2==7 or monthnum2==8 or monthnum2==10 or monthnum2==12):
return True
else:
return True
| 0 | 452 |
mbpp
|
def check_monthnumb_number(monthnum2):
if(monthnum2==1 or monthnum2==3 or monthnum2==5 or monthnum2==7 or monthnum2==8 or monthnum2==10 or monthnum2==12):
return True
else:
return False
|
transformation_or_and_variable
|
def check_monthnumb_number(monthnum2):
if(monthnum2==1 and monthnum2==3 or monthnum2==5 or monthnum2==7 or monthnum2==8 or monthnum2==10 or monthnum2==12):
return True
else:
return False
| 0 | 452 |
mbpp
|
def check_monthnumb_number(monthnum2):
if(monthnum2==1 or monthnum2==3 or monthnum2==5 or monthnum2==7 or monthnum2==8 or monthnum2==10 or monthnum2==12):
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 | 452 |
mbpp
|
def check_monthnumb_number(monthnum2):
if(monthnum2==1 or monthnum2==3 or monthnum2==5 or monthnum2==7 or monthnum2==8 or monthnum2==10 or monthnum2==12):
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 | 452 |
mbpp
|
def check_monthnumb_number(monthnum2):
if(monthnum2==1 or monthnum2==3 or monthnum2==5 or monthnum2==7 or monthnum2==8 or monthnum2==10 or monthnum2==12):
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 | 452 |
mbpp
|
def check_monthnumb_number(monthnum2):
if(monthnum2==1 or monthnum2==3 or monthnum2==5 or monthnum2==7 or monthnum2==8 or monthnum2==10 or monthnum2==12):
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 | 452 |
mbpp
|
def check_monthnumb_number(monthnum2):
if(monthnum2==1 or monthnum2==3 or monthnum2==5 or monthnum2==7 or monthnum2==8 or monthnum2==10 or monthnum2==12):
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 | 452 |
mbpp
|
def Find_Min(lst):
minList = min((x) for x in lst)
return minList
|
transformation_dead_code_insert
|
def Find_Min(lst):
_i_8 = 0
while _i_8 < _i_8:
return minList
minList = min((x) for x in lst)
return minList
| 1 | 454 |
mbpp
|
def Find_Min(lst):
minList = min((x) for x in lst)
return minList
|
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 | 454 |
mbpp
|
def Find_Min(lst):
minList = min((x) for x in lst)
return minList
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 454 |
mbpp
|
def Find_Min(lst):
minList = min((x) for x in lst)
return minList
|
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 | 454 |
mbpp
|
def Find_Min(lst):
minList = min((x) for x in lst)
return minList
|
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 | 454 |
mbpp
|
def Find_Min(lst):
minList = min((x) for x in lst)
return minList
|
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 | 454 |
mbpp
|
def rectangle_area(l,b):
area=l*b
return area
|
transformation_dead_code_insert
|
def rectangle_area(l, b):
for _i_1 in range(0):
area = l * b
area = l * b
return area
| 1 | 455 |
mbpp
|
def rectangle_area(l,b):
area=l*b
return area
|
transformation_for_while_loop
|
def rectangle_area(l, b):
area = l * b
return area
| 1 | 455 |
mbpp
|
def rectangle_area(l,b):
area=l*b
return area
|
transformation_operand_swap
|
def rectangle_area(l, b):
area = l * b
return area
| 1 | 455 |
mbpp
|
def rectangle_area(l,b):
area=l*b
return area
|
transformation_rename_variable_cb
|
def rectangle_area(a, b):
area = a * b
return area
| 1 | 455 |
mbpp
|
def rectangle_area(l,b):
area=l*b
return area
|
transformation_rename_variable_naive
|
def rectangle_area(VAR_0, b):
area = VAR_0 * b
return area
| 1 | 455 |
mbpp
|
def rectangle_area(l,b):
area=l*b
return area
|
transformation_rename_variable_rn
|
def rectangle_area(o, b):
area = o * b
return area
| 1 | 455 |
mbpp
|
def rectangle_area(l,b):
area=l*b
return area
|
transformation_mul_div_variable
|
def rectangle_area(l,b):
area=l/b
return area
| 0 | 455 |
mbpp
|
def rectangle_area(l,b):
area=l*b
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 | 455 |
mbpp
|
def rectangle_area(l,b):
area=l*b
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 | 455 |
mbpp
|
def rectangle_area(l,b):
area=l*b
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 | 455 |
mbpp
|
def rectangle_area(l,b):
area=l*b
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 | 455 |
mbpp
|
def rectangle_area(l,b):
area=l*b
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 | 455 |
mbpp
|
def upper_ctr(str):
upper_ctr = 0
for i in range(len(str)):
if str[i] >= 'A' and str[i] <= 'Z': upper_ctr += 1
return upper_ctr
|
transformation_dead_code_insert
|
def upper_ctr(str):
for _i_4 in range(0):
upper_ctr = 0
upper_ctr = 0
for i in range(len(str)):
if str[i] >= "A" and str[i] <= "Z":
upper_ctr += 1
return upper_ctr
| 1 | 458 |
mbpp
|
def upper_ctr(str):
upper_ctr = 0
for i in range(len(str)):
if str[i] >= 'A' and str[i] <= 'Z': upper_ctr += 1
return upper_ctr
|
transformation_for_while_loop
|
def upper_ctr(str):
upper_ctr = 0
i = 0
while i < len(str):
if str[i] >= "A" and str[i] <= "Z":
upper_ctr += 1
return upper_ctr
i += 1
| 1 | 458 |
mbpp
|
def upper_ctr(str):
upper_ctr = 0
for i in range(len(str)):
if str[i] >= 'A' and str[i] <= 'Z': upper_ctr += 1
return upper_ctr
|
transformation_operand_swap
|
def upper_ctr(str):
upper_ctr = 0
for i in range(len(str)):
if "A" <= str[i] and str[i] <= "Z":
upper_ctr += 1
return upper_ctr
| 1 | 458 |
mbpp
|
def upper_ctr(str):
upper_ctr = 0
for i in range(len(str)):
if str[i] >= 'A' and str[i] <= 'Z': upper_ctr += 1
return upper_ctr
|
transformation_rename_variable_cb
|
def upper_ctr(str):
upper_ctr = 0
for i2 in range(len(str)):
if str[i2] >= "A" and str[i2] <= "Z":
upper_ctr += 1
return upper_ctr
| 1 | 458 |
mbpp
|
def upper_ctr(str):
upper_ctr = 0
for i in range(len(str)):
if str[i] >= 'A' and str[i] <= 'Z': upper_ctr += 1
return upper_ctr
|
transformation_rename_variable_naive
|
def upper_ctr(str):
upper_ctr = 0
for VAR_0 in range(len(str)):
if str[VAR_0] >= "A" and str[VAR_0] <= "Z":
upper_ctr += 1
return upper_ctr
| 1 | 458 |
mbpp
|
def upper_ctr(str):
upper_ctr = 0
for i in range(len(str)):
if str[i] >= 'A' and str[i] <= 'Z': upper_ctr += 1
return upper_ctr
|
transformation_rename_variable_rn
|
def upper_ctr(str):
upper_ctr = 0
for C in range(len(str)):
if str[C] >= "A" and str[C] <= "Z":
upper_ctr += 1
return upper_ctr
| 1 | 458 |
mbpp
|
def upper_ctr(str):
upper_ctr = 0
for i in range(len(str)):
if str[i] >= 'A' and str[i] <= 'Z': upper_ctr += 1
return upper_ctr
|
transformation_add_sub_variable
|
def upper_ctr(str):
upper_ctr = 0
for i in range(len(str)):
if str[i] >= 'A' and str[i] <= 'Z': upper_ctr -= 1
return upper_ctr
| 0 | 458 |
mbpp
|
def upper_ctr(str):
upper_ctr = 0
for i in range(len(str)):
if str[i] >= 'A' and str[i] <= 'Z': upper_ctr += 1
return upper_ctr
|
transformation_lesser_greater_variable
|
def upper_ctr(str):
upper_ctr = 0
for i in range(len(str)):
if str[i] >= 'A' and str[i] >= 'Z': upper_ctr += 1
return upper_ctr
| 0 | 458 |
mbpp
|
def upper_ctr(str):
upper_ctr = 0
for i in range(len(str)):
if str[i] >= 'A' and str[i] <= 'Z': upper_ctr += 1
return upper_ctr
|
transformation_greater_lesser_variable
|
def upper_ctr(str):
upper_ctr = 0
for i in range(len(str)):
if str[i] <= 'A' and str[i] <= 'Z': upper_ctr += 1
return upper_ctr
| 0 | 458 |
mbpp
|
def upper_ctr(str):
upper_ctr = 0
for i in range(len(str)):
if str[i] >= 'A' and str[i] <= 'Z': upper_ctr += 1
return upper_ctr
|
transformation_and_or_variable
|
def upper_ctr(str):
upper_ctr = 0
for i in range(len(str)):
if str[i] >= 'A' or str[i] <= 'Z': upper_ctr += 1
return upper_ctr
| 0 | 458 |
mbpp
|
def upper_ctr(str):
upper_ctr = 0
for i in range(len(str)):
if str[i] >= 'A' and str[i] <= 'Z': upper_ctr += 1
return upper_ctr
|
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 | 458 |
mbpp
|
def upper_ctr(str):
upper_ctr = 0
for i in range(len(str)):
if str[i] >= 'A' and str[i] <= 'Z': upper_ctr += 1
return upper_ctr
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 458 |
mbpp
|
def upper_ctr(str):
upper_ctr = 0
for i in range(len(str)):
if str[i] >= 'A' and str[i] <= 'Z': upper_ctr += 1
return upper_ctr
|
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 | 458 |
mbpp
|
def upper_ctr(str):
upper_ctr = 0
for i in range(len(str)):
if str[i] >= 'A' and str[i] <= 'Z': upper_ctr += 1
return upper_ctr
|
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 | 458 |
mbpp
|
def upper_ctr(str):
upper_ctr = 0
for i in range(len(str)):
if str[i] >= 'A' and str[i] <= 'Z': upper_ctr += 1
return upper_ctr
|
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 | 458 |
mbpp
|
def combinations_list(list1):
if len(list1) == 0:
return [[]]
result = []
for el in combinations_list(list1[1:]):
result += [el, el+[list1[0]]]
return result
|
transformation_dead_code_insert
|
def combinations_list(list1):
_i_3 = 0
while _i_3 > _i_3:
return [[]]
if len(list1) == 0:
return [[]]
result = []
for el in combinations_list(list1[1:]):
result += [el, el + [list1[0]]]
return result
| 1 | 459 |
mbpp
|
def combinations_list(list1):
if len(list1) == 0:
return [[]]
result = []
for el in combinations_list(list1[1:]):
result += [el, el+[list1[0]]]
return result
|
transformation_for_while_loop
|
def combinations_list(list1):
if len(list1) == 0:
return [[]]
result = []
_el_i = 0
while _el_i < len(combinations_list(list1[1:])):
el = combinations_list(list1[1:])[_el_i]
result += [el, el + [list1[0]]]
_el_i += 1
return result
| 1 | 459 |
mbpp
|
def combinations_list(list1):
if len(list1) == 0:
return [[]]
result = []
for el in combinations_list(list1[1:]):
result += [el, el+[list1[0]]]
return result
|
transformation_operand_swap
|
def combinations_list(list1):
if 0 == len(list1):
return [[]]
result = []
for el in combinations_list(list1[1:]):
result += [el, el + [list1[0]]]
return result
| 1 | 459 |
mbpp
|
def combinations_list(list1):
if len(list1) == 0:
return [[]]
result = []
for el in combinations_list(list1[1:]):
result += [el, el+[list1[0]]]
return result
|
transformation_rename_variable_cb
|
def combinations_list(el2):
if len(el2) == 0:
return [[]]
result = []
for el in combinations_list(el2[1:]):
result += [el, el + [el2[0]]]
return result
| 1 | 459 |
mbpp
|
def combinations_list(list1):
if len(list1) == 0:
return [[]]
result = []
for el in combinations_list(list1[1:]):
result += [el, el+[list1[0]]]
return result
|
transformation_rename_variable_naive
|
def combinations_list(VAR_0):
if len(VAR_0) == 0:
return [[]]
result = []
for el in combinations_list(VAR_0[1:]):
result += [el, el + [VAR_0[0]]]
return result
| 1 | 459 |
mbpp
|
def combinations_list(list1):
if len(list1) == 0:
return [[]]
result = []
for el in combinations_list(list1[1:]):
result += [el, el+[list1[0]]]
return result
|
transformation_rename_variable_rn
|
def combinations_list(U9Hlt):
if len(U9Hlt) == 0:
return [[]]
result = []
for el in combinations_list(U9Hlt[1:]):
result += [el, el + [U9Hlt[0]]]
return result
| 1 | 459 |
mbpp
|
def combinations_list(list1):
if len(list1) == 0:
return [[]]
result = []
for el in combinations_list(list1[1:]):
result += [el, el+[list1[0]]]
return result
|
transformation_add_sub_variable
|
def combinations_list(list1):
if len(list1) == 0:
return [[]]
result = []
for el in combinations_list(list1[1:]):
result -= [el, el+[list1[0]]]
return result
| 0 | 459 |
mbpp
|
def combinations_list(list1):
if len(list1) == 0:
return [[]]
result = []
for el in combinations_list(list1[1:]):
result += [el, el+[list1[0]]]
return result
|
transformation_equalto_exclamation_variable
|
def combinations_list(list1):
if len(list1) != 0:
return [[]]
result = []
for el in combinations_list(list1[1:]):
result += [el, el+[list1[0]]]
return result
| 0 | 459 |
mbpp
|
def combinations_list(list1):
if len(list1) == 0:
return [[]]
result = []
for el in combinations_list(list1[1:]):
result += [el, el+[list1[0]]]
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 | 459 |
mbpp
|
def combinations_list(list1):
if len(list1) == 0:
return [[]]
result = []
for el in combinations_list(list1[1:]):
result += [el, el+[list1[0]]]
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 | 459 |
mbpp
|
def combinations_list(list1):
if len(list1) == 0:
return [[]]
result = []
for el in combinations_list(list1[1:]):
result += [el, el+[list1[0]]]
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 | 459 |
mbpp
|
def combinations_list(list1):
if len(list1) == 0:
return [[]]
result = []
for el in combinations_list(list1[1:]):
result += [el, el+[list1[0]]]
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 | 459 |
mbpp
|
def combinations_list(list1):
if len(list1) == 0:
return [[]]
result = []
for el in combinations_list(list1[1:]):
result += [el, el+[list1[0]]]
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 | 459 |
mbpp
|
def max_subarray_product(arr):
n = len(arr)
max_ending_here = 1
min_ending_here = 1
max_so_far = 0
flag = 0
for i in range(0, n):
if arr[i] > 0:
max_ending_here = max_ending_here * arr[i]
min_ending_here = min (min_ending_here * arr[i], 1)
flag = 1
elif arr[i] == 0:
max_ending_here = 1
min_ending_here = 1
else:
temp = max_ending_here
max_ending_here = max (min_ending_here * arr[i], 1)
min_ending_here = temp * arr[i]
if (max_so_far < max_ending_here):
max_so_far = max_ending_here
if flag == 0 and max_so_far == 0:
return 0
return max_so_far
|
transformation_dead_code_insert
|
def max_subarray_product(arr):
n = len(arr)
max_ending_here = 1
min_ending_here = 1
_i_2 = 0
if _i_2 > _i_2:
flag = 1
max_so_far = 0
flag = 0
for i in range(0, n):
if arr[i] > 0:
max_ending_here = max_ending_here * arr[i]
min_ending_here = min(min_ending_here * arr[i], 1)
flag = 1
elif arr[i] == 0:
max_ending_here = 1
min_ending_here = 1
else:
temp = max_ending_here
max_ending_here = max(min_ending_here * arr[i], 1)
min_ending_here = temp * arr[i]
if max_so_far < max_ending_here:
max_so_far = max_ending_here
if flag == 0 and max_so_far == 0:
return 0
return max_so_far
| 1 | 460 |
mbpp
|
def max_subarray_product(arr):
n = len(arr)
max_ending_here = 1
min_ending_here = 1
max_so_far = 0
flag = 0
for i in range(0, n):
if arr[i] > 0:
max_ending_here = max_ending_here * arr[i]
min_ending_here = min (min_ending_here * arr[i], 1)
flag = 1
elif arr[i] == 0:
max_ending_here = 1
min_ending_here = 1
else:
temp = max_ending_here
max_ending_here = max (min_ending_here * arr[i], 1)
min_ending_here = temp * arr[i]
if (max_so_far < max_ending_here):
max_so_far = max_ending_here
if flag == 0 and max_so_far == 0:
return 0
return max_so_far
|
transformation_for_while_loop
|
def max_subarray_product(arr):
n = len(arr)
max_ending_here = 1
min_ending_here = 1
max_so_far = 0
flag = 0
i = 0
while i < n:
if arr[i] > 0:
max_ending_here = max_ending_here * arr[i]
min_ending_here = min(min_ending_here * arr[i], 1)
flag = 1
elif arr[i] == 0:
max_ending_here = 1
min_ending_here = 1
else:
temp = max_ending_here
max_ending_here = max(min_ending_here * arr[i], 1)
min_ending_here = temp * arr[i]
if max_so_far < max_ending_here:
max_so_far = max_ending_here
i += 1
if flag == 0 and max_so_far == 0:
return 0
return max_so_far
| 1 | 460 |
mbpp
|
def max_subarray_product(arr):
n = len(arr)
max_ending_here = 1
min_ending_here = 1
max_so_far = 0
flag = 0
for i in range(0, n):
if arr[i] > 0:
max_ending_here = max_ending_here * arr[i]
min_ending_here = min (min_ending_here * arr[i], 1)
flag = 1
elif arr[i] == 0:
max_ending_here = 1
min_ending_here = 1
else:
temp = max_ending_here
max_ending_here = max (min_ending_here * arr[i], 1)
min_ending_here = temp * arr[i]
if (max_so_far < max_ending_here):
max_so_far = max_ending_here
if flag == 0 and max_so_far == 0:
return 0
return max_so_far
|
transformation_operand_swap
|
def max_subarray_product(arr):
n = len(arr)
max_ending_here = 1
min_ending_here = 1
max_so_far = 0
flag = 0
for i in range(0, n):
if arr[i] > 0:
max_ending_here = max_ending_here * arr[i]
min_ending_here = min(min_ending_here * arr[i], 1)
flag = 1
elif arr[i] == 0:
max_ending_here = 1
min_ending_here = 1
else:
temp = max_ending_here
max_ending_here = max(min_ending_here * arr[i], 1)
min_ending_here = temp * arr[i]
if max_so_far < max_ending_here:
max_so_far = max_ending_here
if 0 == flag and max_so_far == 0:
return 0
return max_so_far
| 1 | 460 |
mbpp
|
def max_subarray_product(arr):
n = len(arr)
max_ending_here = 1
min_ending_here = 1
max_so_far = 0
flag = 0
for i in range(0, n):
if arr[i] > 0:
max_ending_here = max_ending_here * arr[i]
min_ending_here = min (min_ending_here * arr[i], 1)
flag = 1
elif arr[i] == 0:
max_ending_here = 1
min_ending_here = 1
else:
temp = max_ending_here
max_ending_here = max (min_ending_here * arr[i], 1)
min_ending_here = temp * arr[i]
if (max_so_far < max_ending_here):
max_so_far = max_ending_here
if flag == 0 and max_so_far == 0:
return 0
return max_so_far
|
transformation_rename_variable_cb
|
def max_subarray_product(arr):
n = len(arr)
temp2 = 1
min_ending_here = 1
max_so_far = 0
flag = 0
for i in range(0, n):
if arr[i] > 0:
temp2 = temp2 * arr[i]
min_ending_here = min(min_ending_here * arr[i], 1)
flag = 1
elif arr[i] == 0:
temp2 = 1
min_ending_here = 1
else:
temp = temp2
temp2 = max(min_ending_here * arr[i], 1)
min_ending_here = temp * arr[i]
if max_so_far < temp2:
max_so_far = temp2
if flag == 0 and max_so_far == 0:
return 0
return max_so_far
| 1 | 460 |
mbpp
|
def max_subarray_product(arr):
n = len(arr)
max_ending_here = 1
min_ending_here = 1
max_so_far = 0
flag = 0
for i in range(0, n):
if arr[i] > 0:
max_ending_here = max_ending_here * arr[i]
min_ending_here = min (min_ending_here * arr[i], 1)
flag = 1
elif arr[i] == 0:
max_ending_here = 1
min_ending_here = 1
else:
temp = max_ending_here
max_ending_here = max (min_ending_here * arr[i], 1)
min_ending_here = temp * arr[i]
if (max_so_far < max_ending_here):
max_so_far = max_ending_here
if flag == 0 and max_so_far == 0:
return 0
return max_so_far
|
transformation_rename_variable_naive
|
def max_subarray_product(VAR_0):
n = len(VAR_0)
max_ending_here = 1
min_ending_here = 1
max_so_far = 0
flag = 0
for i in range(0, n):
if VAR_0[i] > 0:
max_ending_here = max_ending_here * VAR_0[i]
min_ending_here = min(min_ending_here * VAR_0[i], 1)
flag = 1
elif VAR_0[i] == 0:
max_ending_here = 1
min_ending_here = 1
else:
temp = max_ending_here
max_ending_here = max(min_ending_here * VAR_0[i], 1)
min_ending_here = temp * VAR_0[i]
if max_so_far < max_ending_here:
max_so_far = max_ending_here
if flag == 0 and max_so_far == 0:
return 0
return max_so_far
| 1 | 460 |
mbpp
|
def max_subarray_product(arr):
n = len(arr)
max_ending_here = 1
min_ending_here = 1
max_so_far = 0
flag = 0
for i in range(0, n):
if arr[i] > 0:
max_ending_here = max_ending_here * arr[i]
min_ending_here = min (min_ending_here * arr[i], 1)
flag = 1
elif arr[i] == 0:
max_ending_here = 1
min_ending_here = 1
else:
temp = max_ending_here
max_ending_here = max (min_ending_here * arr[i], 1)
min_ending_here = temp * arr[i]
if (max_so_far < max_ending_here):
max_so_far = max_ending_here
if flag == 0 and max_so_far == 0:
return 0
return max_so_far
|
transformation_rename_variable_rn
|
def max_subarray_product(X3S):
n = len(X3S)
max_ending_here = 1
min_ending_here = 1
max_so_far = 0
flag = 0
for i in range(0, n):
if X3S[i] > 0:
max_ending_here = max_ending_here * X3S[i]
min_ending_here = min(min_ending_here * X3S[i], 1)
flag = 1
elif X3S[i] == 0:
max_ending_here = 1
min_ending_here = 1
else:
temp = max_ending_here
max_ending_here = max(min_ending_here * X3S[i], 1)
min_ending_here = temp * X3S[i]
if max_so_far < max_ending_here:
max_so_far = max_ending_here
if flag == 0 and max_so_far == 0:
return 0
return max_so_far
| 1 | 460 |
mbpp
|
def max_subarray_product(arr):
n = len(arr)
max_ending_here = 1
min_ending_here = 1
max_so_far = 0
flag = 0
for i in range(0, n):
if arr[i] > 0:
max_ending_here = max_ending_here * arr[i]
min_ending_here = min (min_ending_here * arr[i], 1)
flag = 1
elif arr[i] == 0:
max_ending_here = 1
min_ending_here = 1
else:
temp = max_ending_here
max_ending_here = max (min_ending_here * arr[i], 1)
min_ending_here = temp * arr[i]
if (max_so_far < max_ending_here):
max_so_far = max_ending_here
if flag == 0 and max_so_far == 0:
return 0
return max_so_far
|
transformation_mul_div_variable
|
def max_subarray_product(arr):
n = len(arr)
max_ending_here = 1
min_ending_here = 1
max_so_far = 0
flag = 0
for i in range(0, n):
if arr[i] > 0:
max_ending_here = max_ending_here / arr[i]
min_ending_here = min (min_ending_here * arr[i], 1)
flag = 1
elif arr[i] == 0:
max_ending_here = 1
min_ending_here = 1
else:
temp = max_ending_here
max_ending_here = max (min_ending_here * arr[i], 1)
min_ending_here = temp * arr[i]
if (max_so_far < max_ending_here):
max_so_far = max_ending_here
if flag == 0 and max_so_far == 0:
return 0
return max_so_far
| 0 | 460 |
mbpp
|
def max_subarray_product(arr):
n = len(arr)
max_ending_here = 1
min_ending_here = 1
max_so_far = 0
flag = 0
for i in range(0, n):
if arr[i] > 0:
max_ending_here = max_ending_here * arr[i]
min_ending_here = min (min_ending_here * arr[i], 1)
flag = 1
elif arr[i] == 0:
max_ending_here = 1
min_ending_here = 1
else:
temp = max_ending_here
max_ending_here = max (min_ending_here * arr[i], 1)
min_ending_here = temp * arr[i]
if (max_so_far < max_ending_here):
max_so_far = max_ending_here
if flag == 0 and max_so_far == 0:
return 0
return max_so_far
|
transformation_lesser_greater_variable
|
def max_subarray_product(arr):
n = len(arr)
max_ending_here = 1
min_ending_here = 1
max_so_far = 0
flag = 0
for i in range(0, n):
if arr[i] > 0:
max_ending_here = max_ending_here * arr[i]
min_ending_here = min (min_ending_here * arr[i], 1)
flag = 1
elif arr[i] == 0:
max_ending_here = 1
min_ending_here = 1
else:
temp = max_ending_here
max_ending_here = max (min_ending_here * arr[i], 1)
min_ending_here = temp * arr[i]
if (max_so_far > max_ending_here):
max_so_far = max_ending_here
if flag == 0 and max_so_far == 0:
return 0
return max_so_far
| 0 | 460 |
mbpp
|
def max_subarray_product(arr):
n = len(arr)
max_ending_here = 1
min_ending_here = 1
max_so_far = 0
flag = 0
for i in range(0, n):
if arr[i] > 0:
max_ending_here = max_ending_here * arr[i]
min_ending_here = min (min_ending_here * arr[i], 1)
flag = 1
elif arr[i] == 0:
max_ending_here = 1
min_ending_here = 1
else:
temp = max_ending_here
max_ending_here = max (min_ending_here * arr[i], 1)
min_ending_here = temp * arr[i]
if (max_so_far < max_ending_here):
max_so_far = max_ending_here
if flag == 0 and max_so_far == 0:
return 0
return max_so_far
|
transformation_greater_lesser_variable
|
def max_subarray_product(arr):
n = len(arr)
max_ending_here = 1
min_ending_here = 1
max_so_far = 0
flag = 0
for i in range(0, n):
if arr[i] < 0:
max_ending_here = max_ending_here * arr[i]
min_ending_here = min (min_ending_here * arr[i], 1)
flag = 1
elif arr[i] == 0:
max_ending_here = 1
min_ending_here = 1
else:
temp = max_ending_here
max_ending_here = max (min_ending_here * arr[i], 1)
min_ending_here = temp * arr[i]
if (max_so_far < max_ending_here):
max_so_far = max_ending_here
if flag == 0 and max_so_far == 0:
return 0
return max_so_far
| 0 | 460 |
mbpp
|
def max_subarray_product(arr):
n = len(arr)
max_ending_here = 1
min_ending_here = 1
max_so_far = 0
flag = 0
for i in range(0, n):
if arr[i] > 0:
max_ending_here = max_ending_here * arr[i]
min_ending_here = min (min_ending_here * arr[i], 1)
flag = 1
elif arr[i] == 0:
max_ending_here = 1
min_ending_here = 1
else:
temp = max_ending_here
max_ending_here = max (min_ending_here * arr[i], 1)
min_ending_here = temp * arr[i]
if (max_so_far < max_ending_here):
max_so_far = max_ending_here
if flag == 0 and max_so_far == 0:
return 0
return max_so_far
|
transformation_equalto_exclamation_variable
|
def max_subarray_product(arr):
n = len(arr)
max_ending_here = 1
min_ending_here = 1
max_so_far = 0
flag = 0
for i in range(0, n):
if arr[i] > 0:
max_ending_here = max_ending_here * arr[i]
min_ending_here = min (min_ending_here * arr[i], 1)
flag = 1
elif arr[i] != 0:
max_ending_here = 1
min_ending_here = 1
else:
temp = max_ending_here
max_ending_here = max (min_ending_here * arr[i], 1)
min_ending_here = temp * arr[i]
if (max_so_far < max_ending_here):
max_so_far = max_ending_here
if flag == 0 and max_so_far == 0:
return 0
return max_so_far
| 0 | 460 |
mbpp
|
def max_subarray_product(arr):
n = len(arr)
max_ending_here = 1
min_ending_here = 1
max_so_far = 0
flag = 0
for i in range(0, n):
if arr[i] > 0:
max_ending_here = max_ending_here * arr[i]
min_ending_here = min (min_ending_here * arr[i], 1)
flag = 1
elif arr[i] == 0:
max_ending_here = 1
min_ending_here = 1
else:
temp = max_ending_here
max_ending_here = max (min_ending_here * arr[i], 1)
min_ending_here = temp * arr[i]
if (max_so_far < max_ending_here):
max_so_far = max_ending_here
if flag == 0 and max_so_far == 0:
return 0
return max_so_far
|
transformation_and_or_variable
|
def max_subarray_product(arr):
n = len(arr)
max_ending_here = 1
min_ending_here = 1
max_so_far = 0
flag = 0
for i in range(0, n):
if arr[i] > 0:
max_ending_here = max_ending_here * arr[i]
min_ending_here = min (min_ending_here * arr[i], 1)
flag = 1
elif arr[i] == 0:
max_ending_here = 1
min_ending_here = 1
else:
temp = max_ending_here
max_ending_here = max (min_ending_here * arr[i], 1)
min_ending_here = temp * arr[i]
if (max_so_far < max_ending_here):
max_so_far = max_ending_here
if flag == 0 or max_so_far == 0:
return 0
return max_so_far
| 0 | 460 |
mbpp
|
def max_subarray_product(arr):
n = len(arr)
max_ending_here = 1
min_ending_here = 1
max_so_far = 0
flag = 0
for i in range(0, n):
if arr[i] > 0:
max_ending_here = max_ending_here * arr[i]
min_ending_here = min (min_ending_here * arr[i], 1)
flag = 1
elif arr[i] == 0:
max_ending_here = 1
min_ending_here = 1
else:
temp = max_ending_here
max_ending_here = max (min_ending_here * arr[i], 1)
min_ending_here = temp * arr[i]
if (max_so_far < max_ending_here):
max_so_far = max_ending_here
if flag == 0 and max_so_far == 0:
return 0
return max_so_far
|
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 | 460 |
mbpp
|
def max_subarray_product(arr):
n = len(arr)
max_ending_here = 1
min_ending_here = 1
max_so_far = 0
flag = 0
for i in range(0, n):
if arr[i] > 0:
max_ending_here = max_ending_here * arr[i]
min_ending_here = min (min_ending_here * arr[i], 1)
flag = 1
elif arr[i] == 0:
max_ending_here = 1
min_ending_here = 1
else:
temp = max_ending_here
max_ending_here = max (min_ending_here * arr[i], 1)
min_ending_here = temp * arr[i]
if (max_so_far < max_ending_here):
max_so_far = max_ending_here
if flag == 0 and max_so_far == 0:
return 0
return max_so_far
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 460 |
mbpp
|
def max_subarray_product(arr):
n = len(arr)
max_ending_here = 1
min_ending_here = 1
max_so_far = 0
flag = 0
for i in range(0, n):
if arr[i] > 0:
max_ending_here = max_ending_here * arr[i]
min_ending_here = min (min_ending_here * arr[i], 1)
flag = 1
elif arr[i] == 0:
max_ending_here = 1
min_ending_here = 1
else:
temp = max_ending_here
max_ending_here = max (min_ending_here * arr[i], 1)
min_ending_here = temp * arr[i]
if (max_so_far < max_ending_here):
max_so_far = max_ending_here
if flag == 0 and max_so_far == 0:
return 0
return max_so_far
|
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 | 460 |
mbpp
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.