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 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_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
134
mbpp
def fix_spaces(text): new_text = "" i = 0 start, end = 0, 0 while i < len(text): if text[i] == " ": end += 1 else: if end - start > 2: new_text += "-"+text[i] elif end - start > 0: new_text += "_"*(end - start)+text[i] ...
transformation_dead_code_insert
def fix_spaces(text): new_text = "" i = 0 start, end = 0, 0 while i < len(text): if text[i] == " ": end += 1 else: for _i_1 in range(0): start, end = 0, 0 if end - start > 2: new_text += "-" + text[i] elif en...
1
138
mbpp
def fix_spaces(text): new_text = "" i = 0 start, end = 0, 0 while i < len(text): if text[i] == " ": end += 1 else: if end - start > 2: new_text += "-"+text[i] elif end - start > 0: new_text += "_"*(end - start)+text[i] ...
transformation_for_while_loop
def fix_spaces(text): new_text = "" i = 0 start, end = 0, 0 while i < len(text): if text[i] == " ": end += 1 else: if end - start > 2: new_text += "-" + text[i] elif end - start > 0: new_text += "_" * (en...
1
138
mbpp
def fix_spaces(text): new_text = "" i = 0 start, end = 0, 0 while i < len(text): if text[i] == " ": end += 1 else: if end - start > 2: new_text += "-"+text[i] elif end - start > 0: new_text += "_"*(end - start)+text[i] ...
transformation_operand_swap
def fix_spaces(text): new_text = "" i = 0 start, end = 0, 0 while len(text) > i: if text[i] == " ": end += 1 else: if end - start > 2: new_text += "-" + text[i] elif end - start > 0: new_text += "_" * (en...
1
138
mbpp
def fix_spaces(text): new_text = "" i = 0 start, end = 0, 0 while i < len(text): if text[i] == " ": end += 1 else: if end - start > 2: new_text += "-"+text[i] elif end - start > 0: new_text += "_"*(end - start)+text[i] ...
transformation_rename_variable_naive
def fix_spaces(text): new_text = "" VAR_0 = 0 start, end = 0, 0 while VAR_0 < len(text): if text[VAR_0] == " ": end += 1 else: if end - start > 2: new_text += "-" + text[VAR_0] elif end - start > 0: new_t...
1
138
mbpp
def fix_spaces(text): new_text = "" i = 0 start, end = 0, 0 while i < len(text): if text[i] == " ": end += 1 else: if end - start > 2: new_text += "-"+text[i] elif end - start > 0: new_text += "_"*(end - start)+text[i] ...
transformation_rename_variable_rn
def fix_spaces(text): new_text = "" p = 0 start, end = 0, 0 while p < len(text): if text[p] == " ": end += 1 else: if end - start > 2: new_text += "-" + text[p] elif end - start > 0: new_text += "_" * (en...
1
138
mbpp
def fix_spaces(text): new_text = "" i = 0 start, end = 0, 0 while i < len(text): if text[i] == " ": end += 1 else: if end - start > 2: new_text += "-"+text[i] elif end - start > 0: new_text += "_"*(end - start)+text[i] ...
transformation_add_sub_variable
def fix_spaces(text): new_text = "" i = 0 start, end = 0, 0 while i < len(text): if text[i] == " ": end -= 1 else: if end - start > 2: new_text += "-"+text[i] elif end - start > 0: new_text += "_"*(end - start)+text[i] ...
0
138
mbpp
def fix_spaces(text): new_text = "" i = 0 start, end = 0, 0 while i < len(text): if text[i] == " ": end += 1 else: if end - start > 2: new_text += "-"+text[i] elif end - start > 0: new_text += "_"*(end - start)+text[i] ...
transformation_sub_add_variable
def fix_spaces(text): new_text = "" i = 0 start, end = 0, 0 while i < len(text): if text[i] == " ": end += 1 else: if end + start > 2: new_text += "-"+text[i] elif end - start > 0: new_text += "_"*(end - start)+text[i] ...
0
138
mbpp
def fix_spaces(text): new_text = "" i = 0 start, end = 0, 0 while i < len(text): if text[i] == " ": end += 1 else: if end - start > 2: new_text += "-"+text[i] elif end - start > 0: new_text += "_"*(end - start)+text[i] ...
transformation_mul_div_variable
def fix_spaces(text): new_text = "" i = 0 start, end = 0, 0 while i < len(text): if text[i] == " ": end += 1 else: if end - start > 2: new_text += "-"+text[i] elif end - start > 0: new_text += "_"/(end - start)+text[i] ...
0
138
mbpp
def fix_spaces(text): new_text = "" i = 0 start, end = 0, 0 while i < len(text): if text[i] == " ": end += 1 else: if end - start > 2: new_text += "-"+text[i] elif end - start > 0: new_text += "_"*(end - start)+text[i] ...
transformation_lesser_greater_variable
def fix_spaces(text): new_text = "" i = 0 start, end = 0, 0 while i > len(text): if text[i] == " ": end += 1 else: if end - start > 2: new_text += "-"+text[i] elif end - start > 0: new_text += "_"*(end - start)+text[i] ...
0
138
mbpp
def fix_spaces(text): new_text = "" i = 0 start, end = 0, 0 while i < len(text): if text[i] == " ": end += 1 else: if end - start > 2: new_text += "-"+text[i] elif end - start > 0: new_text += "_"*(end - start)+text[i] ...
transformation_greater_lesser_variable
def fix_spaces(text): new_text = "" i = 0 start, end = 0, 0 while i < len(text): if text[i] == " ": end += 1 else: if end - start < 2: new_text += "-"+text[i] elif end - start > 0: new_text += "_"*(end - start)+text[i] ...
0
138
mbpp
def fix_spaces(text): new_text = "" i = 0 start, end = 0, 0 while i < len(text): if text[i] == " ": end += 1 else: if end - start > 2: new_text += "-"+text[i] elif end - start > 0: new_text += "_"*(end - start)+text[i] ...
transformation_equalto_exclamation_variable
def fix_spaces(text): new_text = "" i = 0 start, end = 0, 0 while i < len(text): if text[i] != " ": end += 1 else: if end - start > 2: new_text += "-"+text[i] elif end - start > 0: new_text += "_"*(end - start)+text[i] ...
0
138
mbpp
def fix_spaces(text): new_text = "" i = 0 start, end = 0, 0 while i < len(text): if text[i] == " ": end += 1 else: if end - start > 2: new_text += "-"+text[i] elif end - start > 0: new_text += "_"*(end - start)+text[i] ...
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: re...
0
138
mbpp
def fix_spaces(text): new_text = "" i = 0 start, end = 0, 0 while i < len(text): if text[i] == " ": end += 1 else: if end - start > 2: new_text += "-"+text[i] elif end - start > 0: new_text += "_"*(end - start)+text[i] ...
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 ...
0
138
mbpp
def fix_spaces(text): new_text = "" i = 0 start, end = 0, 0 while i < len(text): if text[i] == " ": end += 1 else: if end - start > 2: new_text += "-"+text[i] elif end - start > 0: new_text += "_"*(end - start)+text[i] ...
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 ...
0
138
mbpp
def fix_spaces(text): new_text = "" i = 0 start, end = 0, 0 while i < len(text): if text[i] == " ": end += 1 else: if end - start > 2: new_text += "-"+text[i] elif end - start > 0: new_text += "_"*(end - start)+text[i] ...
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
138
mbpp
def fix_spaces(text): new_text = "" i = 0 start, end = 0, 0 while i < len(text): if text[i] == " ": end += 1 else: if end - start > 2: new_text += "-"+text[i] elif end - start > 0: new_text += "_"*(end - start)+text[i] ...
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
138
mbpp
def simplify(x, n): a, b = x.split("/") c, d = n.split("/") numerator = int(a) * int(c) denom = int(b) * int(d) if (numerator/denom == int(numerator/denom)): return True return False
transformation_dead_code_insert
def simplify(x, n): while False: return False a, b = x.split("/") c, d = n.split("/") numerator = int(a) * int(c) denom = int(b) * int(d) if numerator / denom == int(numerator / denom): return True return False
1
142
mbpp
def simplify(x, n): a, b = x.split("/") c, d = n.split("/") numerator = int(a) * int(c) denom = int(b) * int(d) if (numerator/denom == int(numerator/denom)): return True return False
transformation_for_while_loop
def simplify(x, n): a, b = x.split("/") c, d = n.split("/") numerator = int(a) * int(c) denom = int(b) * int(d) if numerator / denom == int(numerator / denom): return True return False
1
142
mbpp
def simplify(x, n): a, b = x.split("/") c, d = n.split("/") numerator = int(a) * int(c) denom = int(b) * int(d) if (numerator/denom == int(numerator/denom)): return True return False
transformation_operand_swap
def simplify(x, n): a, b = x.split("/") c, d = n.split("/") numerator = int(a) * int(c) denom = int(b) * int(d) if int(numerator / denom) == numerator / denom: return True return False
1
142
mbpp
def simplify(x, n): a, b = x.split("/") c, d = n.split("/") numerator = int(a) * int(c) denom = int(b) * int(d) if (numerator/denom == int(numerator/denom)): return True return False
transformation_rename_variable_cb
def simplify(x, n): a, b = x.split("/") c, d = n.split("/") x2 = int(a) * int(c) denom = int(b) * int(d) if x2 / denom == int(x2 / denom): return True return False
1
142
mbpp
def simplify(x, n): a, b = x.split("/") c, d = n.split("/") numerator = int(a) * int(c) denom = int(b) * int(d) if (numerator/denom == int(numerator/denom)): return True return False
transformation_rename_variable_naive
def simplify(x, n): a, b = x.split("/") c, d = n.split("/") numerator = int(a) * int(c) VAR_0 = int(b) * int(d) if numerator / VAR_0 == int(numerator / VAR_0): return True return False
1
142
mbpp
def simplify(x, n): a, b = x.split("/") c, d = n.split("/") numerator = int(a) * int(c) denom = int(b) * int(d) if (numerator/denom == int(numerator/denom)): return True return False
transformation_rename_variable_rn
def simplify(x, n): a, b = x.split("/") c, d = n.split("/") numerator = int(a) * int(c) a09b8 = int(b) * int(d) if numerator / a09b8 == int(numerator / a09b8): return True return False
1
142
mbpp
def simplify(x, n): a, b = x.split("/") c, d = n.split("/") numerator = int(a) * int(c) denom = int(b) * int(d) if (numerator/denom == int(numerator/denom)): return True return False
transformation_mul_div_variable
def simplify(x, n): a, b = x.split("/") c, d = n.split("/") numerator = int(a) / int(c) denom = int(b) * int(d) if (numerator/denom == int(numerator/denom)): return True return False
0
142
mbpp
def simplify(x, n): a, b = x.split("/") c, d = n.split("/") numerator = int(a) * int(c) denom = int(b) * int(d) if (numerator/denom == int(numerator/denom)): return True return False
transformation_div_mul_variable
def simplify(x, n): a, b = x.split("*") c, d = n.split("/") numerator = int(a) * int(c) denom = int(b) * int(d) if (numerator/denom == int(numerator/denom)): return True return False
0
142
mbpp
def simplify(x, n): a, b = x.split("/") c, d = n.split("/") numerator = int(a) * int(c) denom = int(b) * int(d) if (numerator/denom == int(numerator/denom)): return True return False
transformation_equalto_exclamation_variable
def simplify(x, n): a, b = x.split("/") c, d = n.split("/") numerator = int(a) * int(c) denom = int(b) * int(d) if (numerator/denom != int(numerator/denom)): return True return False
0
142
mbpp
def simplify(x, n): a, b = x.split("/") c, d = n.split("/") numerator = int(a) * int(c) denom = int(b) * int(d) if (numerator/denom == int(numerator/denom)): return True return False
transformation_true_false_variable
def simplify(x, n): a, b = x.split("/") c, d = n.split("/") numerator = int(a) * int(c) denom = int(b) * int(d) if (numerator/denom == int(numerator/denom)): return False return False
0
142
mbpp
def simplify(x, n): a, b = x.split("/") c, d = n.split("/") numerator = int(a) * int(c) denom = int(b) * int(d) if (numerator/denom == int(numerator/denom)): return True return False
transformation_false_true_variable
def simplify(x, n): a, b = x.split("/") c, d = n.split("/") numerator = int(a) * int(c) denom = int(b) * int(d) if (numerator/denom == int(numerator/denom)): return True return True
0
142
mbpp
def simplify(x, n): a, b = x.split("/") c, d = n.split("/") numerator = int(a) * int(c) denom = int(b) * int(d) if (numerator/denom == int(numerator/denom)): return True 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: re...
0
142
mbpp
def simplify(x, n): a, b = x.split("/") c, d = n.split("/") numerator = int(a) * int(c) denom = int(b) * int(d) if (numerator/denom == int(numerator/denom)): return True 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 ...
0
142
mbpp
def simplify(x, n): a, b = x.split("/") c, d = n.split("/") numerator = int(a) * int(c) denom = int(b) * int(d) if (numerator/denom == int(numerator/denom)): return True 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 ...
0
142
mbpp
def simplify(x, n): a, b = x.split("/") c, d = n.split("/") numerator = int(a) * int(c) denom = int(b) * int(d) if (numerator/denom == int(numerator/denom)): return True 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
142
mbpp
def simplify(x, n): a, b = x.split("/") c, d = n.split("/") numerator = int(a) * int(c) denom = int(b) * int(d) if (numerator/denom == int(numerator/denom)): return True 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
142
mbpp
def order_by_points(nums): def digits_sum(n): neg = 1 if n < 0: n, neg = -1 * n, -1 n = [int(i) for i in str(n)] n[0] = n[0] * neg return sum(n) return sorted(nums, key=digits_sum)
transformation_dead_code_insert
def order_by_points(nums): def digits_sum(n): neg = 1 if n < 0: n, neg = -1 * n, -1 for _i_0 in range(0): n = [int(i) for i in str(n)] n = [int(i) for i in str(n)] n[0] = n[0] * neg return sum(n) return sorted(nums, key=digits_sum)
1
143
mbpp
def order_by_points(nums): def digits_sum(n): neg = 1 if n < 0: n, neg = -1 * n, -1 n = [int(i) for i in str(n)] n[0] = n[0] * neg return sum(n) return sorted(nums, key=digits_sum)
transformation_for_while_loop
def order_by_points(nums): def digits_sum(n): neg = 1 if n < 0: n, neg = -1 * n, -1 n = [int(i) for i in str(n)] n[0] = n[0] * neg return sum(n) return sorted(nums, key=digits_sum)
1
143
mbpp
def order_by_points(nums): def digits_sum(n): neg = 1 if n < 0: n, neg = -1 * n, -1 n = [int(i) for i in str(n)] n[0] = n[0] * neg return sum(n) return sorted(nums, key=digits_sum)
transformation_operand_swap
def order_by_points(nums): def digits_sum(n): neg = 1 if 0 > n: n, neg = -1 * n, -1 n = [int(i) for i in str(n)] n[0] = n[0] * neg return sum(n) return sorted(nums, key=digits_sum)
1
143
mbpp
def order_by_points(nums): def digits_sum(n): neg = 1 if n < 0: n, neg = -1 * n, -1 n = [int(i) for i in str(n)] n[0] = n[0] * neg return sum(n) return sorted(nums, key=digits_sum)
transformation_rename_variable_cb
def order_by_points(nums): def digits_sum(eg): neg = 1 if eg < 0: eg, neg = -1 * eg, -1 eg = [int(i) for i in str(eg)] eg[0] = eg[0] * neg return sum(eg) return sorted(nums, key=digits_sum)
1
143
mbpp
def order_by_points(nums): def digits_sum(n): neg = 1 if n < 0: n, neg = -1 * n, -1 n = [int(i) for i in str(n)] n[0] = n[0] * neg return sum(n) return sorted(nums, key=digits_sum)
transformation_rename_variable_naive
def order_by_points(nums): def digits_sum(VAR_0): neg = 1 if VAR_0 < 0: VAR_0, neg = -1 * VAR_0, -1 VAR_0 = [int(i) for i in str(VAR_0)] VAR_0[0] = VAR_0[0] * neg return sum(VAR_0) return sorted(nums, key=digits_sum)
1
143
mbpp
def order_by_points(nums): def digits_sum(n): neg = 1 if n < 0: n, neg = -1 * n, -1 n = [int(i) for i in str(n)] n[0] = n[0] * neg return sum(n) return sorted(nums, key=digits_sum)
transformation_rename_variable_rn
def order_by_points(nums): def digits_sum(Z): neg = 1 if Z < 0: Z, neg = -1 * Z, -1 Z = [int(i) for i in str(Z)] Z[0] = Z[0] * neg return sum(Z) return sorted(nums, key=digits_sum)
1
143
mbpp
def order_by_points(nums): def digits_sum(n): neg = 1 if n < 0: n, neg = -1 * n, -1 n = [int(i) for i in str(n)] n[0] = n[0] * neg return sum(n) return sorted(nums, key=digits_sum)
transformation_sub_add_variable
def order_by_points(nums): def digits_sum(n): neg = 1 if n < 0: n, neg = +1 * n, -1 n = [int(i) for i in str(n)] n[0] = n[0] * neg return sum(n) return sorted(nums, key=digits_sum)
0
143
mbpp
def order_by_points(nums): def digits_sum(n): neg = 1 if n < 0: n, neg = -1 * n, -1 n = [int(i) for i in str(n)] n[0] = n[0] * neg return sum(n) return sorted(nums, key=digits_sum)
transformation_mul_div_variable
def order_by_points(nums): def digits_sum(n): neg = 1 if n < 0: n, neg = -1 / n, -1 n = [int(i) for i in str(n)] n[0] = n[0] * neg return sum(n) return sorted(nums, key=digits_sum)
0
143
mbpp
def order_by_points(nums): def digits_sum(n): neg = 1 if n < 0: n, neg = -1 * n, -1 n = [int(i) for i in str(n)] n[0] = n[0] * neg return sum(n) return sorted(nums, key=digits_sum)
transformation_lesser_greater_variable
def order_by_points(nums): def digits_sum(n): neg = 1 if n > 0: n, neg = -1 * n, -1 n = [int(i) for i in str(n)] n[0] = n[0] * neg return sum(n) return sorted(nums, key=digits_sum)
0
143
mbpp
def order_by_points(nums): def digits_sum(n): neg = 1 if n < 0: n, neg = -1 * n, -1 n = [int(i) for i in str(n)] n[0] = n[0] * neg return sum(n) return sorted(nums, key=digits_sum)
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: re...
0
143
mbpp
def order_by_points(nums): def digits_sum(n): neg = 1 if n < 0: n, neg = -1 * n, -1 n = [int(i) for i in str(n)] n[0] = n[0] * neg return sum(n) return sorted(nums, key=digits_sum)
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 ...
0
143
mbpp
def order_by_points(nums): def digits_sum(n): neg = 1 if n < 0: n, neg = -1 * n, -1 n = [int(i) for i in str(n)] n[0] = n[0] * neg return sum(n) return sorted(nums, key=digits_sum)
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 ...
0
143
mbpp
def order_by_points(nums): def digits_sum(n): neg = 1 if n < 0: n, neg = -1 * n, -1 n = [int(i) for i in str(n)] n[0] = n[0] * neg return sum(n) return sorted(nums, key=digits_sum)
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
143
mbpp
def order_by_points(nums): def digits_sum(n): neg = 1 if n < 0: n, neg = -1 * n, -1 n = [int(i) for i in str(n)] n[0] = n[0] * neg return sum(n) return sorted(nums, key=digits_sum)
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
143
mbpp
def bf(planet1, planet2): planet_names = ("Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune") if planet1 not in planet_names or planet2 not in planet_names or planet1 == planet2: return () planet1_index = planet_names.index(planet1) planet2_index = planet_names.index(p...
transformation_dead_code_insert
def bf(planet1, planet2): planet_names = ( "Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune", ) if planet1 not in planet_names or planet2 not in planet_names or planet1 == planet2: return () planet1_index...
1
146
mbpp
def bf(planet1, planet2): planet_names = ("Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune") if planet1 not in planet_names or planet2 not in planet_names or planet1 == planet2: return () planet1_index = planet_names.index(planet1) planet2_index = planet_names.index(p...
transformation_for_while_loop
def bf(planet1, planet2): planet_names = ( "Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune", ) if planet1 not in planet_names or planet2 not in planet_names or planet1 == planet2: return () planet1_index...
1
146
mbpp
def bf(planet1, planet2): planet_names = ("Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune") if planet1 not in planet_names or planet2 not in planet_names or planet1 == planet2: return () planet1_index = planet_names.index(planet1) planet2_index = planet_names.index(p...
transformation_operand_swap
def bf(planet1, planet2): planet_names = ( "Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune", ) if planet1 not in planet_names or planet2 not in planet_names or planet1 == planet2: return () planet1_index...
1
146
mbpp
def bf(planet1, planet2): planet_names = ("Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune") if planet1 not in planet_names or planet2 not in planet_names or planet1 == planet2: return () planet1_index = planet_names.index(planet1) planet2_index = planet_names.index(p...
transformation_rename_variable_cb
def bf(planet1, planet2): planets = ( "Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune", ) if planet1 not in planets or planet2 not in planets or planet1 == planet2: return () planet1_index = planets.inde...
1
146
mbpp
def bf(planet1, planet2): planet_names = ("Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune") if planet1 not in planet_names or planet2 not in planet_names or planet1 == planet2: return () planet1_index = planet_names.index(planet1) planet2_index = planet_names.index(p...
transformation_rename_variable_naive
def bf(planet1, planet2): VAR_0 = ( "Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune", ) if planet1 not in VAR_0 or planet2 not in VAR_0 or planet1 == planet2: return () planet1_index = VAR_0.index(planet...
1
146
mbpp
def bf(planet1, planet2): planet_names = ("Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune") if planet1 not in planet_names or planet2 not in planet_names or planet1 == planet2: return () planet1_index = planet_names.index(planet1) planet2_index = planet_names.index(p...
transformation_rename_variable_rn
def bf(planet1, planet2): y86k27189290 = ( "Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune", ) if planet1 not in y86k27189290 or planet2 not in y86k27189290 or planet1 == planet2: return () planet1_index...
1
146
mbpp
def bf(planet1, planet2): planet_names = ("Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune") if planet1 not in planet_names or planet2 not in planet_names or planet1 == planet2: return () planet1_index = planet_names.index(planet1) planet2_index = planet_names.index(p...
transformation_add_sub_variable
def bf(planet1, planet2): planet_names = ("Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune") if planet1 not in planet_names or planet2 not in planet_names or planet1 == planet2: return () planet1_index = planet_names.index(planet1) planet2_index = planet_names.index(p...
0
146
mbpp
def bf(planet1, planet2): planet_names = ("Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune") if planet1 not in planet_names or planet2 not in planet_names or planet1 == planet2: return () planet1_index = planet_names.index(planet1) planet2_index = planet_names.index(p...
transformation_lesser_greater_variable
def bf(planet1, planet2): planet_names = ("Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune") if planet1 not in planet_names or planet2 not in planet_names or planet1 == planet2: return () planet1_index = planet_names.index(planet1) planet2_index = planet_names.index(p...
0
146
mbpp
def bf(planet1, planet2): planet_names = ("Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune") if planet1 not in planet_names or planet2 not in planet_names or planet1 == planet2: return () planet1_index = planet_names.index(planet1) planet2_index = planet_names.index(p...
transformation_equalto_exclamation_variable
def bf(planet1, planet2): planet_names = ("Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune") if planet1 not in planet_names or planet2 not in planet_names or planet1 != planet2: return () planet1_index = planet_names.index(planet1) planet2_index = planet_names.index(p...
0
146
mbpp
def bf(planet1, planet2): planet_names = ("Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune") if planet1 not in planet_names or planet2 not in planet_names or planet1 == planet2: return () planet1_index = planet_names.index(planet1) planet2_index = planet_names.index(p...
transformation_or_and_variable
def bf(planet1, planet2): planet_names = ("Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune") if planet1 not in planet_names and planet2 not in planet_names or planet1 == planet2: return () planet1_index = planet_names.index(planet1) planet2_index = planet_names.index(...
0
146
mbpp
def bf(planet1, planet2): planet_names = ("Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune") if planet1 not in planet_names or planet2 not in planet_names or planet1 == planet2: return () planet1_index = planet_names.index(planet1) planet2_index = planet_names.index(p...
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: re...
0
146
mbpp
def bf(planet1, planet2): planet_names = ("Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune") if planet1 not in planet_names or planet2 not in planet_names or planet1 == planet2: return () planet1_index = planet_names.index(planet1) planet2_index = planet_names.index(p...
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 ...
0
146
mbpp
def bf(planet1, planet2): planet_names = ("Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune") if planet1 not in planet_names or planet2 not in planet_names or planet1 == planet2: return () planet1_index = planet_names.index(planet1) planet2_index = planet_names.index(p...
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 ...
0
146
mbpp
def bf(planet1, planet2): planet_names = ("Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune") if planet1 not in planet_names or planet2 not in planet_names or planet1 == planet2: return () planet1_index = planet_names.index(planet1) planet2_index = planet_names.index(p...
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
146
mbpp
def bf(planet1, planet2): planet_names = ("Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune") if planet1 not in planet_names or planet2 not in planet_names or planet1 == planet2: return () planet1_index = planet_names.index(planet1) planet2_index = planet_names.index(p...
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
146
mbpp
def sorted_list_sum(lst): lst.sort() new_lst = [] for i in lst: if len(i)%2 == 0: new_lst.append(i) return sorted(new_lst, key=len)
transformation_dead_code_insert
def sorted_list_sum(lst): lst.sort() _i_1 = 0 while _i_1 < _i_1: new_lst.append(i) new_lst = [] for i in lst: if len(i) % 2 == 0: new_lst.append(i) return sorted(new_lst, key=len)
1
147
mbpp
def sorted_list_sum(lst): lst.sort() new_lst = [] for i in lst: if len(i)%2 == 0: new_lst.append(i) return sorted(new_lst, key=len)
transformation_for_while_loop
def sorted_list_sum(lst): lst.sort() new_lst = [] _i_i = 0 while _i_i < len(lst): i = lst[_i_i] if len(i) % 2 == 0: new_lst.append(i) _i_i += 1 return sorted(new_lst, key=len)
1
147
mbpp
def sorted_list_sum(lst): lst.sort() new_lst = [] for i in lst: if len(i)%2 == 0: new_lst.append(i) return sorted(new_lst, key=len)
transformation_operand_swap
def sorted_list_sum(lst): lst.sort() new_lst = [] for i in lst: if 0 == len(i) % 2: new_lst.append(i) return sorted(new_lst, key=len)
1
147
mbpp
def sorted_list_sum(lst): lst.sort() new_lst = [] for i in lst: if len(i)%2 == 0: new_lst.append(i) return sorted(new_lst, key=len)
transformation_rename_variable_cb
def sorted_list_sum(lst): lst.sort() i2 = [] for i in lst: if len(i) % 2 == 0: i2.append(i) return sorted(i2, key=len)
1
147
mbpp
def sorted_list_sum(lst): lst.sort() new_lst = [] for i in lst: if len(i)%2 == 0: new_lst.append(i) return sorted(new_lst, key=len)
transformation_rename_variable_naive
def sorted_list_sum(VAR_0): VAR_0.sort() new_lst = [] for i in VAR_0: if len(i) % 2 == 0: new_lst.append(i) return sorted(new_lst, key=len)
1
147
mbpp
def sorted_list_sum(lst): lst.sort() new_lst = [] for i in lst: if len(i)%2 == 0: new_lst.append(i) return sorted(new_lst, key=len)
transformation_rename_variable_rn
def sorted_list_sum(JYl): JYl.sort() new_lst = [] for i in JYl: if len(i) % 2 == 0: new_lst.append(i) return sorted(new_lst, key=len)
1
147
mbpp
def sorted_list_sum(lst): lst.sort() new_lst = [] for i in lst: if len(i)%2 == 0: new_lst.append(i) return sorted(new_lst, key=len)
transformation_equalto_exclamation_variable
def sorted_list_sum(lst): lst.sort() new_lst = [] for i in lst: if len(i)%2 != 0: new_lst.append(i) return sorted(new_lst, key=len)
0
147
mbpp
def sorted_list_sum(lst): lst.sort() new_lst = [] for i in lst: if len(i)%2 == 0: new_lst.append(i) return sorted(new_lst, key=len)
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: re...
0
147
mbpp
def sorted_list_sum(lst): lst.sort() new_lst = [] for i in lst: if len(i)%2 == 0: new_lst.append(i) return sorted(new_lst, key=len)
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 ...
0
147
mbpp
def sorted_list_sum(lst): lst.sort() new_lst = [] for i in lst: if len(i)%2 == 0: new_lst.append(i) return sorted(new_lst, key=len)
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 ...
0
147
mbpp
def sorted_list_sum(lst): lst.sort() new_lst = [] for i in lst: if len(i)%2 == 0: new_lst.append(i) return sorted(new_lst, key=len)
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
147
mbpp
def sorted_list_sum(lst): lst.sort() new_lst = [] for i in lst: if len(i)%2 == 0: new_lst.append(i) return sorted(new_lst, key=len)
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
147
mbpp
def double_the_difference(lst): ''' Given a list of numbers, return the sum of squares of the numbers in the list that are odd. Ignore numbers that are negative or not integers. double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10 double_the_difference([-1, -2, 0]) == 0 double_the_diff...
transformation_add_sub_variable
def double_the_difference(lst): ''' Given a list of numbers, return the sum of squares of the numbers in the list that are odd. Ignore numbers that are negative or not integers. double_the_difference([1, 3, 2, 0]) == 1 - 9 + 0 + 0 = 10 double_the_difference([-1, -2, 0]) == 0 double_the_diff...
0
149
mbpp
def double_the_difference(lst): ''' Given a list of numbers, return the sum of squares of the numbers in the list that are odd. Ignore numbers that are negative or not integers. double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10 double_the_difference([-1, -2, 0]) == 0 double_the_diff...
transformation_sub_add_variable
def double_the_difference(lst): ''' Given a list of numbers, return the sum of squares of the numbers in the list that are odd. Ignore numbers that are negative or not integers. double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10 double_the_difference([+1, -2, 0]) == 0 double_the_diff...
0
149
mbpp
def double_the_difference(lst): ''' Given a list of numbers, return the sum of squares of the numbers in the list that are odd. Ignore numbers that are negative or not integers. double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10 double_the_difference([-1, -2, 0]) == 0 double_the_diff...
transformation_mul_div_variable
def double_the_difference(lst): ''' Given a list of numbers, return the sum of squares of the numbers in the list that are odd. Ignore numbers that are negative or not integers. double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10 double_the_difference([-1, -2, 0]) == 0 double_the_diff...
0
149
mbpp
def double_the_difference(lst): ''' Given a list of numbers, return the sum of squares of the numbers in the list that are odd. Ignore numbers that are negative or not integers. double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10 double_the_difference([-1, -2, 0]) == 0 double_the_diff...
transformation_greater_lesser_variable
def double_the_difference(lst): ''' Given a list of numbers, return the sum of squares of the numbers in the list that are odd. Ignore numbers that are negative or not integers. double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10 double_the_difference([-1, -2, 0]) == 0 double_the_diff...
0
149
mbpp
def double_the_difference(lst): ''' Given a list of numbers, return the sum of squares of the numbers in the list that are odd. Ignore numbers that are negative or not integers. double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10 double_the_difference([-1, -2, 0]) == 0 double_the_diff...
transformation_equalto_exclamation_variable
def double_the_difference(lst): ''' Given a list of numbers, return the sum of squares of the numbers in the list that are odd. Ignore numbers that are negative or not integers. double_the_difference([1, 3, 2, 0]) != 1 + 9 + 0 + 0 = 10 double_the_difference([-1, -2, 0]) == 0 double_the_diff...
0
149
mbpp
def double_the_difference(lst): ''' Given a list of numbers, return the sum of squares of the numbers in the list that are odd. Ignore numbers that are negative or not integers. double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10 double_the_difference([-1, -2, 0]) == 0 double_the_diff...
transformation_exclamation_equalto_variable
def double_the_difference(lst): ''' Given a list of numbers, return the sum of squares of the numbers in the list that are odd. Ignore numbers that are negative or not integers. double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10 double_the_difference([-1, -2, 0]) == 0 double_the_diff...
0
149
mbpp
def double_the_difference(lst): ''' Given a list of numbers, return the sum of squares of the numbers in the list that are odd. Ignore numbers that are negative or not integers. double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10 double_the_difference([-1, -2, 0]) == 0 double_the_diff...
transformation_is_isnot_variable
def double_the_difference(lst): ''' Given a list of numbers, return the sum of squares of the numbers in the list that are odd. Ignore numbers that are negative or not integers. double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10 double_the_difference([-1, -2, 0]) == 0 double_the_diff...
0
149
mbpp
def double_the_difference(lst): ''' Given a list of numbers, return the sum of squares of the numbers in the list that are odd. Ignore numbers that are negative or not integers. double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10 double_the_difference([-1, -2, 0]) == 0 double_the_diff...
transformation_and_or_variable
def double_the_difference(lst): ''' Given a list of numbers, return the sum of squares of the numbers in the list that are odd. Ignore numbers that are negative or not integers. double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10 double_the_difference([-1, -2, 0]) == 0 double_the_diff...
0
149
mbpp
def double_the_difference(lst): ''' Given a list of numbers, return the sum of squares of the numbers in the list that are odd. Ignore numbers that are negative or not integers. double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10 double_the_difference([-1, -2, 0]) == 0 double_the_diff...
transformation_or_and_variable
def double_the_difference(lst): ''' Given a list of numbers, return the sum of squares of the numbers in the list that are odd. Ignore numbers that are negative and not integers. double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10 double_the_difference([-1, -2, 0]) == 0 double_the_dif...
0
149
mbpp
def double_the_difference(lst): ''' Given a list of numbers, return the sum of squares of the numbers in the list that are odd. Ignore numbers that are negative or not integers. double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10 double_the_difference([-1, -2, 0]) == 0 double_the_diff...
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: re...
0
149
mbpp
def double_the_difference(lst): ''' Given a list of numbers, return the sum of squares of the numbers in the list that are odd. Ignore numbers that are negative or not integers. double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10 double_the_difference([-1, -2, 0]) == 0 double_the_diff...
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 ...
0
149
mbpp
def double_the_difference(lst): ''' Given a list of numbers, return the sum of squares of the numbers in the list that are odd. Ignore numbers that are negative or not integers. double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10 double_the_difference([-1, -2, 0]) == 0 double_the_diff...
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 ...
0
149
mbpp
def double_the_difference(lst): ''' Given a list of numbers, return the sum of squares of the numbers in the list that are odd. Ignore numbers that are negative or not integers. double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10 double_the_difference([-1, -2, 0]) == 0 double_the_diff...
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
149
mbpp
def double_the_difference(lst): ''' Given a list of numbers, return the sum of squares of the numbers in the list that are odd. Ignore numbers that are negative or not integers. double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10 double_the_difference([-1, -2, 0]) == 0 double_the_diff...
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
149
mbpp
def compare(game,guess): """I think we all remember that feeling when the result of some long-awaited event is finally known. The feelings and thoughts you have at that moment are definitely worth noting down and comparing. Your task is to determine if a person correctly guessed the results of a number ...
transformation_sub_add_variable
def compare(game,guess): """I think we all remember that feeling when the result of some long+awaited event is finally known. The feelings and thoughts you have at that moment are definitely worth noting down and comparing. Your task is to determine if a person correctly guessed the results of a number ...
0
150
mbpp
def compare(game,guess): """I think we all remember that feeling when the result of some long-awaited event is finally known. The feelings and thoughts you have at that moment are definitely worth noting down and comparing. Your task is to determine if a person correctly guessed the results of a number ...
transformation_greater_lesser_variable
def compare(game,guess): """I think we all remember that feeling when the result of some long-awaited event is finally known. The feelings and thoughts you have at that moment are definitely worth noting down and comparing. Your task is to determine if a person correctly guessed the results of a number ...
0
150
mbpp
def compare(game,guess): """I think we all remember that feeling when the result of some long-awaited event is finally known. The feelings and thoughts you have at that moment are definitely worth noting down and comparing. Your task is to determine if a person correctly guessed the results of a number ...
transformation_is_isnot_variable
def compare(game,guess): """I think we all remember that feeling when the result of some long-awaited event is not finally known. The feelings and thoughts you have at that moment are definitely worth noting down and comparing. Your task is to determine if a person correctly guessed the results of a num...
0
150
mbpp
def compare(game,guess): """I think we all remember that feeling when the result of some long-awaited event is finally known. The feelings and thoughts you have at that moment are definitely worth noting down and comparing. Your task is to determine if a person correctly guessed the results of a number ...
transformation_and_or_variable
def compare(game,guess): """I think we all remember that feeling when the result of some long-awaited event is finally known. The feelings or thoughts you have at that moment are definitely worth noting down and comparing. Your task is to determine if a person correctly guessed the results of a number o...
0
150
mbpp
def compare(game,guess): """I think we all remember that feeling when the result of some long-awaited event is finally known. The feelings and thoughts you have at that moment are definitely worth noting down and comparing. Your task is to determine if a person correctly guessed the results of a number ...
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: re...
0
150
mbpp
def compare(game,guess): """I think we all remember that feeling when the result of some long-awaited event is finally known. The feelings and thoughts you have at that moment are definitely worth noting down and comparing. Your task is to determine if a person correctly guessed the results of a number ...
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 ...
0
150
mbpp
def compare(game,guess): """I think we all remember that feeling when the result of some long-awaited event is finally known. The feelings and thoughts you have at that moment are definitely worth noting down and comparing. Your task is to determine if a person correctly guessed the results of a number ...
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 ...
0
150
mbpp
def compare(game,guess): """I think we all remember that feeling when the result of some long-awaited event is finally known. The feelings and thoughts you have at that moment are definitely worth noting down and comparing. Your task is to determine if a person correctly guessed the results of a number ...
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
150
mbpp
def compare(game,guess): """I think we all remember that feeling when the result of some long-awaited event is finally known. The feelings and thoughts you have at that moment are definitely worth noting down and comparing. Your task is to determine if a person correctly guessed the results of a number ...
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
150
mbpp
def Strongest_Extension(class_name, extensions): strong = extensions[0] my_val = len([x for x in extensions[0] if x.isalpha() and x.isupper()]) - len([x for x in extensions[0] if x.isalpha() and x.islower()]) for s in extensions: val = len([x for x in s if x.isalpha() and x.isupper()]) - len([x for ...
transformation_dead_code_insert
def Strongest_Extension(class_name, extensions): _i_1 = 0 if _i_1 < _i_1: my_val = val strong = extensions[0] my_val = len([x for x in extensions[0] if x.isalpha() and x.isupper()]) - len( [x for x in extensions[0] if x.isalpha() and x.islower()] ) for s in extensions: va...
1
151
mbpp
def Strongest_Extension(class_name, extensions): strong = extensions[0] my_val = len([x for x in extensions[0] if x.isalpha() and x.isupper()]) - len([x for x in extensions[0] if x.isalpha() and x.islower()]) for s in extensions: val = len([x for x in s if x.isalpha() and x.isupper()]) - len([x for ...
transformation_for_while_loop
def Strongest_Extension(class_name, extensions): strong = extensions[0] my_val = len([x for x in extensions[0] if x.isalpha() and x.isupper()]) - len( [x for x in extensions[0] if x.isalpha() and x.islower()] ) _s_i = 0 while _s_i < len(extensions): s = extensions[_s_i] val =...
1
151
mbpp
def Strongest_Extension(class_name, extensions): strong = extensions[0] my_val = len([x for x in extensions[0] if x.isalpha() and x.isupper()]) - len([x for x in extensions[0] if x.isalpha() and x.islower()]) for s in extensions: val = len([x for x in s if x.isalpha() and x.isupper()]) - len([x for ...
transformation_operand_swap
def Strongest_Extension(class_name, extensions): strong = extensions[0] my_val = len([x for x in extensions[0] if x.isalpha() and x.isupper()]) - len( [x for x in extensions[0] if x.isalpha() and x.islower()] ) for s in extensions: val = len([x for x in s if x.isalpha() and x.isupper()])...
1
151
mbpp