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 is_sorted(lst):
count_digit = dict([(i, 0) for i in lst])
for i in lst:
count_digit[i]+=1
if any(count_digit[i] > 2 for i in lst):
return False
if all(lst[i-1] <= lst[i] for i in range(1, len(lst))):
return True
else:
return False
| transformation_for_while_loop | def is_sorted(lst):
count_digit = dict([(i, 0) for i in lst])
_i_i = 0
while _i_i < len(lst):
i = lst[_i_i]
count_digit[i] += 1
_i_i += 1
if any(count_digit[i] > 2 for i in lst):
return False
if all(lst[i - 1] <= lst[i] for i in range(1, len(lst))):
return True
else:
return False | 1 | 124 | mbpp |
def is_sorted(lst):
count_digit = dict([(i, 0) for i in lst])
for i in lst:
count_digit[i]+=1
if any(count_digit[i] > 2 for i in lst):
return False
if all(lst[i-1] <= lst[i] for i in range(1, len(lst))):
return True
else:
return False
| transformation_operand_swap | def is_sorted(lst):
count_digit = dict([(i, 0) for i in lst])
for i in lst:
count_digit[i] += 1
if any(2 < count_digit[i] for i in lst):
return False
if all(lst[i - 1] <= lst[i] for i in range(1, len(lst))):
return True
else:
return False | 1 | 124 | mbpp |
def is_sorted(lst):
count_digit = dict([(i, 0) for i in lst])
for i in lst:
count_digit[i]+=1
if any(count_digit[i] > 2 for i in lst):
return False
if all(lst[i-1] <= lst[i] for i in range(1, len(lst))):
return True
else:
return False
| transformation_rename_variable_cb | def is_sorted(lst):
count_digit = dict([(g, 0) for g in lst])
for g in lst:
count_digit[g] += 1
if any(count_digit[g] > 2 for g in lst):
return False
if all(lst[g - 1] <= lst[g] for g in range(1, len(lst))):
return True
else:
return False | 1 | 124 | mbpp |
def is_sorted(lst):
count_digit = dict([(i, 0) for i in lst])
for i in lst:
count_digit[i]+=1
if any(count_digit[i] > 2 for i in lst):
return False
if all(lst[i-1] <= lst[i] for i in range(1, len(lst))):
return True
else:
return False
| transformation_rename_variable_naive | def is_sorted(lst):
count_digit = dict([(VAR_0, 0) for VAR_0 in lst])
for VAR_0 in lst:
count_digit[VAR_0] += 1
if any(count_digit[VAR_0] > 2 for VAR_0 in lst):
return False
if all(lst[VAR_0 - 1] <= lst[VAR_0] for VAR_0 in range(1, len(lst))):
return True
else:
return False | 1 | 124 | mbpp |
def is_sorted(lst):
count_digit = dict([(i, 0) for i in lst])
for i in lst:
count_digit[i]+=1
if any(count_digit[i] > 2 for i in lst):
return False
if all(lst[i-1] <= lst[i] for i in range(1, len(lst))):
return True
else:
return False
| transformation_rename_variable_rn | def is_sorted(lst):
count_digit = dict([(i2, 0) for i2 in lst])
for i2 in lst:
count_digit[i2] += 1
if any(count_digit[i2] > 2 for i2 in lst):
return False
if all(lst[i2 - 1] <= lst[i2] for i2 in range(1, len(lst))):
return True
else:
return False | 1 | 124 | mbpp |
def is_sorted(lst):
count_digit = dict([(i, 0) for i in lst])
for i in lst:
count_digit[i]+=1
if any(count_digit[i] > 2 for i in lst):
return False
if all(lst[i-1] <= lst[i] for i in range(1, len(lst))):
return True
else:
return False
| transformation_add_sub_variable | def is_sorted(lst):
count_digit = dict([(i, 0) for i in lst])
for i in lst:
count_digit[i]-=1
if any(count_digit[i] > 2 for i in lst):
return False
if all(lst[i-1] <= lst[i] for i in range(1, len(lst))):
return True
else:
return False
| 0 | 124 | mbpp |
def is_sorted(lst):
count_digit = dict([(i, 0) for i in lst])
for i in lst:
count_digit[i]+=1
if any(count_digit[i] > 2 for i in lst):
return False
if all(lst[i-1] <= lst[i] for i in range(1, len(lst))):
return True
else:
return False
| transformation_sub_add_variable | def is_sorted(lst):
count_digit = dict([(i, 0) for i in lst])
for i in lst:
count_digit[i]+=1
if any(count_digit[i] > 2 for i in lst):
return False
if all(lst[i+1] <= lst[i] for i in range(1, len(lst))):
return True
else:
return False
| 0 | 124 | mbpp |
def is_sorted(lst):
count_digit = dict([(i, 0) for i in lst])
for i in lst:
count_digit[i]+=1
if any(count_digit[i] > 2 for i in lst):
return False
if all(lst[i-1] <= lst[i] for i in range(1, len(lst))):
return True
else:
return False
| transformation_lesser_greater_variable | def is_sorted(lst):
count_digit = dict([(i, 0) for i in lst])
for i in lst:
count_digit[i]+=1
if any(count_digit[i] > 2 for i in lst):
return False
if all(lst[i-1] >= lst[i] for i in range(1, len(lst))):
return True
else:
return False
| 0 | 124 | mbpp |
def is_sorted(lst):
count_digit = dict([(i, 0) for i in lst])
for i in lst:
count_digit[i]+=1
if any(count_digit[i] > 2 for i in lst):
return False
if all(lst[i-1] <= lst[i] for i in range(1, len(lst))):
return True
else:
return False
| transformation_greater_lesser_variable | def is_sorted(lst):
count_digit = dict([(i, 0) for i in lst])
for i in lst:
count_digit[i]+=1
if any(count_digit[i] < 2 for i in lst):
return False
if all(lst[i-1] <= lst[i] for i in range(1, len(lst))):
return True
else:
return False
| 0 | 124 | mbpp |
def is_sorted(lst):
count_digit = dict([(i, 0) for i in lst])
for i in lst:
count_digit[i]+=1
if any(count_digit[i] > 2 for i in lst):
return False
if all(lst[i-1] <= lst[i] for i in range(1, len(lst))):
return True
else:
return False
| transformation_true_false_variable | def is_sorted(lst):
count_digit = dict([(i, 0) for i in lst])
for i in lst:
count_digit[i]+=1
if any(count_digit[i] > 2 for i in lst):
return False
if all(lst[i-1] <= lst[i] for i in range(1, len(lst))):
return False
else:
return False
| 0 | 124 | mbpp |
def is_sorted(lst):
count_digit = dict([(i, 0) for i in lst])
for i in lst:
count_digit[i]+=1
if any(count_digit[i] > 2 for i in lst):
return False
if all(lst[i-1] <= lst[i] for i in range(1, len(lst))):
return True
else:
return False
| transformation_false_true_variable | def is_sorted(lst):
count_digit = dict([(i, 0) for i in lst])
for i in lst:
count_digit[i]+=1
if any(count_digit[i] > 2 for i in lst):
return True
if all(lst[i-1] <= lst[i] for i in range(1, len(lst))):
return True
else:
return False
| 0 | 124 | mbpp |
def is_sorted(lst):
count_digit = dict([(i, 0) for i in lst])
for i in lst:
count_digit[i]+=1
if any(count_digit[i] > 2 for i in lst):
return False
if all(lst[i-1] <= lst[i] for i in range(1, len(lst))):
return True
else:
return False
| transformation_dissimilar_code_injection_0 | from typing import List
def has_close_elements(numbers: List[float], threshold: float) -> bool:
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
distance = abs(elem - elem2)
if distance < threshold:
return True
return False | 0 | 124 | mbpp |
def is_sorted(lst):
count_digit = dict([(i, 0) for i in lst])
for i in lst:
count_digit[i]+=1
if any(count_digit[i] > 2 for i in lst):
return False
if all(lst[i-1] <= lst[i] for i in range(1, len(lst))):
return True
else:
return False
| transformation_dissimilar_code_injection_1 | from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
current_depth -= 1
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
return result | 0 | 124 | mbpp |
def is_sorted(lst):
count_digit = dict([(i, 0) for i in lst])
for i in lst:
count_digit[i]+=1
if any(count_digit[i] > 2 for i in lst):
return False
if all(lst[i-1] <= lst[i] for i in range(1, len(lst))):
return True
else:
return False
| transformation_dissimilar_code_injection_2 | def truncate_number(number: float) -> float:
""" Given a positive floating point number, it can be decomposed into
and integer part (largest integer smaller than given number) and decimals
(leftover part always smaller than 1).
Return the decimal part of the number.
>>> truncate_number(3.5)
0.5
"""
return number % 1.0 | 0 | 124 | mbpp |
def is_sorted(lst):
count_digit = dict([(i, 0) for i in lst])
for i in lst:
count_digit[i]+=1
if any(count_digit[i] > 2 for i in lst):
return False
if all(lst[i-1] <= lst[i] for i in range(1, len(lst))):
return True
else:
return False
| transformation_dissimilar_code_injection_3 | from typing import List
def below_zero(operations: List[int]) -> bool:
balance = 0
for op in operations:
balance += op
if balance < 0:
return True
return False | 0 | 124 | mbpp |
def is_sorted(lst):
count_digit = dict([(i, 0) for i in lst])
for i in lst:
count_digit[i]+=1
if any(count_digit[i] > 2 for i in lst):
return False
if all(lst[i-1] <= lst[i] for i in range(1, len(lst))):
return True
else:
return False
| transformation_dissimilar_code_injection_4 | from typing import List
def mean_absolute_deviation(numbers: List[float]) -> float:
mean = sum(numbers) / len(numbers)
return sum(abs(x - mean) for x in numbers) / len(numbers) | 0 | 124 | mbpp |
def prod_signs(arr):
if not arr: return None
prod = 0 if 0 in arr else (-1) ** len(list(filter(lambda x: x < 0, arr)))
return prod * sum([abs(i) for i in arr]) | transformation_dead_code_insert | def prod_signs(arr):
if not arr:
return None
while False:
return prod * sum([abs(i) for i in arr])
prod = 0 if 0 in arr else (-1) ** len(list(filter(lambda x: x < 0, arr)))
return prod * sum([abs(i) for i in arr]) | 1 | 126 | mbpp |
def prod_signs(arr):
if not arr: return None
prod = 0 if 0 in arr else (-1) ** len(list(filter(lambda x: x < 0, arr)))
return prod * sum([abs(i) for i in arr]) | transformation_for_while_loop | def prod_signs(arr):
if not arr:
return None
prod = 0 if 0 in arr else (-1) ** len(list(filter(lambda x: x < 0, arr)))
return prod * sum([abs(i) for i in arr]) | 1 | 126 | mbpp |
def prod_signs(arr):
if not arr: return None
prod = 0 if 0 in arr else (-1) ** len(list(filter(lambda x: x < 0, arr)))
return prod * sum([abs(i) for i in arr]) | transformation_operand_swap | def prod_signs(arr):
if not arr:
return None
prod = 0 if 0 in arr else (-1) ** len(list(filter(lambda x: 0 > x, arr)))
return prod * sum([abs(i) for i in arr]) | 1 | 126 | mbpp |
def prod_signs(arr):
if not arr: return None
prod = 0 if 0 in arr else (-1) ** len(list(filter(lambda x: x < 0, arr)))
return prod * sum([abs(i) for i in arr]) | transformation_rename_variable_cb | def prod_signs(s):
if not s:
return None
prod = 0 if 0 in s else (-1) ** len(list(filter(lambda x: x < 0, s)))
return prod * sum([abs(i) for i in s]) | 1 | 126 | mbpp |
def prod_signs(arr):
if not arr: return None
prod = 0 if 0 in arr else (-1) ** len(list(filter(lambda x: x < 0, arr)))
return prod * sum([abs(i) for i in arr]) | transformation_rename_variable_naive | def prod_signs(VAR_0):
if not VAR_0:
return None
prod = 0 if 0 in VAR_0 else (-1) ** len(list(filter(lambda x: x < 0, VAR_0)))
return prod * sum([abs(i) for i in VAR_0]) | 1 | 126 | mbpp |
def prod_signs(arr):
if not arr: return None
prod = 0 if 0 in arr else (-1) ** len(list(filter(lambda x: x < 0, arr)))
return prod * sum([abs(i) for i in arr]) | transformation_rename_variable_rn | def prod_signs(k8f):
if not k8f:
return None
prod = 0 if 0 in k8f else (-1) ** len(list(filter(lambda x: x < 0, k8f)))
return prod * sum([abs(i) for i in k8f]) | 1 | 126 | mbpp |
def prod_signs(arr):
if not arr: return None
prod = 0 if 0 in arr else (-1) ** len(list(filter(lambda x: x < 0, arr)))
return prod * sum([abs(i) for i in arr]) | transformation_sub_add_variable | def prod_signs(arr):
if not arr: return None
prod = 0 if 0 in arr else (+1) ** len(list(filter(lambda x: x < 0, arr)))
return prod * sum([abs(i) for i in arr]) | 0 | 126 | mbpp |
def prod_signs(arr):
if not arr: return None
prod = 0 if 0 in arr else (-1) ** len(list(filter(lambda x: x < 0, arr)))
return prod * sum([abs(i) for i in arr]) | transformation_mul_div_variable | def prod_signs(arr):
if not arr: return None
prod = 0 if 0 in arr else (-1) /* len(list(filter(lambda x: x < 0, arr)))
return prod * sum([abs(i) for i in arr]) | 0 | 126 | mbpp |
def prod_signs(arr):
if not arr: return None
prod = 0 if 0 in arr else (-1) ** len(list(filter(lambda x: x < 0, arr)))
return prod * sum([abs(i) for i in arr]) | transformation_lesser_greater_variable | def prod_signs(arr):
if not arr: return None
prod = 0 if 0 in arr else (-1) ** len(list(filter(lambda x: x > 0, arr)))
return prod * sum([abs(i) for i in arr]) | 0 | 126 | mbpp |
def prod_signs(arr):
if not arr: return None
prod = 0 if 0 in arr else (-1) ** len(list(filter(lambda x: x < 0, arr)))
return prod * sum([abs(i) for i in arr]) | transformation_dissimilar_code_injection_0 | from typing import List
def has_close_elements(numbers: List[float], threshold: float) -> bool:
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
distance = abs(elem - elem2)
if distance < threshold:
return True
return False | 0 | 126 | mbpp |
def prod_signs(arr):
if not arr: return None
prod = 0 if 0 in arr else (-1) ** len(list(filter(lambda x: x < 0, arr)))
return prod * sum([abs(i) for i in arr]) | transformation_dissimilar_code_injection_1 | from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
current_depth -= 1
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
return result | 0 | 126 | mbpp |
def prod_signs(arr):
if not arr: return None
prod = 0 if 0 in arr else (-1) ** len(list(filter(lambda x: x < 0, arr)))
return prod * sum([abs(i) for i in arr]) | transformation_dissimilar_code_injection_2 | def truncate_number(number: float) -> float:
""" Given a positive floating point number, it can be decomposed into
and integer part (largest integer smaller than given number) and decimals
(leftover part always smaller than 1).
Return the decimal part of the number.
>>> truncate_number(3.5)
0.5
"""
return number % 1.0 | 0 | 126 | mbpp |
def prod_signs(arr):
if not arr: return None
prod = 0 if 0 in arr else (-1) ** len(list(filter(lambda x: x < 0, arr)))
return prod * sum([abs(i) for i in arr]) | transformation_dissimilar_code_injection_3 | from typing import List
def below_zero(operations: List[int]) -> bool:
balance = 0
for op in operations:
balance += op
if balance < 0:
return True
return False | 0 | 126 | mbpp |
def prod_signs(arr):
if not arr: return None
prod = 0 if 0 in arr else (-1) ** len(list(filter(lambda x: x < 0, arr)))
return prod * sum([abs(i) for i in arr]) | transformation_dissimilar_code_injection_4 | from typing import List
def mean_absolute_deviation(numbers: List[float]) -> float:
mean = sum(numbers) / len(numbers)
return sum(abs(x - mean) for x in numbers) / len(numbers) | 0 | 126 | mbpp |
def minPath(grid, k):
n = len(grid)
val = n * n + 1
for i in range(n):
for j in range(n):
if grid[i][j] == 1:
temp = []
if i != 0:
temp.append(grid[i - 1][j])
if j != 0:
temp.append(grid[i][j - 1])
if i != n - 1:
temp.append(grid[i + 1][j])
if j != n - 1:
temp.append(grid[i][j + 1])
val = min(temp)
ans = []
for i in range(k):
if i % 2 == 0:
ans.append(1)
else:
ans.append(val)
return ans | transformation_dead_code_insert | def minPath(grid, k):
n = len(grid)
for _i_0 in range(0):
if j != n - 1:
temp.append(grid[i][j + 1])
val = n * n + 1
for i in range(n):
for j in range(n):
if grid[i][j] == 1:
temp = []
if i != 0:
temp.append(grid[i - 1][j])
if j != 0:
temp.append(grid[i][j - 1])
if i != n - 1:
temp.append(grid[i + 1][j])
if j != n - 1:
temp.append(grid[i][j + 1])
val = min(temp)
ans = []
for i in range(k):
if i % 2 == 0:
ans.append(1)
else:
ans.append(val)
return ans | 1 | 127 | mbpp |
def minPath(grid, k):
n = len(grid)
val = n * n + 1
for i in range(n):
for j in range(n):
if grid[i][j] == 1:
temp = []
if i != 0:
temp.append(grid[i - 1][j])
if j != 0:
temp.append(grid[i][j - 1])
if i != n - 1:
temp.append(grid[i + 1][j])
if j != n - 1:
temp.append(grid[i][j + 1])
val = min(temp)
ans = []
for i in range(k):
if i % 2 == 0:
ans.append(1)
else:
ans.append(val)
return ans | transformation_for_while_loop | def minPath(grid, k):
n = len(grid)
val = n * n + 1
i = 0
while i < n:
for j in range(n):
if grid[i][j] == 1:
temp = []
if i != 0:
temp.append(grid[i - 1][j])
if j != 0:
temp.append(grid[i][j - 1])
if i != n - 1:
temp.append(grid[i + 1][j])
if j != n - 1:
temp.append(grid[i][j + 1])
val = min(temp)
i += 1
ans = []
for i in range(k):
if i % 2 == 0:
ans.append(1)
else:
ans.append(val)
return ans | 1 | 127 | mbpp |
def minPath(grid, k):
n = len(grid)
val = n * n + 1
for i in range(n):
for j in range(n):
if grid[i][j] == 1:
temp = []
if i != 0:
temp.append(grid[i - 1][j])
if j != 0:
temp.append(grid[i][j - 1])
if i != n - 1:
temp.append(grid[i + 1][j])
if j != n - 1:
temp.append(grid[i][j + 1])
val = min(temp)
ans = []
for i in range(k):
if i % 2 == 0:
ans.append(1)
else:
ans.append(val)
return ans | transformation_operand_swap | def minPath(grid, k):
n = len(grid)
val = n * n + 1
for i in range(n):
for j in range(n):
if grid[i][j] == 1:
temp = []
if i != 0:
temp.append(grid[i - 1][j])
if j != 0:
temp.append(grid[i][j - 1])
if i != n - 1:
temp.append(grid[i + 1][j])
if j != n - 1:
temp.append(grid[i][j + 1])
val = min(temp)
ans = []
for i in range(k):
if 0 == i % 2:
ans.append(1)
else:
ans.append(val)
return ans | 1 | 127 | mbpp |
def minPath(grid, k):
n = len(grid)
val = n * n + 1
for i in range(n):
for j in range(n):
if grid[i][j] == 1:
temp = []
if i != 0:
temp.append(grid[i - 1][j])
if j != 0:
temp.append(grid[i][j - 1])
if i != n - 1:
temp.append(grid[i + 1][j])
if j != n - 1:
temp.append(grid[i][j + 1])
val = min(temp)
ans = []
for i in range(k):
if i % 2 == 0:
ans.append(1)
else:
ans.append(val)
return ans | transformation_rename_variable_naive | def minPath(grid, k):
n = len(grid)
val = n * n + 1
for VAR_0 in range(n):
for j in range(n):
if grid[VAR_0][j] == 1:
temp = []
if VAR_0 != 0:
temp.append(grid[VAR_0 - 1][j])
if j != 0:
temp.append(grid[VAR_0][j - 1])
if VAR_0 != n - 1:
temp.append(grid[VAR_0 + 1][j])
if j != n - 1:
temp.append(grid[VAR_0][j + 1])
val = min(temp)
ans = []
for VAR_0 in range(k):
if VAR_0 % 2 == 0:
ans.append(1)
else:
ans.append(val)
return ans | 1 | 127 | mbpp |
def minPath(grid, k):
n = len(grid)
val = n * n + 1
for i in range(n):
for j in range(n):
if grid[i][j] == 1:
temp = []
if i != 0:
temp.append(grid[i - 1][j])
if j != 0:
temp.append(grid[i][j - 1])
if i != n - 1:
temp.append(grid[i + 1][j])
if j != n - 1:
temp.append(grid[i][j + 1])
val = min(temp)
ans = []
for i in range(k):
if i % 2 == 0:
ans.append(1)
else:
ans.append(val)
return ans | transformation_rename_variable_rn | def minPath(grid, k):
n = len(grid)
val = n * n + 1
for y in range(n):
for j in range(n):
if grid[y][j] == 1:
temp = []
if y != 0:
temp.append(grid[y - 1][j])
if j != 0:
temp.append(grid[y][j - 1])
if y != n - 1:
temp.append(grid[y + 1][j])
if j != n - 1:
temp.append(grid[y][j + 1])
val = min(temp)
ans = []
for y in range(k):
if y % 2 == 0:
ans.append(1)
else:
ans.append(val)
return ans | 1 | 127 | mbpp |
def minPath(grid, k):
n = len(grid)
val = n * n + 1
for i in range(n):
for j in range(n):
if grid[i][j] == 1:
temp = []
if i != 0:
temp.append(grid[i - 1][j])
if j != 0:
temp.append(grid[i][j - 1])
if i != n - 1:
temp.append(grid[i + 1][j])
if j != n - 1:
temp.append(grid[i][j + 1])
val = min(temp)
ans = []
for i in range(k):
if i % 2 == 0:
ans.append(1)
else:
ans.append(val)
return ans | transformation_add_sub_variable | def minPath(grid, k):
n = len(grid)
val = n * n - 1
for i in range(n):
for j in range(n):
if grid[i][j] == 1:
temp = []
if i != 0:
temp.append(grid[i - 1][j])
if j != 0:
temp.append(grid[i][j - 1])
if i != n - 1:
temp.append(grid[i + 1][j])
if j != n - 1:
temp.append(grid[i][j + 1])
val = min(temp)
ans = []
for i in range(k):
if i % 2 == 0:
ans.append(1)
else:
ans.append(val)
return ans | 0 | 127 | mbpp |
def minPath(grid, k):
n = len(grid)
val = n * n + 1
for i in range(n):
for j in range(n):
if grid[i][j] == 1:
temp = []
if i != 0:
temp.append(grid[i - 1][j])
if j != 0:
temp.append(grid[i][j - 1])
if i != n - 1:
temp.append(grid[i + 1][j])
if j != n - 1:
temp.append(grid[i][j + 1])
val = min(temp)
ans = []
for i in range(k):
if i % 2 == 0:
ans.append(1)
else:
ans.append(val)
return ans | transformation_sub_add_variable | def minPath(grid, k):
n = len(grid)
val = n * n + 1
for i in range(n):
for j in range(n):
if grid[i][j] == 1:
temp = []
if i != 0:
temp.append(grid[i + 1][j])
if j != 0:
temp.append(grid[i][j - 1])
if i != n - 1:
temp.append(grid[i + 1][j])
if j != n - 1:
temp.append(grid[i][j + 1])
val = min(temp)
ans = []
for i in range(k):
if i % 2 == 0:
ans.append(1)
else:
ans.append(val)
return ans | 0 | 127 | mbpp |
def minPath(grid, k):
n = len(grid)
val = n * n + 1
for i in range(n):
for j in range(n):
if grid[i][j] == 1:
temp = []
if i != 0:
temp.append(grid[i - 1][j])
if j != 0:
temp.append(grid[i][j - 1])
if i != n - 1:
temp.append(grid[i + 1][j])
if j != n - 1:
temp.append(grid[i][j + 1])
val = min(temp)
ans = []
for i in range(k):
if i % 2 == 0:
ans.append(1)
else:
ans.append(val)
return ans | transformation_mul_div_variable | def minPath(grid, k):
n = len(grid)
val = n / n + 1
for i in range(n):
for j in range(n):
if grid[i][j] == 1:
temp = []
if i != 0:
temp.append(grid[i - 1][j])
if j != 0:
temp.append(grid[i][j - 1])
if i != n - 1:
temp.append(grid[i + 1][j])
if j != n - 1:
temp.append(grid[i][j + 1])
val = min(temp)
ans = []
for i in range(k):
if i % 2 == 0:
ans.append(1)
else:
ans.append(val)
return ans | 0 | 127 | mbpp |
def minPath(grid, k):
n = len(grid)
val = n * n + 1
for i in range(n):
for j in range(n):
if grid[i][j] == 1:
temp = []
if i != 0:
temp.append(grid[i - 1][j])
if j != 0:
temp.append(grid[i][j - 1])
if i != n - 1:
temp.append(grid[i + 1][j])
if j != n - 1:
temp.append(grid[i][j + 1])
val = min(temp)
ans = []
for i in range(k):
if i % 2 == 0:
ans.append(1)
else:
ans.append(val)
return ans | transformation_equalto_exclamation_variable | def minPath(grid, k):
n = len(grid)
val = n * n + 1
for i in range(n):
for j in range(n):
if grid[i][j] != 1:
temp = []
if i != 0:
temp.append(grid[i - 1][j])
if j != 0:
temp.append(grid[i][j - 1])
if i != n - 1:
temp.append(grid[i + 1][j])
if j != n - 1:
temp.append(grid[i][j + 1])
val = min(temp)
ans = []
for i in range(k):
if i % 2 == 0:
ans.append(1)
else:
ans.append(val)
return ans | 0 | 127 | mbpp |
def minPath(grid, k):
n = len(grid)
val = n * n + 1
for i in range(n):
for j in range(n):
if grid[i][j] == 1:
temp = []
if i != 0:
temp.append(grid[i - 1][j])
if j != 0:
temp.append(grid[i][j - 1])
if i != n - 1:
temp.append(grid[i + 1][j])
if j != n - 1:
temp.append(grid[i][j + 1])
val = min(temp)
ans = []
for i in range(k):
if i % 2 == 0:
ans.append(1)
else:
ans.append(val)
return ans | transformation_exclamation_equalto_variable | def minPath(grid, k):
n = len(grid)
val = n * n + 1
for i in range(n):
for j in range(n):
if grid[i][j] == 1:
temp = []
if i == 0:
temp.append(grid[i - 1][j])
if j != 0:
temp.append(grid[i][j - 1])
if i != n - 1:
temp.append(grid[i + 1][j])
if j != n - 1:
temp.append(grid[i][j + 1])
val = min(temp)
ans = []
for i in range(k):
if i % 2 == 0:
ans.append(1)
else:
ans.append(val)
return ans | 0 | 127 | mbpp |
def minPath(grid, k):
n = len(grid)
val = n * n + 1
for i in range(n):
for j in range(n):
if grid[i][j] == 1:
temp = []
if i != 0:
temp.append(grid[i - 1][j])
if j != 0:
temp.append(grid[i][j - 1])
if i != n - 1:
temp.append(grid[i + 1][j])
if j != n - 1:
temp.append(grid[i][j + 1])
val = min(temp)
ans = []
for i in range(k):
if i % 2 == 0:
ans.append(1)
else:
ans.append(val)
return ans | transformation_dissimilar_code_injection_0 | from typing import List
def has_close_elements(numbers: List[float], threshold: float) -> bool:
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
distance = abs(elem - elem2)
if distance < threshold:
return True
return False | 0 | 127 | mbpp |
def minPath(grid, k):
n = len(grid)
val = n * n + 1
for i in range(n):
for j in range(n):
if grid[i][j] == 1:
temp = []
if i != 0:
temp.append(grid[i - 1][j])
if j != 0:
temp.append(grid[i][j - 1])
if i != n - 1:
temp.append(grid[i + 1][j])
if j != n - 1:
temp.append(grid[i][j + 1])
val = min(temp)
ans = []
for i in range(k):
if i % 2 == 0:
ans.append(1)
else:
ans.append(val)
return ans | transformation_dissimilar_code_injection_1 | from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
current_depth -= 1
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
return result | 0 | 127 | mbpp |
def minPath(grid, k):
n = len(grid)
val = n * n + 1
for i in range(n):
for j in range(n):
if grid[i][j] == 1:
temp = []
if i != 0:
temp.append(grid[i - 1][j])
if j != 0:
temp.append(grid[i][j - 1])
if i != n - 1:
temp.append(grid[i + 1][j])
if j != n - 1:
temp.append(grid[i][j + 1])
val = min(temp)
ans = []
for i in range(k):
if i % 2 == 0:
ans.append(1)
else:
ans.append(val)
return ans | transformation_dissimilar_code_injection_2 | def truncate_number(number: float) -> float:
""" Given a positive floating point number, it can be decomposed into
and integer part (largest integer smaller than given number) and decimals
(leftover part always smaller than 1).
Return the decimal part of the number.
>>> truncate_number(3.5)
0.5
"""
return number % 1.0 | 0 | 127 | mbpp |
def minPath(grid, k):
n = len(grid)
val = n * n + 1
for i in range(n):
for j in range(n):
if grid[i][j] == 1:
temp = []
if i != 0:
temp.append(grid[i - 1][j])
if j != 0:
temp.append(grid[i][j - 1])
if i != n - 1:
temp.append(grid[i + 1][j])
if j != n - 1:
temp.append(grid[i][j + 1])
val = min(temp)
ans = []
for i in range(k):
if i % 2 == 0:
ans.append(1)
else:
ans.append(val)
return ans | transformation_dissimilar_code_injection_3 | from typing import List
def below_zero(operations: List[int]) -> bool:
balance = 0
for op in operations:
balance += op
if balance < 0:
return True
return False | 0 | 127 | mbpp |
def minPath(grid, k):
n = len(grid)
val = n * n + 1
for i in range(n):
for j in range(n):
if grid[i][j] == 1:
temp = []
if i != 0:
temp.append(grid[i - 1][j])
if j != 0:
temp.append(grid[i][j - 1])
if i != n - 1:
temp.append(grid[i + 1][j])
if j != n - 1:
temp.append(grid[i][j + 1])
val = min(temp)
ans = []
for i in range(k):
if i % 2 == 0:
ans.append(1)
else:
ans.append(val)
return ans | transformation_dissimilar_code_injection_4 | from typing import List
def mean_absolute_deviation(numbers: List[float]) -> float:
mean = sum(numbers) / len(numbers)
return sum(abs(x - mean) for x in numbers) / len(numbers) | 0 | 127 | mbpp |
def tri(n):
if n == 0:
return [1]
my_tri = [1, 3]
for i in range(2, n + 1):
if i % 2 == 0:
my_tri.append(i / 2 + 1)
else:
my_tri.append(my_tri[i - 1] + my_tri[i - 2] + (i + 3) / 2)
return my_tri | transformation_dead_code_insert | def tri(n):
_i_0 = 0
while _i_0 > _i_0:
if n == 0:
return [1]
if n == 0:
return [1]
my_tri = [1, 3]
for i in range(2, n + 1):
if i % 2 == 0:
my_tri.append(i / 2 + 1)
else:
my_tri.append(my_tri[i - 1] + my_tri[i - 2] + (i + 3) / 2)
return my_tri | 1 | 128 | mbpp |
def tri(n):
if n == 0:
return [1]
my_tri = [1, 3]
for i in range(2, n + 1):
if i % 2 == 0:
my_tri.append(i / 2 + 1)
else:
my_tri.append(my_tri[i - 1] + my_tri[i - 2] + (i + 3) / 2)
return my_tri | transformation_for_while_loop | def tri(n):
if n == 0:
return [1]
my_tri = [1, 3]
i = 2
while i < n + 1:
if i % 2 == 0:
my_tri.append(i / 2 + 1)
else:
my_tri.append(my_tri[i - 1] + my_tri[i - 2] + (i + 3) / 2)
i += 1
return my_tri | 1 | 128 | mbpp |
def tri(n):
if n == 0:
return [1]
my_tri = [1, 3]
for i in range(2, n + 1):
if i % 2 == 0:
my_tri.append(i / 2 + 1)
else:
my_tri.append(my_tri[i - 1] + my_tri[i - 2] + (i + 3) / 2)
return my_tri | transformation_operand_swap | def tri(n):
if 0 == n:
return [1]
my_tri = [1, 3]
for i in range(2, n + 1):
if i % 2 == 0:
my_tri.append(i / 2 + 1)
else:
my_tri.append(my_tri[i - 1] + my_tri[i - 2] + (i + 3) / 2)
return my_tri | 1 | 128 | mbpp |
def tri(n):
if n == 0:
return [1]
my_tri = [1, 3]
for i in range(2, n + 1):
if i % 2 == 0:
my_tri.append(i / 2 + 1)
else:
my_tri.append(my_tri[i - 1] + my_tri[i - 2] + (i + 3) / 2)
return my_tri | transformation_rename_variable_cb | def tri(n):
if n == 0:
return [1]
lines = [1, 3]
for i in range(2, n + 1):
if i % 2 == 0:
lines.append(i / 2 + 1)
else:
lines.append(lines[i - 1] + lines[i - 2] + (i + 3) / 2)
return lines | 1 | 128 | mbpp |
def tri(n):
if n == 0:
return [1]
my_tri = [1, 3]
for i in range(2, n + 1):
if i % 2 == 0:
my_tri.append(i / 2 + 1)
else:
my_tri.append(my_tri[i - 1] + my_tri[i - 2] + (i + 3) / 2)
return my_tri | transformation_rename_variable_naive | def tri(n):
if n == 0:
return [1]
my_tri = [1, 3]
for VAR_0 in range(2, n + 1):
if VAR_0 % 2 == 0:
my_tri.append(VAR_0 / 2 + 1)
else:
my_tri.append(my_tri[VAR_0 - 1] + my_tri[VAR_0 - 2] + (VAR_0 + 3) / 2)
return my_tri | 1 | 128 | mbpp |
def tri(n):
if n == 0:
return [1]
my_tri = [1, 3]
for i in range(2, n + 1):
if i % 2 == 0:
my_tri.append(i / 2 + 1)
else:
my_tri.append(my_tri[i - 1] + my_tri[i - 2] + (i + 3) / 2)
return my_tri | transformation_rename_variable_rn | def tri(n):
if n == 0:
return [1]
e10YMM = [1, 3]
for i in range(2, n + 1):
if i % 2 == 0:
e10YMM.append(i / 2 + 1)
else:
e10YMM.append(e10YMM[i - 1] + e10YMM[i - 2] + (i + 3) / 2)
return e10YMM | 1 | 128 | mbpp |
def tri(n):
if n == 0:
return [1]
my_tri = [1, 3]
for i in range(2, n + 1):
if i % 2 == 0:
my_tri.append(i / 2 + 1)
else:
my_tri.append(my_tri[i - 1] + my_tri[i - 2] + (i + 3) / 2)
return my_tri | transformation_add_sub_variable | def tri(n):
if n == 0:
return [1]
my_tri = [1, 3]
for i in range(2, n - 1):
if i % 2 == 0:
my_tri.append(i / 2 + 1)
else:
my_tri.append(my_tri[i - 1] + my_tri[i - 2] + (i + 3) / 2)
return my_tri | 0 | 128 | mbpp |
def tri(n):
if n == 0:
return [1]
my_tri = [1, 3]
for i in range(2, n + 1):
if i % 2 == 0:
my_tri.append(i / 2 + 1)
else:
my_tri.append(my_tri[i - 1] + my_tri[i - 2] + (i + 3) / 2)
return my_tri | transformation_sub_add_variable | def tri(n):
if n == 0:
return [1]
my_tri = [1, 3]
for i in range(2, n + 1):
if i % 2 == 0:
my_tri.append(i / 2 + 1)
else:
my_tri.append(my_tri[i + 1] + my_tri[i - 2] + (i + 3) / 2)
return my_tri | 0 | 128 | mbpp |
def tri(n):
if n == 0:
return [1]
my_tri = [1, 3]
for i in range(2, n + 1):
if i % 2 == 0:
my_tri.append(i / 2 + 1)
else:
my_tri.append(my_tri[i - 1] + my_tri[i - 2] + (i + 3) / 2)
return my_tri | transformation_div_mul_variable | def tri(n):
if n == 0:
return [1]
my_tri = [1, 3]
for i in range(2, n + 1):
if i % 2 == 0:
my_tri.append(i * 2 + 1)
else:
my_tri.append(my_tri[i - 1] + my_tri[i - 2] + (i + 3) / 2)
return my_tri | 0 | 128 | mbpp |
def tri(n):
if n == 0:
return [1]
my_tri = [1, 3]
for i in range(2, n + 1):
if i % 2 == 0:
my_tri.append(i / 2 + 1)
else:
my_tri.append(my_tri[i - 1] + my_tri[i - 2] + (i + 3) / 2)
return my_tri | transformation_equalto_exclamation_variable | def tri(n):
if n != 0:
return [1]
my_tri = [1, 3]
for i in range(2, n + 1):
if i % 2 == 0:
my_tri.append(i / 2 + 1)
else:
my_tri.append(my_tri[i - 1] + my_tri[i - 2] + (i + 3) / 2)
return my_tri | 0 | 128 | mbpp |
def tri(n):
if n == 0:
return [1]
my_tri = [1, 3]
for i in range(2, n + 1):
if i % 2 == 0:
my_tri.append(i / 2 + 1)
else:
my_tri.append(my_tri[i - 1] + my_tri[i - 2] + (i + 3) / 2)
return my_tri | transformation_dissimilar_code_injection_0 | from typing import List
def has_close_elements(numbers: List[float], threshold: float) -> bool:
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
distance = abs(elem - elem2)
if distance < threshold:
return True
return False | 0 | 128 | mbpp |
def tri(n):
if n == 0:
return [1]
my_tri = [1, 3]
for i in range(2, n + 1):
if i % 2 == 0:
my_tri.append(i / 2 + 1)
else:
my_tri.append(my_tri[i - 1] + my_tri[i - 2] + (i + 3) / 2)
return my_tri | transformation_dissimilar_code_injection_1 | from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
current_depth -= 1
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
return result | 0 | 128 | mbpp |
def tri(n):
if n == 0:
return [1]
my_tri = [1, 3]
for i in range(2, n + 1):
if i % 2 == 0:
my_tri.append(i / 2 + 1)
else:
my_tri.append(my_tri[i - 1] + my_tri[i - 2] + (i + 3) / 2)
return my_tri | transformation_dissimilar_code_injection_2 | def truncate_number(number: float) -> float:
""" Given a positive floating point number, it can be decomposed into
and integer part (largest integer smaller than given number) and decimals
(leftover part always smaller than 1).
Return the decimal part of the number.
>>> truncate_number(3.5)
0.5
"""
return number % 1.0 | 0 | 128 | mbpp |
def tri(n):
if n == 0:
return [1]
my_tri = [1, 3]
for i in range(2, n + 1):
if i % 2 == 0:
my_tri.append(i / 2 + 1)
else:
my_tri.append(my_tri[i - 1] + my_tri[i - 2] + (i + 3) / 2)
return my_tri | transformation_dissimilar_code_injection_3 | from typing import List
def below_zero(operations: List[int]) -> bool:
balance = 0
for op in operations:
balance += op
if balance < 0:
return True
return False | 0 | 128 | mbpp |
def tri(n):
if n == 0:
return [1]
my_tri = [1, 3]
for i in range(2, n + 1):
if i % 2 == 0:
my_tri.append(i / 2 + 1)
else:
my_tri.append(my_tri[i - 1] + my_tri[i - 2] + (i + 3) / 2)
return my_tri | transformation_dissimilar_code_injection_4 | from typing import List
def mean_absolute_deviation(numbers: List[float]) -> float:
mean = sum(numbers) / len(numbers)
return sum(abs(x - mean) for x in numbers) / len(numbers) | 0 | 128 | mbpp |
def digits(n):
product = 1
odd_count = 0
for digit in str(n):
int_digit = int(digit)
if int_digit%2 == 1:
product= product*int_digit
odd_count+=1
if odd_count ==0:
return 0
else:
return product | transformation_dead_code_insert | def digits(n):
product = 1
odd_count = 0
for digit in str(n):
int_digit = int(digit)
_i_6 = 0
if _i_6 > _i_6:
product = 1
if int_digit % 2 == 1:
product = product * int_digit
odd_count += 1
if odd_count == 0:
return 0
else:
return product | 1 | 129 | mbpp |
def digits(n):
product = 1
odd_count = 0
for digit in str(n):
int_digit = int(digit)
if int_digit%2 == 1:
product= product*int_digit
odd_count+=1
if odd_count ==0:
return 0
else:
return product | transformation_for_while_loop | def digits(n):
product = 1
odd_count = 0
_digit_i = 0
while _digit_i < len(str(n)):
digit = str(n)[_digit_i]
int_digit = int(digit)
if int_digit % 2 == 1:
product = product * int_digit
odd_count += 1
_digit_i += 1
if odd_count == 0:
return 0
else:
return product | 1 | 129 | mbpp |
def digits(n):
product = 1
odd_count = 0
for digit in str(n):
int_digit = int(digit)
if int_digit%2 == 1:
product= product*int_digit
odd_count+=1
if odd_count ==0:
return 0
else:
return product | transformation_operand_swap | def digits(n):
product = 1
odd_count = 0
for digit in str(n):
int_digit = int(digit)
if int_digit % 2 == 1:
product = product * int_digit
odd_count += 1
if 0 == odd_count:
return 0
else:
return product | 1 | 129 | mbpp |
def digits(n):
product = 1
odd_count = 0
for digit in str(n):
int_digit = int(digit)
if int_digit%2 == 1:
product= product*int_digit
odd_count+=1
if odd_count ==0:
return 0
else:
return product | transformation_rename_variable_cb | def digits(n):
n2 = 1
odd_count = 0
for digit in str(n):
int_digit = int(digit)
if int_digit % 2 == 1:
n2 = n2 * int_digit
odd_count += 1
if odd_count == 0:
return 0
else:
return n2 | 1 | 129 | mbpp |
def digits(n):
product = 1
odd_count = 0
for digit in str(n):
int_digit = int(digit)
if int_digit%2 == 1:
product= product*int_digit
odd_count+=1
if odd_count ==0:
return 0
else:
return product | transformation_rename_variable_naive | def digits(n):
VAR_0 = 1
odd_count = 0
for digit in str(n):
int_digit = int(digit)
if int_digit % 2 == 1:
VAR_0 = VAR_0 * int_digit
odd_count += 1
if odd_count == 0:
return 0
else:
return VAR_0 | 1 | 129 | mbpp |
def digits(n):
product = 1
odd_count = 0
for digit in str(n):
int_digit = int(digit)
if int_digit%2 == 1:
product= product*int_digit
odd_count+=1
if odd_count ==0:
return 0
else:
return product | transformation_rename_variable_rn | def digits(n):
q3t2078 = 1
odd_count = 0
for digit in str(n):
int_digit = int(digit)
if int_digit % 2 == 1:
q3t2078 = q3t2078 * int_digit
odd_count += 1
if odd_count == 0:
return 0
else:
return q3t2078 | 1 | 129 | mbpp |
def digits(n):
product = 1
odd_count = 0
for digit in str(n):
int_digit = int(digit)
if int_digit%2 == 1:
product= product*int_digit
odd_count+=1
if odd_count ==0:
return 0
else:
return product | transformation_add_sub_variable | def digits(n):
product = 1
odd_count = 0
for digit in str(n):
int_digit = int(digit)
if int_digit%2 == 1:
product= product*int_digit
odd_count-=1
if odd_count ==0:
return 0
else:
return product | 0 | 129 | mbpp |
def digits(n):
product = 1
odd_count = 0
for digit in str(n):
int_digit = int(digit)
if int_digit%2 == 1:
product= product*int_digit
odd_count+=1
if odd_count ==0:
return 0
else:
return product | transformation_mul_div_variable | def digits(n):
product = 1
odd_count = 0
for digit in str(n):
int_digit = int(digit)
if int_digit%2 == 1:
product= product/int_digit
odd_count+=1
if odd_count ==0:
return 0
else:
return product | 0 | 129 | mbpp |
def digits(n):
product = 1
odd_count = 0
for digit in str(n):
int_digit = int(digit)
if int_digit%2 == 1:
product= product*int_digit
odd_count+=1
if odd_count ==0:
return 0
else:
return product | transformation_equalto_exclamation_variable | def digits(n):
product = 1
odd_count = 0
for digit in str(n):
int_digit = int(digit)
if int_digit%2 != 1:
product= product*int_digit
odd_count+=1
if odd_count ==0:
return 0
else:
return product | 0 | 129 | mbpp |
def digits(n):
product = 1
odd_count = 0
for digit in str(n):
int_digit = int(digit)
if int_digit%2 == 1:
product= product*int_digit
odd_count+=1
if odd_count ==0:
return 0
else:
return product | transformation_dissimilar_code_injection_0 | from typing import List
def has_close_elements(numbers: List[float], threshold: float) -> bool:
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
distance = abs(elem - elem2)
if distance < threshold:
return True
return False | 0 | 129 | mbpp |
def digits(n):
product = 1
odd_count = 0
for digit in str(n):
int_digit = int(digit)
if int_digit%2 == 1:
product= product*int_digit
odd_count+=1
if odd_count ==0:
return 0
else:
return product | transformation_dissimilar_code_injection_1 | from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
current_depth -= 1
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
return result | 0 | 129 | mbpp |
def digits(n):
product = 1
odd_count = 0
for digit in str(n):
int_digit = int(digit)
if int_digit%2 == 1:
product= product*int_digit
odd_count+=1
if odd_count ==0:
return 0
else:
return product | transformation_dissimilar_code_injection_2 | def truncate_number(number: float) -> float:
""" Given a positive floating point number, it can be decomposed into
and integer part (largest integer smaller than given number) and decimals
(leftover part always smaller than 1).
Return the decimal part of the number.
>>> truncate_number(3.5)
0.5
"""
return number % 1.0 | 0 | 129 | mbpp |
def digits(n):
product = 1
odd_count = 0
for digit in str(n):
int_digit = int(digit)
if int_digit%2 == 1:
product= product*int_digit
odd_count+=1
if odd_count ==0:
return 0
else:
return product | transformation_dissimilar_code_injection_3 | from typing import List
def below_zero(operations: List[int]) -> bool:
balance = 0
for op in operations:
balance += op
if balance < 0:
return True
return False | 0 | 129 | mbpp |
def digits(n):
product = 1
odd_count = 0
for digit in str(n):
int_digit = int(digit)
if int_digit%2 == 1:
product= product*int_digit
odd_count+=1
if odd_count ==0:
return 0
else:
return product | transformation_dissimilar_code_injection_4 | from typing import List
def mean_absolute_deviation(numbers: List[float]) -> float:
mean = sum(numbers) / len(numbers)
return sum(abs(x - mean) for x in numbers) / len(numbers) | 0 | 129 | mbpp |
def is_nested(string):
opening_bracket_index = []
closing_bracket_index = []
for i in range(len(string)):
if string[i] == '[':
opening_bracket_index.append(i)
else:
closing_bracket_index.append(i)
closing_bracket_index.reverse()
cnt = 0
i = 0
l = len(closing_bracket_index)
for idx in opening_bracket_index:
if i < l and idx < closing_bracket_index[i]:
cnt += 1
i += 1
return cnt >= 2
| transformation_dead_code_insert | def is_nested(string):
opening_bracket_index = []
closing_bracket_index = []
for i in range(len(string)):
if string[i] == "[":
opening_bracket_index.append(i)
else:
_i_6 = 0
while _i_6 > _i_6:
for idx in opening_bracket_index:
if i < l and idx < closing_bracket_index[i]:
cnt += 1
i += 1
closing_bracket_index.append(i)
closing_bracket_index.reverse()
cnt = 0
i = 0
l = len(closing_bracket_index)
for idx in opening_bracket_index:
if i < l and idx < closing_bracket_index[i]:
cnt += 1
i += 1
return cnt >= 2 | 1 | 130 | mbpp |
def is_nested(string):
opening_bracket_index = []
closing_bracket_index = []
for i in range(len(string)):
if string[i] == '[':
opening_bracket_index.append(i)
else:
closing_bracket_index.append(i)
closing_bracket_index.reverse()
cnt = 0
i = 0
l = len(closing_bracket_index)
for idx in opening_bracket_index:
if i < l and idx < closing_bracket_index[i]:
cnt += 1
i += 1
return cnt >= 2
| transformation_for_while_loop | def is_nested(string):
opening_bracket_index = []
closing_bracket_index = []
i = 0
while i < len(string):
if string[i] == "[":
opening_bracket_index.append(i)
else:
closing_bracket_index.append(i)
i += 1
closing_bracket_index.reverse()
cnt = 0
i = 0
l = len(closing_bracket_index)
for idx in opening_bracket_index:
if i < l and idx < closing_bracket_index[i]:
cnt += 1
i += 1
return cnt >= 2 | 1 | 130 | mbpp |
def is_nested(string):
opening_bracket_index = []
closing_bracket_index = []
for i in range(len(string)):
if string[i] == '[':
opening_bracket_index.append(i)
else:
closing_bracket_index.append(i)
closing_bracket_index.reverse()
cnt = 0
i = 0
l = len(closing_bracket_index)
for idx in opening_bracket_index:
if i < l and idx < closing_bracket_index[i]:
cnt += 1
i += 1
return cnt >= 2
| transformation_rename_variable_naive | def is_nested(string):
opening_bracket_index = []
closing_bracket_index = []
for VAR_0 in range(len(string)):
if string[VAR_0] == "[":
opening_bracket_index.append(VAR_0)
else:
closing_bracket_index.append(VAR_0)
closing_bracket_index.reverse()
cnt = 0
VAR_0 = 0
l = len(closing_bracket_index)
for idx in opening_bracket_index:
if VAR_0 < l and idx < closing_bracket_index[VAR_0]:
cnt += 1
VAR_0 += 1
return cnt >= 2 | 1 | 130 | mbpp |
def is_nested(string):
opening_bracket_index = []
closing_bracket_index = []
for i in range(len(string)):
if string[i] == '[':
opening_bracket_index.append(i)
else:
closing_bracket_index.append(i)
closing_bracket_index.reverse()
cnt = 0
i = 0
l = len(closing_bracket_index)
for idx in opening_bracket_index:
if i < l and idx < closing_bracket_index[i]:
cnt += 1
i += 1
return cnt >= 2
| transformation_rename_variable_rn | def is_nested(string):
opening_bracket_index = []
closing_bracket_index = []
for u in range(len(string)):
if string[u] == "[":
opening_bracket_index.append(u)
else:
closing_bracket_index.append(u)
closing_bracket_index.reverse()
cnt = 0
u = 0
l = len(closing_bracket_index)
for idx in opening_bracket_index:
if u < l and idx < closing_bracket_index[u]:
cnt += 1
u += 1
return cnt >= 2 | 1 | 130 | mbpp |
def is_nested(string):
opening_bracket_index = []
closing_bracket_index = []
for i in range(len(string)):
if string[i] == '[':
opening_bracket_index.append(i)
else:
closing_bracket_index.append(i)
closing_bracket_index.reverse()
cnt = 0
i = 0
l = len(closing_bracket_index)
for idx in opening_bracket_index:
if i < l and idx < closing_bracket_index[i]:
cnt += 1
i += 1
return cnt >= 2
| transformation_add_sub_variable | def is_nested(string):
opening_bracket_index = []
closing_bracket_index = []
for i in range(len(string)):
if string[i] == '[':
opening_bracket_index.append(i)
else:
closing_bracket_index.append(i)
closing_bracket_index.reverse()
cnt = 0
i = 0
l = len(closing_bracket_index)
for idx in opening_bracket_index:
if i < l and idx < closing_bracket_index[i]:
cnt -= 1
i += 1
return cnt >= 2
| 0 | 130 | mbpp |
def is_nested(string):
opening_bracket_index = []
closing_bracket_index = []
for i in range(len(string)):
if string[i] == '[':
opening_bracket_index.append(i)
else:
closing_bracket_index.append(i)
closing_bracket_index.reverse()
cnt = 0
i = 0
l = len(closing_bracket_index)
for idx in opening_bracket_index:
if i < l and idx < closing_bracket_index[i]:
cnt += 1
i += 1
return cnt >= 2
| transformation_lesser_greater_variable | def is_nested(string):
opening_bracket_index = []
closing_bracket_index = []
for i in range(len(string)):
if string[i] == '[':
opening_bracket_index.append(i)
else:
closing_bracket_index.append(i)
closing_bracket_index.reverse()
cnt = 0
i = 0
l = len(closing_bracket_index)
for idx in opening_bracket_index:
if i > l and idx < closing_bracket_index[i]:
cnt += 1
i += 1
return cnt >= 2
| 0 | 130 | mbpp |
def is_nested(string):
opening_bracket_index = []
closing_bracket_index = []
for i in range(len(string)):
if string[i] == '[':
opening_bracket_index.append(i)
else:
closing_bracket_index.append(i)
closing_bracket_index.reverse()
cnt = 0
i = 0
l = len(closing_bracket_index)
for idx in opening_bracket_index:
if i < l and idx < closing_bracket_index[i]:
cnt += 1
i += 1
return cnt >= 2
| transformation_greater_lesser_variable | def is_nested(string):
opening_bracket_index = []
closing_bracket_index = []
for i in range(len(string)):
if string[i] == '[':
opening_bracket_index.append(i)
else:
closing_bracket_index.append(i)
closing_bracket_index.reverse()
cnt = 0
i = 0
l = len(closing_bracket_index)
for idx in opening_bracket_index:
if i < l and idx < closing_bracket_index[i]:
cnt += 1
i += 1
return cnt <= 2
| 0 | 130 | mbpp |
def is_nested(string):
opening_bracket_index = []
closing_bracket_index = []
for i in range(len(string)):
if string[i] == '[':
opening_bracket_index.append(i)
else:
closing_bracket_index.append(i)
closing_bracket_index.reverse()
cnt = 0
i = 0
l = len(closing_bracket_index)
for idx in opening_bracket_index:
if i < l and idx < closing_bracket_index[i]:
cnt += 1
i += 1
return cnt >= 2
| transformation_equalto_exclamation_variable | def is_nested(string):
opening_bracket_index = []
closing_bracket_index = []
for i in range(len(string)):
if string[i] != '[':
opening_bracket_index.append(i)
else:
closing_bracket_index.append(i)
closing_bracket_index.reverse()
cnt = 0
i = 0
l = len(closing_bracket_index)
for idx in opening_bracket_index:
if i < l and idx < closing_bracket_index[i]:
cnt += 1
i += 1
return cnt >= 2
| 0 | 130 | mbpp |
def is_nested(string):
opening_bracket_index = []
closing_bracket_index = []
for i in range(len(string)):
if string[i] == '[':
opening_bracket_index.append(i)
else:
closing_bracket_index.append(i)
closing_bracket_index.reverse()
cnt = 0
i = 0
l = len(closing_bracket_index)
for idx in opening_bracket_index:
if i < l and idx < closing_bracket_index[i]:
cnt += 1
i += 1
return cnt >= 2
| transformation_and_or_variable | def is_nested(string):
opening_bracket_index = []
closing_bracket_index = []
for i in range(len(string)):
if string[i] == '[':
opening_bracket_index.append(i)
else:
closing_bracket_index.append(i)
closing_bracket_index.reverse()
cnt = 0
i = 0
l = len(closing_bracket_index)
for idx in opening_bracket_index:
if i < l or idx < closing_bracket_index[i]:
cnt += 1
i += 1
return cnt >= 2
| 0 | 130 | mbpp |
def is_nested(string):
opening_bracket_index = []
closing_bracket_index = []
for i in range(len(string)):
if string[i] == '[':
opening_bracket_index.append(i)
else:
closing_bracket_index.append(i)
closing_bracket_index.reverse()
cnt = 0
i = 0
l = len(closing_bracket_index)
for idx in opening_bracket_index:
if i < l and idx < closing_bracket_index[i]:
cnt += 1
i += 1
return cnt >= 2
| transformation_dissimilar_code_injection_0 | from typing import List
def has_close_elements(numbers: List[float], threshold: float) -> bool:
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
distance = abs(elem - elem2)
if distance < threshold:
return True
return False | 0 | 130 | mbpp |
def is_nested(string):
opening_bracket_index = []
closing_bracket_index = []
for i in range(len(string)):
if string[i] == '[':
opening_bracket_index.append(i)
else:
closing_bracket_index.append(i)
closing_bracket_index.reverse()
cnt = 0
i = 0
l = len(closing_bracket_index)
for idx in opening_bracket_index:
if i < l and idx < closing_bracket_index[i]:
cnt += 1
i += 1
return cnt >= 2
| transformation_dissimilar_code_injection_1 | from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
current_depth -= 1
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
return result | 0 | 130 | mbpp |
def is_nested(string):
opening_bracket_index = []
closing_bracket_index = []
for i in range(len(string)):
if string[i] == '[':
opening_bracket_index.append(i)
else:
closing_bracket_index.append(i)
closing_bracket_index.reverse()
cnt = 0
i = 0
l = len(closing_bracket_index)
for idx in opening_bracket_index:
if i < l and idx < closing_bracket_index[i]:
cnt += 1
i += 1
return cnt >= 2
| transformation_dissimilar_code_injection_2 | def truncate_number(number: float) -> float:
""" Given a positive floating point number, it can be decomposed into
and integer part (largest integer smaller than given number) and decimals
(leftover part always smaller than 1).
Return the decimal part of the number.
>>> truncate_number(3.5)
0.5
"""
return number % 1.0 | 0 | 130 | mbpp |
def is_nested(string):
opening_bracket_index = []
closing_bracket_index = []
for i in range(len(string)):
if string[i] == '[':
opening_bracket_index.append(i)
else:
closing_bracket_index.append(i)
closing_bracket_index.reverse()
cnt = 0
i = 0
l = len(closing_bracket_index)
for idx in opening_bracket_index:
if i < l and idx < closing_bracket_index[i]:
cnt += 1
i += 1
return cnt >= 2
| transformation_dissimilar_code_injection_3 | from typing import List
def below_zero(operations: List[int]) -> bool:
balance = 0
for op in operations:
balance += op
if balance < 0:
return True
return False | 0 | 130 | mbpp |
def is_nested(string):
opening_bracket_index = []
closing_bracket_index = []
for i in range(len(string)):
if string[i] == '[':
opening_bracket_index.append(i)
else:
closing_bracket_index.append(i)
closing_bracket_index.reverse()
cnt = 0
i = 0
l = len(closing_bracket_index)
for idx in opening_bracket_index:
if i < l and idx < closing_bracket_index[i]:
cnt += 1
i += 1
return cnt >= 2
| transformation_dissimilar_code_injection_4 | from typing import List
def mean_absolute_deviation(numbers: List[float]) -> float:
mean = sum(numbers) / len(numbers)
return sum(abs(x - mean) for x in numbers) / len(numbers) | 0 | 130 | mbpp |
def largest_smallest_integers(lst):
smallest = list(filter(lambda x: x < 0, lst))
largest = list(filter(lambda x: x > 0, lst))
return (max(smallest) if smallest else None, min(largest) if largest else None) | transformation_dead_code_insert | def largest_smallest_integers(lst):
smallest = list(filter(lambda x: x < 0, lst))
_i_7 = 0
if _i_7 > _i_7:
largest = list(filter(lambda x: x > 0, lst))
largest = list(filter(lambda x: x > 0, lst))
return (max(smallest) if smallest else None, min(largest) if largest else None) | 1 | 134 | mbpp |
def largest_smallest_integers(lst):
smallest = list(filter(lambda x: x < 0, lst))
largest = list(filter(lambda x: x > 0, lst))
return (max(smallest) if smallest else None, min(largest) if largest else None) | transformation_for_while_loop | def largest_smallest_integers(lst):
smallest = list(filter(lambda x: x < 0, lst))
largest = list(filter(lambda x: x > 0, lst))
return (max(smallest) if smallest else None, min(largest) if largest else None) | 1 | 134 | mbpp |
def largest_smallest_integers(lst):
smallest = list(filter(lambda x: x < 0, lst))
largest = list(filter(lambda x: x > 0, lst))
return (max(smallest) if smallest else None, min(largest) if largest else None) | transformation_operand_swap | def largest_smallest_integers(lst):
smallest = list(filter(lambda x: 0 > x, lst))
largest = list(filter(lambda x: x > 0, lst))
return (max(smallest) if smallest else None, min(largest) if largest else None) | 1 | 134 | mbpp |
def largest_smallest_integers(lst):
smallest = list(filter(lambda x: x < 0, lst))
largest = list(filter(lambda x: x > 0, lst))
return (max(smallest) if smallest else None, min(largest) if largest else None) | transformation_rename_variable_cb | def largest_smallest_integers(lst):
smallest = list(filter(lambda ma: ma < 0, lst))
largest = list(filter(lambda ma: ma > 0, lst))
return (max(smallest) if smallest else None, min(largest) if largest else None) | 1 | 134 | mbpp |
def largest_smallest_integers(lst):
smallest = list(filter(lambda x: x < 0, lst))
largest = list(filter(lambda x: x > 0, lst))
return (max(smallest) if smallest else None, min(largest) if largest else None) | transformation_rename_variable_naive | def largest_smallest_integers(lst):
smallest = list(filter(lambda VAR_0: VAR_0 < 0, lst))
largest = list(filter(lambda VAR_0: VAR_0 > 0, lst))
return (max(smallest) if smallest else None, min(largest) if largest else None) | 1 | 134 | mbpp |
def largest_smallest_integers(lst):
smallest = list(filter(lambda x: x < 0, lst))
largest = list(filter(lambda x: x > 0, lst))
return (max(smallest) if smallest else None, min(largest) if largest else None) | transformation_rename_variable_rn | def largest_smallest_integers(lst):
smallest = list(filter(lambda M: M < 0, lst))
largest = list(filter(lambda M: M > 0, lst))
return (max(smallest) if smallest else None, min(largest) if largest else None) | 1 | 134 | mbpp |
def largest_smallest_integers(lst):
smallest = list(filter(lambda x: x < 0, lst))
largest = list(filter(lambda x: x > 0, lst))
return (max(smallest) if smallest else None, min(largest) if largest else None) | transformation_lesser_greater_variable | def largest_smallest_integers(lst):
smallest = list(filter(lambda x: x > 0, lst))
largest = list(filter(lambda x: x > 0, lst))
return (max(smallest) if smallest else None, min(largest) if largest else None) | 0 | 134 | mbpp |
def largest_smallest_integers(lst):
smallest = list(filter(lambda x: x < 0, lst))
largest = list(filter(lambda x: x > 0, lst))
return (max(smallest) if smallest else None, min(largest) if largest else None) | transformation_greater_lesser_variable | def largest_smallest_integers(lst):
smallest = list(filter(lambda x: x < 0, lst))
largest = list(filter(lambda x: x < 0, lst))
return (max(smallest) if smallest else None, min(largest) if largest else None) | 0 | 134 | mbpp |
def largest_smallest_integers(lst):
smallest = list(filter(lambda x: x < 0, lst))
largest = list(filter(lambda x: x > 0, lst))
return (max(smallest) if smallest else None, min(largest) if largest else None) | transformation_dissimilar_code_injection_0 | from typing import List
def has_close_elements(numbers: List[float], threshold: float) -> bool:
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
distance = abs(elem - elem2)
if distance < threshold:
return True
return False | 0 | 134 | mbpp |
def largest_smallest_integers(lst):
smallest = list(filter(lambda x: x < 0, lst))
largest = list(filter(lambda x: x > 0, lst))
return (max(smallest) if smallest else None, min(largest) if largest else None) | transformation_dissimilar_code_injection_1 | from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
current_depth -= 1
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
return result | 0 | 134 | mbpp |
def largest_smallest_integers(lst):
smallest = list(filter(lambda x: x < 0, lst))
largest = list(filter(lambda x: x > 0, lst))
return (max(smallest) if smallest else None, min(largest) if largest else None) | transformation_dissimilar_code_injection_2 | def truncate_number(number: float) -> float:
""" Given a positive floating point number, it can be decomposed into
and integer part (largest integer smaller than given number) and decimals
(leftover part always smaller than 1).
Return the decimal part of the number.
>>> truncate_number(3.5)
0.5
"""
return number % 1.0 | 0 | 134 | mbpp |
def largest_smallest_integers(lst):
smallest = list(filter(lambda x: x < 0, lst))
largest = list(filter(lambda x: x > 0, lst))
return (max(smallest) if smallest else None, min(largest) if largest else None) | transformation_dissimilar_code_injection_3 | from typing import List
def below_zero(operations: List[int]) -> bool:
balance = 0
for op in operations:
balance += op
if balance < 0:
return True
return False | 0 | 134 | mbpp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.