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 pair_wise(l1):
temp = []
for i in range(len(l1) - 1):
current_element, next_element = l1[i], l1[i + 1]
x = (current_element, next_element)
temp.append(x)
return temp
|
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 | 763 |
mbpp
|
def get_Pairs_Count(arr,n,sum):
count = 0
for i in range(0,n):
for j in range(i + 1,n):
if arr[i] + arr[j] == sum:
count += 1
return count
|
transformation_dead_code_insert
|
def get_Pairs_Count(arr, n, sum):
if False:
count += 1
count = 0
for i in range(0, n):
for j in range(i + 1, n):
if arr[i] + arr[j] == sum:
count += 1
return count
| 1 | 764 |
mbpp
|
def get_Pairs_Count(arr,n,sum):
count = 0
for i in range(0,n):
for j in range(i + 1,n):
if arr[i] + arr[j] == sum:
count += 1
return count
|
transformation_for_while_loop
|
def get_Pairs_Count(arr, n, sum):
count = 0
i = 0
while i < n:
for j in range(i + 1, n):
if arr[i] + arr[j] == sum:
count += 1
i += 1
return count
| 1 | 764 |
mbpp
|
def get_Pairs_Count(arr,n,sum):
count = 0
for i in range(0,n):
for j in range(i + 1,n):
if arr[i] + arr[j] == sum:
count += 1
return count
|
transformation_operand_swap
|
def get_Pairs_Count(arr, n, sum):
count = 0
for i in range(0, n):
for j in range(i + 1, n):
if sum == arr[i] + arr[j]:
count += 1
return count
| 1 | 764 |
mbpp
|
def get_Pairs_Count(arr,n,sum):
count = 0
for i in range(0,n):
for j in range(i + 1,n):
if arr[i] + arr[j] == sum:
count += 1
return count
|
transformation_rename_variable_cb
|
def get_Pairs_Count(arr, n, sum):
count = 0
for i2 in range(0, n):
for j in range(i2 + 1, n):
if arr[i2] + arr[j] == sum:
count += 1
return count
| 1 | 764 |
mbpp
|
def get_Pairs_Count(arr,n,sum):
count = 0
for i in range(0,n):
for j in range(i + 1,n):
if arr[i] + arr[j] == sum:
count += 1
return count
|
transformation_rename_variable_naive
|
def get_Pairs_Count(arr, VAR_0, sum):
count = 0
for i in range(0, VAR_0):
for j in range(i + 1, VAR_0):
if arr[i] + arr[j] == sum:
count += 1
return count
| 1 | 764 |
mbpp
|
def get_Pairs_Count(arr,n,sum):
count = 0
for i in range(0,n):
for j in range(i + 1,n):
if arr[i] + arr[j] == sum:
count += 1
return count
|
transformation_rename_variable_rn
|
def get_Pairs_Count(Z27, n, sum):
count = 0
for i in range(0, n):
for j in range(i + 1, n):
if Z27[i] + Z27[j] == sum:
count += 1
return count
| 1 | 764 |
mbpp
|
def get_Pairs_Count(arr,n,sum):
count = 0
for i in range(0,n):
for j in range(i + 1,n):
if arr[i] + arr[j] == sum:
count += 1
return count
|
transformation_add_sub_variable
|
def get_Pairs_Count(arr,n,sum):
count = 0
for i in range(0,n):
for j in range(i - 1,n):
if arr[i] + arr[j] == sum:
count += 1
return count
| 0 | 764 |
mbpp
|
def get_Pairs_Count(arr,n,sum):
count = 0
for i in range(0,n):
for j in range(i + 1,n):
if arr[i] + arr[j] == sum:
count += 1
return count
|
transformation_equalto_exclamation_variable
|
def get_Pairs_Count(arr,n,sum):
count = 0
for i in range(0,n):
for j in range(i + 1,n):
if arr[i] + arr[j] != sum:
count += 1
return count
| 0 | 764 |
mbpp
|
def get_Pairs_Count(arr,n,sum):
count = 0
for i in range(0,n):
for j in range(i + 1,n):
if arr[i] + arr[j] == sum:
count += 1
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 | 764 |
mbpp
|
def get_Pairs_Count(arr,n,sum):
count = 0
for i in range(0,n):
for j in range(i + 1,n):
if arr[i] + arr[j] == sum:
count += 1
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 | 764 |
mbpp
|
def get_Pairs_Count(arr,n,sum):
count = 0
for i in range(0,n):
for j in range(i + 1,n):
if arr[i] + arr[j] == sum:
count += 1
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 | 764 |
mbpp
|
def get_Pairs_Count(arr,n,sum):
count = 0
for i in range(0,n):
for j in range(i + 1,n):
if arr[i] + arr[j] == sum:
count += 1
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 | 764 |
mbpp
|
def get_Pairs_Count(arr,n,sum):
count = 0
for i in range(0,n):
for j in range(i + 1,n):
if arr[i] + arr[j] == sum:
count += 1
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 | 764 |
mbpp
|
def Diff(li1,li2):
return (list(list(set(li1)-set(li2)) + list(set(li2)-set(li1))))
|
transformation_dead_code_insert
|
def Diff(li1, li2):
return list(list(set(li1) - set(li2)) + list(set(li2) - set(li1)))
| 1 | 766 |
mbpp
|
def Diff(li1,li2):
return (list(list(set(li1)-set(li2)) + list(set(li2)-set(li1))))
|
transformation_for_while_loop
|
def Diff(li1, li2):
return list(list(set(li1) - set(li2)) + list(set(li2) - set(li1)))
| 1 | 766 |
mbpp
|
def Diff(li1,li2):
return (list(list(set(li1)-set(li2)) + list(set(li2)-set(li1))))
|
transformation_operand_swap
|
def Diff(li1, li2):
return list(list(set(li1) - set(li2)) + list(set(li2) - set(li1)))
| 1 | 766 |
mbpp
|
def Diff(li1,li2):
return (list(list(set(li1)-set(li2)) + list(set(li2)-set(li1))))
|
transformation_rename_variable_cb
|
def Diff(li, li2):
return list(list(set(li) - set(li2)) + list(set(li2) - set(li)))
| 1 | 766 |
mbpp
|
def Diff(li1,li2):
return (list(list(set(li1)-set(li2)) + list(set(li2)-set(li1))))
|
transformation_rename_variable_naive
|
def Diff(VAR_0, li2):
return list(list(set(VAR_0) - set(li2)) + list(set(li2) - set(VAR_0)))
| 1 | 766 |
mbpp
|
def Diff(li1,li2):
return (list(list(set(li1)-set(li2)) + list(set(li2)-set(li1))))
|
transformation_rename_variable_rn
|
def Diff(QE4, li2):
return list(list(set(QE4) - set(li2)) + list(set(li2) - set(QE4)))
| 1 | 766 |
mbpp
|
def Diff(li1,li2):
return (list(list(set(li1)-set(li2)) + list(set(li2)-set(li1))))
|
transformation_add_sub_variable
|
def Diff(li1,li2):
return (list(list(set(li1)-set(li2)) - list(set(li2)-set(li1))))
| 0 | 766 |
mbpp
|
def Diff(li1,li2):
return (list(list(set(li1)-set(li2)) + list(set(li2)-set(li1))))
|
transformation_sub_add_variable
|
def Diff(li1,li2):
return (list(list(set(li1)+set(li2)) + list(set(li2)-set(li1))))
| 0 | 766 |
mbpp
|
def Diff(li1,li2):
return (list(list(set(li1)-set(li2)) + list(set(li2)-set(li1))))
|
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 | 766 |
mbpp
|
def Diff(li1,li2):
return (list(list(set(li1)-set(li2)) + list(set(li2)-set(li1))))
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 766 |
mbpp
|
def Diff(li1,li2):
return (list(list(set(li1)-set(li2)) + list(set(li2)-set(li1))))
|
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 | 766 |
mbpp
|
def Diff(li1,li2):
return (list(list(set(li1)-set(li2)) + list(set(li2)-set(li1))))
|
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 | 766 |
mbpp
|
def Diff(li1,li2):
return (list(list(set(li1)-set(li2)) + list(set(li2)-set(li1))))
|
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 | 766 |
mbpp
|
def check_expression(exp):
from collections import deque
if len(exp) & 1:
return False
stack = deque()
for ch in exp:
if ch == '(' or ch == '{' or ch == '[':
stack.append(ch)
if ch == ')' or ch == '}' or ch == ']':
if not stack:
return False
top = stack.pop()
if (top == '(' and ch != ')') or (top == '{' and ch != '}' or (top == '[' and ch != ']')):
return False
return not stack
|
transformation_dead_code_insert
|
def check_expression(exp):
from collections import deque
if len(exp) & 1:
return False
stack = deque()
for ch in exp:
if ch == "(" or ch == "{" or ch == "[":
_i_5 = 0
while _i_5 > _i_5:
return not stack
stack.append(ch)
if ch == ")" or ch == "}" or ch == "]":
if not stack:
return False
top = stack.pop()
if (top == "(" and ch != ")") or (
top == "{" and ch != "}" or (top == "[" and ch != "]")
):
return False
return not stack
| 1 | 768 |
mbpp
|
def check_expression(exp):
from collections import deque
if len(exp) & 1:
return False
stack = deque()
for ch in exp:
if ch == '(' or ch == '{' or ch == '[':
stack.append(ch)
if ch == ')' or ch == '}' or ch == ']':
if not stack:
return False
top = stack.pop()
if (top == '(' and ch != ')') or (top == '{' and ch != '}' or (top == '[' and ch != ']')):
return False
return not stack
|
transformation_for_while_loop
|
def check_expression(exp):
from collections import deque
if len(exp) & 1:
return False
stack = deque()
_ch_i = 0
while _ch_i < len(exp):
ch = exp[_ch_i]
if ch == "(" or ch == "{" or ch == "[":
stack.append(ch)
if ch == ")" or ch == "}" or ch == "]":
if not stack:
return False
top = stack.pop()
if (top == "(" and ch != ")") or (
top == "{" and ch != "}" or (top == "[" and ch != "]")
):
return False
_ch_i += 1
return not stack
| 1 | 768 |
mbpp
|
def check_expression(exp):
from collections import deque
if len(exp) & 1:
return False
stack = deque()
for ch in exp:
if ch == '(' or ch == '{' or ch == '[':
stack.append(ch)
if ch == ')' or ch == '}' or ch == ']':
if not stack:
return False
top = stack.pop()
if (top == '(' and ch != ')') or (top == '{' and ch != '}' or (top == '[' and ch != ']')):
return False
return not stack
|
transformation_operand_swap
|
def check_expression(exp):
from collections import deque
if len(exp) & 1:
return False
stack = deque()
for ch in exp:
if ch == "(" or ch == "{" or "[" == ch:
stack.append(ch)
if ch == ")" or ch == "}" or ch == "]":
if not stack:
return False
top = stack.pop()
if (top == "(" and ch != ")") or (
top == "{" and ch != "}" or (top == "[" and ch != "]")
):
return False
return not stack
| 1 | 768 |
mbpp
|
def check_expression(exp):
from collections import deque
if len(exp) & 1:
return False
stack = deque()
for ch in exp:
if ch == '(' or ch == '{' or ch == '[':
stack.append(ch)
if ch == ')' or ch == '}' or ch == ']':
if not stack:
return False
top = stack.pop()
if (top == '(' and ch != ')') or (top == '{' and ch != '}' or (top == '[' and ch != ']')):
return False
return not stack
|
transformation_rename_variable_cb
|
def check_expression(exp):
from collections import deque
if len(exp) & 1:
return False
stack = deque()
for top2 in exp:
if top2 == "(" or top2 == "{" or top2 == "[":
stack.append(top2)
if top2 == ")" or top2 == "}" or top2 == "]":
if not stack:
return False
top = stack.pop()
if (top == "(" and top2 != ")") or (
top == "{" and top2 != "}" or (top == "[" and top2 != "]")
):
return False
return not stack
| 1 | 768 |
mbpp
|
def check_expression(exp):
from collections import deque
if len(exp) & 1:
return False
stack = deque()
for ch in exp:
if ch == '(' or ch == '{' or ch == '[':
stack.append(ch)
if ch == ')' or ch == '}' or ch == ']':
if not stack:
return False
top = stack.pop()
if (top == '(' and ch != ')') or (top == '{' and ch != '}' or (top == '[' and ch != ']')):
return False
return not stack
|
transformation_rename_variable_naive
|
def check_expression(exp):
from collections import deque
if len(exp) & 1:
return False
stack = deque()
for VAR_0 in exp:
if VAR_0 == "(" or VAR_0 == "{" or VAR_0 == "[":
stack.append(VAR_0)
if VAR_0 == ")" or VAR_0 == "}" or VAR_0 == "]":
if not stack:
return False
top = stack.pop()
if (top == "(" and VAR_0 != ")") or (
top == "{" and VAR_0 != "}" or (top == "[" and VAR_0 != "]")
):
return False
return not stack
| 1 | 768 |
mbpp
|
def check_expression(exp):
from collections import deque
if len(exp) & 1:
return False
stack = deque()
for ch in exp:
if ch == '(' or ch == '{' or ch == '[':
stack.append(ch)
if ch == ')' or ch == '}' or ch == ']':
if not stack:
return False
top = stack.pop()
if (top == '(' and ch != ')') or (top == '{' and ch != '}' or (top == '[' and ch != ']')):
return False
return not stack
|
transformation_rename_variable_rn
|
def check_expression(exp):
from collections import deque
if len(exp) & 1:
return False
stack = deque()
for Mk in exp:
if Mk == "(" or Mk == "{" or Mk == "[":
stack.append(Mk)
if Mk == ")" or Mk == "}" or Mk == "]":
if not stack:
return False
top = stack.pop()
if (top == "(" and Mk != ")") or (
top == "{" and Mk != "}" or (top == "[" and Mk != "]")
):
return False
return not stack
| 1 | 768 |
mbpp
|
def check_expression(exp):
from collections import deque
if len(exp) & 1:
return False
stack = deque()
for ch in exp:
if ch == '(' or ch == '{' or ch == '[':
stack.append(ch)
if ch == ')' or ch == '}' or ch == ']':
if not stack:
return False
top = stack.pop()
if (top == '(' and ch != ')') or (top == '{' and ch != '}' or (top == '[' and ch != ']')):
return False
return not stack
|
transformation_equalto_exclamation_variable
|
def check_expression(exp):
from collections import deque
if len(exp) & 1:
return False
stack = deque()
for ch in exp:
if ch != '(' or ch == '{' or ch == '[':
stack.append(ch)
if ch == ')' or ch == '}' or ch == ']':
if not stack:
return False
top = stack.pop()
if (top == '(' and ch != ')') or (top == '{' and ch != '}' or (top == '[' and ch != ']')):
return False
return not stack
| 0 | 768 |
mbpp
|
def check_expression(exp):
from collections import deque
if len(exp) & 1:
return False
stack = deque()
for ch in exp:
if ch == '(' or ch == '{' or ch == '[':
stack.append(ch)
if ch == ')' or ch == '}' or ch == ']':
if not stack:
return False
top = stack.pop()
if (top == '(' and ch != ')') or (top == '{' and ch != '}' or (top == '[' and ch != ']')):
return False
return not stack
|
transformation_exclamation_equalto_variable
|
def check_expression(exp):
from collections import deque
if len(exp) & 1:
return False
stack = deque()
for ch in exp:
if ch == '(' or ch == '{' or ch == '[':
stack.append(ch)
if ch == ')' or ch == '}' or ch == ']':
if not stack:
return False
top = stack.pop()
if (top == '(' and ch == ')') or (top == '{' and ch != '}' or (top == '[' and ch != ']')):
return False
return not stack
| 0 | 768 |
mbpp
|
def check_expression(exp):
from collections import deque
if len(exp) & 1:
return False
stack = deque()
for ch in exp:
if ch == '(' or ch == '{' or ch == '[':
stack.append(ch)
if ch == ')' or ch == '}' or ch == ']':
if not stack:
return False
top = stack.pop()
if (top == '(' and ch != ')') or (top == '{' and ch != '}' or (top == '[' and ch != ']')):
return False
return not stack
|
transformation_false_true_variable
|
def check_expression(exp):
from collections import deque
if len(exp) & 1:
return True
stack = deque()
for ch in exp:
if ch == '(' or ch == '{' or ch == '[':
stack.append(ch)
if ch == ')' or ch == '}' or ch == ']':
if not stack:
return False
top = stack.pop()
if (top == '(' and ch != ')') or (top == '{' and ch != '}' or (top == '[' and ch != ']')):
return False
return not stack
| 0 | 768 |
mbpp
|
def check_expression(exp):
from collections import deque
if len(exp) & 1:
return False
stack = deque()
for ch in exp:
if ch == '(' or ch == '{' or ch == '[':
stack.append(ch)
if ch == ')' or ch == '}' or ch == ']':
if not stack:
return False
top = stack.pop()
if (top == '(' and ch != ')') or (top == '{' and ch != '}' or (top == '[' and ch != ']')):
return False
return not stack
|
transformation_and_or_variable
|
def check_expression(exp):
from collections import deque
if len(exp) & 1:
return False
stack = deque()
for ch in exp:
if ch == '(' or ch == '{' or ch == '[':
stack.append(ch)
if ch == ')' or ch == '}' or ch == ']':
if not stack:
return False
top = stack.pop()
if (top == '(' or ch != ')') or (top == '{' and ch != '}' or (top == '[' and ch != ']')):
return False
return not stack
| 0 | 768 |
mbpp
|
def check_expression(exp):
from collections import deque
if len(exp) & 1:
return False
stack = deque()
for ch in exp:
if ch == '(' or ch == '{' or ch == '[':
stack.append(ch)
if ch == ')' or ch == '}' or ch == ']':
if not stack:
return False
top = stack.pop()
if (top == '(' and ch != ')') or (top == '{' and ch != '}' or (top == '[' and ch != ']')):
return False
return not stack
|
transformation_or_and_variable
|
def check_expression(exp):
from collections import deque
if len(exp) & 1:
return False
stack = deque()
for ch in exp:
if ch == '(' and ch == '{' or ch == '[':
stack.append(ch)
if ch == ')' or ch == '}' or ch == ']':
if not stack:
return False
top = stack.pop()
if (top == '(' and ch != ')') or (top == '{' and ch != '}' or (top == '[' and ch != ']')):
return False
return not stack
| 0 | 768 |
mbpp
|
def check_expression(exp):
from collections import deque
if len(exp) & 1:
return False
stack = deque()
for ch in exp:
if ch == '(' or ch == '{' or ch == '[':
stack.append(ch)
if ch == ')' or ch == '}' or ch == ']':
if not stack:
return False
top = stack.pop()
if (top == '(' and ch != ')') or (top == '{' and ch != '}' or (top == '[' and ch != ']')):
return False
return not stack
|
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 | 768 |
mbpp
|
def check_expression(exp):
from collections import deque
if len(exp) & 1:
return False
stack = deque()
for ch in exp:
if ch == '(' or ch == '{' or ch == '[':
stack.append(ch)
if ch == ')' or ch == '}' or ch == ']':
if not stack:
return False
top = stack.pop()
if (top == '(' and ch != ')') or (top == '{' and ch != '}' or (top == '[' and ch != ']')):
return False
return not stack
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 768 |
mbpp
|
def check_expression(exp):
from collections import deque
if len(exp) & 1:
return False
stack = deque()
for ch in exp:
if ch == '(' or ch == '{' or ch == '[':
stack.append(ch)
if ch == ')' or ch == '}' or ch == ']':
if not stack:
return False
top = stack.pop()
if (top == '(' and ch != ')') or (top == '{' and ch != '}' or (top == '[' and ch != ']')):
return False
return not stack
|
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 | 768 |
mbpp
|
def check_expression(exp):
from collections import deque
if len(exp) & 1:
return False
stack = deque()
for ch in exp:
if ch == '(' or ch == '{' or ch == '[':
stack.append(ch)
if ch == ')' or ch == '}' or ch == ']':
if not stack:
return False
top = stack.pop()
if (top == '(' and ch != ')') or (top == '{' and ch != '}' or (top == '[' and ch != ']')):
return False
return not stack
|
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 | 768 |
mbpp
|
def check_expression(exp):
from collections import deque
if len(exp) & 1:
return False
stack = deque()
for ch in exp:
if ch == '(' or ch == '{' or ch == '[':
stack.append(ch)
if ch == ')' or ch == '}' or ch == ']':
if not stack:
return False
top = stack.pop()
if (top == '(' and ch != ')') or (top == '{' and ch != '}' or (top == '[' and ch != ']')):
return False
return not stack
|
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 | 768 |
mbpp
|
def remove_length(test_str, K):
temp = test_str.split()
res = [ele for ele in temp if len(ele) != K]
res = ' '.join(res)
return (res)
|
transformation_dead_code_insert
|
def remove_length(test_str, K):
_i_4 = 0
while _i_4 < _i_4:
return res
temp = test_str.split()
res = [ele for ele in temp if len(ele) != K]
res = " ".join(res)
return res
| 1 | 769 |
mbpp
|
def remove_length(test_str, K):
temp = test_str.split()
res = [ele for ele in temp if len(ele) != K]
res = ' '.join(res)
return (res)
|
transformation_for_while_loop
|
def remove_length(test_str, K):
temp = test_str.split()
res = [ele for ele in temp if len(ele) != K]
res = " ".join(res)
return res
| 1 | 769 |
mbpp
|
def remove_length(test_str, K):
temp = test_str.split()
res = [ele for ele in temp if len(ele) != K]
res = ' '.join(res)
return (res)
|
transformation_operand_swap
|
def remove_length(test_str, K):
temp = test_str.split()
res = [ele for ele in temp if K != len(ele)]
res = " ".join(res)
return res
| 1 | 769 |
mbpp
|
def remove_length(test_str, K):
temp = test_str.split()
res = [ele for ele in temp if len(ele) != K]
res = ' '.join(res)
return (res)
|
transformation_rename_variable_cb
|
def remove_length(test_str, K):
temp = test_str.split()
temp2 = [ele for ele in temp if len(ele) != K]
temp2 = " ".join(temp2)
return temp2
| 1 | 769 |
mbpp
|
def remove_length(test_str, K):
temp = test_str.split()
res = [ele for ele in temp if len(ele) != K]
res = ' '.join(res)
return (res)
|
transformation_rename_variable_naive
|
def remove_length(test_str, K):
temp = test_str.split()
VAR_0 = [ele for ele in temp if len(ele) != K]
VAR_0 = " ".join(VAR_0)
return VAR_0
| 1 | 769 |
mbpp
|
def remove_length(test_str, K):
temp = test_str.split()
res = [ele for ele in temp if len(ele) != K]
res = ' '.join(res)
return (res)
|
transformation_rename_variable_rn
|
def remove_length(test_str, K):
temp = test_str.split()
W87 = [ele for ele in temp if len(ele) != K]
W87 = " ".join(W87)
return W87
| 1 | 769 |
mbpp
|
def remove_length(test_str, K):
temp = test_str.split()
res = [ele for ele in temp if len(ele) != K]
res = ' '.join(res)
return (res)
|
transformation_exclamation_equalto_variable
|
def remove_length(test_str, K):
temp = test_str.split()
res = [ele for ele in temp if len(ele) == K]
res = ' '.join(res)
return (res)
| 0 | 769 |
mbpp
|
def remove_length(test_str, K):
temp = test_str.split()
res = [ele for ele in temp if len(ele) != K]
res = ' '.join(res)
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 | 769 |
mbpp
|
def remove_length(test_str, K):
temp = test_str.split()
res = [ele for ele in temp if len(ele) != K]
res = ' '.join(res)
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 | 769 |
mbpp
|
def remove_length(test_str, K):
temp = test_str.split()
res = [ele for ele in temp if len(ele) != K]
res = ' '.join(res)
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 | 769 |
mbpp
|
def remove_length(test_str, K):
temp = test_str.split()
res = [ele for ele in temp if len(ele) != K]
res = ' '.join(res)
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 | 769 |
mbpp
|
def remove_length(test_str, K):
temp = test_str.split()
res = [ele for ele in temp if len(ele) != K]
res = ' '.join(res)
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 | 769 |
mbpp
|
def check_email(email):
import re
regex = '^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,3}$'
if(re.search(regex,email)):
return ("Valid Email")
else:
return ("Invalid Email")
|
transformation_dead_code_insert
|
def check_email(email):
import re
regex = "^[a-z0-9]+[._]?[a-z0-9]+[@]w+[.]w{2,3}$"
_i_4 = 0
while _i_4 > _i_4:
return "Valid Email"
if re.search(regex, email):
return "Valid Email"
else:
return "Invalid Email"
| 1 | 771 |
mbpp
|
def check_email(email):
import re
regex = '^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,3}$'
if(re.search(regex,email)):
return ("Valid Email")
else:
return ("Invalid Email")
|
transformation_for_while_loop
|
def check_email(email):
import re
regex = "^[a-z0-9]+[._]?[a-z0-9]+[@]w+[.]w{2,3}$"
if re.search(regex, email):
return "Valid Email"
else:
return "Invalid Email"
| 1 | 771 |
mbpp
|
def check_email(email):
import re
regex = '^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,3}$'
if(re.search(regex,email)):
return ("Valid Email")
else:
return ("Invalid Email")
|
transformation_operand_swap
|
def check_email(email):
import re
regex = "^[a-z0-9]+[._]?[a-z0-9]+[@]w+[.]w{2,3}$"
if re.search(regex, email):
return "Valid Email"
else:
return "Invalid Email"
| 1 | 771 |
mbpp
|
def check_email(email):
import re
regex = '^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,3}$'
if(re.search(regex,email)):
return ("Valid Email")
else:
return ("Invalid Email")
|
transformation_rename_variable_cb
|
def check_email(email):
import re
regex2 = "^[a-z0-9]+[._]?[a-z0-9]+[@]w+[.]w{2,3}$"
if re.search(regex2, email):
return "Valid Email"
else:
return "Invalid Email"
| 1 | 771 |
mbpp
|
def check_email(email):
import re
regex = '^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,3}$'
if(re.search(regex,email)):
return ("Valid Email")
else:
return ("Invalid Email")
|
transformation_rename_variable_naive
|
def check_email(email):
import re
VAR_0 = "^[a-z0-9]+[._]?[a-z0-9]+[@]w+[.]w{2,3}$"
if re.search(VAR_0, email):
return "Valid Email"
else:
return "Invalid Email"
| 1 | 771 |
mbpp
|
def check_email(email):
import re
regex = '^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,3}$'
if(re.search(regex,email)):
return ("Valid Email")
else:
return ("Invalid Email")
|
transformation_rename_variable_rn
|
def check_email(pqiP0):
import re
regex = "^[a-z0-9]+[._]?[a-z0-9]+[@]w+[.]w{2,3}$"
if re.search(regex, pqiP0):
return "Valid Email"
else:
return "Invalid Email"
| 1 | 771 |
mbpp
|
def check_email(email):
import re
regex = '^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,3}$'
if(re.search(regex,email)):
return ("Valid Email")
else:
return ("Invalid Email")
|
transformation_add_sub_variable
|
def check_email(email):
import re
regex = '^[a-z0-9]-[\._]?[a-z0-9]+[@]\w+[.]\w{2,3}$'
if(re.search(regex,email)):
return ("Valid Email")
else:
return ("Invalid Email")
| 0 | 771 |
mbpp
|
def check_email(email):
import re
regex = '^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,3}$'
if(re.search(regex,email)):
return ("Valid Email")
else:
return ("Invalid Email")
|
transformation_sub_add_variable
|
def check_email(email):
import re
regex = '^[a+z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,3}$'
if(re.search(regex,email)):
return ("Valid Email")
else:
return ("Invalid Email")
| 0 | 771 |
mbpp
|
def check_email(email):
import re
regex = '^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,3}$'
if(re.search(regex,email)):
return ("Valid Email")
else:
return ("Invalid Email")
|
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 | 771 |
mbpp
|
def check_email(email):
import re
regex = '^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,3}$'
if(re.search(regex,email)):
return ("Valid Email")
else:
return ("Invalid Email")
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 771 |
mbpp
|
def check_email(email):
import re
regex = '^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,3}$'
if(re.search(regex,email)):
return ("Valid Email")
else:
return ("Invalid Email")
|
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 | 771 |
mbpp
|
def check_email(email):
import re
regex = '^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,3}$'
if(re.search(regex,email)):
return ("Valid Email")
else:
return ("Invalid Email")
|
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 | 771 |
mbpp
|
def check_email(email):
import re
regex = '^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,3}$'
if(re.search(regex,email)):
return ("Valid Email")
else:
return ("Invalid Email")
|
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 | 771 |
mbpp
|
def odd_position(nums):
return all(nums[i]%2==i%2 for i in range(len(nums)))
|
transformation_dead_code_insert
|
def odd_position(nums):
return all(nums[i] % 2 == i % 2 for i in range(len(nums)))
| 1 | 772 |
mbpp
|
def odd_position(nums):
return all(nums[i]%2==i%2 for i in range(len(nums)))
|
transformation_for_while_loop
|
def odd_position(nums):
return all(nums[i] % 2 == i % 2 for i in range(len(nums)))
| 1 | 772 |
mbpp
|
def odd_position(nums):
return all(nums[i]%2==i%2 for i in range(len(nums)))
|
transformation_operand_swap
|
def odd_position(nums):
return all(i % 2 == nums[i] % 2 for i in range(len(nums)))
| 1 | 772 |
mbpp
|
def odd_position(nums):
return all(nums[i]%2==i%2 for i in range(len(nums)))
|
transformation_rename_variable_cb
|
def odd_position(nums):
return all(nums[i2] % 2 == i2 % 2 for i2 in range(len(nums)))
| 1 | 772 |
mbpp
|
def odd_position(nums):
return all(nums[i]%2==i%2 for i in range(len(nums)))
|
transformation_rename_variable_naive
|
def odd_position(VAR_0):
return all(VAR_0[i] % 2 == i % 2 for i in range(len(VAR_0)))
| 1 | 772 |
mbpp
|
def odd_position(nums):
return all(nums[i]%2==i%2 for i in range(len(nums)))
|
transformation_rename_variable_rn
|
def odd_position(nums):
return all(nums[X] % 2 == X % 2 for X in range(len(nums)))
| 1 | 772 |
mbpp
|
def odd_position(nums):
return all(nums[i]%2==i%2 for i in range(len(nums)))
|
transformation_equalto_exclamation_variable
|
def odd_position(nums):
return all(nums[i]%2!=i%2 for i in range(len(nums)))
| 0 | 772 |
mbpp
|
def odd_position(nums):
return all(nums[i]%2==i%2 for i in range(len(nums)))
|
transformation_dissimilar_code_injection_0
|
def min_cost(cost, m, n):
R = 3
C = 3
tc = [[0 for x in range(C)] for x in range(R)]
tc[0][0] = cost[0][0]
for i in range(1, m+1):
tc[i][0] = tc[i-1][0] + cost[i][0]
for j in range(1, n+1):
tc[0][j] = tc[0][j-1] + cost[0][j]
for i in range(1, m+1):
for j in range(1, n+1):
tc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j]
return tc[m][n]
| 0 | 772 |
mbpp
|
def odd_position(nums):
return all(nums[i]%2==i%2 for i in range(len(nums)))
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 772 |
mbpp
|
def odd_position(nums):
return all(nums[i]%2==i%2 for i in range(len(nums)))
|
transformation_dissimilar_code_injection_2
|
def is_not_prime(n):
import math
result = False
for i in range(2,int(math.sqrt(n)) + 1):
if n % i == 0:
result = True
return result
| 0 | 772 |
mbpp
|
def odd_position(nums):
return all(nums[i]%2==i%2 for i in range(len(nums)))
|
transformation_dissimilar_code_injection_3
|
def heap_queue_largest(nums,n):
import heapq as hq
largest_nums = hq.nlargest(n, nums)
return largest_nums
| 0 | 772 |
mbpp
|
def odd_position(nums):
return all(nums[i]%2==i%2 for i in range(len(nums)))
|
transformation_dissimilar_code_injection_4
|
def count_ways(n):
A = [0] * (n + 1)
B = [0] * (n + 1)
A[0] = 1
A[1] = 0
B[0] = 0
B[1] = 1
for i in range(2, n+1):
A[i] = A[i - 2] + 2 * B[i - 1]
B[i] = A[i - 1] + B[i - 2]
return A[n]
| 0 | 772 |
mbpp
|
def pack_consecutive_duplicates(list1):
from itertools import groupby
return [list(group) for key, group in groupby(list1)]
|
transformation_dead_code_insert
|
def pack_consecutive_duplicates(list1):
from itertools import groupby
for _i_3 in range(0):
from itertools import groupby
return [list(group) for key, group in groupby(list1)]
| 1 | 775 |
mbpp
|
def pack_consecutive_duplicates(list1):
from itertools import groupby
return [list(group) for key, group in groupby(list1)]
|
transformation_for_while_loop
|
def pack_consecutive_duplicates(list1):
from itertools import groupby
return [list(group) for key, group in groupby(list1)]
| 1 | 775 |
mbpp
|
def pack_consecutive_duplicates(list1):
from itertools import groupby
return [list(group) for key, group in groupby(list1)]
|
transformation_operand_swap
|
def pack_consecutive_duplicates(list1):
from itertools import groupby
return [list(group) for key, group in groupby(list1)]
| 1 | 775 |
mbpp
|
def pack_consecutive_duplicates(list1):
from itertools import groupby
return [list(group) for key, group in groupby(list1)]
|
transformation_rename_variable_cb
|
def pack_consecutive_duplicates(list1):
from itertools import groupby
return [list(value) for key, value in groupby(list1)]
| 1 | 775 |
mbpp
|
def pack_consecutive_duplicates(list1):
from itertools import groupby
return [list(group) for key, group in groupby(list1)]
|
transformation_rename_variable_naive
|
def pack_consecutive_duplicates(list1):
from itertools import groupby
return [list(VAR_0) for key, VAR_0 in groupby(list1)]
| 1 | 775 |
mbpp
|
def pack_consecutive_duplicates(list1):
from itertools import groupby
return [list(group) for key, group in groupby(list1)]
|
transformation_rename_variable_rn
|
def pack_consecutive_duplicates(list1):
from itertools import groupby
return [list(z4i0K) for key, z4i0K in groupby(list1)]
| 1 | 775 |
mbpp
|
def pack_consecutive_duplicates(list1):
from itertools import groupby
return [list(group) for key, group in groupby(list1)]
|
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 | 775 |
mbpp
|
def pack_consecutive_duplicates(list1):
from itertools import groupby
return [list(group) for key, group in groupby(list1)]
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 775 |
mbpp
|
def pack_consecutive_duplicates(list1):
from itertools import groupby
return [list(group) for key, group in groupby(list1)]
|
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 | 775 |
mbpp
|
def pack_consecutive_duplicates(list1):
from itertools import groupby
return [list(group) for key, group in groupby(list1)]
|
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 | 775 |
mbpp
|
def pack_consecutive_duplicates(list1):
from itertools import groupby
return [list(group) for key, group in groupby(list1)]
|
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 | 775 |
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_dead_code_insert
|
def unique_sublists(list1):
for _i_8 in range(0):
result.setdefault(tuple(l), list()).append(1)
result = {}
for l in list1:
result.setdefault(tuple(l), list()).append(1)
for a, b in result.items():
result[a] = sum(b)
return result
| 1 | 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_for_while_loop
|
def unique_sublists(list1):
result = {}
_l_i = 0
while _l_i < len(list1):
l = list1[_l_i]
result.setdefault(tuple(l), list()).append(1)
_l_i += 1
for a, b in result.items():
result[a] = sum(b)
return result
| 1 | 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_operand_swap
|
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
| 1 | 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_rename_variable_cb
|
def unique_sublists(list1):
l2 = {}
for l in list1:
l2.setdefault(tuple(l), list()).append(1)
for a, b in l2.items():
l2[a] = sum(b)
return l2
| 1 | 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_rename_variable_naive
|
def unique_sublists(list1):
VAR_0 = {}
for l in list1:
VAR_0.setdefault(tuple(l), list()).append(1)
for a, b in VAR_0.items():
VAR_0[a] = sum(b)
return VAR_0
| 1 | 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_rename_variable_rn
|
def unique_sublists(list1):
u2K353 = {}
for l in list1:
u2K353.setdefault(tuple(l), list()).append(1)
for a, b in u2K353.items():
u2K353[a] = sum(b)
return u2K353
| 1 | 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_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 | 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_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 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_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 | 776 |
mbpp
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.