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_ways(M):
def bin_coff(n, r):
val = 1
if (r > (n - r)):
r = (n - r)
for i in range(0, r):
val *= (n - i)
val //= (i + 1)
return val
n = M // 2
a = bin_coff(2 * n, n)
b = a // (n + 1)
return (b)
|
transformation_rename_variable_naive
|
def find_ways(M):
def bin_coff(VAR_0, r):
val = 1
if r > (VAR_0 - r):
r = VAR_0 - r
for i in range(0, r):
val *= VAR_0 - i
val //= i + 1
return val
VAR_0 = M // 2
a = bin_coff(2 * VAR_0, VAR_0)
b = a // (VAR_0 + 1)
return b
| 1 | 345 |
mbpp
|
def find_ways(M):
def bin_coff(n, r):
val = 1
if (r > (n - r)):
r = (n - r)
for i in range(0, r):
val *= (n - i)
val //= (i + 1)
return val
n = M // 2
a = bin_coff(2 * n, n)
b = a // (n + 1)
return (b)
|
transformation_rename_variable_rn
|
def find_ways(M):
def bin_coff(o, r):
val = 1
if r > (o - r):
r = o - r
for i in range(0, r):
val *= o - i
val //= i + 1
return val
o = M // 2
a = bin_coff(2 * o, o)
b = a // (o + 1)
return b
| 1 | 345 |
mbpp
|
def find_ways(M):
def bin_coff(n, r):
val = 1
if (r > (n - r)):
r = (n - r)
for i in range(0, r):
val *= (n - i)
val //= (i + 1)
return val
n = M // 2
a = bin_coff(2 * n, n)
b = a // (n + 1)
return (b)
|
transformation_add_sub_variable
|
def find_ways(M):
def bin_coff(n, r):
val = 1
if (r > (n - r)):
r = (n - r)
for i in range(0, r):
val *= (n - i)
val //= (i - 1)
return val
n = M // 2
a = bin_coff(2 * n, n)
b = a // (n + 1)
return (b)
| 0 | 345 |
mbpp
|
def find_ways(M):
def bin_coff(n, r):
val = 1
if (r > (n - r)):
r = (n - r)
for i in range(0, r):
val *= (n - i)
val //= (i + 1)
return val
n = M // 2
a = bin_coff(2 * n, n)
b = a // (n + 1)
return (b)
|
transformation_sub_add_variable
|
def find_ways(M):
def bin_coff(n, r):
val = 1
if (r > (n + r)):
r = (n - r)
for i in range(0, r):
val *= (n - i)
val //= (i + 1)
return val
n = M // 2
a = bin_coff(2 * n, n)
b = a // (n + 1)
return (b)
| 0 | 345 |
mbpp
|
def find_ways(M):
def bin_coff(n, r):
val = 1
if (r > (n - r)):
r = (n - r)
for i in range(0, r):
val *= (n - i)
val //= (i + 1)
return val
n = M // 2
a = bin_coff(2 * n, n)
b = a // (n + 1)
return (b)
|
transformation_mul_div_variable
|
def find_ways(M):
def bin_coff(n, r):
val = 1
if (r > (n - r)):
r = (n - r)
for i in range(0, r):
val /= (n - i)
val //= (i + 1)
return val
n = M // 2
a = bin_coff(2 * n, n)
b = a // (n + 1)
return (b)
| 0 | 345 |
mbpp
|
def find_ways(M):
def bin_coff(n, r):
val = 1
if (r > (n - r)):
r = (n - r)
for i in range(0, r):
val *= (n - i)
val //= (i + 1)
return val
n = M // 2
a = bin_coff(2 * n, n)
b = a // (n + 1)
return (b)
|
transformation_div_mul_variable
|
def find_ways(M):
def bin_coff(n, r):
val = 1
if (r > (n - r)):
r = (n - r)
for i in range(0, r):
val *= (n - i)
val */= (i + 1)
return val
n = M // 2
a = bin_coff(2 * n, n)
b = a // (n + 1)
return (b)
| 0 | 345 |
mbpp
|
def find_ways(M):
def bin_coff(n, r):
val = 1
if (r > (n - r)):
r = (n - r)
for i in range(0, r):
val *= (n - i)
val //= (i + 1)
return val
n = M // 2
a = bin_coff(2 * n, n)
b = a // (n + 1)
return (b)
|
transformation_greater_lesser_variable
|
def find_ways(M):
def bin_coff(n, r):
val = 1
if (r < (n - r)):
r = (n - r)
for i in range(0, r):
val *= (n - i)
val //= (i + 1)
return val
n = M // 2
a = bin_coff(2 * n, n)
b = a // (n + 1)
return (b)
| 0 | 345 |
mbpp
|
def find_ways(M):
def bin_coff(n, r):
val = 1
if (r > (n - r)):
r = (n - r)
for i in range(0, r):
val *= (n - i)
val //= (i + 1)
return val
n = M // 2
a = bin_coff(2 * n, n)
b = a // (n + 1)
return (b)
|
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 | 345 |
mbpp
|
def find_ways(M):
def bin_coff(n, r):
val = 1
if (r > (n - r)):
r = (n - r)
for i in range(0, r):
val *= (n - i)
val //= (i + 1)
return val
n = M // 2
a = bin_coff(2 * n, n)
b = a // (n + 1)
return (b)
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 345 |
mbpp
|
def find_ways(M):
def bin_coff(n, r):
val = 1
if (r > (n - r)):
r = (n - r)
for i in range(0, r):
val *= (n - i)
val //= (i + 1)
return val
n = M // 2
a = bin_coff(2 * n, n)
b = a // (n + 1)
return (b)
|
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 | 345 |
mbpp
|
def find_ways(M):
def bin_coff(n, r):
val = 1
if (r > (n - r)):
r = (n - r)
for i in range(0, r):
val *= (n - i)
val //= (i + 1)
return val
n = M // 2
a = bin_coff(2 * n, n)
b = a // (n + 1)
return (b)
|
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 | 345 |
mbpp
|
def find_ways(M):
def bin_coff(n, r):
val = 1
if (r > (n - r)):
r = (n - r)
for i in range(0, r):
val *= (n - i)
val //= (i + 1)
return val
n = M // 2
a = bin_coff(2 * n, n)
b = a // (n + 1)
return (b)
|
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 | 345 |
mbpp
|
def minimum_Length(s) :
maxOcc = 0
n = len(s)
arr = [0]*26
for i in range(n) :
arr[ord(s[i]) -ord('a')] += 1
for i in range(26) :
if arr[i] > maxOcc :
maxOcc = arr[i]
return n - maxOcc
|
transformation_dead_code_insert
|
def minimum_Length(s):
maxOcc = 0
n = len(s)
arr = [0] * 26
for i in range(n):
_i_5 = 0
while _i_5 < _i_5:
n = len(s)
arr[ord(s[i]) - ord("a")] += 1
for i in range(26):
if arr[i] > maxOcc:
maxOcc = arr[i]
return n - maxOcc
| 1 | 347 |
mbpp
|
def minimum_Length(s) :
maxOcc = 0
n = len(s)
arr = [0]*26
for i in range(n) :
arr[ord(s[i]) -ord('a')] += 1
for i in range(26) :
if arr[i] > maxOcc :
maxOcc = arr[i]
return n - maxOcc
|
transformation_for_while_loop
|
def minimum_Length(s):
maxOcc = 0
n = len(s)
arr = [0] * 26
i = 0
while i < n:
arr[ord(s[i]) - ord("a")] += 1
i += 1
for i in range(26):
if arr[i] > maxOcc:
maxOcc = arr[i]
return n - maxOcc
| 1 | 347 |
mbpp
|
def minimum_Length(s) :
maxOcc = 0
n = len(s)
arr = [0]*26
for i in range(n) :
arr[ord(s[i]) -ord('a')] += 1
for i in range(26) :
if arr[i] > maxOcc :
maxOcc = arr[i]
return n - maxOcc
|
transformation_operand_swap
|
def minimum_Length(s):
maxOcc = 0
n = len(s)
arr = [0] * 26
for i in range(n):
arr[ord(s[i]) - ord("a")] += 1
for i in range(26):
if maxOcc < arr[i]:
maxOcc = arr[i]
return n - maxOcc
| 1 | 347 |
mbpp
|
def minimum_Length(s) :
maxOcc = 0
n = len(s)
arr = [0]*26
for i in range(n) :
arr[ord(s[i]) -ord('a')] += 1
for i in range(26) :
if arr[i] > maxOcc :
maxOcc = arr[i]
return n - maxOcc
|
transformation_rename_variable_cb
|
def minimum_Length(s):
maxOcc = 0
n = len(s)
arr = [0] * 26
for i2 in range(n):
arr[ord(s[i2]) - ord("a")] += 1
for i2 in range(26):
if arr[i2] > maxOcc:
maxOcc = arr[i2]
return n - maxOcc
| 1 | 347 |
mbpp
|
def minimum_Length(s) :
maxOcc = 0
n = len(s)
arr = [0]*26
for i in range(n) :
arr[ord(s[i]) -ord('a')] += 1
for i in range(26) :
if arr[i] > maxOcc :
maxOcc = arr[i]
return n - maxOcc
|
transformation_rename_variable_naive
|
def minimum_Length(s):
maxOcc = 0
n = len(s)
arr = [0] * 26
for VAR_0 in range(n):
arr[ord(s[VAR_0]) - ord("a")] += 1
for VAR_0 in range(26):
if arr[VAR_0] > maxOcc:
maxOcc = arr[VAR_0]
return n - maxOcc
| 1 | 347 |
mbpp
|
def minimum_Length(s) :
maxOcc = 0
n = len(s)
arr = [0]*26
for i in range(n) :
arr[ord(s[i]) -ord('a')] += 1
for i in range(26) :
if arr[i] > maxOcc :
maxOcc = arr[i]
return n - maxOcc
|
transformation_rename_variable_rn
|
def minimum_Length(s):
maxOcc = 0
n = len(s)
arr = [0] * 26
for f in range(n):
arr[ord(s[f]) - ord("a")] += 1
for f in range(26):
if arr[f] > maxOcc:
maxOcc = arr[f]
return n - maxOcc
| 1 | 347 |
mbpp
|
def minimum_Length(s) :
maxOcc = 0
n = len(s)
arr = [0]*26
for i in range(n) :
arr[ord(s[i]) -ord('a')] += 1
for i in range(26) :
if arr[i] > maxOcc :
maxOcc = arr[i]
return n - maxOcc
|
transformation_add_sub_variable
|
def minimum_Length(s) :
maxOcc = 0
n = len(s)
arr = [0]*26
for i in range(n) :
arr[ord(s[i]) -ord('a')] -= 1
for i in range(26) :
if arr[i] > maxOcc :
maxOcc = arr[i]
return n - maxOcc
| 0 | 347 |
mbpp
|
def minimum_Length(s) :
maxOcc = 0
n = len(s)
arr = [0]*26
for i in range(n) :
arr[ord(s[i]) -ord('a')] += 1
for i in range(26) :
if arr[i] > maxOcc :
maxOcc = arr[i]
return n - maxOcc
|
transformation_sub_add_variable
|
def minimum_Length(s) :
maxOcc = 0
n = len(s)
arr = [0]*26
for i in range(n) :
arr[ord(s[i]) +ord('a')] += 1
for i in range(26) :
if arr[i] > maxOcc :
maxOcc = arr[i]
return n - maxOcc
| 0 | 347 |
mbpp
|
def minimum_Length(s) :
maxOcc = 0
n = len(s)
arr = [0]*26
for i in range(n) :
arr[ord(s[i]) -ord('a')] += 1
for i in range(26) :
if arr[i] > maxOcc :
maxOcc = arr[i]
return n - maxOcc
|
transformation_mul_div_variable
|
def minimum_Length(s) :
maxOcc = 0
n = len(s)
arr = [0]/26
for i in range(n) :
arr[ord(s[i]) -ord('a')] += 1
for i in range(26) :
if arr[i] > maxOcc :
maxOcc = arr[i]
return n - maxOcc
| 0 | 347 |
mbpp
|
def minimum_Length(s) :
maxOcc = 0
n = len(s)
arr = [0]*26
for i in range(n) :
arr[ord(s[i]) -ord('a')] += 1
for i in range(26) :
if arr[i] > maxOcc :
maxOcc = arr[i]
return n - maxOcc
|
transformation_greater_lesser_variable
|
def minimum_Length(s) :
maxOcc = 0
n = len(s)
arr = [0]*26
for i in range(n) :
arr[ord(s[i]) -ord('a')] += 1
for i in range(26) :
if arr[i] < maxOcc :
maxOcc = arr[i]
return n - maxOcc
| 0 | 347 |
mbpp
|
def minimum_Length(s) :
maxOcc = 0
n = len(s)
arr = [0]*26
for i in range(n) :
arr[ord(s[i]) -ord('a')] += 1
for i in range(26) :
if arr[i] > maxOcc :
maxOcc = arr[i]
return n - maxOcc
|
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 | 347 |
mbpp
|
def minimum_Length(s) :
maxOcc = 0
n = len(s)
arr = [0]*26
for i in range(n) :
arr[ord(s[i]) -ord('a')] += 1
for i in range(26) :
if arr[i] > maxOcc :
maxOcc = arr[i]
return n - maxOcc
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 347 |
mbpp
|
def minimum_Length(s) :
maxOcc = 0
n = len(s)
arr = [0]*26
for i in range(n) :
arr[ord(s[i]) -ord('a')] += 1
for i in range(26) :
if arr[i] > maxOcc :
maxOcc = arr[i]
return n - maxOcc
|
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 | 347 |
mbpp
|
def minimum_Length(s) :
maxOcc = 0
n = len(s)
arr = [0]*26
for i in range(n) :
arr[ord(s[i]) -ord('a')] += 1
for i in range(26) :
if arr[i] > maxOcc :
maxOcc = arr[i]
return n - maxOcc
|
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 | 347 |
mbpp
|
def minimum_Length(s) :
maxOcc = 0
n = len(s)
arr = [0]*26
for i in range(n) :
arr[ord(s[i]) -ord('a')] += 1
for i in range(26) :
if arr[i] > maxOcc :
maxOcc = arr[i]
return n - maxOcc
|
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 | 347 |
mbpp
|
def first_Element(arr,n,k):
count_map = {};
for i in range(0, n):
if(arr[i] in count_map.keys()):
count_map[arr[i]] += 1
else:
count_map[arr[i]] = 1
i += 1
for i in range(0, n):
if (count_map[arr[i]] == k):
return arr[i]
i += 1
return -1
|
transformation_dead_code_insert
|
def first_Element(arr, n, k):
_i_3 = 0
while _i_3 > _i_3:
i += 1
count_map = {}
for i in range(0, n):
if arr[i] in count_map.keys():
count_map[arr[i]] += 1
else:
count_map[arr[i]] = 1
i += 1
for i in range(0, n):
if count_map[arr[i]] == k:
return arr[i]
i += 1
return -1
| 1 | 348 |
mbpp
|
def first_Element(arr,n,k):
count_map = {};
for i in range(0, n):
if(arr[i] in count_map.keys()):
count_map[arr[i]] += 1
else:
count_map[arr[i]] = 1
i += 1
for i in range(0, n):
if (count_map[arr[i]] == k):
return arr[i]
i += 1
return -1
|
transformation_for_while_loop
|
def first_Element(arr, n, k):
count_map = {}
i = 0
while i < n:
if arr[i] in count_map.keys():
count_map[arr[i]] += 1
else:
count_map[arr[i]] = 1
i += 1
i += 1
for i in range(0, n):
if count_map[arr[i]] == k:
return arr[i]
i += 1
return -1
| 1 | 348 |
mbpp
|
def first_Element(arr,n,k):
count_map = {};
for i in range(0, n):
if(arr[i] in count_map.keys()):
count_map[arr[i]] += 1
else:
count_map[arr[i]] = 1
i += 1
for i in range(0, n):
if (count_map[arr[i]] == k):
return arr[i]
i += 1
return -1
|
transformation_operand_swap
|
def first_Element(arr, n, k):
count_map = {}
for i in range(0, n):
if arr[i] in count_map.keys():
count_map[arr[i]] += 1
else:
count_map[arr[i]] = 1
i += 1
for i in range(0, n):
if k == count_map[arr[i]]:
return arr[i]
i += 1
return -1
| 1 | 348 |
mbpp
|
def first_Element(arr,n,k):
count_map = {};
for i in range(0, n):
if(arr[i] in count_map.keys()):
count_map[arr[i]] += 1
else:
count_map[arr[i]] = 1
i += 1
for i in range(0, n):
if (count_map[arr[i]] == k):
return arr[i]
i += 1
return -1
|
transformation_rename_variable_cb
|
def first_Element(arr, n, k):
count_map = {}
for k2 in range(0, n):
if arr[k2] in count_map.keys():
count_map[arr[k2]] += 1
else:
count_map[arr[k2]] = 1
k2 += 1
for k2 in range(0, n):
if count_map[arr[k2]] == k:
return arr[k2]
k2 += 1
return -1
| 1 | 348 |
mbpp
|
def first_Element(arr,n,k):
count_map = {};
for i in range(0, n):
if(arr[i] in count_map.keys()):
count_map[arr[i]] += 1
else:
count_map[arr[i]] = 1
i += 1
for i in range(0, n):
if (count_map[arr[i]] == k):
return arr[i]
i += 1
return -1
|
transformation_rename_variable_naive
|
def first_Element(arr, n, k):
count_map = {}
for VAR_0 in range(0, n):
if arr[VAR_0] in count_map.keys():
count_map[arr[VAR_0]] += 1
else:
count_map[arr[VAR_0]] = 1
VAR_0 += 1
for VAR_0 in range(0, n):
if count_map[arr[VAR_0]] == k:
return arr[VAR_0]
VAR_0 += 1
return -1
| 1 | 348 |
mbpp
|
def first_Element(arr,n,k):
count_map = {};
for i in range(0, n):
if(arr[i] in count_map.keys()):
count_map[arr[i]] += 1
else:
count_map[arr[i]] = 1
i += 1
for i in range(0, n):
if (count_map[arr[i]] == k):
return arr[i]
i += 1
return -1
|
transformation_rename_variable_rn
|
def first_Element(arr, n, k):
count_map = {}
for G in range(0, n):
if arr[G] in count_map.keys():
count_map[arr[G]] += 1
else:
count_map[arr[G]] = 1
G += 1
for G in range(0, n):
if count_map[arr[G]] == k:
return arr[G]
G += 1
return -1
| 1 | 348 |
mbpp
|
def first_Element(arr,n,k):
count_map = {};
for i in range(0, n):
if(arr[i] in count_map.keys()):
count_map[arr[i]] += 1
else:
count_map[arr[i]] = 1
i += 1
for i in range(0, n):
if (count_map[arr[i]] == k):
return arr[i]
i += 1
return -1
|
transformation_add_sub_variable
|
def first_Element(arr,n,k):
count_map = {};
for i in range(0, n):
if(arr[i] in count_map.keys()):
count_map[arr[i]] -= 1
else:
count_map[arr[i]] = 1
i += 1
for i in range(0, n):
if (count_map[arr[i]] == k):
return arr[i]
i += 1
return -1
| 0 | 348 |
mbpp
|
def first_Element(arr,n,k):
count_map = {};
for i in range(0, n):
if(arr[i] in count_map.keys()):
count_map[arr[i]] += 1
else:
count_map[arr[i]] = 1
i += 1
for i in range(0, n):
if (count_map[arr[i]] == k):
return arr[i]
i += 1
return -1
|
transformation_sub_add_variable
|
def first_Element(arr,n,k):
count_map = {};
for i in range(0, n):
if(arr[i] in count_map.keys()):
count_map[arr[i]] += 1
else:
count_map[arr[i]] = 1
i += 1
for i in range(0, n):
if (count_map[arr[i]] == k):
return arr[i]
i += 1
return +1
| 0 | 348 |
mbpp
|
def first_Element(arr,n,k):
count_map = {};
for i in range(0, n):
if(arr[i] in count_map.keys()):
count_map[arr[i]] += 1
else:
count_map[arr[i]] = 1
i += 1
for i in range(0, n):
if (count_map[arr[i]] == k):
return arr[i]
i += 1
return -1
|
transformation_equalto_exclamation_variable
|
def first_Element(arr,n,k):
count_map = {};
for i in range(0, n):
if(arr[i] in count_map.keys()):
count_map[arr[i]] += 1
else:
count_map[arr[i]] = 1
i += 1
for i in range(0, n):
if (count_map[arr[i]] != k):
return arr[i]
i += 1
return -1
| 0 | 348 |
mbpp
|
def first_Element(arr,n,k):
count_map = {};
for i in range(0, n):
if(arr[i] in count_map.keys()):
count_map[arr[i]] += 1
else:
count_map[arr[i]] = 1
i += 1
for i in range(0, n):
if (count_map[arr[i]] == k):
return arr[i]
i += 1
return -1
|
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 | 348 |
mbpp
|
def first_Element(arr,n,k):
count_map = {};
for i in range(0, n):
if(arr[i] in count_map.keys()):
count_map[arr[i]] += 1
else:
count_map[arr[i]] = 1
i += 1
for i in range(0, n):
if (count_map[arr[i]] == k):
return arr[i]
i += 1
return -1
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 348 |
mbpp
|
def first_Element(arr,n,k):
count_map = {};
for i in range(0, n):
if(arr[i] in count_map.keys()):
count_map[arr[i]] += 1
else:
count_map[arr[i]] = 1
i += 1
for i in range(0, n):
if (count_map[arr[i]] == k):
return arr[i]
i += 1
return -1
|
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 | 348 |
mbpp
|
def first_Element(arr,n,k):
count_map = {};
for i in range(0, n):
if(arr[i] in count_map.keys()):
count_map[arr[i]] += 1
else:
count_map[arr[i]] = 1
i += 1
for i in range(0, n):
if (count_map[arr[i]] == k):
return arr[i]
i += 1
return -1
|
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 | 348 |
mbpp
|
def first_Element(arr,n,k):
count_map = {};
for i in range(0, n):
if(arr[i] in count_map.keys()):
count_map[arr[i]] += 1
else:
count_map[arr[i]] = 1
i += 1
for i in range(0, n):
if (count_map[arr[i]] == k):
return arr[i]
i += 1
return -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 | 348 |
mbpp
|
def unique_Characters(str):
for i in range(len(str)):
for j in range(i + 1,len(str)):
if (str[i] == str[j]):
return False;
return True;
|
transformation_dead_code_insert
|
def unique_Characters(str):
for i in range(len(str)):
for j in range(i + 1, len(str)):
if False:
return True
if str[i] == str[j]:
return False
return True
| 1 | 349 |
mbpp
|
def unique_Characters(str):
for i in range(len(str)):
for j in range(i + 1,len(str)):
if (str[i] == str[j]):
return False;
return True;
|
transformation_for_while_loop
|
def unique_Characters(str):
i = 0
while i < len(str):
for j in range(i + 1, len(str)):
if str[i] == str[j]:
return False
i += 1
return True
| 1 | 349 |
mbpp
|
def unique_Characters(str):
for i in range(len(str)):
for j in range(i + 1,len(str)):
if (str[i] == str[j]):
return False;
return True;
|
transformation_operand_swap
|
def unique_Characters(str):
for i in range(len(str)):
for j in range(i + 1, len(str)):
if str[j] == str[i]:
return False
return True
| 1 | 349 |
mbpp
|
def unique_Characters(str):
for i in range(len(str)):
for j in range(i + 1,len(str)):
if (str[i] == str[j]):
return False;
return True;
|
transformation_rename_variable_cb
|
def unique_Characters(str):
for i2 in range(len(str)):
for j in range(i2 + 1, len(str)):
if str[i2] == str[j]:
return False
return True
| 1 | 349 |
mbpp
|
def unique_Characters(str):
for i in range(len(str)):
for j in range(i + 1,len(str)):
if (str[i] == str[j]):
return False;
return True;
|
transformation_rename_variable_naive
|
def unique_Characters(str):
for VAR_0 in range(len(str)):
for j in range(VAR_0 + 1, len(str)):
if str[VAR_0] == str[j]:
return False
return True
| 1 | 349 |
mbpp
|
def unique_Characters(str):
for i in range(len(str)):
for j in range(i + 1,len(str)):
if (str[i] == str[j]):
return False;
return True;
|
transformation_rename_variable_rn
|
def unique_Characters(str):
for A in range(len(str)):
for j in range(A + 1, len(str)):
if str[A] == str[j]:
return False
return True
| 1 | 349 |
mbpp
|
def unique_Characters(str):
for i in range(len(str)):
for j in range(i + 1,len(str)):
if (str[i] == str[j]):
return False;
return True;
|
transformation_add_sub_variable
|
def unique_Characters(str):
for i in range(len(str)):
for j in range(i - 1,len(str)):
if (str[i] == str[j]):
return False;
return True;
| 0 | 349 |
mbpp
|
def unique_Characters(str):
for i in range(len(str)):
for j in range(i + 1,len(str)):
if (str[i] == str[j]):
return False;
return True;
|
transformation_equalto_exclamation_variable
|
def unique_Characters(str):
for i in range(len(str)):
for j in range(i + 1,len(str)):
if (str[i] != str[j]):
return False;
return True;
| 0 | 349 |
mbpp
|
def unique_Characters(str):
for i in range(len(str)):
for j in range(i + 1,len(str)):
if (str[i] == str[j]):
return False;
return True;
|
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 | 349 |
mbpp
|
def unique_Characters(str):
for i in range(len(str)):
for j in range(i + 1,len(str)):
if (str[i] == str[j]):
return False;
return True;
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 349 |
mbpp
|
def unique_Characters(str):
for i in range(len(str)):
for j in range(i + 1,len(str)):
if (str[i] == str[j]):
return False;
return True;
|
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 | 349 |
mbpp
|
def unique_Characters(str):
for i in range(len(str)):
for j in range(i + 1,len(str)):
if (str[i] == str[j]):
return False;
return True;
|
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 | 349 |
mbpp
|
def unique_Characters(str):
for i in range(len(str)):
for j in range(i + 1,len(str)):
if (str[i] == str[j]):
return False;
return True;
|
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 | 349 |
mbpp
|
def find_angle(a,b):
c = 180 - (a + b)
return c
|
transformation_dead_code_insert
|
def find_angle(a, b):
_i_4 = 0
while _i_4 < _i_4:
c = 180 - (a + b)
c = 180 - (a + b)
return c
| 1 | 353 |
mbpp
|
def find_angle(a,b):
c = 180 - (a + b)
return c
|
transformation_for_while_loop
|
def find_angle(a, b):
c = 180 - (a + b)
return c
| 1 | 353 |
mbpp
|
def find_angle(a,b):
c = 180 - (a + b)
return c
|
transformation_operand_swap
|
def find_angle(a, b):
c = 180 - (a + b)
return c
| 1 | 353 |
mbpp
|
def find_angle(a,b):
c = 180 - (a + b)
return c
|
transformation_rename_variable_cb
|
def find_angle(a2, b):
c = 180 - (a2 + b)
return c
| 1 | 353 |
mbpp
|
def find_angle(a,b):
c = 180 - (a + b)
return c
|
transformation_rename_variable_naive
|
def find_angle(VAR_0, b):
c = 180 - (VAR_0 + b)
return c
| 1 | 353 |
mbpp
|
def find_angle(a,b):
c = 180 - (a + b)
return c
|
transformation_rename_variable_rn
|
def find_angle(a, b):
E = 180 - (a + b)
return E
| 1 | 353 |
mbpp
|
def find_angle(a,b):
c = 180 - (a + b)
return c
|
transformation_add_sub_variable
|
def find_angle(a,b):
c = 180 - (a - b)
return c
| 0 | 353 |
mbpp
|
def find_angle(a,b):
c = 180 - (a + b)
return c
|
transformation_sub_add_variable
|
def find_angle(a,b):
c = 180 + (a + b)
return c
| 0 | 353 |
mbpp
|
def find_angle(a,b):
c = 180 - (a + b)
return c
|
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 | 353 |
mbpp
|
def find_angle(a,b):
c = 180 - (a + b)
return c
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 353 |
mbpp
|
def find_angle(a,b):
c = 180 - (a + b)
return c
|
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 | 353 |
mbpp
|
def find_angle(a,b):
c = 180 - (a + b)
return c
|
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 | 353 |
mbpp
|
def find_angle(a,b):
c = 180 - (a + b)
return c
|
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 | 353 |
mbpp
|
def Check_Solution(a,b,c):
if (2*b*b == 9*a*c):
return ("Yes");
else:
return ("No");
|
transformation_dead_code_insert
|
def Check_Solution(a, b, c):
if 2 * b * b == 9 * a * c:
_i_6 = 0
while _i_6 < _i_6:
return "Yes"
return "Yes"
else:
return "No"
| 1 | 356 |
mbpp
|
def Check_Solution(a,b,c):
if (2*b*b == 9*a*c):
return ("Yes");
else:
return ("No");
|
transformation_for_while_loop
|
def Check_Solution(a, b, c):
if 2 * b * b == 9 * a * c:
return "Yes"
else:
return "No"
| 1 | 356 |
mbpp
|
def Check_Solution(a,b,c):
if (2*b*b == 9*a*c):
return ("Yes");
else:
return ("No");
|
transformation_operand_swap
|
def Check_Solution(a, b, c):
if 9 * a * c == 2 * b * b:
return "Yes"
else:
return "No"
| 1 | 356 |
mbpp
|
def Check_Solution(a,b,c):
if (2*b*b == 9*a*c):
return ("Yes");
else:
return ("No");
|
transformation_rename_variable_cb
|
def Check_Solution(a, b2, c):
if 2 * b2 * b2 == 9 * a * c:
return "Yes"
else:
return "No"
| 1 | 356 |
mbpp
|
def Check_Solution(a,b,c):
if (2*b*b == 9*a*c):
return ("Yes");
else:
return ("No");
|
transformation_rename_variable_naive
|
def Check_Solution(a, VAR_0, c):
if 2 * VAR_0 * VAR_0 == 9 * a * c:
return "Yes"
else:
return "No"
| 1 | 356 |
mbpp
|
def Check_Solution(a,b,c):
if (2*b*b == 9*a*c):
return ("Yes");
else:
return ("No");
|
transformation_rename_variable_rn
|
def Check_Solution(a, E, c):
if 2 * E * E == 9 * a * c:
return "Yes"
else:
return "No"
| 1 | 356 |
mbpp
|
def Check_Solution(a,b,c):
if (2*b*b == 9*a*c):
return ("Yes");
else:
return ("No");
|
transformation_mul_div_variable
|
def Check_Solution(a,b,c):
if (2/b*b == 9*a*c):
return ("Yes");
else:
return ("No");
| 0 | 356 |
mbpp
|
def Check_Solution(a,b,c):
if (2*b*b == 9*a*c):
return ("Yes");
else:
return ("No");
|
transformation_equalto_exclamation_variable
|
def Check_Solution(a,b,c):
if (2*b*b != 9*a*c):
return ("Yes");
else:
return ("No");
| 0 | 356 |
mbpp
|
def Check_Solution(a,b,c):
if (2*b*b == 9*a*c):
return ("Yes");
else:
return ("No");
|
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 | 356 |
mbpp
|
def Check_Solution(a,b,c):
if (2*b*b == 9*a*c):
return ("Yes");
else:
return ("No");
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 356 |
mbpp
|
def Check_Solution(a,b,c):
if (2*b*b == 9*a*c):
return ("Yes");
else:
return ("No");
|
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 | 356 |
mbpp
|
def Check_Solution(a,b,c):
if (2*b*b == 9*a*c):
return ("Yes");
else:
return ("No");
|
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 | 356 |
mbpp
|
def Check_Solution(a,b,c):
if (2*b*b == 9*a*c):
return ("Yes");
else:
return ("No");
|
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 | 356 |
mbpp
|
def remove_empty(list1):
remove_empty = [x for x in list1 if x]
return remove_empty
|
transformation_dead_code_insert
|
def remove_empty(list1):
_i_8 = 0
if _i_8 > _i_8:
remove_empty = [x for x in list1 if x]
remove_empty = [x for x in list1 if x]
return remove_empty
| 1 | 358 |
mbpp
|
def remove_empty(list1):
remove_empty = [x for x in list1 if x]
return remove_empty
|
transformation_for_while_loop
|
def remove_empty(list1):
remove_empty = [x for x in list1 if x]
return remove_empty
| 1 | 358 |
mbpp
|
def remove_empty(list1):
remove_empty = [x for x in list1 if x]
return remove_empty
|
transformation_operand_swap
|
def remove_empty(list1):
remove_empty = [x for x in list1 if x]
return remove_empty
| 1 | 358 |
mbpp
|
def remove_empty(list1):
remove_empty = [x for x in list1 if x]
return remove_empty
|
transformation_rename_variable_cb
|
def remove_empty(list1):
remove_empty = [item for item in list1 if item]
return remove_empty
| 1 | 358 |
mbpp
|
def remove_empty(list1):
remove_empty = [x for x in list1 if x]
return remove_empty
|
transformation_rename_variable_naive
|
def remove_empty(list1):
remove_empty = [VAR_0 for VAR_0 in list1 if VAR_0]
return remove_empty
| 1 | 358 |
mbpp
|
def remove_empty(list1):
remove_empty = [x for x in list1 if x]
return remove_empty
|
transformation_rename_variable_rn
|
def remove_empty(list1):
remove_empty = [z for z in list1 if z]
return remove_empty
| 1 | 358 |
mbpp
|
def remove_empty(list1):
remove_empty = [x for x in list1 if x]
return remove_empty
|
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 | 358 |
mbpp
|
def remove_empty(list1):
remove_empty = [x for x in list1 if x]
return remove_empty
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 358 |
mbpp
|
def remove_empty(list1):
remove_empty = [x for x in list1 if x]
return remove_empty
|
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 | 358 |
mbpp
|
def remove_empty(list1):
remove_empty = [x for x in list1 if x]
return remove_empty
|
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 | 358 |
mbpp
|
def remove_empty(list1):
remove_empty = [x for x in list1 if x]
return remove_empty
|
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 | 358 |
mbpp
|
def is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is None:
return 0
return max(get_height(root.left), get_height(root.right)) + 1
if root is None:
return True
lh = get_height(root.left)
rh = get_height(root.right)
if (abs(lh - rh) <= 1) and is_tree_balanced(
root.left) is True and is_tree_balanced( root.right) is True:
return True
return False
|
transformation_dead_code_insert
|
def is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is None:
return 0
_i_6 = 0
if _i_6 > _i_6:
self.right = None
return max(get_height(root.left), get_height(root.right)) + 1
if root is None:
return True
lh = get_height(root.left)
rh = get_height(root.right)
if (
(abs(lh - rh) <= 1)
and is_tree_balanced(root.left) is True
and is_tree_balanced(root.right) is True
):
return True
return False
| 1 | 364 |
mbpp
|
def is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is None:
return 0
return max(get_height(root.left), get_height(root.right)) + 1
if root is None:
return True
lh = get_height(root.left)
rh = get_height(root.right)
if (abs(lh - rh) <= 1) and is_tree_balanced(
root.left) is True and is_tree_balanced( root.right) is True:
return True
return False
|
transformation_for_while_loop
|
def is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is None:
return 0
return max(get_height(root.left), get_height(root.right)) + 1
if root is None:
return True
lh = get_height(root.left)
rh = get_height(root.right)
if (
(abs(lh - rh) <= 1)
and is_tree_balanced(root.left) is True
and is_tree_balanced(root.right) is True
):
return True
return False
| 1 | 364 |
mbpp
|
def is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is None:
return 0
return max(get_height(root.left), get_height(root.right)) + 1
if root is None:
return True
lh = get_height(root.left)
rh = get_height(root.right)
if (abs(lh - rh) <= 1) and is_tree_balanced(
root.left) is True and is_tree_balanced( root.right) is True:
return True
return False
|
transformation_operand_swap
|
def is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is None:
return 0
return max(get_height(root.left), get_height(root.right)) + 1
if root is None:
return True
lh = get_height(root.left)
rh = get_height(root.right)
if (
(1 >= abs(lh - rh))
and is_tree_balanced(root.left) is True
and is_tree_balanced(root.right) is True
):
return True
return False
| 1 | 364 |
mbpp
|
def is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is None:
return 0
return max(get_height(root.left), get_height(root.right)) + 1
if root is None:
return True
lh = get_height(root.left)
rh = get_height(root.right)
if (abs(lh - rh) <= 1) and is_tree_balanced(
root.left) is True and is_tree_balanced( root.right) is True:
return True
return False
|
transformation_rename_variable_cb
|
def is_tree_balanced(mask):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(mask):
if mask is None:
return 0
return max(get_height(mask.left), get_height(mask.right)) + 1
if mask is None:
return True
lh = get_height(mask.left)
rh = get_height(mask.right)
if (
(abs(lh - rh) <= 1)
and is_tree_balanced(mask.left) is True
and is_tree_balanced(mask.right) is True
):
return True
return False
| 1 | 364 |
mbpp
|
def is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is None:
return 0
return max(get_height(root.left), get_height(root.right)) + 1
if root is None:
return True
lh = get_height(root.left)
rh = get_height(root.right)
if (abs(lh - rh) <= 1) and is_tree_balanced(
root.left) is True and is_tree_balanced( root.right) is True:
return True
return False
|
transformation_rename_variable_naive
|
def is_tree_balanced(VAR_0):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(VAR_0):
if VAR_0 is None:
return 0
return max(get_height(VAR_0.left), get_height(VAR_0.right)) + 1
if VAR_0 is None:
return True
lh = get_height(VAR_0.left)
rh = get_height(VAR_0.right)
if (
(abs(lh - rh) <= 1)
and is_tree_balanced(VAR_0.left) is True
and is_tree_balanced(VAR_0.right) is True
):
return True
return False
| 1 | 364 |
mbpp
|
def is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is None:
return 0
return max(get_height(root.left), get_height(root.right)) + 1
if root is None:
return True
lh = get_height(root.left)
rh = get_height(root.right)
if (abs(lh - rh) <= 1) and is_tree_balanced(
root.left) is True and is_tree_balanced( root.right) is True:
return True
return False
|
transformation_rename_variable_rn
|
def is_tree_balanced(wa8b):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(wa8b):
if wa8b is None:
return 0
return max(get_height(wa8b.left), get_height(wa8b.right)) + 1
if wa8b is None:
return True
lh = get_height(wa8b.left)
rh = get_height(wa8b.right)
if (
(abs(lh - rh) <= 1)
and is_tree_balanced(wa8b.left) is True
and is_tree_balanced(wa8b.right) is True
):
return True
return False
| 1 | 364 |
mbpp
|
def is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is None:
return 0
return max(get_height(root.left), get_height(root.right)) + 1
if root is None:
return True
lh = get_height(root.left)
rh = get_height(root.right)
if (abs(lh - rh) <= 1) and is_tree_balanced(
root.left) is True and is_tree_balanced( root.right) is True:
return True
return False
|
transformation_add_sub_variable
|
def is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is None:
return 0
return max(get_height(root.left), get_height(root.right)) - 1
if root is None:
return True
lh = get_height(root.left)
rh = get_height(root.right)
if (abs(lh - rh) <= 1) and is_tree_balanced(
root.left) is True and is_tree_balanced( root.right) is True:
return True
return False
| 0 | 364 |
mbpp
|
def is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is None:
return 0
return max(get_height(root.left), get_height(root.right)) + 1
if root is None:
return True
lh = get_height(root.left)
rh = get_height(root.right)
if (abs(lh - rh) <= 1) and is_tree_balanced(
root.left) is True and is_tree_balanced( root.right) is True:
return True
return False
|
transformation_sub_add_variable
|
def is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is None:
return 0
return max(get_height(root.left), get_height(root.right)) + 1
if root is None:
return True
lh = get_height(root.left)
rh = get_height(root.right)
if (abs(lh + rh) <= 1) and is_tree_balanced(
root.left) is True and is_tree_balanced( root.right) is True:
return True
return False
| 0 | 364 |
mbpp
|
def is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is None:
return 0
return max(get_height(root.left), get_height(root.right)) + 1
if root is None:
return True
lh = get_height(root.left)
rh = get_height(root.right)
if (abs(lh - rh) <= 1) and is_tree_balanced(
root.left) is True and is_tree_balanced( root.right) is True:
return True
return False
|
transformation_lesser_greater_variable
|
def is_tree_balanced(root):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def get_height(root):
if root is None:
return 0
return max(get_height(root.left), get_height(root.right)) + 1
if root is None:
return True
lh = get_height(root.left)
rh = get_height(root.right)
if (abs(lh - rh) >= 1) and is_tree_balanced(
root.left) is True and is_tree_balanced( root.right) is True:
return True
return False
| 0 | 364 |
mbpp
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.