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 sort_even(l: list): evens = l[::2] odds = l[1::2] evens.sort() ans = [] for e, o in zip(evens, odds): ans.extend([e, o]) if len(evens) > len(odds): ans.append(evens[-1]) 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
37
mbpp
def sort_even(l: list): evens = l[::2] odds = l[1::2] evens.sort() ans = [] for e, o in zip(evens, odds): ans.extend([e, o]) if len(evens) > len(odds): ans.append(evens[-1]) 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
37
mbpp
def encode_cyclic(s: str): """ returns encoded string by cycling groups of three characters. """ # split string to groups. Each of length 3. groups = [s[(3 * i):min((3 * i + 3), len(s))] for i in range((len(s) + 2) // 3)] # cycle elements in each group. Unless group has fewer elements than 3. groups = [(group[1:] + group[0]) if len(group) == 3 else group for group in groups] return "".join(groups) def decode_cyclic(s: str): """ takes as input string encoded with encode_cyclic function. Returns decoded string. """ return encode_cyclic(encode_cyclic(s))
transformation_add_sub_variable
def encode_cyclic(s: str): """ returns encoded string by cycling groups of three characters. """ # split string to groups. Each of length 3. groups = [s[(3 * i):min((3 * i - 3), len(s))] for i in range((len(s) + 2) // 3)] # cycle elements in each group. Unless group has fewer elements than 3. groups = [(group[1:] + group[0]) if len(group) == 3 else group for group in groups] return "".join(groups) def decode_cyclic(s: str): """ takes as input string encoded with encode_cyclic function. Returns decoded string. """ return encode_cyclic(encode_cyclic(s))
0
38
mbpp
def encode_cyclic(s: str): """ returns encoded string by cycling groups of three characters. """ # split string to groups. Each of length 3. groups = [s[(3 * i):min((3 * i + 3), len(s))] for i in range((len(s) + 2) // 3)] # cycle elements in each group. Unless group has fewer elements than 3. groups = [(group[1:] + group[0]) if len(group) == 3 else group for group in groups] return "".join(groups) def decode_cyclic(s: str): """ takes as input string encoded with encode_cyclic function. Returns decoded string. """ return encode_cyclic(encode_cyclic(s))
transformation_mul_div_variable
def encode_cyclic(s: str): """ returns encoded string by cycling groups of three characters. """ # split string to groups. Each of length 3. groups = [s[(3 / i):min((3 * i + 3), len(s))] for i in range((len(s) + 2) // 3)] # cycle elements in each group. Unless group has fewer elements than 3. groups = [(group[1:] + group[0]) if len(group) == 3 else group for group in groups] return "".join(groups) def decode_cyclic(s: str): """ takes as input string encoded with encode_cyclic function. Returns decoded string. """ return encode_cyclic(encode_cyclic(s))
0
38
mbpp
def encode_cyclic(s: str): """ returns encoded string by cycling groups of three characters. """ # split string to groups. Each of length 3. groups = [s[(3 * i):min((3 * i + 3), len(s))] for i in range((len(s) + 2) // 3)] # cycle elements in each group. Unless group has fewer elements than 3. groups = [(group[1:] + group[0]) if len(group) == 3 else group for group in groups] return "".join(groups) def decode_cyclic(s: str): """ takes as input string encoded with encode_cyclic function. Returns decoded string. """ return encode_cyclic(encode_cyclic(s))
transformation_div_mul_variable
def encode_cyclic(s: str): """ returns encoded string by cycling groups of three characters. """ # split string to groups. Each of length 3. groups = [s[(3 * i):min((3 * i + 3), len(s))] for i in range((len(s) + 2) */ 3)] # cycle elements in each group. Unless group has fewer elements than 3. groups = [(group[1:] + group[0]) if len(group) == 3 else group for group in groups] return "".join(groups) def decode_cyclic(s: str): """ takes as input string encoded with encode_cyclic function. Returns decoded string. """ return encode_cyclic(encode_cyclic(s))
0
38
mbpp
def encode_cyclic(s: str): """ returns encoded string by cycling groups of three characters. """ # split string to groups. Each of length 3. groups = [s[(3 * i):min((3 * i + 3), len(s))] for i in range((len(s) + 2) // 3)] # cycle elements in each group. Unless group has fewer elements than 3. groups = [(group[1:] + group[0]) if len(group) == 3 else group for group in groups] return "".join(groups) def decode_cyclic(s: str): """ takes as input string encoded with encode_cyclic function. Returns decoded string. """ return encode_cyclic(encode_cyclic(s))
transformation_equalto_exclamation_variable
def encode_cyclic(s: str): """ returns encoded string by cycling groups of three characters. """ # split string to groups. Each of length 3. groups = [s[(3 * i):min((3 * i + 3), len(s))] for i in range((len(s) + 2) // 3)] # cycle elements in each group. Unless group has fewer elements than 3. groups = [(group[1:] + group[0]) if len(group) != 3 else group for group in groups] return "".join(groups) def decode_cyclic(s: str): """ takes as input string encoded with encode_cyclic function. Returns decoded string. """ return encode_cyclic(encode_cyclic(s))
0
38
mbpp
def encode_cyclic(s: str): """ returns encoded string by cycling groups of three characters. """ # split string to groups. Each of length 3. groups = [s[(3 * i):min((3 * i + 3), len(s))] for i in range((len(s) + 2) // 3)] # cycle elements in each group. Unless group has fewer elements than 3. groups = [(group[1:] + group[0]) if len(group) == 3 else group for group in groups] return "".join(groups) def decode_cyclic(s: str): """ takes as input string encoded with encode_cyclic function. Returns decoded string. """ return encode_cyclic(encode_cyclic(s))
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
38
mbpp
def encode_cyclic(s: str): """ returns encoded string by cycling groups of three characters. """ # split string to groups. Each of length 3. groups = [s[(3 * i):min((3 * i + 3), len(s))] for i in range((len(s) + 2) // 3)] # cycle elements in each group. Unless group has fewer elements than 3. groups = [(group[1:] + group[0]) if len(group) == 3 else group for group in groups] return "".join(groups) def decode_cyclic(s: str): """ takes as input string encoded with encode_cyclic function. Returns decoded string. """ return encode_cyclic(encode_cyclic(s))
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
38
mbpp
def encode_cyclic(s: str): """ returns encoded string by cycling groups of three characters. """ # split string to groups. Each of length 3. groups = [s[(3 * i):min((3 * i + 3), len(s))] for i in range((len(s) + 2) // 3)] # cycle elements in each group. Unless group has fewer elements than 3. groups = [(group[1:] + group[0]) if len(group) == 3 else group for group in groups] return "".join(groups) def decode_cyclic(s: str): """ takes as input string encoded with encode_cyclic function. Returns decoded string. """ return encode_cyclic(encode_cyclic(s))
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
38
mbpp
def encode_cyclic(s: str): """ returns encoded string by cycling groups of three characters. """ # split string to groups. Each of length 3. groups = [s[(3 * i):min((3 * i + 3), len(s))] for i in range((len(s) + 2) // 3)] # cycle elements in each group. Unless group has fewer elements than 3. groups = [(group[1:] + group[0]) if len(group) == 3 else group for group in groups] return "".join(groups) def decode_cyclic(s: str): """ takes as input string encoded with encode_cyclic function. Returns decoded string. """ return encode_cyclic(encode_cyclic(s))
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
38
mbpp
def encode_cyclic(s: str): """ returns encoded string by cycling groups of three characters. """ # split string to groups. Each of length 3. groups = [s[(3 * i):min((3 * i + 3), len(s))] for i in range((len(s) + 2) // 3)] # cycle elements in each group. Unless group has fewer elements than 3. groups = [(group[1:] + group[0]) if len(group) == 3 else group for group in groups] return "".join(groups) def decode_cyclic(s: str): """ takes as input string encoded with encode_cyclic function. Returns decoded string. """ return encode_cyclic(encode_cyclic(s))
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
38
mbpp
def triples_sum_to_zero(l: list): for i in range(len(l)): for j in range(i + 1, len(l)): for k in range(j + 1, len(l)): if l[i] + l[j] + l[k] == 0: return True return False
transformation_dead_code_insert
def triples_sum_to_zero(l: list): for i in range(len(l)): for j in range(i + 1, len(l)): for k in range(j + 1, len(l)): for _i_4 in range(0): return True if l[i] + l[j] + l[k] == 0: return True return False
1
40
mbpp
def triples_sum_to_zero(l: list): for i in range(len(l)): for j in range(i + 1, len(l)): for k in range(j + 1, len(l)): if l[i] + l[j] + l[k] == 0: return True return False
transformation_for_while_loop
def triples_sum_to_zero(l: list): i = 0 while i < len(l): for j in range(i + 1, len(l)): for k in range(j + 1, len(l)): if l[i] + l[j] + l[k] == 0: return True i += 1 return False
1
40
mbpp
def triples_sum_to_zero(l: list): for i in range(len(l)): for j in range(i + 1, len(l)): for k in range(j + 1, len(l)): if l[i] + l[j] + l[k] == 0: return True return False
transformation_operand_swap
def triples_sum_to_zero(l: list): for i in range(len(l)): for j in range(i + 1, len(l)): for k in range(j + 1, len(l)): if 0 == l[i] + l[j] + l[k]: return True return False
1
40
mbpp
def triples_sum_to_zero(l: list): for i in range(len(l)): for j in range(i + 1, len(l)): for k in range(j + 1, len(l)): if l[i] + l[j] + l[k] == 0: return True return False
transformation_rename_variable_cb
def triples_sum_to_zero(i2: list): for i in range(len(i2)): for j in range(i + 1, len(i2)): for k in range(j + 1, len(i2)): if i2[i] + i2[j] + i2[k] == 0: return True return False
1
40
mbpp
def triples_sum_to_zero(l: list): for i in range(len(l)): for j in range(i + 1, len(l)): for k in range(j + 1, len(l)): if l[i] + l[j] + l[k] == 0: return True return False
transformation_rename_variable_naive
def triples_sum_to_zero(VAR_0: list): for i in range(len(VAR_0)): for j in range(i + 1, len(VAR_0)): for k in range(j + 1, len(VAR_0)): if VAR_0[i] + VAR_0[j] + VAR_0[k] == 0: return True return False
1
40
mbpp
def triples_sum_to_zero(l: list): for i in range(len(l)): for j in range(i + 1, len(l)): for k in range(j + 1, len(l)): if l[i] + l[j] + l[k] == 0: return True return False
transformation_rename_variable_rn
def triples_sum_to_zero(U: list): for i in range(len(U)): for j in range(i + 1, len(U)): for k in range(j + 1, len(U)): if U[i] + U[j] + U[k] == 0: return True return False
1
40
mbpp
def triples_sum_to_zero(l: list): for i in range(len(l)): for j in range(i + 1, len(l)): for k in range(j + 1, len(l)): if l[i] + l[j] + l[k] == 0: return True return False
transformation_add_sub_variable
def triples_sum_to_zero(l: list): for i in range(len(l)): for j in range(i - 1, len(l)): for k in range(j + 1, len(l)): if l[i] + l[j] + l[k] == 0: return True return False
0
40
mbpp
def triples_sum_to_zero(l: list): for i in range(len(l)): for j in range(i + 1, len(l)): for k in range(j + 1, len(l)): if l[i] + l[j] + l[k] == 0: return True return False
transformation_equalto_exclamation_variable
def triples_sum_to_zero(l: list): for i in range(len(l)): for j in range(i + 1, len(l)): for k in range(j + 1, len(l)): if l[i] + l[j] + l[k] != 0: return True return False
0
40
mbpp
def triples_sum_to_zero(l: list): for i in range(len(l)): for j in range(i + 1, len(l)): for k in range(j + 1, len(l)): if l[i] + l[j] + l[k] == 0: return True return False
transformation_true_false_variable
def triples_sum_to_zero(l: list): for i in range(len(l)): for j in range(i + 1, len(l)): for k in range(j + 1, len(l)): if l[i] + l[j] + l[k] == 0: return False return False
0
40
mbpp
def triples_sum_to_zero(l: list): for i in range(len(l)): for j in range(i + 1, len(l)): for k in range(j + 1, len(l)): if l[i] + l[j] + l[k] == 0: return True return False
transformation_false_true_variable
def triples_sum_to_zero(l: list): for i in range(len(l)): for j in range(i + 1, len(l)): for k in range(j + 1, len(l)): if l[i] + l[j] + l[k] == 0: return True return True
0
40
mbpp
def triples_sum_to_zero(l: list): for i in range(len(l)): for j in range(i + 1, len(l)): for k in range(j + 1, len(l)): if l[i] + l[j] + l[k] == 0: 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: return True return False
0
40
mbpp
def triples_sum_to_zero(l: list): for i in range(len(l)): for j in range(i + 1, len(l)): for k in range(j + 1, len(l)): if l[i] + l[j] + l[k] == 0: 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 current_string.append(c) if current_depth == 0: result.append(''.join(current_string)) current_string.clear() return result
0
40
mbpp
def triples_sum_to_zero(l: list): for i in range(len(l)): for j in range(i + 1, len(l)): for k in range(j + 1, len(l)): if l[i] + l[j] + l[k] == 0: 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 """ return number % 1.0
0
40
mbpp
def triples_sum_to_zero(l: list): for i in range(len(l)): for j in range(i + 1, len(l)): for k in range(j + 1, len(l)): if l[i] + l[j] + l[k] == 0: 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
40
mbpp
def triples_sum_to_zero(l: list): for i in range(len(l)): for j in range(i + 1, len(l)): for k in range(j + 1, len(l)): if l[i] + l[j] + l[k] == 0: 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
40
mbpp
def triangle_area(a, h): """Given length of a side and high return area for a triangle. >>> triangle_area(5, 3) 7.5 """ return a * h / 2.0
transformation_mul_div_variable
def triangle_area(a, h): """Given length of a side and high return area for a triangle. >>> triangle_area(5, 3) 7.5 """ return a / h / 2.0
0
45
mbpp
def triangle_area(a, h): """Given length of a side and high return area for a triangle. >>> triangle_area(5, 3) 7.5 """ return a * h / 2.0
transformation_div_mul_variable
def triangle_area(a, h): """Given length of a side and high return area for a triangle. >>> triangle_area(5, 3) 7.5 """ return a * h * 2.0
0
45
mbpp
def triangle_area(a, h): """Given length of a side and high return area for a triangle. >>> triangle_area(5, 3) 7.5 """ return a * h / 2.0
transformation_greater_lesser_variable
def triangle_area(a, h): """Given length of a side and high return area for a triangle. <>> triangle_area(5, 3) 7.5 """ return a * h / 2.0
0
45
mbpp
def triangle_area(a, h): """Given length of a side and high return area for a triangle. >>> triangle_area(5, 3) 7.5 """ return a * h / 2.0
transformation_and_or_variable
def triangle_area(a, h): """Given length of a side or high return area for a triangle. >>> triangle_area(5, 3) 7.5 """ return a * h / 2.0
0
45
mbpp
def triangle_area(a, h): """Given length of a side and high return area for a triangle. >>> triangle_area(5, 3) 7.5 """ return a * h / 2.0
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
45
mbpp
def triangle_area(a, h): """Given length of a side and high return area for a triangle. >>> triangle_area(5, 3) 7.5 """ return a * h / 2.0
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
45
mbpp
def triangle_area(a, h): """Given length of a side and high return area for a triangle. >>> triangle_area(5, 3) 7.5 """ return a * h / 2.0
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
45
mbpp
def triangle_area(a, h): """Given length of a side and high return area for a triangle. >>> triangle_area(5, 3) 7.5 """ return a * h / 2.0
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
45
mbpp
def triangle_area(a, h): """Given length of a side and high return area for a triangle. >>> triangle_area(5, 3) 7.5 """ return a * h / 2.0
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
45
mbpp
def fib4(n: int): results = [0, 0, 2, 0] if n < 4: return results[n] for _ in range(4, n + 1): results.append(results[-1] + results[-2] + results[-3] + results[-4]) results.pop(0) return results[-1]
transformation_dead_code_insert
def fib4(n: int): for _i_1 in range(0): results = [0, 0, 2, 0] results = [0, 0, 2, 0] if n < 4: return results[n] for _ in range(4, n + 1): results.append(results[-1] + results[-2] + results[-3] + results[-4]) results.pop(0) return results[-1]
1
46
mbpp
def fib4(n: int): results = [0, 0, 2, 0] if n < 4: return results[n] for _ in range(4, n + 1): results.append(results[-1] + results[-2] + results[-3] + results[-4]) results.pop(0) return results[-1]
transformation_for_while_loop
def fib4(n: int): results = [0, 0, 2, 0] if n < 4: return results[n] _ = 4 while _ < n + 1: results.append(results[-1] + results[-2] + results[-3] + results[-4]) results.pop(0) _ += 1 return results[-1]
1
46
mbpp
def fib4(n: int): results = [0, 0, 2, 0] if n < 4: return results[n] for _ in range(4, n + 1): results.append(results[-1] + results[-2] + results[-3] + results[-4]) results.pop(0) return results[-1]
transformation_operand_swap
def fib4(n: int): results = [0, 0, 2, 0] if 4 > n: return results[n] for _ in range(4, n + 1): results.append(results[-1] + results[-2] + results[-3] + results[-4]) results.pop(0) return results[-1]
1
46
mbpp
def fib4(n: int): results = [0, 0, 2, 0] if n < 4: return results[n] for _ in range(4, n + 1): results.append(results[-1] + results[-2] + results[-3] + results[-4]) results.pop(0) return results[-1]
transformation_rename_variable_cb
def fib4(n: int): n2 = [0, 0, 2, 0] if n < 4: return n2[n] for _ in range(4, n + 1): n2.append(n2[-1] + n2[-2] + n2[-3] + n2[-4]) n2.pop(0) return n2[-1]
1
46
mbpp
def fib4(n: int): results = [0, 0, 2, 0] if n < 4: return results[n] for _ in range(4, n + 1): results.append(results[-1] + results[-2] + results[-3] + results[-4]) results.pop(0) return results[-1]
transformation_rename_variable_naive
def fib4(n: int): VAR_0 = [0, 0, 2, 0] if n < 4: return VAR_0[n] for _ in range(4, n + 1): VAR_0.append(VAR_0[-1] + VAR_0[-2] + VAR_0[-3] + VAR_0[-4]) VAR_0.pop(0) return VAR_0[-1]
1
46
mbpp
def fib4(n: int): results = [0, 0, 2, 0] if n < 4: return results[n] for _ in range(4, n + 1): results.append(results[-1] + results[-2] + results[-3] + results[-4]) results.pop(0) return results[-1]
transformation_rename_variable_rn
def fib4(n: int): k9ob11y = [0, 0, 2, 0] if n < 4: return k9ob11y[n] for _ in range(4, n + 1): k9ob11y.append(k9ob11y[-1] + k9ob11y[-2] + k9ob11y[-3] + k9ob11y[-4]) k9ob11y.pop(0) return k9ob11y[-1]
1
46
mbpp
def fib4(n: int): results = [0, 0, 2, 0] if n < 4: return results[n] for _ in range(4, n + 1): results.append(results[-1] + results[-2] + results[-3] + results[-4]) results.pop(0) return results[-1]
transformation_add_sub_variable
def fib4(n: int): results = [0, 0, 2, 0] if n < 4: return results[n] for _ in range(4, n - 1): results.append(results[-1] + results[-2] + results[-3] + results[-4]) results.pop(0) return results[-1]
0
46
mbpp
def fib4(n: int): results = [0, 0, 2, 0] if n < 4: return results[n] for _ in range(4, n + 1): results.append(results[-1] + results[-2] + results[-3] + results[-4]) results.pop(0) return results[-1]
transformation_sub_add_variable
def fib4(n: int): results = [0, 0, 2, 0] if n < 4: return results[n] for _ in range(4, n + 1): results.append(results[+1] + results[-2] + results[-3] + results[-4]) results.pop(0) return results[-1]
0
46
mbpp
def fib4(n: int): results = [0, 0, 2, 0] if n < 4: return results[n] for _ in range(4, n + 1): results.append(results[-1] + results[-2] + results[-3] + results[-4]) results.pop(0) return results[-1]
transformation_lesser_greater_variable
def fib4(n: int): results = [0, 0, 2, 0] if n > 4: return results[n] for _ in range(4, n + 1): results.append(results[-1] + results[-2] + results[-3] + results[-4]) results.pop(0) return results[-1]
0
46
mbpp
def fib4(n: int): results = [0, 0, 2, 0] if n < 4: return results[n] for _ in range(4, n + 1): results.append(results[-1] + results[-2] + results[-3] + results[-4]) results.pop(0) return results[-1]
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
46
mbpp
def fib4(n: int): results = [0, 0, 2, 0] if n < 4: return results[n] for _ in range(4, n + 1): results.append(results[-1] + results[-2] + results[-3] + results[-4]) results.pop(0) return results[-1]
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
46
mbpp
def fib4(n: int): results = [0, 0, 2, 0] if n < 4: return results[n] for _ in range(4, n + 1): results.append(results[-1] + results[-2] + results[-3] + results[-4]) results.pop(0) return results[-1]
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
46
mbpp
def fib4(n: int): results = [0, 0, 2, 0] if n < 4: return results[n] for _ in range(4, n + 1): results.append(results[-1] + results[-2] + results[-3] + results[-4]) results.pop(0) return results[-1]
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
46
mbpp
def fib4(n: int): results = [0, 0, 2, 0] if n < 4: return results[n] for _ in range(4, n + 1): results.append(results[-1] + results[-2] + results[-3] + results[-4]) results.pop(0) return results[-1]
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
46
mbpp
def median(l: list): l = sorted(l) if len(l) % 2 == 1: return l[len(l) // 2] else: return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
transformation_dead_code_insert
def median(l: list): _i_5 = 0 while _i_5 < _i_5: l = sorted(l) l = sorted(l) if len(l) % 2 == 1: return l[len(l) // 2] else: return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
1
47
mbpp
def median(l: list): l = sorted(l) if len(l) % 2 == 1: return l[len(l) // 2] else: return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
transformation_for_while_loop
def median(l: list): l = sorted(l) if len(l) % 2 == 1: return l[len(l) // 2] else: return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
1
47
mbpp
def median(l: list): l = sorted(l) if len(l) % 2 == 1: return l[len(l) // 2] else: return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
transformation_operand_swap
def median(l: list): l = sorted(l) if 1 == len(l) % 2: return l[len(l) // 2] else: return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
1
47
mbpp
def median(l: list): l = sorted(l) if len(l) % 2 == 1: return l[len(l) // 2] else: return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
transformation_rename_variable_cb
def median(se: list): se = sorted(se) if len(se) % 2 == 1: return se[len(se) // 2] else: return (se[len(se) // 2 - 1] + se[len(se) // 2]) / 2.0
1
47
mbpp
def median(l: list): l = sorted(l) if len(l) % 2 == 1: return l[len(l) // 2] else: return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
transformation_rename_variable_naive
def median(VAR_0: list): VAR_0 = sorted(VAR_0) if len(VAR_0) % 2 == 1: return VAR_0[len(VAR_0) // 2] else: return (VAR_0[len(VAR_0) // 2 - 1] + VAR_0[len(VAR_0) // 2]) / 2.0
1
47
mbpp
def median(l: list): l = sorted(l) if len(l) % 2 == 1: return l[len(l) // 2] else: return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
transformation_rename_variable_rn
def median(p: list): p = sorted(p) if len(p) % 2 == 1: return p[len(p) // 2] else: return (p[len(p) // 2 - 1] + p[len(p) // 2]) / 2.0
1
47
mbpp
def median(l: list): l = sorted(l) if len(l) % 2 == 1: return l[len(l) // 2] else: return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
transformation_add_sub_variable
def median(l: list): l = sorted(l) if len(l) % 2 == 1: return l[len(l) // 2] else: return (l[len(l) // 2 - 1] - l[len(l) // 2]) / 2.0
0
47
mbpp
def median(l: list): l = sorted(l) if len(l) % 2 == 1: return l[len(l) // 2] else: return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
transformation_sub_add_variable
def median(l: list): l = sorted(l) if len(l) % 2 == 1: return l[len(l) // 2] else: return (l[len(l) // 2 + 1] + l[len(l) // 2]) / 2.0
0
47
mbpp
def median(l: list): l = sorted(l) if len(l) % 2 == 1: return l[len(l) // 2] else: return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
transformation_div_mul_variable
def median(l: list): l = sorted(l) if len(l) % 2 == 1: return l[len(l) */ 2] else: return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
0
47
mbpp
def median(l: list): l = sorted(l) if len(l) % 2 == 1: return l[len(l) // 2] else: return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
transformation_equalto_exclamation_variable
def median(l: list): l = sorted(l) if len(l) % 2 != 1: return l[len(l) // 2] else: return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
0
47
mbpp
def median(l: list): l = sorted(l) if len(l) % 2 == 1: return l[len(l) // 2] else: return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
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
47
mbpp
def median(l: list): l = sorted(l) if len(l) % 2 == 1: return l[len(l) // 2] else: return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
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
47
mbpp
def median(l: list): l = sorted(l) if len(l) % 2 == 1: return l[len(l) // 2] else: return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
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
47
mbpp
def median(l: list): l = sorted(l) if len(l) % 2 == 1: return l[len(l) // 2] else: return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
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
47
mbpp
def median(l: list): l = sorted(l) if len(l) % 2 == 1: return l[len(l) // 2] else: return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
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
47
mbpp
def is_palindrome(text: str): for i in range(len(text)): if text[i] != text[len(text) - 1 - i]: return False return True
transformation_dead_code_insert
def is_palindrome(text: str): for i in range(len(text)): if text[i] != text[len(text) - 1 - i]: _i_8 = 0 if _i_8 < _i_8: return False return False return True
1
48
mbpp
def is_palindrome(text: str): for i in range(len(text)): if text[i] != text[len(text) - 1 - i]: return False return True
transformation_for_while_loop
def is_palindrome(text: str): i = 0 while i < len(text): if text[i] != text[len(text) - 1 - i]: return False i += 1 return True
1
48
mbpp
def is_palindrome(text: str): for i in range(len(text)): if text[i] != text[len(text) - 1 - i]: return False return True
transformation_operand_swap
def is_palindrome(text: str): for i in range(len(text)): if text[len(text) - 1 - i] != text[i]: return False return True
1
48
mbpp
def is_palindrome(text: str): for i in range(len(text)): if text[i] != text[len(text) - 1 - i]: return False return True
transformation_rename_variable_cb
def is_palindrome(line: str): for i in range(len(line)): if line[i] != line[len(line) - 1 - i]: return False return True
1
48
mbpp
def is_palindrome(text: str): for i in range(len(text)): if text[i] != text[len(text) - 1 - i]: return False return True
transformation_rename_variable_naive
def is_palindrome(VAR_0: str): for i in range(len(VAR_0)): if VAR_0[i] != VAR_0[len(VAR_0) - 1 - i]: return False return True
1
48
mbpp
def is_palindrome(text: str): for i in range(len(text)): if text[i] != text[len(text) - 1 - i]: return False return True
transformation_rename_variable_rn
def is_palindrome(dShR: str): for i in range(len(dShR)): if dShR[i] != dShR[len(dShR) - 1 - i]: return False return True
1
48
mbpp
def is_palindrome(text: str): for i in range(len(text)): if text[i] != text[len(text) - 1 - i]: return False return True
transformation_sub_add_variable
def is_palindrome(text: str): for i in range(len(text)): if text[i] != text[len(text) + 1 - i]: return False return True
0
48
mbpp
def is_palindrome(text: str): for i in range(len(text)): if text[i] != text[len(text) - 1 - i]: return False return True
transformation_exclamation_equalto_variable
def is_palindrome(text: str): for i in range(len(text)): if text[i] == text[len(text) - 1 - i]: return False return True
0
48
mbpp
def is_palindrome(text: str): for i in range(len(text)): if text[i] != text[len(text) - 1 - i]: return False return True
transformation_true_false_variable
def is_palindrome(text: str): for i in range(len(text)): if text[i] != text[len(text) - 1 - i]: return False return False
0
48
mbpp
def is_palindrome(text: str): for i in range(len(text)): if text[i] != text[len(text) - 1 - i]: return False return True
transformation_false_true_variable
def is_palindrome(text: str): for i in range(len(text)): if text[i] != text[len(text) - 1 - i]: return True return True
0
48
mbpp
def is_palindrome(text: str): for i in range(len(text)): if text[i] != text[len(text) - 1 - i]: return False return True
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
48
mbpp
def is_palindrome(text: str): for i in range(len(text)): if text[i] != text[len(text) - 1 - i]: return False return True
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
48
mbpp
def is_palindrome(text: str): for i in range(len(text)): if text[i] != text[len(text) - 1 - i]: return False return True
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
48
mbpp
def is_palindrome(text: str): for i in range(len(text)): if text[i] != text[len(text) - 1 - i]: return False return True
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
48
mbpp
def is_palindrome(text: str): for i in range(len(text)): if text[i] != text[len(text) - 1 - i]: return False return True
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
48
mbpp
def encode_shift(s: str): """ returns encoded string by shifting every character by 5 in the alphabet. """ return "".join([chr(((ord(ch) + 5 - ord("a")) % 26) + ord("a")) for ch in s]) def decode_shift(s: str): """ takes as input string encoded with encode_shift function. Returns decoded string. """ return "".join([chr(((ord(ch) - 5 - ord("a")) % 26) + ord("a")) for ch in s])
transformation_add_sub_variable
def encode_shift(s: str): """ returns encoded string by shifting every character by 5 in the alphabet. """ return "".join([chr(((ord(ch) - 5 - ord("a")) % 26) + ord("a")) for ch in s]) def decode_shift(s: str): """ takes as input string encoded with encode_shift function. Returns decoded string. """ return "".join([chr(((ord(ch) - 5 - ord("a")) % 26) + ord("a")) for ch in s])
0
50
mbpp
def encode_shift(s: str): """ returns encoded string by shifting every character by 5 in the alphabet. """ return "".join([chr(((ord(ch) + 5 - ord("a")) % 26) + ord("a")) for ch in s]) def decode_shift(s: str): """ takes as input string encoded with encode_shift function. Returns decoded string. """ return "".join([chr(((ord(ch) - 5 - ord("a")) % 26) + ord("a")) for ch in s])
transformation_sub_add_variable
def encode_shift(s: str): """ returns encoded string by shifting every character by 5 in the alphabet. """ return "".join([chr(((ord(ch) + 5 + ord("a")) % 26) + ord("a")) for ch in s]) def decode_shift(s: str): """ takes as input string encoded with encode_shift function. Returns decoded string. """ return "".join([chr(((ord(ch) - 5 - ord("a")) % 26) + ord("a")) for ch in s])
0
50
mbpp
def encode_shift(s: str): """ returns encoded string by shifting every character by 5 in the alphabet. """ return "".join([chr(((ord(ch) + 5 - ord("a")) % 26) + ord("a")) for ch in s]) def decode_shift(s: str): """ takes as input string encoded with encode_shift function. Returns decoded string. """ return "".join([chr(((ord(ch) - 5 - ord("a")) % 26) + ord("a")) for ch in s])
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
50
mbpp
def encode_shift(s: str): """ returns encoded string by shifting every character by 5 in the alphabet. """ return "".join([chr(((ord(ch) + 5 - ord("a")) % 26) + ord("a")) for ch in s]) def decode_shift(s: str): """ takes as input string encoded with encode_shift function. Returns decoded string. """ return "".join([chr(((ord(ch) - 5 - ord("a")) % 26) + ord("a")) for ch in s])
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
50
mbpp
def encode_shift(s: str): """ returns encoded string by shifting every character by 5 in the alphabet. """ return "".join([chr(((ord(ch) + 5 - ord("a")) % 26) + ord("a")) for ch in s]) def decode_shift(s: str): """ takes as input string encoded with encode_shift function. Returns decoded string. """ return "".join([chr(((ord(ch) - 5 - ord("a")) % 26) + ord("a")) for ch in s])
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
50
mbpp
def encode_shift(s: str): """ returns encoded string by shifting every character by 5 in the alphabet. """ return "".join([chr(((ord(ch) + 5 - ord("a")) % 26) + ord("a")) for ch in s]) def decode_shift(s: str): """ takes as input string encoded with encode_shift function. Returns decoded string. """ return "".join([chr(((ord(ch) - 5 - ord("a")) % 26) + ord("a")) for ch in s])
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
50
mbpp
def encode_shift(s: str): """ returns encoded string by shifting every character by 5 in the alphabet. """ return "".join([chr(((ord(ch) + 5 - ord("a")) % 26) + ord("a")) for ch in s]) def decode_shift(s: str): """ takes as input string encoded with encode_shift function. Returns decoded string. """ return "".join([chr(((ord(ch) - 5 - ord("a")) % 26) + ord("a")) for ch in s])
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
50
mbpp
def below_threshold(l: list, t: int): for e in l: if e >= t: return False return True
transformation_dead_code_insert
def below_threshold(l: list, t: int): for e in l: _i_1 = 0 while _i_1 > _i_1: return False if e >= t: return False return True
1
52
mbpp
def below_threshold(l: list, t: int): for e in l: if e >= t: return False return True
transformation_for_while_loop
def below_threshold(l: list, t: int): _e_i = 0 while _e_i < len(l): e = l[_e_i] if e >= t: return False _e_i += 1 return True
1
52
mbpp
def below_threshold(l: list, t: int): for e in l: if e >= t: return False return True
transformation_operand_swap
def below_threshold(l: list, t: int): for e in l: if t <= e: return False return True
1
52
mbpp
def below_threshold(l: list, t: int): for e in l: if e >= t: return False return True
transformation_rename_variable_cb
def below_threshold(l: list, t: int): for r in l: if r >= t: return False return True
1
52
mbpp
def below_threshold(l: list, t: int): for e in l: if e >= t: return False return True
transformation_rename_variable_naive
def below_threshold(l: list, VAR_0: int): for e in l: if e >= VAR_0: return False return True
1
52
mbpp
def below_threshold(l: list, t: int): for e in l: if e >= t: return False return True
transformation_rename_variable_rn
def below_threshold(l: list, t: int): for i in l: if i >= t: return False return True
1
52
mbpp
def below_threshold(l: list, t: int): for e in l: if e >= t: return False return True
transformation_greater_lesser_variable
def below_threshold(l: list, t: int): for e in l: if e <= t: return False return True
0
52
mbpp
def below_threshold(l: list, t: int): for e in l: if e >= t: return False return True
transformation_true_false_variable
def below_threshold(l: list, t: int): for e in l: if e >= t: return False return False
0
52
mbpp
def below_threshold(l: list, t: int): for e in l: if e >= t: return False return True
transformation_false_true_variable
def below_threshold(l: list, t: int): for e in l: if e >= t: return True return True
0
52
mbpp
def below_threshold(l: list, t: int): for e in l: if e >= t: return False return True
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
52
mbpp
def below_threshold(l: list, t: int): for e in l: if e >= t: return False return True
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
52
mbpp
def below_threshold(l: list, t: int): for e in l: if e >= t: return False return True
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
52
mbpp
def below_threshold(l: list, t: int): for e in l: if e >= t: return False return True
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
52
mbpp
def below_threshold(l: list, t: int): for e in l: if e >= t: return False return True
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
52
mbpp