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 |
|---|---|---|---|---|---|
from typing import List, Tuple
def sum_product(numbers: List[int]) -> Tuple[int, int]:
sum_value = 0
prod_value = 1
for n in numbers:
sum_value += n
prod_value *= n
return sum_value, prod_value | transformation_for_while_loop | from typing import List, Tuple
def sum_product(numbers: List[int]) -> Tuple[int, int]:
sum_value = 0
prod_value = 1
_n_i = 0
while _n_i < len(numbers):
n = numbers[_n_i]
sum_value += n
prod_value *= n
_n_i += 1
return sum_value, prod_value | 1 | 8 | mbpp |
from typing import List, Tuple
def sum_product(numbers: List[int]) -> Tuple[int, int]:
sum_value = 0
prod_value = 1
for n in numbers:
sum_value += n
prod_value *= n
return sum_value, prod_value | transformation_operand_swap | from typing import List, Tuple
def sum_product(numbers: List[int]) -> Tuple[int, int]:
sum_value = 0
prod_value = 1
for n in numbers:
sum_value += n
prod_value *= n
return sum_value, prod_value | 1 | 8 | mbpp |
from typing import List, Tuple
def sum_product(numbers: List[int]) -> Tuple[int, int]:
sum_value = 0
prod_value = 1
for n in numbers:
sum_value += n
prod_value *= n
return sum_value, prod_value | transformation_rename_variable_cb | from typing import List, Tuple
def sum_product(numbers: List[int]) -> Tuple[int, int]:
sum_value = 0
n2 = 1
for n in numbers:
sum_value += n
n2 *= n
return sum_value, n2 | 1 | 8 | mbpp |
from typing import List, Tuple
def sum_product(numbers: List[int]) -> Tuple[int, int]:
sum_value = 0
prod_value = 1
for n in numbers:
sum_value += n
prod_value *= n
return sum_value, prod_value | transformation_rename_variable_naive | from typing import List, Tuple
def sum_product(numbers: List[int]) -> Tuple[int, int]:
VAR_0 = 0
prod_value = 1
for n in numbers:
VAR_0 += n
prod_value *= n
return VAR_0, prod_value | 1 | 8 | mbpp |
from typing import List, Tuple
def sum_product(numbers: List[int]) -> Tuple[int, int]:
sum_value = 0
prod_value = 1
for n in numbers:
sum_value += n
prod_value *= n
return sum_value, prod_value | transformation_rename_variable_rn | from typing import List, Tuple
def sum_product(numbers: List[int]) -> Tuple[int, int]:
sum_value = 0
prod_value = 1
for F in numbers:
sum_value += F
prod_value *= F
return sum_value, prod_value | 1 | 8 | mbpp |
from typing import List, Tuple
def sum_product(numbers: List[int]) -> Tuple[int, int]:
sum_value = 0
prod_value = 1
for n in numbers:
sum_value += n
prod_value *= n
return sum_value, prod_value | transformation_add_sub_variable | from typing import List, Tuple
def sum_product(numbers: List[int]) -> Tuple[int, int]:
sum_value = 0
prod_value = 1
for n in numbers:
sum_value -= n
prod_value *= n
return sum_value, prod_value | 0 | 8 | mbpp |
from typing import List, Tuple
def sum_product(numbers: List[int]) -> Tuple[int, int]:
sum_value = 0
prod_value = 1
for n in numbers:
sum_value += n
prod_value *= n
return sum_value, prod_value | transformation_sub_add_variable | from typing import List, Tuple
def sum_product(numbers: List[int]) +> Tuple[int, int]:
sum_value = 0
prod_value = 1
for n in numbers:
sum_value += n
prod_value *= n
return sum_value, prod_value | 0 | 8 | mbpp |
from typing import List, Tuple
def sum_product(numbers: List[int]) -> Tuple[int, int]:
sum_value = 0
prod_value = 1
for n in numbers:
sum_value += n
prod_value *= n
return sum_value, prod_value | transformation_mul_div_variable | from typing import List, Tuple
def sum_product(numbers: List[int]) -> Tuple[int, int]:
sum_value = 0
prod_value = 1
for n in numbers:
sum_value += n
prod_value /= n
return sum_value, prod_value | 0 | 8 | mbpp |
from typing import List, Tuple
def sum_product(numbers: List[int]) -> Tuple[int, int]:
sum_value = 0
prod_value = 1
for n in numbers:
sum_value += n
prod_value *= n
return sum_value, prod_value | transformation_greater_lesser_variable | from typing import List, Tuple
def sum_product(numbers: List[int]) -< Tuple[int, int]:
sum_value = 0
prod_value = 1
for n in numbers:
sum_value += n
prod_value *= n
return sum_value, prod_value | 0 | 8 | mbpp |
from typing import List, Tuple
def sum_product(numbers: List[int]) -> Tuple[int, int]:
sum_value = 0
prod_value = 1
for n in numbers:
sum_value += n
prod_value *= n
return sum_value, prod_value | 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 | 8 | mbpp |
from typing import List, Tuple
def sum_product(numbers: List[int]) -> Tuple[int, int]:
sum_value = 0
prod_value = 1
for n in numbers:
sum_value += n
prod_value *= n
return sum_value, prod_value | 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 | 8 | mbpp |
from typing import List, Tuple
def sum_product(numbers: List[int]) -> Tuple[int, int]:
sum_value = 0
prod_value = 1
for n in numbers:
sum_value += n
prod_value *= n
return sum_value, prod_value | 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 | 8 | mbpp |
from typing import List, Tuple
def sum_product(numbers: List[int]) -> Tuple[int, int]:
sum_value = 0
prod_value = 1
for n in numbers:
sum_value += n
prod_value *= n
return sum_value, prod_value | 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 | 8 | mbpp |
from typing import List, Tuple
def sum_product(numbers: List[int]) -> Tuple[int, int]:
sum_value = 0
prod_value = 1
for n in numbers:
sum_value += n
prod_value *= n
return sum_value, prod_value | 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 | 8 | mbpp |
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
return result | transformation_dead_code_insert | from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
running_max = None
for _i_4 in range(0):
from typing import List, Tuple
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
running_max = m... | 1 | 9 | mbpp |
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
return result | transformation_for_while_loop | from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
running_max = None
result = []
_n_i = 0
while _n_i < len(numbers):
n = numbers[_n_i]
if running_max is None:
running_max = n
else:
running_max = max(running_max, n... | 1 | 9 | mbpp |
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
return result | transformation_operand_swap | from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
return ... | 1 | 9 | mbpp |
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
return result | transformation_rename_variable_cb | from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
n2 = None
result = []
for n in numbers:
if n2 is None:
n2 = n
else:
n2 = max(n2, n)
result.append(n2)
return result | 1 | 9 | mbpp |
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
return result | transformation_rename_variable_naive | from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
VAR_0 = None
result = []
for n in numbers:
if VAR_0 is None:
VAR_0 = n
else:
VAR_0 = max(VAR_0, n)
result.append(VAR_0)
return result | 1 | 9 | mbpp |
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
return result | transformation_rename_variable_rn | from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
YMt6s5h1F16 = None
result = []
for n in numbers:
if YMt6s5h1F16 is None:
YMt6s5h1F16 = n
else:
YMt6s5h1F16 = max(YMt6s5h1F16, n)
result.append(YMt6s5h1F16)
return ... | 1 | 9 | mbpp |
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
return result | transformation_sub_add_variable | from typing import List, Tuple
def rolling_max(numbers: List[int]) +> List[int]:
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
return result | 0 | 9 | mbpp |
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
return result | transformation_greater_lesser_variable | from typing import List, Tuple
def rolling_max(numbers: List[int]) -< List[int]:
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
return result | 0 | 9 | mbpp |
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
return result | transformation_is_isnot_variable | from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
running_max = None
result = []
for n in numbers:
if running_max is not None:
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
return result | 0 | 9 | mbpp |
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
return result | 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 | 9 | mbpp |
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
return result | 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 | 9 | mbpp |
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
return result | 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 | 9 | mbpp |
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
return result | 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 | 9 | mbpp |
from typing import List, Tuple
def rolling_max(numbers: List[int]) -> List[int]:
running_max = None
result = []
for n in numbers:
if running_max is None:
running_max = n
else:
running_max = max(running_max, n)
result.append(running_max)
return result | 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 | 9 | mbpp |
def greatest_common_divisor(a: int, b: int) -> int:
while b:
a, b = b, a % b
return a | transformation_dead_code_insert | def greatest_common_divisor(a: int, b: int) -> int:
while b:
_i_3 = 0
if _i_3 < _i_3:
a, b = b, a % b
a, b = b, a % b
return a | 1 | 13 | mbpp |
def greatest_common_divisor(a: int, b: int) -> int:
while b:
a, b = b, a % b
return a | transformation_for_while_loop | def greatest_common_divisor(a: int, b: int) -> int:
while b:
a, b = b, a % b
return a | 1 | 13 | mbpp |
def greatest_common_divisor(a: int, b: int) -> int:
while b:
a, b = b, a % b
return a | transformation_operand_swap | def greatest_common_divisor(a: int, b: int) -> int:
while b:
a, b = b, a % b
return a | 1 | 13 | mbpp |
def greatest_common_divisor(a: int, b: int) -> int:
while b:
a, b = b, a % b
return a | transformation_rename_variable_cb | def greatest_common_divisor(a: int, b2: int) -> int:
while b2:
a, b2 = b2, a % b2
return a | 1 | 13 | mbpp |
def greatest_common_divisor(a: int, b: int) -> int:
while b:
a, b = b, a % b
return a | transformation_rename_variable_naive | def greatest_common_divisor(a: int, VAR_0: int) -> int:
while VAR_0:
a, VAR_0 = VAR_0, a % VAR_0
return a | 1 | 13 | mbpp |
def greatest_common_divisor(a: int, b: int) -> int:
while b:
a, b = b, a % b
return a | transformation_rename_variable_rn | def greatest_common_divisor(a: int, C: int) -> int:
while C:
a, C = C, a % C
return a | 1 | 13 | mbpp |
def greatest_common_divisor(a: int, b: int) -> int:
while b:
a, b = b, a % b
return a | transformation_sub_add_variable | def greatest_common_divisor(a: int, b: int) +> int:
while b:
a, b = b, a % b
return a | 0 | 13 | mbpp |
def greatest_common_divisor(a: int, b: int) -> int:
while b:
a, b = b, a % b
return a | transformation_greater_lesser_variable | def greatest_common_divisor(a: int, b: int) -< int:
while b:
a, b = b, a % b
return a | 0 | 13 | mbpp |
def greatest_common_divisor(a: int, b: int) -> int:
while b:
a, b = b, a % b
return a | 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 | 13 | mbpp |
def greatest_common_divisor(a: int, b: int) -> int:
while b:
a, b = b, a % b
return a | 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 | 13 | mbpp |
def greatest_common_divisor(a: int, b: int) -> int:
while b:
a, b = b, a % b
return a | 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 | 13 | mbpp |
def greatest_common_divisor(a: int, b: int) -> int:
while b:
a, b = b, a % b
return a | 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 | 13 | mbpp |
def greatest_common_divisor(a: int, b: int) -> int:
while b:
a, b = b, a % b
return a | 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 | 13 | mbpp |
from typing import List
def all_prefixes(string: str) -> List[str]:
result = []
for i in range(len(string)):
result.append(string[:i+1])
return result | transformation_dead_code_insert | from typing import List
def all_prefixes(string: str) -> List[str]:
result = []
_i_4 = 0
if _i_4 > _i_4:
result = []
for i in range(len(string)):
result.append(string[: i + 1])
return result | 1 | 14 | mbpp |
from typing import List
def all_prefixes(string: str) -> List[str]:
result = []
for i in range(len(string)):
result.append(string[:i+1])
return result | transformation_for_while_loop | from typing import List
def all_prefixes(string: str) -> List[str]:
result = []
i = 0
while i < len(string):
result.append(string[: i + 1])
i += 1
return result | 1 | 14 | mbpp |
from typing import List
def all_prefixes(string: str) -> List[str]:
result = []
for i in range(len(string)):
result.append(string[:i+1])
return result | transformation_operand_swap | from typing import List
def all_prefixes(string: str) -> List[str]:
result = []
for i in range(len(string)):
result.append(string[: i + 1])
return result | 1 | 14 | mbpp |
from typing import List
def all_prefixes(string: str) -> List[str]:
result = []
for i in range(len(string)):
result.append(string[:i+1])
return result | transformation_rename_variable_cb | from typing import List
def all_prefixes(string: str) -> List[str]:
result2 = []
for i in range(len(string)):
result2.append(string[: i + 1])
return result2 | 1 | 14 | mbpp |
from typing import List
def all_prefixes(string: str) -> List[str]:
result = []
for i in range(len(string)):
result.append(string[:i+1])
return result | transformation_rename_variable_naive | from typing import List
def all_prefixes(string: str) -> List[str]:
VAR_0 = []
for i in range(len(string)):
VAR_0.append(string[: i + 1])
return VAR_0 | 1 | 14 | mbpp |
from typing import List
def all_prefixes(string: str) -> List[str]:
result = []
for i in range(len(string)):
result.append(string[:i+1])
return result | transformation_rename_variable_rn | from typing import List
def all_prefixes(qd6lK7: str) -> List[str]:
result = []
for i in range(len(qd6lK7)):
result.append(qd6lK7[: i + 1])
return result | 1 | 14 | mbpp |
from typing import List
def all_prefixes(string: str) -> List[str]:
result = []
for i in range(len(string)):
result.append(string[:i+1])
return result | transformation_add_sub_variable | from typing import List
def all_prefixes(string: str) -> List[str]:
result = []
for i in range(len(string)):
result.append(string[:i-1])
return result | 0 | 14 | mbpp |
from typing import List
def all_prefixes(string: str) -> List[str]:
result = []
for i in range(len(string)):
result.append(string[:i+1])
return result | transformation_sub_add_variable | from typing import List
def all_prefixes(string: str) +> List[str]:
result = []
for i in range(len(string)):
result.append(string[:i+1])
return result | 0 | 14 | mbpp |
from typing import List
def all_prefixes(string: str) -> List[str]:
result = []
for i in range(len(string)):
result.append(string[:i+1])
return result | transformation_greater_lesser_variable | from typing import List
def all_prefixes(string: str) -< List[str]:
result = []
for i in range(len(string)):
result.append(string[:i+1])
return result | 0 | 14 | mbpp |
from typing import List
def all_prefixes(string: str) -> List[str]:
result = []
for i in range(len(string)):
result.append(string[:i+1])
return result | 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 | 14 | mbpp |
from typing import List
def all_prefixes(string: str) -> List[str]:
result = []
for i in range(len(string)):
result.append(string[:i+1])
return result | 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 | 14 | mbpp |
from typing import List
def all_prefixes(string: str) -> List[str]:
result = []
for i in range(len(string)):
result.append(string[:i+1])
return result | 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 | 14 | mbpp |
from typing import List
def all_prefixes(string: str) -> List[str]:
result = []
for i in range(len(string)):
result.append(string[:i+1])
return result | 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 | 14 | mbpp |
from typing import List
def all_prefixes(string: str) -> List[str]:
result = []
for i in range(len(string)):
result.append(string[:i+1])
return result | 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 | 14 | mbpp |
def count_distinct_characters(string: str) -> int:
""" Given a string, find out how many distinct characters (regardless of case) does it consist of
>>> count_distinct_characters('xyzXYZ')
3
>>> count_distinct_characters('Jerry')
4
"""
return len(set(string.lower())) | transformation_sub_add_variable | def count_distinct_characters(string: str) +> int:
""" Given a string, find out how many distinct characters (regardless of case) does it consist of
>>> count_distinct_characters('xyzXYZ')
3
>>> count_distinct_characters('Jerry')
4
"""
return len(set(string.lower())) | 0 | 16 | mbpp |
def count_distinct_characters(string: str) -> int:
""" Given a string, find out how many distinct characters (regardless of case) does it consist of
>>> count_distinct_characters('xyzXYZ')
3
>>> count_distinct_characters('Jerry')
4
"""
return len(set(string.lower())) | transformation_greater_lesser_variable | def count_distinct_characters(string: str) -< int:
""" Given a string, find out how many distinct characters (regardless of case) does it consist of
>>> count_distinct_characters('xyzXYZ')
3
>>> count_distinct_characters('Jerry')
4
"""
return len(set(string.lower())) | 0 | 16 | mbpp |
def count_distinct_characters(string: str) -> int:
""" Given a string, find out how many distinct characters (regardless of case) does it consist of
>>> count_distinct_characters('xyzXYZ')
3
>>> count_distinct_characters('Jerry')
4
"""
return len(set(string.lower())) | 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 | 16 | mbpp |
def count_distinct_characters(string: str) -> int:
""" Given a string, find out how many distinct characters (regardless of case) does it consist of
>>> count_distinct_characters('xyzXYZ')
3
>>> count_distinct_characters('Jerry')
4
"""
return len(set(string.lower())) | 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 | 16 | mbpp |
def count_distinct_characters(string: str) -> int:
""" Given a string, find out how many distinct characters (regardless of case) does it consist of
>>> count_distinct_characters('xyzXYZ')
3
>>> count_distinct_characters('Jerry')
4
"""
return len(set(string.lower())) | 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 | 16 | mbpp |
def count_distinct_characters(string: str) -> int:
""" Given a string, find out how many distinct characters (regardless of case) does it consist of
>>> count_distinct_characters('xyzXYZ')
3
>>> count_distinct_characters('Jerry')
4
"""
return len(set(string.lower())) | 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 | 16 | mbpp |
def count_distinct_characters(string: str) -> int:
""" Given a string, find out how many distinct characters (regardless of case) does it consist of
>>> count_distinct_characters('xyzXYZ')
3
>>> count_distinct_characters('Jerry')
4
"""
return len(set(string.lower())) | 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 | 16 | mbpp |
from typing import List
def parse_music(music_string: str) -> List[int]:
note_map = {'o': 4, 'o|': 2, '.|': 1}
return [note_map[x] for x in music_string.split(' ') if x] | transformation_dead_code_insert | if False:
return [note_map[x] for x in music_string.split(" ") if x]
from typing import List
def parse_music(music_string: str) -> List[int]:
note_map = {"o": 4, "o|": 2, ".|": 1}
return [note_map[x] for x in music_string.split(" ") if x] | 1 | 17 | mbpp |
from typing import List
def parse_music(music_string: str) -> List[int]:
note_map = {'o': 4, 'o|': 2, '.|': 1}
return [note_map[x] for x in music_string.split(' ') if x] | transformation_for_while_loop | from typing import List
def parse_music(music_string: str) -> List[int]:
note_map = {"o": 4, "o|": 2, ".|": 1}
return [note_map[x] for x in music_string.split(" ") if x] | 1 | 17 | mbpp |
from typing import List
def parse_music(music_string: str) -> List[int]:
note_map = {'o': 4, 'o|': 2, '.|': 1}
return [note_map[x] for x in music_string.split(' ') if x] | transformation_operand_swap | from typing import List
def parse_music(music_string: str) -> List[int]:
note_map = {"o": 4, "o|": 2, ".|": 1}
return [note_map[x] for x in music_string.split(" ") if x] | 1 | 17 | mbpp |
from typing import List
def parse_music(music_string: str) -> List[int]:
note_map = {'o': 4, 'o|': 2, '.|': 1}
return [note_map[x] for x in music_string.split(' ') if x] | transformation_rename_variable_cb | from typing import List
def parse_music(music_string: str) -> List[int]:
note_map = {"o": 4, "o|": 2, ".|": 1}
return [note_map[i] for i in music_string.split(" ") if i] | 1 | 17 | mbpp |
from typing import List
def parse_music(music_string: str) -> List[int]:
note_map = {'o': 4, 'o|': 2, '.|': 1}
return [note_map[x] for x in music_string.split(' ') if x] | transformation_rename_variable_naive | from typing import List
def parse_music(music_string: str) -> List[int]:
note_map = {"o": 4, "o|": 2, ".|": 1}
return [note_map[VAR_0] for VAR_0 in music_string.split(" ") if VAR_0] | 1 | 17 | mbpp |
from typing import List
def parse_music(music_string: str) -> List[int]:
note_map = {'o': 4, 'o|': 2, '.|': 1}
return [note_map[x] for x in music_string.split(' ') if x] | transformation_rename_variable_rn | from typing import List
def parse_music(music_string: str) -> List[int]:
note_map = {"o": 4, "o|": 2, ".|": 1}
return [note_map[O] for O in music_string.split(" ") if O] | 1 | 17 | mbpp |
from typing import List
def parse_music(music_string: str) -> List[int]:
note_map = {'o': 4, 'o|': 2, '.|': 1}
return [note_map[x] for x in music_string.split(' ') if x] | transformation_sub_add_variable | from typing import List
def parse_music(music_string: str) +> List[int]:
note_map = {'o': 4, 'o|': 2, '.|': 1}
return [note_map[x] for x in music_string.split(' ') if x] | 0 | 17 | mbpp |
from typing import List
def parse_music(music_string: str) -> List[int]:
note_map = {'o': 4, 'o|': 2, '.|': 1}
return [note_map[x] for x in music_string.split(' ') if x] | transformation_greater_lesser_variable | from typing import List
def parse_music(music_string: str) -< List[int]:
note_map = {'o': 4, 'o|': 2, '.|': 1}
return [note_map[x] for x in music_string.split(' ') if x] | 0 | 17 | mbpp |
from typing import List
def parse_music(music_string: str) -> List[int]:
note_map = {'o': 4, 'o|': 2, '.|': 1}
return [note_map[x] for x in music_string.split(' ') if x] | 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 | 17 | mbpp |
from typing import List
def parse_music(music_string: str) -> List[int]:
note_map = {'o': 4, 'o|': 2, '.|': 1}
return [note_map[x] for x in music_string.split(' ') if x] | 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 | 17 | mbpp |
from typing import List
def parse_music(music_string: str) -> List[int]:
note_map = {'o': 4, 'o|': 2, '.|': 1}
return [note_map[x] for x in music_string.split(' ') if x] | 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 | 17 | mbpp |
from typing import List
def parse_music(music_string: str) -> List[int]:
note_map = {'o': 4, 'o|': 2, '.|': 1}
return [note_map[x] for x in music_string.split(' ') if x] | 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 | 17 | mbpp |
from typing import List
def parse_music(music_string: str) -> List[int]:
note_map = {'o': 4, 'o|': 2, '.|': 1}
return [note_map[x] for x in music_string.split(' ') if x] | 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 | 17 | mbpp |
from typing import List
def sort_numbers(numbers: str) -> str:
value_map = {
'zero': 0,
'one': 1,
'two': 2,
'three': 3,
'four': 4,
'five': 5,
'six': 6,
'seven': 7,
'eight': 8,
'nine': 9
}
return ' '.join(sorted([x for x in numbe... | transformation_sub_add_variable | from typing import List
def sort_numbers(numbers: str) +> str:
value_map = {
'zero': 0,
'one': 1,
'two': 2,
'three': 3,
'four': 4,
'five': 5,
'six': 6,
'seven': 7,
'eight': 8,
'nine': 9
}
return ' '.join(sorted([x for x in numbe... | 0 | 19 | mbpp |
from typing import List
def sort_numbers(numbers: str) -> str:
value_map = {
'zero': 0,
'one': 1,
'two': 2,
'three': 3,
'four': 4,
'five': 5,
'six': 6,
'seven': 7,
'eight': 8,
'nine': 9
}
return ' '.join(sorted([x for x in numbe... | transformation_greater_lesser_variable | from typing import List
def sort_numbers(numbers: str) -< str:
value_map = {
'zero': 0,
'one': 1,
'two': 2,
'three': 3,
'four': 4,
'five': 5,
'six': 6,
'seven': 7,
'eight': 8,
'nine': 9
}
return ' '.join(sorted([x for x in numbe... | 0 | 19 | mbpp |
from typing import List
def sort_numbers(numbers: str) -> str:
value_map = {
'zero': 0,
'one': 1,
'two': 2,
'three': 3,
'four': 4,
'five': 5,
'six': 6,
'seven': 7,
'eight': 8,
'nine': 9
}
return ' '.join(sorted([x for x in numbe... | 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 | 19 | mbpp |
from typing import List
def sort_numbers(numbers: str) -> str:
value_map = {
'zero': 0,
'one': 1,
'two': 2,
'three': 3,
'four': 4,
'five': 5,
'six': 6,
'seven': 7,
'eight': 8,
'nine': 9
}
return ' '.join(sorted([x for x in numbe... | 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 | 19 | mbpp |
from typing import List
def sort_numbers(numbers: str) -> str:
value_map = {
'zero': 0,
'one': 1,
'two': 2,
'three': 3,
'four': 4,
'five': 5,
'six': 6,
'seven': 7,
'eight': 8,
'nine': 9
}
return ' '.join(sorted([x for x in numbe... | 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 | 19 | mbpp |
from typing import List
def sort_numbers(numbers: str) -> str:
value_map = {
'zero': 0,
'one': 1,
'two': 2,
'three': 3,
'four': 4,
'five': 5,
'six': 6,
'seven': 7,
'eight': 8,
'nine': 9
}
return ' '.join(sorted([x for x in numbe... | 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 | 19 | mbpp |
from typing import List
def sort_numbers(numbers: str) -> str:
value_map = {
'zero': 0,
'one': 1,
'two': 2,
'three': 3,
'four': 4,
'five': 5,
'six': 6,
'seven': 7,
'eight': 8,
'nine': 9
}
return ' '.join(sorted([x for x in numbe... | 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 | 19 | mbpp |
from typing import List, Tuple
def find_closest_elements(numbers: List[float]) -> Tuple[float, float]:
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
... | transformation_dead_code_insert | from typing import List, Tuple
def find_closest_elements(numbers: List[float]) -> Tuple[float, float]:
closest_pair = None
if False:
return closest_pair
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
... | 1 | 20 | mbpp |
from typing import List, Tuple
def find_closest_elements(numbers: List[float]) -> Tuple[float, float]:
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
... | transformation_for_while_loop | from typing import List, Tuple
def find_closest_elements(numbers: List[float]) -> Tuple[float, float]:
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
... | 1 | 20 | mbpp |
from typing import List, Tuple
def find_closest_elements(numbers: List[float]) -> Tuple[float, float]:
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
... | transformation_operand_swap | from typing import List, Tuple
def find_closest_elements(numbers: List[float]) -> Tuple[float, float]:
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx2 != idx:
if distance is None:
... | 1 | 20 | mbpp |
from typing import List, Tuple
def find_closest_elements(numbers: List[float]) -> Tuple[float, float]:
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
... | transformation_rename_variable_cb | from typing import List, Tuple
def find_closest_elements(numbers: List[float]) -> Tuple[float, float]:
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, distance2 in enumerate(numbers):
if idx != idx2:
if distance is None:
... | 1 | 20 | mbpp |
from typing import List, Tuple
def find_closest_elements(numbers: List[float]) -> Tuple[float, float]:
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
... | transformation_rename_variable_naive | from typing import List, Tuple
def find_closest_elements(numbers: List[float]) -> Tuple[float, float]:
closest_pair = None
distance = None
for idx, VAR_0 in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
... | 1 | 20 | mbpp |
from typing import List, Tuple
def find_closest_elements(numbers: List[float]) -> Tuple[float, float]:
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
... | transformation_rename_variable_rn | from typing import List, Tuple
def find_closest_elements(numbers: List[float]) -> Tuple[float, float]:
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, N3i75 in enumerate(numbers):
if idx != idx2:
if distance is None:
... | 1 | 20 | mbpp |
from typing import List, Tuple
def find_closest_elements(numbers: List[float]) -> Tuple[float, float]:
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
... | transformation_sub_add_variable | from typing import List, Tuple
def find_closest_elements(numbers: List[float]) +> Tuple[float, float]:
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
... | 0 | 20 | mbpp |
from typing import List, Tuple
def find_closest_elements(numbers: List[float]) -> Tuple[float, float]:
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
... | transformation_lesser_greater_variable | from typing import List, Tuple
def find_closest_elements(numbers: List[float]) -> Tuple[float, float]:
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
... | 0 | 20 | mbpp |
from typing import List, Tuple
def find_closest_elements(numbers: List[float]) -> Tuple[float, float]:
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
... | transformation_greater_lesser_variable | from typing import List, Tuple
def find_closest_elements(numbers: List[float]) -< Tuple[float, float]:
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
... | 0 | 20 | mbpp |
from typing import List, Tuple
def find_closest_elements(numbers: List[float]) -> Tuple[float, float]:
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
... | transformation_exclamation_equalto_variable | from typing import List, Tuple
def find_closest_elements(numbers: List[float]) -> Tuple[float, float]:
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx == idx2:
if distance is None:
... | 0 | 20 | mbpp |
from typing import List, Tuple
def find_closest_elements(numbers: List[float]) -> Tuple[float, float]:
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
... | transformation_is_isnot_variable | from typing import List, Tuple
def find_closest_elements(numbers: List[float]) -> Tuple[float, float]:
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is not None:
... | 0 | 20 | mbpp |
from typing import List, Tuple
def find_closest_elements(numbers: List[float]) -> Tuple[float, float]:
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
... | transformation_dissimilar_code_injection_0 | from typing import List
def has_close_elements(numbers: List[float], threshold: float) -> bool:
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
distance = abs(elem - elem2)
if distance < threshold:
re... | 0 | 20 | mbpp |
from typing import List, Tuple
def find_closest_elements(numbers: List[float]) -> Tuple[float, float]:
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
... | transformation_dissimilar_code_injection_1 | from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
current_depth -= 1
... | 0 | 20 | mbpp |
from typing import List, Tuple
def find_closest_elements(numbers: List[float]) -> Tuple[float, float]:
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
... | transformation_dissimilar_code_injection_2 | def truncate_number(number: float) -> float:
""" Given a positive floating point number, it can be decomposed into
and integer part (largest integer smaller than given number) and decimals
(leftover part always smaller than 1).
Return the decimal part of the number.
>>> truncate_number(3.5)
0.5
... | 0 | 20 | mbpp |
from typing import List, Tuple
def find_closest_elements(numbers: List[float]) -> Tuple[float, float]:
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is None:
... | transformation_dissimilar_code_injection_3 | from typing import List
def below_zero(operations: List[int]) -> bool:
balance = 0
for op in operations:
balance += op
if balance < 0:
return True
return False | 0 | 20 | mbpp |
from typing import List, Tuple
def find_closest_elements(numbers: List[float]) -> Tuple[float, float]:
closest_pair = None
distance = None
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
if distance is 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 | 20 | mbpp |
from typing import List
def rescale_to_unit(numbers: List[float]) -> List[float]:
min_number = min(numbers)
max_number = max(numbers)
return [(x - min_number) / (max_number - min_number) for x in numbers] | transformation_dead_code_insert | while False:
return [(x - min_number) / (max_number - min_number) for x in numbers]
from typing import List
def rescale_to_unit(numbers: List[float]) -> List[float]:
min_number = min(numbers)
max_number = max(numbers)
return [(x - min_number) / (max_number - min_number) for x in numbers] | 1 | 21 | mbpp |
from typing import List
def rescale_to_unit(numbers: List[float]) -> List[float]:
min_number = min(numbers)
max_number = max(numbers)
return [(x - min_number) / (max_number - min_number) for x in numbers] | transformation_for_while_loop | from typing import List
def rescale_to_unit(numbers: List[float]) -> List[float]:
min_number = min(numbers)
max_number = max(numbers)
return [(x - min_number) / (max_number - min_number) for x in numbers] | 1 | 21 | mbpp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.