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 unique_sublists(list1):
result ={}
for l in list1:
result.setdefault(tuple(l), list()).append(1)
for a, b in result.items():
result[a] = sum(b)
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 | 776 |
mbpp
|
def unique_sublists(list1):
result ={}
for l in list1:
result.setdefault(tuple(l), list()).append(1)
for a, b in result.items():
result[a] = sum(b)
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 | 776 |
mbpp
|
def Odd_Length_Sum(arr):
Sum = 0
l = len(arr)
for i in range(l):
Sum += ((((i + 1) *(l - i) + 1) // 2) * arr[i])
return Sum
|
transformation_dead_code_insert
|
def Odd_Length_Sum(arr):
for _i_2 in range(0):
Sum += (((i + 1) * (l - i) + 1) // 2) * arr[i]
Sum = 0
l = len(arr)
for i in range(l):
Sum += (((i + 1) * (l - i) + 1) // 2) * arr[i]
return Sum
| 1 | 779 |
mbpp
|
def Odd_Length_Sum(arr):
Sum = 0
l = len(arr)
for i in range(l):
Sum += ((((i + 1) *(l - i) + 1) // 2) * arr[i])
return Sum
|
transformation_for_while_loop
|
def Odd_Length_Sum(arr):
Sum = 0
l = len(arr)
i = 0
while i < l:
Sum += (((i + 1) * (l - i) + 1) // 2) * arr[i]
i += 1
return Sum
| 1 | 779 |
mbpp
|
def Odd_Length_Sum(arr):
Sum = 0
l = len(arr)
for i in range(l):
Sum += ((((i + 1) *(l - i) + 1) // 2) * arr[i])
return Sum
|
transformation_operand_swap
|
def Odd_Length_Sum(arr):
Sum = 0
l = len(arr)
for i in range(l):
Sum += (((i + 1) * (l - i) + 1) // 2) * arr[i]
return Sum
| 1 | 779 |
mbpp
|
def Odd_Length_Sum(arr):
Sum = 0
l = len(arr)
for i in range(l):
Sum += ((((i + 1) *(l - i) + 1) // 2) * arr[i])
return Sum
|
transformation_rename_variable_cb
|
def Odd_Length_Sum(arr):
Sum = 0
l = len(arr)
for i2 in range(l):
Sum += (((i2 + 1) * (l - i2) + 1) // 2) * arr[i2]
return Sum
| 1 | 779 |
mbpp
|
def Odd_Length_Sum(arr):
Sum = 0
l = len(arr)
for i in range(l):
Sum += ((((i + 1) *(l - i) + 1) // 2) * arr[i])
return Sum
|
transformation_rename_variable_naive
|
def Odd_Length_Sum(arr):
Sum = 0
l = len(arr)
for VAR_0 in range(l):
Sum += (((VAR_0 + 1) * (l - VAR_0) + 1) // 2) * arr[VAR_0]
return Sum
| 1 | 779 |
mbpp
|
def Odd_Length_Sum(arr):
Sum = 0
l = len(arr)
for i in range(l):
Sum += ((((i + 1) *(l - i) + 1) // 2) * arr[i])
return Sum
|
transformation_rename_variable_rn
|
def Odd_Length_Sum(arr):
Sum = 0
l = len(arr)
for q in range(l):
Sum += (((q + 1) * (l - q) + 1) // 2) * arr[q]
return Sum
| 1 | 779 |
mbpp
|
def Odd_Length_Sum(arr):
Sum = 0
l = len(arr)
for i in range(l):
Sum += ((((i + 1) *(l - i) + 1) // 2) * arr[i])
return Sum
|
transformation_add_sub_variable
|
def Odd_Length_Sum(arr):
Sum = 0
l = len(arr)
for i in range(l):
Sum -= ((((i + 1) *(l - i) + 1) // 2) * arr[i])
return Sum
| 0 | 779 |
mbpp
|
def Odd_Length_Sum(arr):
Sum = 0
l = len(arr)
for i in range(l):
Sum += ((((i + 1) *(l - i) + 1) // 2) * arr[i])
return Sum
|
transformation_sub_add_variable
|
def Odd_Length_Sum(arr):
Sum = 0
l = len(arr)
for i in range(l):
Sum += ((((i + 1) *(l + i) + 1) // 2) * arr[i])
return Sum
| 0 | 779 |
mbpp
|
def Odd_Length_Sum(arr):
Sum = 0
l = len(arr)
for i in range(l):
Sum += ((((i + 1) *(l - i) + 1) // 2) * arr[i])
return Sum
|
transformation_mul_div_variable
|
def Odd_Length_Sum(arr):
Sum = 0
l = len(arr)
for i in range(l):
Sum += ((((i + 1) /(l - i) + 1) // 2) * arr[i])
return Sum
| 0 | 779 |
mbpp
|
def Odd_Length_Sum(arr):
Sum = 0
l = len(arr)
for i in range(l):
Sum += ((((i + 1) *(l - i) + 1) // 2) * arr[i])
return Sum
|
transformation_div_mul_variable
|
def Odd_Length_Sum(arr):
Sum = 0
l = len(arr)
for i in range(l):
Sum += ((((i + 1) *(l - i) + 1) */ 2) * arr[i])
return Sum
| 0 | 779 |
mbpp
|
def Odd_Length_Sum(arr):
Sum = 0
l = len(arr)
for i in range(l):
Sum += ((((i + 1) *(l - i) + 1) // 2) * arr[i])
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 | 779 |
mbpp
|
def Odd_Length_Sum(arr):
Sum = 0
l = len(arr)
for i in range(l):
Sum += ((((i + 1) *(l - i) + 1) // 2) * arr[i])
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 | 779 |
mbpp
|
def Odd_Length_Sum(arr):
Sum = 0
l = len(arr)
for i in range(l):
Sum += ((((i + 1) *(l - i) + 1) // 2) * arr[i])
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 | 779 |
mbpp
|
def Odd_Length_Sum(arr):
Sum = 0
l = len(arr)
for i in range(l):
Sum += ((((i + 1) *(l - i) + 1) // 2) * arr[i])
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 | 779 |
mbpp
|
def Odd_Length_Sum(arr):
Sum = 0
l = len(arr)
for i in range(l):
Sum += ((((i + 1) *(l - i) + 1) // 2) * arr[i])
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 | 779 |
mbpp
|
def rgb_to_hsv(r, g, b):
r, g, b = r/255.0, g/255.0, b/255.0
mx = max(r, g, b)
mn = min(r, g, b)
df = mx-mn
if mx == mn:
h = 0
elif mx == r:
h = (60 * ((g-b)/df) + 360) % 360
elif mx == g:
h = (60 * ((b-r)/df) + 120) % 360
elif mx == b:
h = (60 * ((r-g)/df) + 240) % 360
if mx == 0:
s = 0
else:
s = (df/mx)*100
v = mx*100
return h, s, v
|
transformation_dead_code_insert
|
def rgb_to_hsv(r, g, b):
r, g, b = r / 255.0, g / 255.0, b / 255.0
mx = max(r, g, b)
mn = min(r, g, b)
_i_3 = 0
if _i_3 < _i_3:
h = (60 * ((r - g) / df) + 240) % 360
df = mx - mn
if mx == mn:
h = 0
elif mx == r:
h = (60 * ((g - b) / df) + 360) % 360
elif mx == g:
h = (60 * ((b - r) / df) + 120) % 360
elif mx == b:
h = (60 * ((r - g) / df) + 240) % 360
if mx == 0:
s = 0
else:
s = (df / mx) * 100
v = mx * 100
return h, s, v
| 1 | 780 |
mbpp
|
def rgb_to_hsv(r, g, b):
r, g, b = r/255.0, g/255.0, b/255.0
mx = max(r, g, b)
mn = min(r, g, b)
df = mx-mn
if mx == mn:
h = 0
elif mx == r:
h = (60 * ((g-b)/df) + 360) % 360
elif mx == g:
h = (60 * ((b-r)/df) + 120) % 360
elif mx == b:
h = (60 * ((r-g)/df) + 240) % 360
if mx == 0:
s = 0
else:
s = (df/mx)*100
v = mx*100
return h, s, v
|
transformation_for_while_loop
|
def rgb_to_hsv(r, g, b):
r, g, b = r / 255.0, g / 255.0, b / 255.0
mx = max(r, g, b)
mn = min(r, g, b)
df = mx - mn
if mx == mn:
h = 0
elif mx == r:
h = (60 * ((g - b) / df) + 360) % 360
elif mx == g:
h = (60 * ((b - r) / df) + 120) % 360
elif mx == b:
h = (60 * ((r - g) / df) + 240) % 360
if mx == 0:
s = 0
else:
s = (df / mx) * 100
v = mx * 100
return h, s, v
| 1 | 780 |
mbpp
|
def rgb_to_hsv(r, g, b):
r, g, b = r/255.0, g/255.0, b/255.0
mx = max(r, g, b)
mn = min(r, g, b)
df = mx-mn
if mx == mn:
h = 0
elif mx == r:
h = (60 * ((g-b)/df) + 360) % 360
elif mx == g:
h = (60 * ((b-r)/df) + 120) % 360
elif mx == b:
h = (60 * ((r-g)/df) + 240) % 360
if mx == 0:
s = 0
else:
s = (df/mx)*100
v = mx*100
return h, s, v
|
transformation_operand_swap
|
def rgb_to_hsv(r, g, b):
r, g, b = r / 255.0, g / 255.0, b / 255.0
mx = max(r, g, b)
mn = min(r, g, b)
df = mx - mn
if mn == mx:
h = 0
elif mx == r:
h = (60 * ((g - b) / df) + 360) % 360
elif mx == g:
h = (60 * ((b - r) / df) + 120) % 360
elif mx == b:
h = (60 * ((r - g) / df) + 240) % 360
if mx == 0:
s = 0
else:
s = (df / mx) * 100
v = mx * 100
return h, s, v
| 1 | 780 |
mbpp
|
def rgb_to_hsv(r, g, b):
r, g, b = r/255.0, g/255.0, b/255.0
mx = max(r, g, b)
mn = min(r, g, b)
df = mx-mn
if mx == mn:
h = 0
elif mx == r:
h = (60 * ((g-b)/df) + 360) % 360
elif mx == g:
h = (60 * ((b-r)/df) + 120) % 360
elif mx == b:
h = (60 * ((r-g)/df) + 240) % 360
if mx == 0:
s = 0
else:
s = (df/mx)*100
v = mx*100
return h, s, v
|
transformation_rename_variable_cb
|
def rgb_to_hsv(r, g, b):
r, g, b = r / 255.0, g / 255.0, b / 255.0
h2 = max(r, g, b)
mn = min(r, g, b)
df = h2 - mn
if h2 == mn:
h = 0
elif h2 == r:
h = (60 * ((g - b) / df) + 360) % 360
elif h2 == g:
h = (60 * ((b - r) / df) + 120) % 360
elif h2 == b:
h = (60 * ((r - g) / df) + 240) % 360
if h2 == 0:
s = 0
else:
s = (df / h2) * 100
v = h2 * 100
return h, s, v
| 1 | 780 |
mbpp
|
def rgb_to_hsv(r, g, b):
r, g, b = r/255.0, g/255.0, b/255.0
mx = max(r, g, b)
mn = min(r, g, b)
df = mx-mn
if mx == mn:
h = 0
elif mx == r:
h = (60 * ((g-b)/df) + 360) % 360
elif mx == g:
h = (60 * ((b-r)/df) + 120) % 360
elif mx == b:
h = (60 * ((r-g)/df) + 240) % 360
if mx == 0:
s = 0
else:
s = (df/mx)*100
v = mx*100
return h, s, v
|
transformation_rename_variable_naive
|
def rgb_to_hsv(r, g, b):
r, g, b = r / 255.0, g / 255.0, b / 255.0
VAR_0 = max(r, g, b)
mn = min(r, g, b)
df = VAR_0 - mn
if VAR_0 == mn:
h = 0
elif VAR_0 == r:
h = (60 * ((g - b) / df) + 360) % 360
elif VAR_0 == g:
h = (60 * ((b - r) / df) + 120) % 360
elif VAR_0 == b:
h = (60 * ((r - g) / df) + 240) % 360
if VAR_0 == 0:
s = 0
else:
s = (df / VAR_0) * 100
v = VAR_0 * 100
return h, s, v
| 1 | 780 |
mbpp
|
def rgb_to_hsv(r, g, b):
r, g, b = r/255.0, g/255.0, b/255.0
mx = max(r, g, b)
mn = min(r, g, b)
df = mx-mn
if mx == mn:
h = 0
elif mx == r:
h = (60 * ((g-b)/df) + 360) % 360
elif mx == g:
h = (60 * ((b-r)/df) + 120) % 360
elif mx == b:
h = (60 * ((r-g)/df) + 240) % 360
if mx == 0:
s = 0
else:
s = (df/mx)*100
v = mx*100
return h, s, v
|
transformation_rename_variable_rn
|
def rgb_to_hsv(r, g, b):
r, g, b = r / 255.0, g / 255.0, b / 255.0
Sn = max(r, g, b)
mn = min(r, g, b)
df = Sn - mn
if Sn == mn:
h = 0
elif Sn == r:
h = (60 * ((g - b) / df) + 360) % 360
elif Sn == g:
h = (60 * ((b - r) / df) + 120) % 360
elif Sn == b:
h = (60 * ((r - g) / df) + 240) % 360
if Sn == 0:
s = 0
else:
s = (df / Sn) * 100
v = Sn * 100
return h, s, v
| 1 | 780 |
mbpp
|
def rgb_to_hsv(r, g, b):
r, g, b = r/255.0, g/255.0, b/255.0
mx = max(r, g, b)
mn = min(r, g, b)
df = mx-mn
if mx == mn:
h = 0
elif mx == r:
h = (60 * ((g-b)/df) + 360) % 360
elif mx == g:
h = (60 * ((b-r)/df) + 120) % 360
elif mx == b:
h = (60 * ((r-g)/df) + 240) % 360
if mx == 0:
s = 0
else:
s = (df/mx)*100
v = mx*100
return h, s, v
|
transformation_add_sub_variable
|
def rgb_to_hsv(r, g, b):
r, g, b = r/255.0, g/255.0, b/255.0
mx = max(r, g, b)
mn = min(r, g, b)
df = mx-mn
if mx == mn:
h = 0
elif mx == r:
h = (60 * ((g-b)/df) - 360) % 360
elif mx == g:
h = (60 * ((b-r)/df) + 120) % 360
elif mx == b:
h = (60 * ((r-g)/df) + 240) % 360
if mx == 0:
s = 0
else:
s = (df/mx)*100
v = mx*100
return h, s, v
| 0 | 780 |
mbpp
|
def rgb_to_hsv(r, g, b):
r, g, b = r/255.0, g/255.0, b/255.0
mx = max(r, g, b)
mn = min(r, g, b)
df = mx-mn
if mx == mn:
h = 0
elif mx == r:
h = (60 * ((g-b)/df) + 360) % 360
elif mx == g:
h = (60 * ((b-r)/df) + 120) % 360
elif mx == b:
h = (60 * ((r-g)/df) + 240) % 360
if mx == 0:
s = 0
else:
s = (df/mx)*100
v = mx*100
return h, s, v
|
transformation_sub_add_variable
|
def rgb_to_hsv(r, g, b):
r, g, b = r/255.0, g/255.0, b/255.0
mx = max(r, g, b)
mn = min(r, g, b)
df = mx+mn
if mx == mn:
h = 0
elif mx == r:
h = (60 * ((g-b)/df) + 360) % 360
elif mx == g:
h = (60 * ((b-r)/df) + 120) % 360
elif mx == b:
h = (60 * ((r-g)/df) + 240) % 360
if mx == 0:
s = 0
else:
s = (df/mx)*100
v = mx*100
return h, s, v
| 0 | 780 |
mbpp
|
def rgb_to_hsv(r, g, b):
r, g, b = r/255.0, g/255.0, b/255.0
mx = max(r, g, b)
mn = min(r, g, b)
df = mx-mn
if mx == mn:
h = 0
elif mx == r:
h = (60 * ((g-b)/df) + 360) % 360
elif mx == g:
h = (60 * ((b-r)/df) + 120) % 360
elif mx == b:
h = (60 * ((r-g)/df) + 240) % 360
if mx == 0:
s = 0
else:
s = (df/mx)*100
v = mx*100
return h, s, v
|
transformation_mul_div_variable
|
def rgb_to_hsv(r, g, b):
r, g, b = r/255.0, g/255.0, b/255.0
mx = max(r, g, b)
mn = min(r, g, b)
df = mx-mn
if mx == mn:
h = 0
elif mx == r:
h = (60 / ((g-b)/df) + 360) % 360
elif mx == g:
h = (60 * ((b-r)/df) + 120) % 360
elif mx == b:
h = (60 * ((r-g)/df) + 240) % 360
if mx == 0:
s = 0
else:
s = (df/mx)*100
v = mx*100
return h, s, v
| 0 | 780 |
mbpp
|
def rgb_to_hsv(r, g, b):
r, g, b = r/255.0, g/255.0, b/255.0
mx = max(r, g, b)
mn = min(r, g, b)
df = mx-mn
if mx == mn:
h = 0
elif mx == r:
h = (60 * ((g-b)/df) + 360) % 360
elif mx == g:
h = (60 * ((b-r)/df) + 120) % 360
elif mx == b:
h = (60 * ((r-g)/df) + 240) % 360
if mx == 0:
s = 0
else:
s = (df/mx)*100
v = mx*100
return h, s, v
|
transformation_div_mul_variable
|
def rgb_to_hsv(r, g, b):
r, g, b = r*255.0, g/255.0, b/255.0
mx = max(r, g, b)
mn = min(r, g, b)
df = mx-mn
if mx == mn:
h = 0
elif mx == r:
h = (60 * ((g-b)/df) + 360) % 360
elif mx == g:
h = (60 * ((b-r)/df) + 120) % 360
elif mx == b:
h = (60 * ((r-g)/df) + 240) % 360
if mx == 0:
s = 0
else:
s = (df/mx)*100
v = mx*100
return h, s, v
| 0 | 780 |
mbpp
|
def rgb_to_hsv(r, g, b):
r, g, b = r/255.0, g/255.0, b/255.0
mx = max(r, g, b)
mn = min(r, g, b)
df = mx-mn
if mx == mn:
h = 0
elif mx == r:
h = (60 * ((g-b)/df) + 360) % 360
elif mx == g:
h = (60 * ((b-r)/df) + 120) % 360
elif mx == b:
h = (60 * ((r-g)/df) + 240) % 360
if mx == 0:
s = 0
else:
s = (df/mx)*100
v = mx*100
return h, s, v
|
transformation_equalto_exclamation_variable
|
def rgb_to_hsv(r, g, b):
r, g, b = r/255.0, g/255.0, b/255.0
mx = max(r, g, b)
mn = min(r, g, b)
df = mx-mn
if mx != mn:
h = 0
elif mx == r:
h = (60 * ((g-b)/df) + 360) % 360
elif mx == g:
h = (60 * ((b-r)/df) + 120) % 360
elif mx == b:
h = (60 * ((r-g)/df) + 240) % 360
if mx == 0:
s = 0
else:
s = (df/mx)*100
v = mx*100
return h, s, v
| 0 | 780 |
mbpp
|
def rgb_to_hsv(r, g, b):
r, g, b = r/255.0, g/255.0, b/255.0
mx = max(r, g, b)
mn = min(r, g, b)
df = mx-mn
if mx == mn:
h = 0
elif mx == r:
h = (60 * ((g-b)/df) + 360) % 360
elif mx == g:
h = (60 * ((b-r)/df) + 120) % 360
elif mx == b:
h = (60 * ((r-g)/df) + 240) % 360
if mx == 0:
s = 0
else:
s = (df/mx)*100
v = mx*100
return h, s, v
|
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 | 780 |
mbpp
|
def rgb_to_hsv(r, g, b):
r, g, b = r/255.0, g/255.0, b/255.0
mx = max(r, g, b)
mn = min(r, g, b)
df = mx-mn
if mx == mn:
h = 0
elif mx == r:
h = (60 * ((g-b)/df) + 360) % 360
elif mx == g:
h = (60 * ((b-r)/df) + 120) % 360
elif mx == b:
h = (60 * ((r-g)/df) + 240) % 360
if mx == 0:
s = 0
else:
s = (df/mx)*100
v = mx*100
return h, s, v
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 780 |
mbpp
|
def rgb_to_hsv(r, g, b):
r, g, b = r/255.0, g/255.0, b/255.0
mx = max(r, g, b)
mn = min(r, g, b)
df = mx-mn
if mx == mn:
h = 0
elif mx == r:
h = (60 * ((g-b)/df) + 360) % 360
elif mx == g:
h = (60 * ((b-r)/df) + 120) % 360
elif mx == b:
h = (60 * ((r-g)/df) + 240) % 360
if mx == 0:
s = 0
else:
s = (df/mx)*100
v = mx*100
return h, s, v
|
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 | 780 |
mbpp
|
def rgb_to_hsv(r, g, b):
r, g, b = r/255.0, g/255.0, b/255.0
mx = max(r, g, b)
mn = min(r, g, b)
df = mx-mn
if mx == mn:
h = 0
elif mx == r:
h = (60 * ((g-b)/df) + 360) % 360
elif mx == g:
h = (60 * ((b-r)/df) + 120) % 360
elif mx == b:
h = (60 * ((r-g)/df) + 240) % 360
if mx == 0:
s = 0
else:
s = (df/mx)*100
v = mx*100
return h, s, v
|
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 | 780 |
mbpp
|
def rgb_to_hsv(r, g, b):
r, g, b = r/255.0, g/255.0, b/255.0
mx = max(r, g, b)
mn = min(r, g, b)
df = mx-mn
if mx == mn:
h = 0
elif mx == r:
h = (60 * ((g-b)/df) + 360) % 360
elif mx == g:
h = (60 * ((b-r)/df) + 120) % 360
elif mx == b:
h = (60 * ((r-g)/df) + 240) % 360
if mx == 0:
s = 0
else:
s = (df/mx)*100
v = mx*100
return h, s, v
|
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 | 780 |
mbpp
|
def tuple_str_int(test_str):
res = tuple(int(num) for num in test_str.replace('(', '').replace(')', '').replace('...', '').split(', '))
return (res)
|
transformation_dead_code_insert
|
def tuple_str_int(test_str):
_i_9 = 0
if _i_9 < _i_9:
return res
res = tuple(
int(num)
for num in test_str.replace("(", "")
.replace(")", "")
.replace("...", "")
.split(", ")
)
return res
| 1 | 782 |
mbpp
|
def tuple_str_int(test_str):
res = tuple(int(num) for num in test_str.replace('(', '').replace(')', '').replace('...', '').split(', '))
return (res)
|
transformation_for_while_loop
|
def tuple_str_int(test_str):
res = tuple(
int(num)
for num in test_str.replace("(", "")
.replace(")", "")
.replace("...", "")
.split(", ")
)
return res
| 1 | 782 |
mbpp
|
def tuple_str_int(test_str):
res = tuple(int(num) for num in test_str.replace('(', '').replace(')', '').replace('...', '').split(', '))
return (res)
|
transformation_operand_swap
|
def tuple_str_int(test_str):
res = tuple(
int(num)
for num in test_str.replace("(", "")
.replace(")", "")
.replace("...", "")
.split(", ")
)
return res
| 1 | 782 |
mbpp
|
def tuple_str_int(test_str):
res = tuple(int(num) for num in test_str.replace('(', '').replace(')', '').replace('...', '').split(', '))
return (res)
|
transformation_rename_variable_cb
|
def tuple_str_int(test_str):
res = tuple(
int(num)
for num in test_str.split2("(", "")
.split2(")", "")
.split2("...", "")
.split(", ")
)
return res
| 1 | 782 |
mbpp
|
def tuple_str_int(test_str):
res = tuple(int(num) for num in test_str.replace('(', '').replace(')', '').replace('...', '').split(', '))
return (res)
|
transformation_rename_variable_naive
|
def tuple_str_int(test_str):
res = tuple(
int(num)
for num in test_str.VAR_0("(", "").VAR_0(")", "").VAR_0("...", "").split(", ")
)
return res
| 1 | 782 |
mbpp
|
def tuple_str_int(test_str):
res = tuple(int(num) for num in test_str.replace('(', '').replace(')', '').replace('...', '').split(', '))
return (res)
|
transformation_rename_variable_rn
|
def tuple_str_int(test_str):
res = tuple(
int(num)
for num in test_str.t2V64s5("(", "")
.t2V64s5(")", "")
.t2V64s5("...", "")
.split(", ")
)
return res
| 1 | 782 |
mbpp
|
def tuple_str_int(test_str):
res = tuple(int(num) for num in test_str.replace('(', '').replace(')', '').replace('...', '').split(', '))
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 | 782 |
mbpp
|
def tuple_str_int(test_str):
res = tuple(int(num) for num in test_str.replace('(', '').replace(')', '').replace('...', '').split(', '))
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 | 782 |
mbpp
|
def tuple_str_int(test_str):
res = tuple(int(num) for num in test_str.replace('(', '').replace(')', '').replace('...', '').split(', '))
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 | 782 |
mbpp
|
def tuple_str_int(test_str):
res = tuple(int(num) for num in test_str.replace('(', '').replace(')', '').replace('...', '').split(', '))
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 | 782 |
mbpp
|
def tuple_str_int(test_str):
res = tuple(int(num) for num in test_str.replace('(', '').replace(')', '').replace('...', '').split(', '))
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 | 782 |
mbpp
|
def right_insertion(a, x):
import bisect
i = bisect.bisect_right(a, x)
return i
|
transformation_dead_code_insert
|
def right_insertion(a, x):
import bisect
_i_7 = 0
while _i_7 < _i_7:
import bisect
i = bisect.bisect_right(a, x)
return i
| 1 | 783 |
mbpp
|
def right_insertion(a, x):
import bisect
i = bisect.bisect_right(a, x)
return i
|
transformation_for_while_loop
|
def right_insertion(a, x):
import bisect
i = bisect.bisect_right(a, x)
return i
| 1 | 783 |
mbpp
|
def right_insertion(a, x):
import bisect
i = bisect.bisect_right(a, x)
return i
|
transformation_operand_swap
|
def right_insertion(a, x):
import bisect
i = bisect.bisect_right(a, x)
return i
| 1 | 783 |
mbpp
|
def right_insertion(a, x):
import bisect
i = bisect.bisect_right(a, x)
return i
|
transformation_rename_variable_cb
|
def right_insertion(a, x):
import bisect
r = bisect.bisect_right(a, x)
return r
| 1 | 783 |
mbpp
|
def right_insertion(a, x):
import bisect
i = bisect.bisect_right(a, x)
return i
|
transformation_rename_variable_naive
|
def right_insertion(a, VAR_0):
import bisect
i = bisect.bisect_right(a, VAR_0)
return i
| 1 | 783 |
mbpp
|
def right_insertion(a, x):
import bisect
i = bisect.bisect_right(a, x)
return i
|
transformation_rename_variable_rn
|
def right_insertion(a, x):
import bisect
C = bisect.bisect_right(a, x)
return C
| 1 | 783 |
mbpp
|
def right_insertion(a, x):
import bisect
i = bisect.bisect_right(a, x)
return i
|
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 | 783 |
mbpp
|
def right_insertion(a, x):
import bisect
i = bisect.bisect_right(a, x)
return i
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 783 |
mbpp
|
def right_insertion(a, x):
import bisect
i = bisect.bisect_right(a, x)
return i
|
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 | 783 |
mbpp
|
def right_insertion(a, x):
import bisect
i = bisect.bisect_right(a, x)
return i
|
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 | 783 |
mbpp
|
def right_insertion(a, x):
import bisect
i = bisect.bisect_right(a, x)
return i
|
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 | 783 |
mbpp
|
def text_match_three(text):
import re
patterns = 'ab{3}?'
if re.search(patterns, text):
return 'Found a match!'
else:
return('Not matched!')
|
transformation_dead_code_insert
|
def text_match_three(text):
import re
if False:
import re
patterns = "ab{3}?"
if re.search(patterns, text):
return "Found a match!"
else:
return "Not matched!"
| 1 | 784 |
mbpp
|
def text_match_three(text):
import re
patterns = 'ab{3}?'
if re.search(patterns, text):
return 'Found a match!'
else:
return('Not matched!')
|
transformation_for_while_loop
|
def text_match_three(text):
import re
patterns = "ab{3}?"
if re.search(patterns, text):
return "Found a match!"
else:
return "Not matched!"
| 1 | 784 |
mbpp
|
def text_match_three(text):
import re
patterns = 'ab{3}?'
if re.search(patterns, text):
return 'Found a match!'
else:
return('Not matched!')
|
transformation_operand_swap
|
def text_match_three(text):
import re
patterns = "ab{3}?"
if re.search(patterns, text):
return "Found a match!"
else:
return "Not matched!"
| 1 | 784 |
mbpp
|
def text_match_three(text):
import re
patterns = 'ab{3}?'
if re.search(patterns, text):
return 'Found a match!'
else:
return('Not matched!')
|
transformation_rename_variable_naive
|
def text_match_three(VAR_0):
import re
patterns = "ab{3}?"
if re.search(patterns, VAR_0):
return "Found a match!"
else:
return "Not matched!"
| 1 | 784 |
mbpp
|
def text_match_three(text):
import re
patterns = 'ab{3}?'
if re.search(patterns, text):
return 'Found a match!'
else:
return('Not matched!')
|
transformation_rename_variable_rn
|
def text_match_three(u9t6):
import re
patterns = "ab{3}?"
if re.search(patterns, u9t6):
return "Found a match!"
else:
return "Not matched!"
| 1 | 784 |
mbpp
|
def text_match_three(text):
import re
patterns = 'ab{3}?'
if re.search(patterns, text):
return 'Found a match!'
else:
return('Not matched!')
|
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 | 784 |
mbpp
|
def text_match_three(text):
import re
patterns = 'ab{3}?'
if re.search(patterns, text):
return 'Found a match!'
else:
return('Not matched!')
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 784 |
mbpp
|
def text_match_three(text):
import re
patterns = 'ab{3}?'
if re.search(patterns, text):
return 'Found a match!'
else:
return('Not matched!')
|
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 | 784 |
mbpp
|
def text_match_three(text):
import re
patterns = 'ab{3}?'
if re.search(patterns, text):
return 'Found a match!'
else:
return('Not matched!')
|
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 | 784 |
mbpp
|
def text_match_three(text):
import re
patterns = 'ab{3}?'
if re.search(patterns, text):
return 'Found a match!'
else:
return('Not matched!')
|
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 | 784 |
mbpp
|
def new_tuple(test_list, test_str):
res = tuple(test_list + [test_str])
return (res)
|
transformation_dead_code_insert
|
def new_tuple(test_list, test_str):
_i_4 = 0
while _i_4 > _i_4:
return res
res = tuple(test_list + [test_str])
return res
| 1 | 785 |
mbpp
|
def new_tuple(test_list, test_str):
res = tuple(test_list + [test_str])
return (res)
|
transformation_for_while_loop
|
def new_tuple(test_list, test_str):
res = tuple(test_list + [test_str])
return res
| 1 | 785 |
mbpp
|
def new_tuple(test_list, test_str):
res = tuple(test_list + [test_str])
return (res)
|
transformation_operand_swap
|
def new_tuple(test_list, test_str):
res = tuple(test_list + [test_str])
return res
| 1 | 785 |
mbpp
|
def new_tuple(test_list, test_str):
res = tuple(test_list + [test_str])
return (res)
|
transformation_rename_variable_cb
|
def new_tuple(test_list, line):
res = tuple(test_list + [line])
return res
| 1 | 785 |
mbpp
|
def new_tuple(test_list, test_str):
res = tuple(test_list + [test_str])
return (res)
|
transformation_rename_variable_naive
|
def new_tuple(test_list, VAR_0):
res = tuple(test_list + [VAR_0])
return res
| 1 | 785 |
mbpp
|
def new_tuple(test_list, test_str):
res = tuple(test_list + [test_str])
return (res)
|
transformation_rename_variable_rn
|
def new_tuple(test_list, bj99HJ39):
res = tuple(test_list + [bj99HJ39])
return res
| 1 | 785 |
mbpp
|
def new_tuple(test_list, test_str):
res = tuple(test_list + [test_str])
return (res)
|
transformation_add_sub_variable
|
def new_tuple(test_list, test_str):
res = tuple(test_list - [test_str])
return (res)
| 0 | 785 |
mbpp
|
def new_tuple(test_list, test_str):
res = tuple(test_list + [test_str])
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 | 785 |
mbpp
|
def new_tuple(test_list, test_str):
res = tuple(test_list + [test_str])
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 | 785 |
mbpp
|
def new_tuple(test_list, test_str):
res = tuple(test_list + [test_str])
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 | 785 |
mbpp
|
def new_tuple(test_list, test_str):
res = tuple(test_list + [test_str])
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 | 785 |
mbpp
|
def new_tuple(test_list, test_str):
res = tuple(test_list + [test_str])
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 | 785 |
mbpp
|
def remove_nested(test_tup):
res = tuple()
for count, ele in enumerate(test_tup):
if not isinstance(ele, tuple):
res = res + (ele, )
return (res)
|
transformation_dead_code_insert
|
def remove_nested(test_tup):
res = tuple()
for count, ele in enumerate(test_tup):
_i_0 = 0
while _i_0 > _i_0:
if not isinstance(ele, tuple):
res = res + (ele,)
if not isinstance(ele, tuple):
res = res + (ele,)
return res
| 1 | 788 |
mbpp
|
def remove_nested(test_tup):
res = tuple()
for count, ele in enumerate(test_tup):
if not isinstance(ele, tuple):
res = res + (ele, )
return (res)
|
transformation_for_while_loop
|
def remove_nested(test_tup):
res = tuple()
for count, ele in enumerate(test_tup):
if not isinstance(ele, tuple):
res = res + (ele,)
return res
| 1 | 788 |
mbpp
|
def remove_nested(test_tup):
res = tuple()
for count, ele in enumerate(test_tup):
if not isinstance(ele, tuple):
res = res + (ele, )
return (res)
|
transformation_operand_swap
|
def remove_nested(test_tup):
res = tuple()
for count, ele in enumerate(test_tup):
if not isinstance(ele, tuple):
res = res + (ele,)
return res
| 1 | 788 |
mbpp
|
def remove_nested(test_tup):
res = tuple()
for count, ele in enumerate(test_tup):
if not isinstance(ele, tuple):
res = res + (ele, )
return (res)
|
transformation_rename_variable_cb
|
def remove_nested(test_tup):
count2 = tuple()
for count, ele in enumerate(test_tup):
if not isinstance(ele, tuple):
count2 = count2 + (ele,)
return count2
| 1 | 788 |
mbpp
|
def remove_nested(test_tup):
res = tuple()
for count, ele in enumerate(test_tup):
if not isinstance(ele, tuple):
res = res + (ele, )
return (res)
|
transformation_rename_variable_naive
|
def remove_nested(test_tup):
VAR_0 = tuple()
for count, ele in enumerate(test_tup):
if not isinstance(ele, tuple):
VAR_0 = VAR_0 + (ele,)
return VAR_0
| 1 | 788 |
mbpp
|
def remove_nested(test_tup):
res = tuple()
for count, ele in enumerate(test_tup):
if not isinstance(ele, tuple):
res = res + (ele, )
return (res)
|
transformation_rename_variable_rn
|
def remove_nested(test_tup):
r84 = tuple()
for count, ele in enumerate(test_tup):
if not isinstance(ele, tuple):
r84 = r84 + (ele,)
return r84
| 1 | 788 |
mbpp
|
def remove_nested(test_tup):
res = tuple()
for count, ele in enumerate(test_tup):
if not isinstance(ele, tuple):
res = res + (ele, )
return (res)
|
transformation_add_sub_variable
|
def remove_nested(test_tup):
res = tuple()
for count, ele in enumerate(test_tup):
if not isinstance(ele, tuple):
res = res - (ele, )
return (res)
| 0 | 788 |
mbpp
|
def remove_nested(test_tup):
res = tuple()
for count, ele in enumerate(test_tup):
if not isinstance(ele, tuple):
res = res + (ele, )
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 | 788 |
mbpp
|
def remove_nested(test_tup):
res = tuple()
for count, ele in enumerate(test_tup):
if not isinstance(ele, tuple):
res = res + (ele, )
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 | 788 |
mbpp
|
def remove_nested(test_tup):
res = tuple()
for count, ele in enumerate(test_tup):
if not isinstance(ele, tuple):
res = res + (ele, )
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 | 788 |
mbpp
|
def remove_nested(test_tup):
res = tuple()
for count, ele in enumerate(test_tup):
if not isinstance(ele, tuple):
res = res + (ele, )
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 | 788 |
mbpp
|
def remove_nested(test_tup):
res = tuple()
for count, ele in enumerate(test_tup):
if not isinstance(ele, tuple):
res = res + (ele, )
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 | 788 |
mbpp
|
def count_list(input_list):
return len(input_list)
|
transformation_dead_code_insert
|
def count_list(input_list):
_i_3 = 0
if _i_3 < _i_3:
return len(input_list)
return len(input_list)
| 1 | 789 |
mbpp
|
def count_list(input_list):
return len(input_list)
|
transformation_dissimilar_code_injection_0
|
def min_cost(cost, m, n):
R = 3
C = 3
tc = [[0 for x in range(C)] for x in range(R)]
tc[0][0] = cost[0][0]
for i in range(1, m+1):
tc[i][0] = tc[i-1][0] + cost[i][0]
for j in range(1, n+1):
tc[0][j] = tc[0][j-1] + cost[0][j]
for i in range(1, m+1):
for j in range(1, n+1):
tc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j]
return tc[m][n]
| 0 | 789 |
mbpp
|
def count_list(input_list):
return len(input_list)
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 789 |
mbpp
|
def count_list(input_list):
return len(input_list)
|
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 | 789 |
mbpp
|
def count_list(input_list):
return len(input_list)
|
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 | 789 |
mbpp
|
def count_list(input_list):
return len(input_list)
|
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 | 789 |
mbpp
|
def last(arr,x,n):
low = 0
high = n - 1
res = -1
while (low <= high):
mid = (low + high) // 2
if arr[mid] > x:
high = mid - 1
elif arr[mid] < x:
low = mid + 1
else:
res = mid
low = mid + 1
return res
|
transformation_dead_code_insert
|
def last(arr, x, n):
low = 0
high = n - 1
res = -1
while low <= high:
mid = (low + high) // 2
if arr[mid] > x:
for _i_4 in range(0):
mid = (low + high) // 2
high = mid - 1
elif arr[mid] < x:
low = mid + 1
else:
res = mid
low = mid + 1
return res
| 1 | 790 |
mbpp
|
def last(arr,x,n):
low = 0
high = n - 1
res = -1
while (low <= high):
mid = (low + high) // 2
if arr[mid] > x:
high = mid - 1
elif arr[mid] < x:
low = mid + 1
else:
res = mid
low = mid + 1
return res
|
transformation_for_while_loop
|
def last(arr, x, n):
low = 0
high = n - 1
res = -1
while low <= high:
mid = (low + high) // 2
if arr[mid] > x:
high = mid - 1
elif arr[mid] < x:
low = mid + 1
else:
res = mid
low = mid + 1
return res
| 1 | 790 |
mbpp
|
def last(arr,x,n):
low = 0
high = n - 1
res = -1
while (low <= high):
mid = (low + high) // 2
if arr[mid] > x:
high = mid - 1
elif arr[mid] < x:
low = mid + 1
else:
res = mid
low = mid + 1
return res
|
transformation_operand_swap
|
def last(arr, x, n):
low = 0
high = n - 1
res = -1
while high >= low:
mid = (low + high) // 2
if arr[mid] > x:
high = mid - 1
elif arr[mid] < x:
low = mid + 1
else:
res = mid
low = mid + 1
return res
| 1 | 790 |
mbpp
|
def last(arr,x,n):
low = 0
high = n - 1
res = -1
while (low <= high):
mid = (low + high) // 2
if arr[mid] > x:
high = mid - 1
elif arr[mid] < x:
low = mid + 1
else:
res = mid
low = mid + 1
return res
|
transformation_rename_variable_cb
|
def last(arr, x, n):
low = 0
high = n - 1
res = -1
while low <= high:
low2 = (low + high) // 2
if arr[low2] > x:
high = low2 - 1
elif arr[low2] < x:
low = low2 + 1
else:
res = low2
low = low2 + 1
return res
| 1 | 790 |
mbpp
|
def last(arr,x,n):
low = 0
high = n - 1
res = -1
while (low <= high):
mid = (low + high) // 2
if arr[mid] > x:
high = mid - 1
elif arr[mid] < x:
low = mid + 1
else:
res = mid
low = mid + 1
return res
|
transformation_rename_variable_naive
|
def last(arr, x, n):
low = 0
high = n - 1
res = -1
while low <= high:
VAR_0 = (low + high) // 2
if arr[VAR_0] > x:
high = VAR_0 - 1
elif arr[VAR_0] < x:
low = VAR_0 + 1
else:
res = VAR_0
low = VAR_0 + 1
return res
| 1 | 790 |
mbpp
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.