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 remove_tuple(test_list):
res = [sub for sub in test_list if not all(ele == None for ele in sub)]
return (str(res))
|
transformation_equalto_exclamation_variable
|
def remove_tuple(test_list):
res = [sub for sub in test_list if not all(ele != None for ele in sub)]
return (str(res))
| 0 | 917 |
mbpp
|
def remove_tuple(test_list):
res = [sub for sub in test_list if not all(ele == None for ele in sub)]
return (str(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 | 917 |
mbpp
|
def remove_tuple(test_list):
res = [sub for sub in test_list if not all(ele == None for ele in sub)]
return (str(res))
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 917 |
mbpp
|
def remove_tuple(test_list):
res = [sub for sub in test_list if not all(ele == None for ele in sub)]
return (str(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 | 917 |
mbpp
|
def remove_tuple(test_list):
res = [sub for sub in test_list if not all(ele == None for ele in sub)]
return (str(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 | 917 |
mbpp
|
def remove_tuple(test_list):
res = [sub for sub in test_list if not all(ele == None for ele in sub)]
return (str(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 | 917 |
mbpp
|
def chunk_tuples(test_tup, N):
res = [test_tup[i : i + N] for i in range(0, len(test_tup), N)]
return (res)
|
transformation_dead_code_insert
|
def chunk_tuples(test_tup, N):
for _i_7 in range(0):
return res
res = [test_tup[i : i + N] for i in range(0, len(test_tup), N)]
return res
| 1 | 918 |
mbpp
|
def chunk_tuples(test_tup, N):
res = [test_tup[i : i + N] for i in range(0, len(test_tup), N)]
return (res)
|
transformation_for_while_loop
|
def chunk_tuples(test_tup, N):
res = [test_tup[i : i + N] for i in range(0, len(test_tup), N)]
return res
| 1 | 918 |
mbpp
|
def chunk_tuples(test_tup, N):
res = [test_tup[i : i + N] for i in range(0, len(test_tup), N)]
return (res)
|
transformation_operand_swap
|
def chunk_tuples(test_tup, N):
res = [test_tup[i : i + N] for i in range(0, len(test_tup), N)]
return res
| 1 | 918 |
mbpp
|
def chunk_tuples(test_tup, N):
res = [test_tup[i : i + N] for i in range(0, len(test_tup), N)]
return (res)
|
transformation_rename_variable_cb
|
def chunk_tuples(test_tup, N):
res = [test_tup[i2 : i2 + N] for i2 in range(0, len(test_tup), N)]
return res
| 1 | 918 |
mbpp
|
def chunk_tuples(test_tup, N):
res = [test_tup[i : i + N] for i in range(0, len(test_tup), N)]
return (res)
|
transformation_rename_variable_naive
|
def chunk_tuples(test_tup, VAR_0):
res = [test_tup[i : i + VAR_0] for i in range(0, len(test_tup), VAR_0)]
return res
| 1 | 918 |
mbpp
|
def chunk_tuples(test_tup, N):
res = [test_tup[i : i + N] for i in range(0, len(test_tup), N)]
return (res)
|
transformation_rename_variable_rn
|
def chunk_tuples(SP147wy2, N):
res = [SP147wy2[i : i + N] for i in range(0, len(SP147wy2), N)]
return res
| 1 | 918 |
mbpp
|
def chunk_tuples(test_tup, N):
res = [test_tup[i : i + N] for i in range(0, len(test_tup), N)]
return (res)
|
transformation_add_sub_variable
|
def chunk_tuples(test_tup, N):
res = [test_tup[i : i - N] for i in range(0, len(test_tup), N)]
return (res)
| 0 | 918 |
mbpp
|
def chunk_tuples(test_tup, N):
res = [test_tup[i : i + N] for i in range(0, len(test_tup), N)]
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 | 918 |
mbpp
|
def chunk_tuples(test_tup, N):
res = [test_tup[i : i + N] for i in range(0, len(test_tup), N)]
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 | 918 |
mbpp
|
def chunk_tuples(test_tup, N):
res = [test_tup[i : i + N] for i in range(0, len(test_tup), N)]
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 | 918 |
mbpp
|
def chunk_tuples(test_tup, N):
res = [test_tup[i : i + N] for i in range(0, len(test_tup), N)]
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 | 918 |
mbpp
|
def chunk_tuples(test_tup, N):
res = [test_tup[i : i + N] for i in range(0, len(test_tup), N)]
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 | 918 |
mbpp
|
def max_height(node):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
if node is None:
return 0 ;
else :
left_height = max_height(node.left)
right_height = max_height(node.right)
if (left_height > right_height):
return left_height+1
else:
return right_height+1
|
transformation_dead_code_insert
|
def max_height(node):
class Node:
def __init__(self, data):
while False:
self.left = None
self.data = data
self.left = None
self.right = None
if node is None:
return 0
else:
left_height = max_height(node.left)
right_height = max_height(node.right)
if left_height > right_height:
return left_height + 1
else:
return right_height + 1
| 1 | 924 |
mbpp
|
def max_height(node):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
if node is None:
return 0 ;
else :
left_height = max_height(node.left)
right_height = max_height(node.right)
if (left_height > right_height):
return left_height+1
else:
return right_height+1
|
transformation_for_while_loop
|
def max_height(node):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
if node is None:
return 0
else:
left_height = max_height(node.left)
right_height = max_height(node.right)
if left_height > right_height:
return left_height + 1
else:
return right_height + 1
| 1 | 924 |
mbpp
|
def max_height(node):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
if node is None:
return 0 ;
else :
left_height = max_height(node.left)
right_height = max_height(node.right)
if (left_height > right_height):
return left_height+1
else:
return right_height+1
|
transformation_operand_swap
|
def max_height(node):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
if node is None:
return 0
else:
left_height = max_height(node.left)
right_height = max_height(node.right)
if right_height < left_height:
return left_height + 1
else:
return right_height + 1
| 1 | 924 |
mbpp
|
def max_height(node):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
if node is None:
return 0 ;
else :
left_height = max_height(node.left)
right_height = max_height(node.right)
if (left_height > right_height):
return left_height+1
else:
return right_height+1
|
transformation_rename_variable_cb
|
def max_height(mask):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
if mask is None:
return 0
else:
left_height = max_height(mask.left)
right_height = max_height(mask.right)
if left_height > right_height:
return left_height + 1
else:
return right_height + 1
| 1 | 924 |
mbpp
|
def max_height(node):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
if node is None:
return 0 ;
else :
left_height = max_height(node.left)
right_height = max_height(node.right)
if (left_height > right_height):
return left_height+1
else:
return right_height+1
|
transformation_rename_variable_naive
|
def max_height(VAR_0):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
if VAR_0 is None:
return 0
else:
left_height = max_height(VAR_0.left)
right_height = max_height(VAR_0.right)
if left_height > right_height:
return left_height + 1
else:
return right_height + 1
| 1 | 924 |
mbpp
|
def max_height(node):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
if node is None:
return 0 ;
else :
left_height = max_height(node.left)
right_height = max_height(node.right)
if (left_height > right_height):
return left_height+1
else:
return right_height+1
|
transformation_rename_variable_rn
|
def max_height(v9bZ):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
if v9bZ is None:
return 0
else:
left_height = max_height(v9bZ.left)
right_height = max_height(v9bZ.right)
if left_height > right_height:
return left_height + 1
else:
return right_height + 1
| 1 | 924 |
mbpp
|
def max_height(node):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
if node is None:
return 0 ;
else :
left_height = max_height(node.left)
right_height = max_height(node.right)
if (left_height > right_height):
return left_height+1
else:
return right_height+1
|
transformation_add_sub_variable
|
def max_height(node):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
if node is None:
return 0 ;
else :
left_height = max_height(node.left)
right_height = max_height(node.right)
if (left_height > right_height):
return left_height-1
else:
return right_height+1
| 0 | 924 |
mbpp
|
def max_height(node):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
if node is None:
return 0 ;
else :
left_height = max_height(node.left)
right_height = max_height(node.right)
if (left_height > right_height):
return left_height+1
else:
return right_height+1
|
transformation_greater_lesser_variable
|
def max_height(node):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
if node is None:
return 0 ;
else :
left_height = max_height(node.left)
right_height = max_height(node.right)
if (left_height < right_height):
return left_height+1
else:
return right_height+1
| 0 | 924 |
mbpp
|
def max_height(node):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
if node is None:
return 0 ;
else :
left_height = max_height(node.left)
right_height = max_height(node.right)
if (left_height > right_height):
return left_height+1
else:
return right_height+1
|
transformation_is_isnot_variable
|
def max_height(node):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
if node is not None:
return 0 ;
else :
left_height = max_height(node.left)
right_height = max_height(node.right)
if (left_height > right_height):
return left_height+1
else:
return right_height+1
| 0 | 924 |
mbpp
|
def max_height(node):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
if node is None:
return 0 ;
else :
left_height = max_height(node.left)
right_height = max_height(node.right)
if (left_height > right_height):
return left_height+1
else:
return right_height+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 | 924 |
mbpp
|
def max_height(node):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
if node is None:
return 0 ;
else :
left_height = max_height(node.left)
right_height = max_height(node.right)
if (left_height > right_height):
return left_height+1
else:
return right_height+1
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 924 |
mbpp
|
def max_height(node):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
if node is None:
return 0 ;
else :
left_height = max_height(node.left)
right_height = max_height(node.right)
if (left_height > right_height):
return left_height+1
else:
return right_height+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 | 924 |
mbpp
|
def max_height(node):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
if node is None:
return 0 ;
else :
left_height = max_height(node.left)
right_height = max_height(node.right)
if (left_height > right_height):
return left_height+1
else:
return right_height+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 | 924 |
mbpp
|
def max_height(node):
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
if node is None:
return 0 ;
else :
left_height = max_height(node.left)
right_height = max_height(node.right)
if (left_height > right_height):
return left_height+1
else:
return right_height+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 | 924 |
mbpp
|
def count_tuplex(tuplex,value):
count = tuplex.count(value)
return count
|
transformation_dead_code_insert
|
def count_tuplex(tuplex, value):
_i_6 = 0
if _i_6 < _i_6:
return count
count = tuplex.count(value)
return count
| 1 | 926 |
mbpp
|
def count_tuplex(tuplex,value):
count = tuplex.count(value)
return count
|
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 | 926 |
mbpp
|
def count_tuplex(tuplex,value):
count = tuplex.count(value)
return count
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 926 |
mbpp
|
def count_tuplex(tuplex,value):
count = tuplex.count(value)
return count
|
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 | 926 |
mbpp
|
def count_tuplex(tuplex,value):
count = tuplex.count(value)
return count
|
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 | 926 |
mbpp
|
def count_tuplex(tuplex,value):
count = tuplex.count(value)
return count
|
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 | 926 |
mbpp
|
def text_match(text):
import re
patterns = 'ab*?'
if re.search(patterns, text):
return ('Found a match!')
else:
return ('Not matched!')
|
transformation_dead_code_insert
|
def text_match(text):
import re
patterns = "ab*?"
for _i_1 in range(0):
return "Found a match!"
if re.search(patterns, text):
return "Found a match!"
else:
return "Not matched!"
| 1 | 927 |
mbpp
|
def text_match(text):
import re
patterns = 'ab*?'
if re.search(patterns, text):
return ('Found a match!')
else:
return ('Not matched!')
|
transformation_for_while_loop
|
def text_match(text):
import re
patterns = "ab*?"
if re.search(patterns, text):
return "Found a match!"
else:
return "Not matched!"
| 1 | 927 |
mbpp
|
def text_match(text):
import re
patterns = 'ab*?'
if re.search(patterns, text):
return ('Found a match!')
else:
return ('Not matched!')
|
transformation_operand_swap
|
def text_match(text):
import re
patterns = "ab*?"
if re.search(patterns, text):
return "Found a match!"
else:
return "Not matched!"
| 1 | 927 |
mbpp
|
def text_match(text):
import re
patterns = 'ab*?'
if re.search(patterns, text):
return ('Found a match!')
else:
return ('Not matched!')
|
transformation_rename_variable_naive
|
def text_match(VAR_0):
import re
patterns = "ab*?"
if re.search(patterns, VAR_0):
return "Found a match!"
else:
return "Not matched!"
| 1 | 927 |
mbpp
|
def text_match(text):
import re
patterns = 'ab*?'
if re.search(patterns, text):
return ('Found a match!')
else:
return ('Not matched!')
|
transformation_rename_variable_rn
|
def text_match(n23e):
import re
patterns = "ab*?"
if re.search(patterns, n23e):
return "Found a match!"
else:
return "Not matched!"
| 1 | 927 |
mbpp
|
def text_match(text):
import re
patterns = 'ab*?'
if re.search(patterns, text):
return ('Found a match!')
else:
return ('Not matched!')
|
transformation_mul_div_variable
|
def text_match(text):
import re
patterns = 'ab/?'
if re.search(patterns, text):
return ('Found a match!')
else:
return ('Not matched!')
| 0 | 927 |
mbpp
|
def text_match(text):
import re
patterns = 'ab*?'
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 | 927 |
mbpp
|
def text_match(text):
import re
patterns = 'ab*?'
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 | 927 |
mbpp
|
def text_match(text):
import re
patterns = 'ab*?'
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 | 927 |
mbpp
|
def text_match(text):
import re
patterns = 'ab*?'
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 | 927 |
mbpp
|
def text_match(text):
import re
patterns = 'ab*?'
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 | 927 |
mbpp
|
def sum_series(number):
import math
total = 0
total = math.pow((number * (number + 1)) /2, 2)
return total
|
transformation_dead_code_insert
|
def sum_series(number):
_i_3 = 0
while _i_3 < _i_3:
return total
import math
total = 0
total = math.pow((number * (number + 1)) / 2, 2)
return total
| 1 | 928 |
mbpp
|
def sum_series(number):
import math
total = 0
total = math.pow((number * (number + 1)) /2, 2)
return total
|
transformation_for_while_loop
|
def sum_series(number):
import math
total = 0
total = math.pow((number * (number + 1)) / 2, 2)
return total
| 1 | 928 |
mbpp
|
def sum_series(number):
import math
total = 0
total = math.pow((number * (number + 1)) /2, 2)
return total
|
transformation_operand_swap
|
def sum_series(number):
import math
total = 0
total = math.pow((number * (number + 1)) / 2, 2)
return total
| 1 | 928 |
mbpp
|
def sum_series(number):
import math
total = 0
total = math.pow((number * (number + 1)) /2, 2)
return total
|
transformation_rename_variable_cb
|
def sum_series(number):
import math
number2 = 0
number2 = math.pow((number * (number + 1)) / 2, 2)
return number2
| 1 | 928 |
mbpp
|
def sum_series(number):
import math
total = 0
total = math.pow((number * (number + 1)) /2, 2)
return total
|
transformation_rename_variable_naive
|
def sum_series(VAR_0):
import math
total = 0
total = math.pow((VAR_0 * (VAR_0 + 1)) / 2, 2)
return total
| 1 | 928 |
mbpp
|
def sum_series(number):
import math
total = 0
total = math.pow((number * (number + 1)) /2, 2)
return total
|
transformation_rename_variable_rn
|
def sum_series(PG35c9):
import math
total = 0
total = math.pow((PG35c9 * (PG35c9 + 1)) / 2, 2)
return total
| 1 | 928 |
mbpp
|
def sum_series(number):
import math
total = 0
total = math.pow((number * (number + 1)) /2, 2)
return total
|
transformation_add_sub_variable
|
def sum_series(number):
import math
total = 0
total = math.pow((number * (number - 1)) /2, 2)
return total
| 0 | 928 |
mbpp
|
def sum_series(number):
import math
total = 0
total = math.pow((number * (number + 1)) /2, 2)
return total
|
transformation_mul_div_variable
|
def sum_series(number):
import math
total = 0
total = math.pow((number / (number + 1)) /2, 2)
return total
| 0 | 928 |
mbpp
|
def sum_series(number):
import math
total = 0
total = math.pow((number * (number + 1)) /2, 2)
return total
|
transformation_div_mul_variable
|
def sum_series(number):
import math
total = 0
total = math.pow((number * (number + 1)) *2, 2)
return total
| 0 | 928 |
mbpp
|
def sum_series(number):
import math
total = 0
total = math.pow((number * (number + 1)) /2, 2)
return total
|
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 | 928 |
mbpp
|
def sum_series(number):
import math
total = 0
total = math.pow((number * (number + 1)) /2, 2)
return total
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 928 |
mbpp
|
def sum_series(number):
import math
total = 0
total = math.pow((number * (number + 1)) /2, 2)
return total
|
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 | 928 |
mbpp
|
def sum_series(number):
import math
total = 0
total = math.pow((number * (number + 1)) /2, 2)
return total
|
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 | 928 |
mbpp
|
def sum_series(number):
import math
total = 0
total = math.pow((number * (number + 1)) /2, 2)
return total
|
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 | 928 |
mbpp
|
def camel_to_snake(text):
import re
str1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', text)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', str1).lower()
|
transformation_dead_code_insert
|
def camel_to_snake(text):
while False:
str1 = re.sub("(.)([A-Z][a-z]+)", r"1_2", text)
import re
str1 = re.sub("(.)([A-Z][a-z]+)", r"1_2", text)
return re.sub("([a-z0-9])([A-Z])", r"1_2", str1).lower()
| 1 | 930 |
mbpp
|
def camel_to_snake(text):
import re
str1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', text)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', str1).lower()
|
transformation_for_while_loop
|
def camel_to_snake(text):
import re
str1 = re.sub("(.)([A-Z][a-z]+)", r"1_2", text)
return re.sub("([a-z0-9])([A-Z])", r"1_2", str1).lower()
| 1 | 930 |
mbpp
|
def camel_to_snake(text):
import re
str1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', text)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', str1).lower()
|
transformation_operand_swap
|
def camel_to_snake(text):
import re
str1 = re.sub("(.)([A-Z][a-z]+)", r"1_2", text)
return re.sub("([a-z0-9])([A-Z])", r"1_2", str1).lower()
| 1 | 930 |
mbpp
|
def camel_to_snake(text):
import re
str1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', text)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', str1).lower()
|
transformation_rename_variable_cb
|
def camel_to_snake(text):
import re
text2 = re.sub("(.)([A-Z][a-z]+)", r"1_2", text)
return re.sub("([a-z0-9])([A-Z])", r"1_2", text2).lower()
| 1 | 930 |
mbpp
|
def camel_to_snake(text):
import re
str1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', text)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', str1).lower()
|
transformation_rename_variable_naive
|
def camel_to_snake(text):
import re
VAR_0 = re.sub("(.)([A-Z][a-z]+)", r"1_2", text)
return re.sub("([a-z0-9])([A-Z])", r"1_2", VAR_0).lower()
| 1 | 930 |
mbpp
|
def camel_to_snake(text):
import re
str1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', text)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', str1).lower()
|
transformation_rename_variable_rn
|
def camel_to_snake(text):
import re
str1 = re.V98("(.)([A-Z][a-z]+)", r"1_2", text)
return re.V98("([a-z0-9])([A-Z])", r"1_2", str1).lower()
| 1 | 930 |
mbpp
|
def camel_to_snake(text):
import re
str1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', text)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', str1).lower()
|
transformation_add_sub_variable
|
def camel_to_snake(text):
import re
str1 = re.sub('(.)([A-Z][a-z]-)', r'\1_\2', text)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', str1).lower()
| 0 | 930 |
mbpp
|
def camel_to_snake(text):
import re
str1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', text)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', str1).lower()
|
transformation_sub_add_variable
|
def camel_to_snake(text):
import re
str1 = re.sub('(.)([A+Z][a-z]+)', r'\1_\2', text)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', str1).lower()
| 0 | 930 |
mbpp
|
def camel_to_snake(text):
import re
str1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', text)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', str1).lower()
|
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 | 930 |
mbpp
|
def camel_to_snake(text):
import re
str1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', text)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', str1).lower()
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 930 |
mbpp
|
def camel_to_snake(text):
import re
str1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', text)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', str1).lower()
|
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 | 930 |
mbpp
|
def camel_to_snake(text):
import re
str1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', text)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', str1).lower()
|
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 | 930 |
mbpp
|
def camel_to_snake(text):
import re
str1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', text)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', str1).lower()
|
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 | 930 |
mbpp
|
def dealnnoy_num(n, m):
if (m == 0 or n == 0) :
return 1
return dealnnoy_num(m - 1, n) + dealnnoy_num(m - 1, n - 1) + dealnnoy_num(m, n - 1)
|
transformation_dead_code_insert
|
def dealnnoy_num(n, m):
_i_4 = 0
while _i_4 < _i_4:
return 1
if m == 0 or n == 0:
return 1
return dealnnoy_num(m - 1, n) + dealnnoy_num(m - 1, n - 1) + dealnnoy_num(m, n - 1)
| 1 | 931 |
mbpp
|
def dealnnoy_num(n, m):
if (m == 0 or n == 0) :
return 1
return dealnnoy_num(m - 1, n) + dealnnoy_num(m - 1, n - 1) + dealnnoy_num(m, n - 1)
|
transformation_for_while_loop
|
def dealnnoy_num(n, m):
if m == 0 or n == 0:
return 1
return dealnnoy_num(m - 1, n) + dealnnoy_num(m - 1, n - 1) + dealnnoy_num(m, n - 1)
| 1 | 931 |
mbpp
|
def dealnnoy_num(n, m):
if (m == 0 or n == 0) :
return 1
return dealnnoy_num(m - 1, n) + dealnnoy_num(m - 1, n - 1) + dealnnoy_num(m, n - 1)
|
transformation_operand_swap
|
def dealnnoy_num(n, m):
if 0 == m or n == 0:
return 1
return dealnnoy_num(m - 1, n) + dealnnoy_num(m - 1, n - 1) + dealnnoy_num(m, n - 1)
| 1 | 931 |
mbpp
|
def dealnnoy_num(n, m):
if (m == 0 or n == 0) :
return 1
return dealnnoy_num(m - 1, n) + dealnnoy_num(m - 1, n - 1) + dealnnoy_num(m, n - 1)
|
transformation_rename_variable_cb
|
def dealnnoy_num(n, n2):
if n2 == 0 or n == 0:
return 1
return (
dealnnoy_num(n2 - 1, n) + dealnnoy_num(n2 - 1, n - 1) + dealnnoy_num(n2, n - 1)
)
| 1 | 931 |
mbpp
|
def dealnnoy_num(n, m):
if (m == 0 or n == 0) :
return 1
return dealnnoy_num(m - 1, n) + dealnnoy_num(m - 1, n - 1) + dealnnoy_num(m, n - 1)
|
transformation_rename_variable_naive
|
def dealnnoy_num(n, VAR_0):
if VAR_0 == 0 or n == 0:
return 1
return (
dealnnoy_num(VAR_0 - 1, n)
+ dealnnoy_num(VAR_0 - 1, n - 1)
+ dealnnoy_num(VAR_0, n - 1)
)
| 1 | 931 |
mbpp
|
def dealnnoy_num(n, m):
if (m == 0 or n == 0) :
return 1
return dealnnoy_num(m - 1, n) + dealnnoy_num(m - 1, n - 1) + dealnnoy_num(m, n - 1)
|
transformation_rename_variable_rn
|
def dealnnoy_num(n, G):
if G == 0 or n == 0:
return 1
return dealnnoy_num(G - 1, n) + dealnnoy_num(G - 1, n - 1) + dealnnoy_num(G, n - 1)
| 1 | 931 |
mbpp
|
def dealnnoy_num(n, m):
if (m == 0 or n == 0) :
return 1
return dealnnoy_num(m - 1, n) + dealnnoy_num(m - 1, n - 1) + dealnnoy_num(m, n - 1)
|
transformation_add_sub_variable
|
def dealnnoy_num(n, m):
if (m == 0 or n == 0) :
return 1
return dealnnoy_num(m - 1, n) - dealnnoy_num(m - 1, n - 1) + dealnnoy_num(m, n - 1)
| 0 | 931 |
mbpp
|
def dealnnoy_num(n, m):
if (m == 0 or n == 0) :
return 1
return dealnnoy_num(m - 1, n) + dealnnoy_num(m - 1, n - 1) + dealnnoy_num(m, n - 1)
|
transformation_sub_add_variable
|
def dealnnoy_num(n, m):
if (m == 0 or n == 0) :
return 1
return dealnnoy_num(m + 1, n) + dealnnoy_num(m - 1, n - 1) + dealnnoy_num(m, n - 1)
| 0 | 931 |
mbpp
|
def dealnnoy_num(n, m):
if (m == 0 or n == 0) :
return 1
return dealnnoy_num(m - 1, n) + dealnnoy_num(m - 1, n - 1) + dealnnoy_num(m, n - 1)
|
transformation_equalto_exclamation_variable
|
def dealnnoy_num(n, m):
if (m != 0 or n == 0) :
return 1
return dealnnoy_num(m - 1, n) + dealnnoy_num(m - 1, n - 1) + dealnnoy_num(m, n - 1)
| 0 | 931 |
mbpp
|
def dealnnoy_num(n, m):
if (m == 0 or n == 0) :
return 1
return dealnnoy_num(m - 1, n) + dealnnoy_num(m - 1, n - 1) + dealnnoy_num(m, n - 1)
|
transformation_or_and_variable
|
def dealnnoy_num(n, m):
if (m == 0 and n == 0) :
return 1
return dealnnoy_num(m - 1, n) + dealnnoy_num(m - 1, n - 1) + dealnnoy_num(m, n - 1)
| 0 | 931 |
mbpp
|
def dealnnoy_num(n, m):
if (m == 0 or n == 0) :
return 1
return dealnnoy_num(m - 1, n) + dealnnoy_num(m - 1, n - 1) + dealnnoy_num(m, n - 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 | 931 |
mbpp
|
def dealnnoy_num(n, m):
if (m == 0 or n == 0) :
return 1
return dealnnoy_num(m - 1, n) + dealnnoy_num(m - 1, n - 1) + dealnnoy_num(m, n - 1)
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 931 |
mbpp
|
def dealnnoy_num(n, m):
if (m == 0 or n == 0) :
return 1
return dealnnoy_num(m - 1, n) + dealnnoy_num(m - 1, n - 1) + dealnnoy_num(m, n - 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 | 931 |
mbpp
|
def dealnnoy_num(n, m):
if (m == 0 or n == 0) :
return 1
return dealnnoy_num(m - 1, n) + dealnnoy_num(m - 1, n - 1) + dealnnoy_num(m, n - 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 | 931 |
mbpp
|
def dealnnoy_num(n, m):
if (m == 0 or n == 0) :
return 1
return dealnnoy_num(m - 1, n) + dealnnoy_num(m - 1, n - 1) + dealnnoy_num(m, n - 1)
|
transformation_dissimilar_code_injection_4
|
def count_ways(n):
A = [0] * (n + 1)
B = [0] * (n + 1)
A[0] = 1
A[1] = 0
B[0] = 0
B[1] = 1
for i in range(2, n+1):
A[i] = A[i - 2] + 2 * B[i - 1]
B[i] = A[i - 1] + B[i - 2]
return A[n]
| 0 | 931 |
mbpp
|
def heap_sort(arr):
heapify(arr)
end = len(arr) - 1
while end > 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
return arr
def heapify(arr):
start = len(arr) // 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return
|
transformation_dead_code_insert
|
def heap_sort(arr):
heapify(arr)
end = len(arr) - 1
while end > 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
_i_0 = 0
while _i_0 < _i_0:
while end > 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
end -= 1
return arr
def heapify(arr):
start = len(arr) // 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return
| 1 | 937 |
mbpp
|
def heap_sort(arr):
heapify(arr)
end = len(arr) - 1
while end > 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
return arr
def heapify(arr):
start = len(arr) // 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return
|
transformation_for_while_loop
|
def heap_sort(arr):
heapify(arr)
end = len(arr) - 1
while end > 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
return arr
def heapify(arr):
start = len(arr) // 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return
| 1 | 937 |
mbpp
|
def heap_sort(arr):
heapify(arr)
end = len(arr) - 1
while end > 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
return arr
def heapify(arr):
start = len(arr) // 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return
|
transformation_operand_swap
|
def heap_sort(arr):
heapify(arr)
end = len(arr) - 1
while 0 < end:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
return arr
def heapify(arr):
start = len(arr) // 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return
| 1 | 937 |
mbpp
|
def heap_sort(arr):
heapify(arr)
end = len(arr) - 1
while end > 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
return arr
def heapify(arr):
start = len(arr) // 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return
|
transformation_rename_variable_cb
|
def heap_sort(root2):
heapify(root2)
end = len(root2) - 1
while end > 0:
root2[end], root2[0] = root2[0], root2[end]
shift_down(root2, 0, end - 1)
end -= 1
return root2
def heapify(root2):
start = len(root2) // 2
while start >= 0:
shift_down(root2, start, len(root2) - 1)
start -= 1
def shift_down(root2, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and root2[child] < root2[child + 1]:
child += 1
if child <= end and root2[root] < root2[child]:
root2[root], root2[child] = root2[child], root2[root]
root = child
else:
return
| 1 | 937 |
mbpp
|
def heap_sort(arr):
heapify(arr)
end = len(arr) - 1
while end > 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
return arr
def heapify(arr):
start = len(arr) // 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return
|
transformation_rename_variable_naive
|
def heap_sort(VAR_0):
heapify(VAR_0)
end = len(VAR_0) - 1
while end > 0:
VAR_0[end], VAR_0[0] = VAR_0[0], VAR_0[end]
shift_down(VAR_0, 0, end - 1)
end -= 1
return VAR_0
def heapify(VAR_0):
start = len(VAR_0) // 2
while start >= 0:
shift_down(VAR_0, start, len(VAR_0) - 1)
start -= 1
def shift_down(VAR_0, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and VAR_0[child] < VAR_0[child + 1]:
child += 1
if child <= end and VAR_0[root] < VAR_0[child]:
VAR_0[root], VAR_0[child] = VAR_0[child], VAR_0[root]
root = child
else:
return
| 1 | 937 |
mbpp
|
def heap_sort(arr):
heapify(arr)
end = len(arr) - 1
while end > 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
return arr
def heapify(arr):
start = len(arr) // 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return
|
transformation_rename_variable_rn
|
def heap_sort(S0H):
heapify(S0H)
end = len(S0H) - 1
while end > 0:
S0H[end], S0H[0] = S0H[0], S0H[end]
shift_down(S0H, 0, end - 1)
end -= 1
return S0H
def heapify(S0H):
start = len(S0H) // 2
while start >= 0:
shift_down(S0H, start, len(S0H) - 1)
start -= 1
def shift_down(S0H, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and S0H[child] < S0H[child + 1]:
child += 1
if child <= end and S0H[root] < S0H[child]:
S0H[root], S0H[child] = S0H[child], S0H[root]
root = child
else:
return
| 1 | 937 |
mbpp
|
def heap_sort(arr):
heapify(arr)
end = len(arr) - 1
while end > 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
return arr
def heapify(arr):
start = len(arr) // 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return
|
transformation_add_sub_variable
|
def heap_sort(arr):
heapify(arr)
end = len(arr) - 1
while end > 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
return arr
def heapify(arr):
start = len(arr) // 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root * 2 - 1 <= end:
child = root * 2 + 1
if child + 1 <= end and arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return
| 0 | 937 |
mbpp
|
def heap_sort(arr):
heapify(arr)
end = len(arr) - 1
while end > 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
return arr
def heapify(arr):
start = len(arr) // 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return
|
transformation_sub_add_variable
|
def heap_sort(arr):
heapify(arr)
end = len(arr) + 1
while end > 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
return arr
def heapify(arr):
start = len(arr) // 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return
| 0 | 937 |
mbpp
|
def heap_sort(arr):
heapify(arr)
end = len(arr) - 1
while end > 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
return arr
def heapify(arr):
start = len(arr) // 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root * 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return
|
transformation_mul_div_variable
|
def heap_sort(arr):
heapify(arr)
end = len(arr) - 1
while end > 0:
arr[end], arr[0] = arr[0], arr[end]
shift_down(arr, 0, end - 1)
end -= 1
return arr
def heapify(arr):
start = len(arr) // 2
while start >= 0:
shift_down(arr, start, len(arr) - 1)
start -= 1
def shift_down(arr, start, end):
root = start
while root / 2 + 1 <= end:
child = root * 2 + 1
if child + 1 <= end and arr[child] < arr[child + 1]:
child += 1
if child <= end and arr[root] < arr[child]:
arr[root], arr[child] = arr[child], arr[root]
root = child
else:
return
| 0 | 937 |
mbpp
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.