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 add(x: int, y: int): """Add two numbers x and y >>> add(2, 3) 5 >>> add(5, 7) 12 """ return x + y
transformation_add_sub_variable
def add(x: int, y: int): """Add two numbers x and y >>> add(2, 3) 5 >>> add(5, 7) 12 """ return x - y
0
53
mbpp
def add(x: int, y: int): """Add two numbers x and y >>> add(2, 3) 5 >>> add(5, 7) 12 """ return x + y
transformation_greater_lesser_variable
def add(x: int, y: int): """Add two numbers x and y <>> add(2, 3) 5 >>> add(5, 7) 12 """ return x + y
0
53
mbpp
def add(x: int, y: int): """Add two numbers x and y >>> add(2, 3) 5 >>> add(5, 7) 12 """ return x + y
transformation_and_or_variable
def add(x: int, y: int): """Add two numbers x or y >>> add(2, 3) 5 >>> add(5, 7) 12 """ return x + y
0
53
mbpp
def add(x: int, y: int): """Add two numbers x and y >>> add(2, 3) 5 >>> add(5, 7) 12 """ return x + y
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
53
mbpp
def add(x: int, y: int): """Add two numbers x and y >>> add(2, 3) 5 >>> add(5, 7) 12 """ return x + y
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
53
mbpp
def add(x: int, y: int): """Add two numbers x and y >>> add(2, 3) 5 >>> add(5, 7) 12 """ return x + y
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
53
mbpp
def add(x: int, y: int): """Add two numbers x and y >>> add(2, 3) 5 >>> add(5, 7) 12 """ return x + y
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
53
mbpp
def add(x: int, y: int): """Add two numbers x and y >>> add(2, 3) 5 >>> add(5, 7) 12 """ return x + y
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
53
mbpp
def monotonic(l: list): if l == sorted(l) or l == sorted(l, reverse=True): return True return False
transformation_dead_code_insert
def monotonic(l: list): if l == sorted(l) or l == sorted(l, reverse=True): for _i_4 in range(0): return True return True return False
1
57
mbpp
def monotonic(l: list): if l == sorted(l) or l == sorted(l, reverse=True): return True return False
transformation_for_while_loop
def monotonic(l: list): if l == sorted(l) or l == sorted(l, reverse=True): return True return False
1
57
mbpp
def monotonic(l: list): if l == sorted(l) or l == sorted(l, reverse=True): return True return False
transformation_operand_swap
def monotonic(l: list): if sorted(l) == l or l == sorted(l, reverse=True): return True return False
1
57
mbpp
def monotonic(l: list): if l == sorted(l) or l == sorted(l, reverse=True): return True return False
transformation_rename_variable_cb
def monotonic(se: list): if se == sorted(se) or se == sorted(se, reverse=True): return True return False
1
57
mbpp
def monotonic(l: list): if l == sorted(l) or l == sorted(l, reverse=True): return True return False
transformation_rename_variable_naive
def monotonic(VAR_0: list): if VAR_0 == sorted(VAR_0) or VAR_0 == sorted(VAR_0, reverse=True): return True return False
1
57
mbpp
def monotonic(l: list): if l == sorted(l) or l == sorted(l, reverse=True): return True return False
transformation_rename_variable_rn
def monotonic(X: list): if X == sorted(X) or X == sorted(X, reverse=True): return True return False
1
57
mbpp
def monotonic(l: list): if l == sorted(l) or l == sorted(l, reverse=True): return True return False
transformation_equalto_exclamation_variable
def monotonic(l: list): if l != sorted(l) or l == sorted(l, reverse=True): return True return False
0
57
mbpp
def monotonic(l: list): if l == sorted(l) or l == sorted(l, reverse=True): return True return False
transformation_true_false_variable
def monotonic(l: list): if l == sorted(l) or l == sorted(l, reverse=True): return False return False
0
57
mbpp
def monotonic(l: list): if l == sorted(l) or l == sorted(l, reverse=True): return True return False
transformation_false_true_variable
def monotonic(l: list): if l == sorted(l) or l == sorted(l, reverse=True): return True return True
0
57
mbpp
def monotonic(l: list): if l == sorted(l) or l == sorted(l, reverse=True): return True return False
transformation_or_and_variable
def monotonic(l: list): if l == sorted(l) and l == sorted(l, reverse=True): return True return False
0
57
mbpp
def monotonic(l: list): if l == sorted(l) or l == sorted(l, reverse=True): 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
57
mbpp
def monotonic(l: list): if l == sorted(l) or l == sorted(l, reverse=True): 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
57
mbpp
def monotonic(l: list): if l == sorted(l) or l == sorted(l, reverse=True): 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
57
mbpp
def monotonic(l: list): if l == sorted(l) or l == sorted(l, reverse=True): 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
57
mbpp
def monotonic(l: list): if l == sorted(l) or l == sorted(l, reverse=True): 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
57
mbpp
def common(l1: list, l2: list): ret = set() for e1 in l1: for e2 in l2: if e1 == e2: ret.add(e1) return sorted(list(ret))
transformation_dead_code_insert
def common(l1: list, l2: list): ret = set() for e1 in l1: for e2 in l2: _i_1 = 0 if _i_1 < _i_1: ret = set() if e1 == e2: ret.add(e1) return sorted(list(ret))
1
58
mbpp
def common(l1: list, l2: list): ret = set() for e1 in l1: for e2 in l2: if e1 == e2: ret.add(e1) return sorted(list(ret))
transformation_for_while_loop
def common(l1: list, l2: list): ret = set() _e1_i = 0 while _e1_i < len(l1): e1 = l1[_e1_i] for e2 in l2: if e1 == e2: ret.add(e1) _e1_i += 1 return sorted(list(ret))
1
58
mbpp
def common(l1: list, l2: list): ret = set() for e1 in l1: for e2 in l2: if e1 == e2: ret.add(e1) return sorted(list(ret))
transformation_operand_swap
def common(l1: list, l2: list): ret = set() for e1 in l1: for e2 in l2: if e2 == e1: ret.add(e1) return sorted(list(ret))
1
58
mbpp
def common(l1: list, l2: list): ret = set() for e1 in l1: for e2 in l2: if e1 == e2: ret.add(e1) return sorted(list(ret))
transformation_rename_variable_cb
def common(l1: list, l2: list): ret = set() for e in l1: for e2 in l2: if e == e2: ret.add(e) return sorted(list(ret))
1
58
mbpp
def common(l1: list, l2: list): ret = set() for e1 in l1: for e2 in l2: if e1 == e2: ret.add(e1) return sorted(list(ret))
transformation_rename_variable_naive
def common(l1: list, l2: list): ret = set() for VAR_0 in l1: for e2 in l2: if VAR_0 == e2: ret.add(VAR_0) return sorted(list(ret))
1
58
mbpp
def common(l1: list, l2: list): ret = set() for e1 in l1: for e2 in l2: if e1 == e2: ret.add(e1) return sorted(list(ret))
transformation_rename_variable_rn
def common(l1: list, l2: list): OR3 = set() for e1 in l1: for e2 in l2: if e1 == e2: OR3.add(e1) return sorted(list(OR3))
1
58
mbpp
def common(l1: list, l2: list): ret = set() for e1 in l1: for e2 in l2: if e1 == e2: ret.add(e1) return sorted(list(ret))
transformation_equalto_exclamation_variable
def common(l1: list, l2: list): ret = set() for e1 in l1: for e2 in l2: if e1 != e2: ret.add(e1) return sorted(list(ret))
0
58
mbpp
def common(l1: list, l2: list): ret = set() for e1 in l1: for e2 in l2: if e1 == e2: ret.add(e1) return sorted(list(ret))
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
58
mbpp
def common(l1: list, l2: list): ret = set() for e1 in l1: for e2 in l2: if e1 == e2: ret.add(e1) return sorted(list(ret))
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
58
mbpp
def common(l1: list, l2: list): ret = set() for e1 in l1: for e2 in l2: if e1 == e2: ret.add(e1) return sorted(list(ret))
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
58
mbpp
def common(l1: list, l2: list): ret = set() for e1 in l1: for e2 in l2: if e1 == e2: ret.add(e1) return sorted(list(ret))
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
58
mbpp
def common(l1: list, l2: list): ret = set() for e1 in l1: for e2 in l2: if e1 == e2: ret.add(e1) return sorted(list(ret))
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
58
mbpp
def derivative(xs: list): """ xs represent coefficients of a polynomial. xs[0] + xs[1] * x + xs[2] * x^2 + .... Return derivative of this polynomial in the same form. >>> derivative([3, 1, 2, 4, 5]) [1, 4, 12, 20] >>> derivative([1, 2, 3]) [2, 6] """ return [(i * x) for i, x in enumerate(xs)][1:]
transformation_add_sub_variable
def derivative(xs: list): """ xs represent coefficients of a polynomial. xs[0] - xs[1] * x + xs[2] * x^2 + .... Return derivative of this polynomial in the same form. >>> derivative([3, 1, 2, 4, 5]) [1, 4, 12, 20] >>> derivative([1, 2, 3]) [2, 6] """ return [(i * x) for i, x in enumerate(xs)][1:]
0
62
mbpp
def derivative(xs: list): """ xs represent coefficients of a polynomial. xs[0] + xs[1] * x + xs[2] * x^2 + .... Return derivative of this polynomial in the same form. >>> derivative([3, 1, 2, 4, 5]) [1, 4, 12, 20] >>> derivative([1, 2, 3]) [2, 6] """ return [(i * x) for i, x in enumerate(xs)][1:]
transformation_mul_div_variable
def derivative(xs: list): """ xs represent coefficients of a polynomial. xs[0] + xs[1] / x + xs[2] * x^2 + .... Return derivative of this polynomial in the same form. >>> derivative([3, 1, 2, 4, 5]) [1, 4, 12, 20] >>> derivative([1, 2, 3]) [2, 6] """ return [(i * x) for i, x in enumerate(xs)][1:]
0
62
mbpp
def derivative(xs: list): """ xs represent coefficients of a polynomial. xs[0] + xs[1] * x + xs[2] * x^2 + .... Return derivative of this polynomial in the same form. >>> derivative([3, 1, 2, 4, 5]) [1, 4, 12, 20] >>> derivative([1, 2, 3]) [2, 6] """ return [(i * x) for i, x in enumerate(xs)][1:]
transformation_greater_lesser_variable
def derivative(xs: list): """ xs represent coefficients of a polynomial. xs[0] + xs[1] * x + xs[2] * x^2 + .... Return derivative of this polynomial in the same form. <>> derivative([3, 1, 2, 4, 5]) [1, 4, 12, 20] >>> derivative([1, 2, 3]) [2, 6] """ return [(i * x) for i, x in enumerate(xs)][1:]
0
62
mbpp
def derivative(xs: list): """ xs represent coefficients of a polynomial. xs[0] + xs[1] * x + xs[2] * x^2 + .... Return derivative of this polynomial in the same form. >>> derivative([3, 1, 2, 4, 5]) [1, 4, 12, 20] >>> derivative([1, 2, 3]) [2, 6] """ return [(i * x) for i, x in enumerate(xs)][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
62
mbpp
def derivative(xs: list): """ xs represent coefficients of a polynomial. xs[0] + xs[1] * x + xs[2] * x^2 + .... Return derivative of this polynomial in the same form. >>> derivative([3, 1, 2, 4, 5]) [1, 4, 12, 20] >>> derivative([1, 2, 3]) [2, 6] """ return [(i * x) for i, x in enumerate(xs)][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
62
mbpp
def derivative(xs: list): """ xs represent coefficients of a polynomial. xs[0] + xs[1] * x + xs[2] * x^2 + .... Return derivative of this polynomial in the same form. >>> derivative([3, 1, 2, 4, 5]) [1, 4, 12, 20] >>> derivative([1, 2, 3]) [2, 6] """ return [(i * x) for i, x in enumerate(xs)][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
62
mbpp
def derivative(xs: list): """ xs represent coefficients of a polynomial. xs[0] + xs[1] * x + xs[2] * x^2 + .... Return derivative of this polynomial in the same form. >>> derivative([3, 1, 2, 4, 5]) [1, 4, 12, 20] >>> derivative([1, 2, 3]) [2, 6] """ return [(i * x) for i, x in enumerate(xs)][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
62
mbpp
def derivative(xs: list): """ xs represent coefficients of a polynomial. xs[0] + xs[1] * x + xs[2] * x^2 + .... Return derivative of this polynomial in the same form. >>> derivative([3, 1, 2, 4, 5]) [1, 4, 12, 20] >>> derivative([1, 2, 3]) [2, 6] """ return [(i * x) for i, x in enumerate(xs)][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
62
mbpp
FIX = """ Add more test cases. """ def vowels_count(s): vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[-1] == 'y' or s[-1] == 'Y': n_vowels += 1 return n_vowels
transformation_dead_code_insert
for _i_0 in range(0): n_vowels = sum(c in vowels for c in s) FIX = """ Add more test cases. """ def vowels_count(s): vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[-1] == "y" or s[-1] == "Y": n_vowels += 1 return n_vowels
1
64
mbpp
FIX = """ Add more test cases. """ def vowels_count(s): vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[-1] == 'y' or s[-1] == 'Y': n_vowels += 1 return n_vowels
transformation_for_while_loop
FIX = """ Add more test cases. """ def vowels_count(s): vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[-1] == "y" or s[-1] == "Y": n_vowels += 1 return n_vowels
1
64
mbpp
FIX = """ Add more test cases. """ def vowels_count(s): vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[-1] == 'y' or s[-1] == 'Y': n_vowels += 1 return n_vowels
transformation_operand_swap
FIX = """ Add more test cases. """ def vowels_count(s): vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if "y" == s[-1] or s[-1] == "Y": n_vowels += 1 return n_vowels
1
64
mbpp
FIX = """ Add more test cases. """ def vowels_count(s): vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[-1] == 'y' or s[-1] == 'Y': n_vowels += 1 return n_vowels
transformation_rename_variable_cb
FIX = """ Add more test cases. """ def vowels_count(vowel): vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in vowel) if vowel[-1] == "y" or vowel[-1] == "Y": n_vowels += 1 return n_vowels
1
64
mbpp
FIX = """ Add more test cases. """ def vowels_count(s): vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[-1] == 'y' or s[-1] == 'Y': n_vowels += 1 return n_vowels
transformation_rename_variable_naive
FIX = """ Add more test cases. """ def vowels_count(VAR_0): vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in VAR_0) if VAR_0[-1] == "y" or VAR_0[-1] == "Y": n_vowels += 1 return n_vowels
1
64
mbpp
FIX = """ Add more test cases. """ def vowels_count(s): vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[-1] == 'y' or s[-1] == 'Y': n_vowels += 1 return n_vowels
transformation_rename_variable_rn
FIX = """ Add more test cases. """ def vowels_count(o): vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in o) if o[-1] == "y" or o[-1] == "Y": n_vowels += 1 return n_vowels
1
64
mbpp
FIX = """ Add more test cases. """ def vowels_count(s): vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[-1] == 'y' or s[-1] == 'Y': n_vowels += 1 return n_vowels
transformation_add_sub_variable
FIX = """ Add more test cases. """ def vowels_count(s): vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[-1] == 'y' or s[-1] == 'Y': n_vowels -= 1 return n_vowels
0
64
mbpp
FIX = """ Add more test cases. """ def vowels_count(s): vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[-1] == 'y' or s[-1] == 'Y': n_vowels += 1 return n_vowels
transformation_sub_add_variable
FIX = """ Add more test cases. """ def vowels_count(s): vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[+1] == 'y' or s[-1] == 'Y': n_vowels += 1 return n_vowels
0
64
mbpp
FIX = """ Add more test cases. """ def vowels_count(s): vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[-1] == 'y' or s[-1] == 'Y': n_vowels += 1 return n_vowels
transformation_equalto_exclamation_variable
FIX = """ Add more test cases. """ def vowels_count(s): vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[-1] != 'y' or s[-1] == 'Y': n_vowels += 1 return n_vowels
0
64
mbpp
FIX = """ Add more test cases. """ def vowels_count(s): vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[-1] == 'y' or s[-1] == 'Y': n_vowels += 1 return n_vowels
transformation_or_and_variable
FIX = """ Add more test cases. """ def vowels_count(s): vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[-1] == 'y' and s[-1] == 'Y': n_vowels += 1 return n_vowels
0
64
mbpp
FIX = """ Add more test cases. """ def vowels_count(s): vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[-1] == 'y' or s[-1] == 'Y': n_vowels += 1 return n_vowels
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
64
mbpp
FIX = """ Add more test cases. """ def vowels_count(s): vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[-1] == 'y' or s[-1] == 'Y': n_vowels += 1 return n_vowels
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
64
mbpp
FIX = """ Add more test cases. """ def vowels_count(s): vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[-1] == 'y' or s[-1] == 'Y': n_vowels += 1 return n_vowels
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
64
mbpp
FIX = """ Add more test cases. """ def vowels_count(s): vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[-1] == 'y' or s[-1] == 'Y': n_vowels += 1 return n_vowels
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
64
mbpp
FIX = """ Add more test cases. """ def vowels_count(s): vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[-1] == 'y' or s[-1] == 'Y': n_vowels += 1 return n_vowels
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
64
mbpp
def pluck(arr): if(len(arr) == 0): return [] evens = list(filter(lambda x: x%2 == 0, arr)) if(evens == []): return [] return [min(evens), arr.index(min(evens))]
transformation_dead_code_insert
def pluck(arr): if len(arr) == 0: return [] _i_1 = 0 while _i_1 > _i_1: evens = list(filter(lambda x: x % 2 == 0, arr)) evens = list(filter(lambda x: x % 2 == 0, arr)) if evens == []: return [] return [min(evens), arr.index(min(evens))]
1
68
mbpp
def pluck(arr): if(len(arr) == 0): return [] evens = list(filter(lambda x: x%2 == 0, arr)) if(evens == []): return [] return [min(evens), arr.index(min(evens))]
transformation_for_while_loop
def pluck(arr): if len(arr) == 0: return [] evens = list(filter(lambda x: x % 2 == 0, arr)) if evens == []: return [] return [min(evens), arr.index(min(evens))]
1
68
mbpp
def pluck(arr): if(len(arr) == 0): return [] evens = list(filter(lambda x: x%2 == 0, arr)) if(evens == []): return [] return [min(evens), arr.index(min(evens))]
transformation_operand_swap
def pluck(arr): if 0 == len(arr): return [] evens = list(filter(lambda x: x % 2 == 0, arr)) if evens == []: return [] return [min(evens), arr.index(min(evens))]
1
68
mbpp
def pluck(arr): if(len(arr) == 0): return [] evens = list(filter(lambda x: x%2 == 0, arr)) if(evens == []): return [] return [min(evens), arr.index(min(evens))]
transformation_rename_variable_cb
def pluck(x2): if len(x2) == 0: return [] evens = list(filter(lambda x: x % 2 == 0, x2)) if evens == []: return [] return [min(evens), x2.index(min(evens))]
1
68
mbpp
def pluck(arr): if(len(arr) == 0): return [] evens = list(filter(lambda x: x%2 == 0, arr)) if(evens == []): return [] return [min(evens), arr.index(min(evens))]
transformation_rename_variable_naive
def pluck(VAR_0): if len(VAR_0) == 0: return [] evens = list(filter(lambda x: x % 2 == 0, VAR_0)) if evens == []: return [] return [min(evens), VAR_0.index(min(evens))]
1
68
mbpp
def pluck(arr): if(len(arr) == 0): return [] evens = list(filter(lambda x: x%2 == 0, arr)) if(evens == []): return [] return [min(evens), arr.index(min(evens))]
transformation_rename_variable_rn
def pluck(arr): if len(arr) == 0: return [] Yw475 = list(filter(lambda x: x % 2 == 0, arr)) if Yw475 == []: return [] return [min(Yw475), arr.index(min(Yw475))]
1
68
mbpp
def pluck(arr): if(len(arr) == 0): return [] evens = list(filter(lambda x: x%2 == 0, arr)) if(evens == []): return [] return [min(evens), arr.index(min(evens))]
transformation_equalto_exclamation_variable
def pluck(arr): if(len(arr) != 0): return [] evens = list(filter(lambda x: x%2 == 0, arr)) if(evens == []): return [] return [min(evens), arr.index(min(evens))]
0
68
mbpp
def pluck(arr): if(len(arr) == 0): return [] evens = list(filter(lambda x: x%2 == 0, arr)) if(evens == []): return [] return [min(evens), arr.index(min(evens))]
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
68
mbpp
def pluck(arr): if(len(arr) == 0): return [] evens = list(filter(lambda x: x%2 == 0, arr)) if(evens == []): return [] return [min(evens), arr.index(min(evens))]
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
68
mbpp
def pluck(arr): if(len(arr) == 0): return [] evens = list(filter(lambda x: x%2 == 0, arr)) if(evens == []): return [] return [min(evens), arr.index(min(evens))]
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
68
mbpp
def pluck(arr): if(len(arr) == 0): return [] evens = list(filter(lambda x: x%2 == 0, arr)) if(evens == []): return [] return [min(evens), arr.index(min(evens))]
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
68
mbpp
def pluck(arr): if(len(arr) == 0): return [] evens = list(filter(lambda x: x%2 == 0, arr)) if(evens == []): return [] return [min(evens), arr.index(min(evens))]
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
68
mbpp
def triangle_area(a, b, c): if a + b <= c or a + c <= b or b + c <= a: return -1 s = (a + b + c)/2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
transformation_dead_code_insert
def triangle_area(a, b, c): if a + b <= c or a + c <= b or b + c <= a: _i_3 = 0 if _i_3 < _i_3: s = (a + b + c) / 2 return -1 s = (a + b + c) / 2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
1
71
mbpp
def triangle_area(a, b, c): if a + b <= c or a + c <= b or b + c <= a: return -1 s = (a + b + c)/2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
transformation_for_while_loop
def triangle_area(a, b, c): if a + b <= c or a + c <= b or b + c <= a: return -1 s = (a + b + c) / 2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
1
71
mbpp
def triangle_area(a, b, c): if a + b <= c or a + c <= b or b + c <= a: return -1 s = (a + b + c)/2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
transformation_operand_swap
def triangle_area(a, b, c): if a + b <= c or a + c <= b or a >= b + c: return -1 s = (a + b + c) / 2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
1
71
mbpp
def triangle_area(a, b, c): if a + b <= c or a + c <= b or b + c <= a: return -1 s = (a + b + c)/2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
transformation_rename_variable_cb
def triangle_area(a, b2, c): if a + b2 <= c or a + c <= b2 or b2 + c <= a: return -1 s = (a + b2 + c) / 2 area = (s * (s - a) * (s - b2) * (s - c)) ** 0.5 area = round(area, 2) return area
1
71
mbpp
def triangle_area(a, b, c): if a + b <= c or a + c <= b or b + c <= a: return -1 s = (a + b + c)/2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
transformation_rename_variable_naive
def triangle_area(VAR_0, b, c): if VAR_0 + b <= c or VAR_0 + c <= b or b + c <= VAR_0: return -1 s = (VAR_0 + b + c) / 2 area = (s * (s - VAR_0) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
1
71
mbpp
def triangle_area(a, b, c): if a + b <= c or a + c <= b or b + c <= a: return -1 s = (a + b + c)/2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
transformation_rename_variable_rn
def triangle_area(r, b, c): if r + b <= c or r + c <= b or b + c <= r: return -1 s = (r + b + c) / 2 area = (s * (s - r) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
1
71
mbpp
def triangle_area(a, b, c): if a + b <= c or a + c <= b or b + c <= a: return -1 s = (a + b + c)/2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
transformation_add_sub_variable
def triangle_area(a, b, c): if a - b <= c or a + c <= b or b + c <= a: return -1 s = (a + b + c)/2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
0
71
mbpp
def triangle_area(a, b, c): if a + b <= c or a + c <= b or b + c <= a: return -1 s = (a + b + c)/2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
transformation_sub_add_variable
def triangle_area(a, b, c): if a + b <= c or a + c <= b or b + c <= a: return +1 s = (a + b + c)/2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
0
71
mbpp
def triangle_area(a, b, c): if a + b <= c or a + c <= b or b + c <= a: return -1 s = (a + b + c)/2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
transformation_mul_div_variable
def triangle_area(a, b, c): if a + b <= c or a + c <= b or b + c <= a: return -1 s = (a + b + c)/2 area = (s / (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
0
71
mbpp
def triangle_area(a, b, c): if a + b <= c or a + c <= b or b + c <= a: return -1 s = (a + b + c)/2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
transformation_div_mul_variable
def triangle_area(a, b, c): if a + b <= c or a + c <= b or b + c <= a: return -1 s = (a + b + c)*2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
0
71
mbpp
def triangle_area(a, b, c): if a + b <= c or a + c <= b or b + c <= a: return -1 s = (a + b + c)/2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
transformation_lesser_greater_variable
def triangle_area(a, b, c): if a + b >= c or a + c <= b or b + c <= a: return -1 s = (a + b + c)/2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
0
71
mbpp
def triangle_area(a, b, c): if a + b <= c or a + c <= b or b + c <= a: return -1 s = (a + b + c)/2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
transformation_or_and_variable
def triangle_area(a, b, c): if a + b <= c and a + c <= b or b + c <= a: return -1 s = (a + b + c)/2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
0
71
mbpp
def triangle_area(a, b, c): if a + b <= c or a + c <= b or b + c <= a: return -1 s = (a + b + c)/2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
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
71
mbpp
def triangle_area(a, b, c): if a + b <= c or a + c <= b or b + c <= a: return -1 s = (a + b + c)/2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
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
71
mbpp
def triangle_area(a, b, c): if a + b <= c or a + c <= b or b + c <= a: return -1 s = (a + b + c)/2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
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
71
mbpp
def triangle_area(a, b, c): if a + b <= c or a + c <= b or b + c <= a: return -1 s = (a + b + c)/2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
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
71
mbpp
def triangle_area(a, b, c): if a + b <= c or a + c <= b or b + c <= a: return -1 s = (a + b + c)/2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
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
71
mbpp
def is_multiply_prime(a): def is_prime(n): for j in range(2,n): if n%j == 0: return False return True for i in range(2,101): if not is_prime(i): continue for j in range(2,101): if not is_prime(j): continue for k in range(2,101): if not is_prime(k): continue if i*j*k == a: return True return False
transformation_dead_code_insert
def is_multiply_prime(a): def is_prime(n): for j in range(2, n): _i_6 = 0 if _i_6 > _i_6: return False if n % j == 0: return False return True for i in range(2, 101): if not is_prime(i): continue for j in range(2, 101): if not is_prime(j): continue for k in range(2, 101): if not is_prime(k): continue if i * j * k == a: return True return False
1
75
mbpp
def is_multiply_prime(a): def is_prime(n): for j in range(2,n): if n%j == 0: return False return True for i in range(2,101): if not is_prime(i): continue for j in range(2,101): if not is_prime(j): continue for k in range(2,101): if not is_prime(k): continue if i*j*k == a: return True return False
transformation_for_while_loop
def is_multiply_prime(a): def is_prime(n): for j in range(2, n): if n % j == 0: return False return True i = 2 while i < 101: if not is_prime(i): continue for j in range(2, 101): if not is_prime(j): continue for k in range(2, 101): if not is_prime(k): continue if i * j * k == a: return True i += 1 return False
1
75
mbpp
def is_multiply_prime(a): def is_prime(n): for j in range(2,n): if n%j == 0: return False return True for i in range(2,101): if not is_prime(i): continue for j in range(2,101): if not is_prime(j): continue for k in range(2,101): if not is_prime(k): continue if i*j*k == a: return True return False
transformation_operand_swap
def is_multiply_prime(a): def is_prime(n): for j in range(2, n): if 0 == n % j: return False return True for i in range(2, 101): if not is_prime(i): continue for j in range(2, 101): if not is_prime(j): continue for k in range(2, 101): if not is_prime(k): continue if i * j * k == a: return True return False
1
75
mbpp
def is_multiply_prime(a): def is_prime(n): for j in range(2,n): if n%j == 0: return False return True for i in range(2,101): if not is_prime(i): continue for j in range(2,101): if not is_prime(j): continue for k in range(2,101): if not is_prime(k): continue if i*j*k == a: return True return False
transformation_rename_variable_cb
def is_multiply_prime(a): def is_prime(n): for i2 in range(2, n): if n % i2 == 0: return False return True for i in range(2, 101): if not is_prime(i): continue for i2 in range(2, 101): if not is_prime(i2): continue for k in range(2, 101): if not is_prime(k): continue if i * i2 * k == a: return True return False
1
75
mbpp
def is_multiply_prime(a): def is_prime(n): for j in range(2,n): if n%j == 0: return False return True for i in range(2,101): if not is_prime(i): continue for j in range(2,101): if not is_prime(j): continue for k in range(2,101): if not is_prime(k): continue if i*j*k == a: return True return False
transformation_rename_variable_naive
def is_multiply_prime(a): def is_prime(n): for VAR_0 in range(2, n): if n % VAR_0 == 0: return False return True for i in range(2, 101): if not is_prime(i): continue for VAR_0 in range(2, 101): if not is_prime(VAR_0): continue for k in range(2, 101): if not is_prime(k): continue if i * VAR_0 * k == a: return True return False
1
75
mbpp
def is_multiply_prime(a): def is_prime(n): for j in range(2,n): if n%j == 0: return False return True for i in range(2,101): if not is_prime(i): continue for j in range(2,101): if not is_prime(j): continue for k in range(2,101): if not is_prime(k): continue if i*j*k == a: return True return False
transformation_rename_variable_rn
def is_multiply_prime(a): def is_prime(n): for x in range(2, n): if n % x == 0: return False return True for i in range(2, 101): if not is_prime(i): continue for x in range(2, 101): if not is_prime(x): continue for k in range(2, 101): if not is_prime(k): continue if i * x * k == a: return True return False
1
75
mbpp
def is_multiply_prime(a): def is_prime(n): for j in range(2,n): if n%j == 0: return False return True for i in range(2,101): if not is_prime(i): continue for j in range(2,101): if not is_prime(j): continue for k in range(2,101): if not is_prime(k): continue if i*j*k == a: return True return False
transformation_mul_div_variable
def is_multiply_prime(a): def is_prime(n): for j in range(2,n): if n%j == 0: return False return True for i in range(2,101): if not is_prime(i): continue for j in range(2,101): if not is_prime(j): continue for k in range(2,101): if not is_prime(k): continue if i/j*k == a: return True return False
0
75
mbpp
def is_multiply_prime(a): def is_prime(n): for j in range(2,n): if n%j == 0: return False return True for i in range(2,101): if not is_prime(i): continue for j in range(2,101): if not is_prime(j): continue for k in range(2,101): if not is_prime(k): continue if i*j*k == a: return True return False
transformation_equalto_exclamation_variable
def is_multiply_prime(a): def is_prime(n): for j in range(2,n): if n%j != 0: return False return True for i in range(2,101): if not is_prime(i): continue for j in range(2,101): if not is_prime(j): continue for k in range(2,101): if not is_prime(k): continue if i*j*k == a: return True return False
0
75
mbpp
def is_multiply_prime(a): def is_prime(n): for j in range(2,n): if n%j == 0: return False return True for i in range(2,101): if not is_prime(i): continue for j in range(2,101): if not is_prime(j): continue for k in range(2,101): if not is_prime(k): continue if i*j*k == a: return True return False
transformation_true_false_variable
def is_multiply_prime(a): def is_prime(n): for j in range(2,n): if n%j == 0: return False return False for i in range(2,101): if not is_prime(i): continue for j in range(2,101): if not is_prime(j): continue for k in range(2,101): if not is_prime(k): continue if i*j*k == a: return True return False
0
75
mbpp
def is_multiply_prime(a): def is_prime(n): for j in range(2,n): if n%j == 0: return False return True for i in range(2,101): if not is_prime(i): continue for j in range(2,101): if not is_prime(j): continue for k in range(2,101): if not is_prime(k): continue if i*j*k == a: return True return False
transformation_false_true_variable
def is_multiply_prime(a): def is_prime(n): for j in range(2,n): if n%j == 0: return True return True for i in range(2,101): if not is_prime(i): continue for j in range(2,101): if not is_prime(j): continue for k in range(2,101): if not is_prime(k): continue if i*j*k == a: return True return False
0
75
mbpp
def is_multiply_prime(a): def is_prime(n): for j in range(2,n): if n%j == 0: return False return True for i in range(2,101): if not is_prime(i): continue for j in range(2,101): if not is_prime(j): continue for k in range(2,101): if not is_prime(k): continue if i*j*k == a: 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
75
mbpp
def is_multiply_prime(a): def is_prime(n): for j in range(2,n): if n%j == 0: return False return True for i in range(2,101): if not is_prime(i): continue for j in range(2,101): if not is_prime(j): continue for k in range(2,101): if not is_prime(k): continue if i*j*k == a: 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
75
mbpp
def is_multiply_prime(a): def is_prime(n): for j in range(2,n): if n%j == 0: return False return True for i in range(2,101): if not is_prime(i): continue for j in range(2,101): if not is_prime(j): continue for k in range(2,101): if not is_prime(k): continue if i*j*k == a: 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
75
mbpp