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 Strongest_Extension(class_name, extensions):
strong = extensions[0]
my_val = len([x for x in extensions[0] if x.isalpha() and x.isupper()]) - len([x for x in extensions[0] if x.isalpha() and x.islower()])
for s in extensions:
val = len([x for x in s if x.isalpha() and x.isupper()]) - len([x for x in s if x.isalpha() and x.islower()])
if val > my_val:
strong = s
my_val = val
ans = class_name + "." + strong
return ans | transformation_rename_variable_cb | def Strongest_Extension(class_name, extensions):
strong = extensions[0]
my_val = len([s2 for s2 in extensions[0] if s2.isalpha() and s2.isupper()]) - len(
[s2 for s2 in extensions[0] if s2.isalpha() and s2.islower()]
)
for s in extensions:
val = len([s2 for s2 in s if s2.isalpha() and s2.isupper()]) - len(
[s2 for s2 in s if s2.isalpha() and s2.islower()]
)
if val > my_val:
strong = s
my_val = val
ans = class_name + "." + strong
return ans | 1 | 151 | mbpp |
def Strongest_Extension(class_name, extensions):
strong = extensions[0]
my_val = len([x for x in extensions[0] if x.isalpha() and x.isupper()]) - len([x for x in extensions[0] if x.isalpha() and x.islower()])
for s in extensions:
val = len([x for x in s if x.isalpha() and x.isupper()]) - len([x for x in s if x.isalpha() and x.islower()])
if val > my_val:
strong = s
my_val = val
ans = class_name + "." + strong
return ans | transformation_rename_variable_naive | def Strongest_Extension(class_name, extensions):
strong = extensions[0]
my_val = len(
[VAR_0 for VAR_0 in extensions[0] if VAR_0.isalpha() and VAR_0.isupper()]
) - len([VAR_0 for VAR_0 in extensions[0] if VAR_0.isalpha() and VAR_0.islower()])
for s in extensions:
val = len([VAR_0 for VAR_0 in s if VAR_0.isalpha() and VAR_0.isupper()]) - len(
[VAR_0 for VAR_0 in s if VAR_0.isalpha() and VAR_0.islower()]
)
if val > my_val:
strong = s
my_val = val
ans = class_name + "." + strong
return ans | 1 | 151 | mbpp |
def Strongest_Extension(class_name, extensions):
strong = extensions[0]
my_val = len([x for x in extensions[0] if x.isalpha() and x.isupper()]) - len([x for x in extensions[0] if x.isalpha() and x.islower()])
for s in extensions:
val = len([x for x in s if x.isalpha() and x.isupper()]) - len([x for x in s if x.isalpha() and x.islower()])
if val > my_val:
strong = s
my_val = val
ans = class_name + "." + strong
return ans | transformation_rename_variable_rn | def Strongest_Extension(class_name, extensions):
strong = extensions[0]
my_val = len([D for D in extensions[0] if D.isalpha() and D.isupper()]) - len(
[D for D in extensions[0] if D.isalpha() and D.islower()]
)
for s in extensions:
val = len([D for D in s if D.isalpha() and D.isupper()]) - len(
[D for D in s if D.isalpha() and D.islower()]
)
if val > my_val:
strong = s
my_val = val
ans = class_name + "." + strong
return ans | 1 | 151 | mbpp |
def Strongest_Extension(class_name, extensions):
strong = extensions[0]
my_val = len([x for x in extensions[0] if x.isalpha() and x.isupper()]) - len([x for x in extensions[0] if x.isalpha() and x.islower()])
for s in extensions:
val = len([x for x in s if x.isalpha() and x.isupper()]) - len([x for x in s if x.isalpha() and x.islower()])
if val > my_val:
strong = s
my_val = val
ans = class_name + "." + strong
return ans | transformation_add_sub_variable | def Strongest_Extension(class_name, extensions):
strong = extensions[0]
my_val = len([x for x in extensions[0] if x.isalpha() and x.isupper()]) - len([x for x in extensions[0] if x.isalpha() and x.islower()])
for s in extensions:
val = len([x for x in s if x.isalpha() and x.isupper()]) - len([x for x in s if x.isalpha() and x.islower()])
if val > my_val:
strong = s
my_val = val
ans = class_name - "." + strong
return ans | 0 | 151 | mbpp |
def Strongest_Extension(class_name, extensions):
strong = extensions[0]
my_val = len([x for x in extensions[0] if x.isalpha() and x.isupper()]) - len([x for x in extensions[0] if x.isalpha() and x.islower()])
for s in extensions:
val = len([x for x in s if x.isalpha() and x.isupper()]) - len([x for x in s if x.isalpha() and x.islower()])
if val > my_val:
strong = s
my_val = val
ans = class_name + "." + strong
return ans | transformation_sub_add_variable | def Strongest_Extension(class_name, extensions):
strong = extensions[0]
my_val = len([x for x in extensions[0] if x.isalpha() and x.isupper()]) + len([x for x in extensions[0] if x.isalpha() and x.islower()])
for s in extensions:
val = len([x for x in s if x.isalpha() and x.isupper()]) - len([x for x in s if x.isalpha() and x.islower()])
if val > my_val:
strong = s
my_val = val
ans = class_name + "." + strong
return ans | 0 | 151 | mbpp |
def Strongest_Extension(class_name, extensions):
strong = extensions[0]
my_val = len([x for x in extensions[0] if x.isalpha() and x.isupper()]) - len([x for x in extensions[0] if x.isalpha() and x.islower()])
for s in extensions:
val = len([x for x in s if x.isalpha() and x.isupper()]) - len([x for x in s if x.isalpha() and x.islower()])
if val > my_val:
strong = s
my_val = val
ans = class_name + "." + strong
return ans | transformation_greater_lesser_variable | def Strongest_Extension(class_name, extensions):
strong = extensions[0]
my_val = len([x for x in extensions[0] if x.isalpha() and x.isupper()]) - len([x for x in extensions[0] if x.isalpha() and x.islower()])
for s in extensions:
val = len([x for x in s if x.isalpha() and x.isupper()]) - len([x for x in s if x.isalpha() and x.islower()])
if val < my_val:
strong = s
my_val = val
ans = class_name + "." + strong
return ans | 0 | 151 | mbpp |
def Strongest_Extension(class_name, extensions):
strong = extensions[0]
my_val = len([x for x in extensions[0] if x.isalpha() and x.isupper()]) - len([x for x in extensions[0] if x.isalpha() and x.islower()])
for s in extensions:
val = len([x for x in s if x.isalpha() and x.isupper()]) - len([x for x in s if x.isalpha() and x.islower()])
if val > my_val:
strong = s
my_val = val
ans = class_name + "." + strong
return ans | transformation_and_or_variable | def Strongest_Extension(class_name, extensions):
strong = extensions[0]
my_val = len([x for x in extensions[0] if x.isalpha() or x.isupper()]) - len([x for x in extensions[0] if x.isalpha() and x.islower()])
for s in extensions:
val = len([x for x in s if x.isalpha() and x.isupper()]) - len([x for x in s if x.isalpha() and x.islower()])
if val > my_val:
strong = s
my_val = val
ans = class_name + "." + strong
return ans | 0 | 151 | mbpp |
def Strongest_Extension(class_name, extensions):
strong = extensions[0]
my_val = len([x for x in extensions[0] if x.isalpha() and x.isupper()]) - len([x for x in extensions[0] if x.isalpha() and x.islower()])
for s in extensions:
val = len([x for x in s if x.isalpha() and x.isupper()]) - len([x for x in s if x.isalpha() and x.islower()])
if val > my_val:
strong = s
my_val = val
ans = class_name + "." + strong
return ans | transformation_dissimilar_code_injection_0 | from typing import List
def has_close_elements(numbers: List[float], threshold: float) -> bool:
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
distance = abs(elem - elem2)
if distance < threshold:
return True
return False | 0 | 151 | mbpp |
def Strongest_Extension(class_name, extensions):
strong = extensions[0]
my_val = len([x for x in extensions[0] if x.isalpha() and x.isupper()]) - len([x for x in extensions[0] if x.isalpha() and x.islower()])
for s in extensions:
val = len([x for x in s if x.isalpha() and x.isupper()]) - len([x for x in s if x.isalpha() and x.islower()])
if val > my_val:
strong = s
my_val = val
ans = class_name + "." + strong
return ans | transformation_dissimilar_code_injection_1 | from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
current_depth -= 1
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
return result | 0 | 151 | mbpp |
def Strongest_Extension(class_name, extensions):
strong = extensions[0]
my_val = len([x for x in extensions[0] if x.isalpha() and x.isupper()]) - len([x for x in extensions[0] if x.isalpha() and x.islower()])
for s in extensions:
val = len([x for x in s if x.isalpha() and x.isupper()]) - len([x for x in s if x.isalpha() and x.islower()])
if val > my_val:
strong = s
my_val = val
ans = class_name + "." + strong
return ans | transformation_dissimilar_code_injection_2 | def truncate_number(number: float) -> float:
""" Given a positive floating point number, it can be decomposed into
and integer part (largest integer smaller than given number) and decimals
(leftover part always smaller than 1).
Return the decimal part of the number.
>>> truncate_number(3.5)
0.5
"""
return number % 1.0 | 0 | 151 | mbpp |
def Strongest_Extension(class_name, extensions):
strong = extensions[0]
my_val = len([x for x in extensions[0] if x.isalpha() and x.isupper()]) - len([x for x in extensions[0] if x.isalpha() and x.islower()])
for s in extensions:
val = len([x for x in s if x.isalpha() and x.isupper()]) - len([x for x in s if x.isalpha() and x.islower()])
if val > my_val:
strong = s
my_val = val
ans = class_name + "." + strong
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 | 151 | mbpp |
def Strongest_Extension(class_name, extensions):
strong = extensions[0]
my_val = len([x for x in extensions[0] if x.isalpha() and x.isupper()]) - len([x for x in extensions[0] if x.isalpha() and x.islower()])
for s in extensions:
val = len([x for x in s if x.isalpha() and x.isupper()]) - len([x for x in s if x.isalpha() and x.islower()])
if val > my_val:
strong = s
my_val = val
ans = class_name + "." + strong
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 | 151 | mbpp |
def cycpattern_check(a , b):
l = len(b)
pat = b + b
for i in range(len(a) - l + 1):
for j in range(l + 1):
if a[i:i+l] == pat[j:j+l]:
return True
return False | transformation_dead_code_insert | def cycpattern_check(a, b):
_i_5 = 0
while _i_5 > _i_5:
for j in range(l + 1):
if a[i : i + l] == pat[j : j + l]:
return True
l = len(b)
pat = b + b
for i in range(len(a) - l + 1):
for j in range(l + 1):
if a[i : i + l] == pat[j : j + l]:
return True
return False | 1 | 152 | mbpp |
def cycpattern_check(a , b):
l = len(b)
pat = b + b
for i in range(len(a) - l + 1):
for j in range(l + 1):
if a[i:i+l] == pat[j:j+l]:
return True
return False | transformation_for_while_loop | def cycpattern_check(a, b):
l = len(b)
pat = b + b
i = 0
while i < len(a) - l + 1:
for j in range(l + 1):
if a[i : i + l] == pat[j : j + l]:
return True
i += 1
return False | 1 | 152 | mbpp |
def cycpattern_check(a , b):
l = len(b)
pat = b + b
for i in range(len(a) - l + 1):
for j in range(l + 1):
if a[i:i+l] == pat[j:j+l]:
return True
return False | transformation_operand_swap | def cycpattern_check(a, b):
l = len(b)
pat = b + b
for i in range(len(a) - l + 1):
for j in range(l + 1):
if pat[j : j + l] == a[i : i + l]:
return True
return False | 1 | 152 | mbpp |
def cycpattern_check(a , b):
l = len(b)
pat = b + b
for i in range(len(a) - l + 1):
for j in range(l + 1):
if a[i:i+l] == pat[j:j+l]:
return True
return False | transformation_rename_variable_cb | def cycpattern_check(a, b):
j2 = len(b)
pat = b + b
for i in range(len(a) - j2 + 1):
for j in range(j2 + 1):
if a[i : i + j2] == pat[j : j + j2]:
return True
return False | 1 | 152 | mbpp |
def cycpattern_check(a , b):
l = len(b)
pat = b + b
for i in range(len(a) - l + 1):
for j in range(l + 1):
if a[i:i+l] == pat[j:j+l]:
return True
return False | transformation_rename_variable_naive | def cycpattern_check(a, b):
VAR_0 = len(b)
pat = b + b
for i in range(len(a) - VAR_0 + 1):
for j in range(VAR_0 + 1):
if a[i : i + VAR_0] == pat[j : j + VAR_0]:
return True
return False | 1 | 152 | mbpp |
def cycpattern_check(a , b):
l = len(b)
pat = b + b
for i in range(len(a) - l + 1):
for j in range(l + 1):
if a[i:i+l] == pat[j:j+l]:
return True
return False | transformation_rename_variable_rn | def cycpattern_check(a, b):
l2 = len(b)
pat = b + b
for i in range(len(a) - l2 + 1):
for j in range(l2 + 1):
if a[i : i + l2] == pat[j : j + l2]:
return True
return False | 1 | 152 | mbpp |
def cycpattern_check(a , b):
l = len(b)
pat = b + b
for i in range(len(a) - l + 1):
for j in range(l + 1):
if a[i:i+l] == pat[j:j+l]:
return True
return False | transformation_add_sub_variable | def cycpattern_check(a , b):
l = len(b)
pat = b - b
for i in range(len(a) - l + 1):
for j in range(l + 1):
if a[i:i+l] == pat[j:j+l]:
return True
return False | 0 | 152 | mbpp |
def cycpattern_check(a , b):
l = len(b)
pat = b + b
for i in range(len(a) - l + 1):
for j in range(l + 1):
if a[i:i+l] == pat[j:j+l]:
return True
return False | transformation_sub_add_variable | def cycpattern_check(a , b):
l = len(b)
pat = b + b
for i in range(len(a) + l + 1):
for j in range(l + 1):
if a[i:i+l] == pat[j:j+l]:
return True
return False | 0 | 152 | mbpp |
def cycpattern_check(a , b):
l = len(b)
pat = b + b
for i in range(len(a) - l + 1):
for j in range(l + 1):
if a[i:i+l] == pat[j:j+l]:
return True
return False | transformation_equalto_exclamation_variable | def cycpattern_check(a , b):
l = len(b)
pat = b + b
for i in range(len(a) - l + 1):
for j in range(l + 1):
if a[i:i+l] != pat[j:j+l]:
return True
return False | 0 | 152 | mbpp |
def cycpattern_check(a , b):
l = len(b)
pat = b + b
for i in range(len(a) - l + 1):
for j in range(l + 1):
if a[i:i+l] == pat[j:j+l]:
return True
return False | transformation_true_false_variable | def cycpattern_check(a , b):
l = len(b)
pat = b + b
for i in range(len(a) - l + 1):
for j in range(l + 1):
if a[i:i+l] == pat[j:j+l]:
return False
return False | 0 | 152 | mbpp |
def cycpattern_check(a , b):
l = len(b)
pat = b + b
for i in range(len(a) - l + 1):
for j in range(l + 1):
if a[i:i+l] == pat[j:j+l]:
return True
return False | transformation_false_true_variable | def cycpattern_check(a , b):
l = len(b)
pat = b + b
for i in range(len(a) - l + 1):
for j in range(l + 1):
if a[i:i+l] == pat[j:j+l]:
return True
return True | 0 | 152 | mbpp |
def cycpattern_check(a , b):
l = len(b)
pat = b + b
for i in range(len(a) - l + 1):
for j in range(l + 1):
if a[i:i+l] == pat[j:j+l]:
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 | 152 | mbpp |
def cycpattern_check(a , b):
l = len(b)
pat = b + b
for i in range(len(a) - l + 1):
for j in range(l + 1):
if a[i:i+l] == pat[j:j+l]:
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 | 152 | mbpp |
def cycpattern_check(a , b):
l = len(b)
pat = b + b
for i in range(len(a) - l + 1):
for j in range(l + 1):
if a[i:i+l] == pat[j:j+l]:
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 | 152 | mbpp |
def cycpattern_check(a , b):
l = len(b)
pat = b + b
for i in range(len(a) - l + 1):
for j in range(l + 1):
if a[i:i+l] == pat[j:j+l]:
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 | 152 | mbpp |
def cycpattern_check(a , b):
l = len(b)
pat = b + b
for i in range(len(a) - l + 1):
for j in range(l + 1):
if a[i:i+l] == pat[j:j+l]:
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 | 152 | mbpp |
def even_odd_count(num):
even_count = 0
odd_count = 0
for i in str(abs(num)):
if int(i)%2==0:
even_count +=1
else:
odd_count +=1
return (even_count, odd_count) | transformation_dead_code_insert | def even_odd_count(num):
even_count = 0
odd_count = 0
for i in str(abs(num)):
if int(i) % 2 == 0:
for _i_5 in range(0):
return (even_count, odd_count)
even_count += 1
else:
odd_count += 1
return (even_count, odd_count) | 1 | 153 | mbpp |
def even_odd_count(num):
even_count = 0
odd_count = 0
for i in str(abs(num)):
if int(i)%2==0:
even_count +=1
else:
odd_count +=1
return (even_count, odd_count) | transformation_for_while_loop | def even_odd_count(num):
even_count = 0
odd_count = 0
_i_i = 0
while _i_i < len(str(abs(num))):
i = str(abs(num))[_i_i]
if int(i) % 2 == 0:
even_count += 1
else:
odd_count += 1
_i_i += 1
return (even_count, odd_count) | 1 | 153 | mbpp |
def even_odd_count(num):
even_count = 0
odd_count = 0
for i in str(abs(num)):
if int(i)%2==0:
even_count +=1
else:
odd_count +=1
return (even_count, odd_count) | transformation_operand_swap | def even_odd_count(num):
even_count = 0
odd_count = 0
for i in str(abs(num)):
if 0 == int(i) % 2:
even_count += 1
else:
odd_count += 1
return (even_count, odd_count) | 1 | 153 | mbpp |
def even_odd_count(num):
even_count = 0
odd_count = 0
for i in str(abs(num)):
if int(i)%2==0:
even_count +=1
else:
odd_count +=1
return (even_count, odd_count) | transformation_rename_variable_cb | def even_odd_count(num):
even_count = 0
split = 0
for i in str(abs(num)):
if int(i) % 2 == 0:
even_count += 1
else:
split += 1
return (even_count, split) | 1 | 153 | mbpp |
def even_odd_count(num):
even_count = 0
odd_count = 0
for i in str(abs(num)):
if int(i)%2==0:
even_count +=1
else:
odd_count +=1
return (even_count, odd_count) | transformation_rename_variable_naive | def even_odd_count(num):
even_count = 0
VAR_0 = 0
for i in str(abs(num)):
if int(i) % 2 == 0:
even_count += 1
else:
VAR_0 += 1
return (even_count, VAR_0) | 1 | 153 | mbpp |
def even_odd_count(num):
even_count = 0
odd_count = 0
for i in str(abs(num)):
if int(i)%2==0:
even_count +=1
else:
odd_count +=1
return (even_count, odd_count) | transformation_rename_variable_rn | def even_odd_count(num):
v7H3oHG292 = 0
odd_count = 0
for i in str(abs(num)):
if int(i) % 2 == 0:
v7H3oHG292 += 1
else:
odd_count += 1
return (v7H3oHG292, odd_count) | 1 | 153 | mbpp |
def even_odd_count(num):
even_count = 0
odd_count = 0
for i in str(abs(num)):
if int(i)%2==0:
even_count +=1
else:
odd_count +=1
return (even_count, odd_count) | transformation_add_sub_variable | def even_odd_count(num):
even_count = 0
odd_count = 0
for i in str(abs(num)):
if int(i)%2==0:
even_count -=1
else:
odd_count +=1
return (even_count, odd_count) | 0 | 153 | mbpp |
def even_odd_count(num):
even_count = 0
odd_count = 0
for i in str(abs(num)):
if int(i)%2==0:
even_count +=1
else:
odd_count +=1
return (even_count, odd_count) | transformation_equalto_exclamation_variable | def even_odd_count(num):
even_count = 0
odd_count = 0
for i in str(abs(num)):
if int(i)%2!=0:
even_count +=1
else:
odd_count +=1
return (even_count, odd_count) | 0 | 153 | mbpp |
def even_odd_count(num):
even_count = 0
odd_count = 0
for i in str(abs(num)):
if int(i)%2==0:
even_count +=1
else:
odd_count +=1
return (even_count, odd_count) | 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 | 153 | mbpp |
def even_odd_count(num):
even_count = 0
odd_count = 0
for i in str(abs(num)):
if int(i)%2==0:
even_count +=1
else:
odd_count +=1
return (even_count, odd_count) | 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 | 153 | mbpp |
def even_odd_count(num):
even_count = 0
odd_count = 0
for i in str(abs(num)):
if int(i)%2==0:
even_count +=1
else:
odd_count +=1
return (even_count, odd_count) | 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 | 153 | mbpp |
def even_odd_count(num):
even_count = 0
odd_count = 0
for i in str(abs(num)):
if int(i)%2==0:
even_count +=1
else:
odd_count +=1
return (even_count, odd_count) | 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 | 153 | mbpp |
def even_odd_count(num):
even_count = 0
odd_count = 0
for i in str(abs(num)):
if int(i)%2==0:
even_count +=1
else:
odd_count +=1
return (even_count, odd_count) | 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 | 153 | mbpp |
def int_to_mini_roman(number):
num = [1, 4, 5, 9, 10, 40, 50, 90,
100, 400, 500, 900, 1000]
sym = ["I", "IV", "V", "IX", "X", "XL",
"L", "XC", "C", "CD", "D", "CM", "M"]
i = 12
res = ''
while number:
div = number // num[i]
number %= num[i]
while div:
res += sym[i]
div -= 1
i -= 1
return res.lower() | transformation_dead_code_insert | def int_to_mini_roman(number):
num = [1, 4, 5, 9, 10, 40, 50, 90, 100, 400, 500, 900, 1000]
while False:
return res.lower()
sym = ["I", "IV", "V", "IX", "X", "XL", "L", "XC", "C", "CD", "D", "CM", "M"]
i = 12
res = ""
while number:
div = number // num[i]
number %= num[i]
while div:
res += sym[i]
div -= 1
i -= 1
return res.lower() | 1 | 154 | mbpp |
def int_to_mini_roman(number):
num = [1, 4, 5, 9, 10, 40, 50, 90,
100, 400, 500, 900, 1000]
sym = ["I", "IV", "V", "IX", "X", "XL",
"L", "XC", "C", "CD", "D", "CM", "M"]
i = 12
res = ''
while number:
div = number // num[i]
number %= num[i]
while div:
res += sym[i]
div -= 1
i -= 1
return res.lower() | transformation_for_while_loop | def int_to_mini_roman(number):
num = [1, 4, 5, 9, 10, 40, 50, 90, 100, 400, 500, 900, 1000]
sym = ["I", "IV", "V", "IX", "X", "XL", "L", "XC", "C", "CD", "D", "CM", "M"]
i = 12
res = ""
while number:
div = number // num[i]
number %= num[i]
while div:
res += sym[i]
div -= 1
i -= 1
return res.lower() | 1 | 154 | mbpp |
def int_to_mini_roman(number):
num = [1, 4, 5, 9, 10, 40, 50, 90,
100, 400, 500, 900, 1000]
sym = ["I", "IV", "V", "IX", "X", "XL",
"L", "XC", "C", "CD", "D", "CM", "M"]
i = 12
res = ''
while number:
div = number // num[i]
number %= num[i]
while div:
res += sym[i]
div -= 1
i -= 1
return res.lower() | transformation_operand_swap | def int_to_mini_roman(number):
num = [1, 4, 5, 9, 10, 40, 50, 90, 100, 400, 500, 900, 1000]
sym = ["I", "IV", "V", "IX", "X", "XL", "L", "XC", "C", "CD", "D", "CM", "M"]
i = 12
res = ""
while number:
div = number // num[i]
number %= num[i]
while div:
res += sym[i]
div -= 1
i -= 1
return res.lower() | 1 | 154 | mbpp |
def int_to_mini_roman(number):
num = [1, 4, 5, 9, 10, 40, 50, 90,
100, 400, 500, 900, 1000]
sym = ["I", "IV", "V", "IX", "X", "XL",
"L", "XC", "C", "CD", "D", "CM", "M"]
i = 12
res = ''
while number:
div = number // num[i]
number %= num[i]
while div:
res += sym[i]
div -= 1
i -= 1
return res.lower() | transformation_rename_variable_cb | def int_to_mini_roman(number):
num = [1, 4, 5, 9, 10, 40, 50, 90, 100, 400, 500, 900, 1000]
sym = ["I", "IV", "V", "IX", "X", "XL", "L", "XC", "C", "CD", "D", "CM", "M"]
i2 = 12
res = ""
while number:
div = number // num[i2]
number %= num[i2]
while div:
res += sym[i2]
div -= 1
i2 -= 1
return res.lower() | 1 | 154 | mbpp |
def int_to_mini_roman(number):
num = [1, 4, 5, 9, 10, 40, 50, 90,
100, 400, 500, 900, 1000]
sym = ["I", "IV", "V", "IX", "X", "XL",
"L", "XC", "C", "CD", "D", "CM", "M"]
i = 12
res = ''
while number:
div = number // num[i]
number %= num[i]
while div:
res += sym[i]
div -= 1
i -= 1
return res.lower() | transformation_rename_variable_naive | def int_to_mini_roman(number):
num = [1, 4, 5, 9, 10, 40, 50, 90, 100, 400, 500, 900, 1000]
sym = ["I", "IV", "V", "IX", "X", "XL", "L", "XC", "C", "CD", "D", "CM", "M"]
VAR_0 = 12
res = ""
while number:
div = number // num[VAR_0]
number %= num[VAR_0]
while div:
res += sym[VAR_0]
div -= 1
VAR_0 -= 1
return res.lower() | 1 | 154 | mbpp |
def int_to_mini_roman(number):
num = [1, 4, 5, 9, 10, 40, 50, 90,
100, 400, 500, 900, 1000]
sym = ["I", "IV", "V", "IX", "X", "XL",
"L", "XC", "C", "CD", "D", "CM", "M"]
i = 12
res = ''
while number:
div = number // num[i]
number %= num[i]
while div:
res += sym[i]
div -= 1
i -= 1
return res.lower() | transformation_rename_variable_rn | def int_to_mini_roman(number):
num = [1, 4, 5, 9, 10, 40, 50, 90, 100, 400, 500, 900, 1000]
sym = ["I", "IV", "V", "IX", "X", "XL", "L", "XC", "C", "CD", "D", "CM", "M"]
h = 12
res = ""
while number:
div = number // num[h]
number %= num[h]
while div:
res += sym[h]
div -= 1
h -= 1
return res.lower() | 1 | 154 | mbpp |
def int_to_mini_roman(number):
num = [1, 4, 5, 9, 10, 40, 50, 90,
100, 400, 500, 900, 1000]
sym = ["I", "IV", "V", "IX", "X", "XL",
"L", "XC", "C", "CD", "D", "CM", "M"]
i = 12
res = ''
while number:
div = number // num[i]
number %= num[i]
while div:
res += sym[i]
div -= 1
i -= 1
return res.lower() | transformation_add_sub_variable | def int_to_mini_roman(number):
num = [1, 4, 5, 9, 10, 40, 50, 90,
100, 400, 500, 900, 1000]
sym = ["I", "IV", "V", "IX", "X", "XL",
"L", "XC", "C", "CD", "D", "CM", "M"]
i = 12
res = ''
while number:
div = number // num[i]
number %= num[i]
while div:
res -= sym[i]
div -= 1
i -= 1
return res.lower() | 0 | 154 | mbpp |
def int_to_mini_roman(number):
num = [1, 4, 5, 9, 10, 40, 50, 90,
100, 400, 500, 900, 1000]
sym = ["I", "IV", "V", "IX", "X", "XL",
"L", "XC", "C", "CD", "D", "CM", "M"]
i = 12
res = ''
while number:
div = number // num[i]
number %= num[i]
while div:
res += sym[i]
div -= 1
i -= 1
return res.lower() | transformation_sub_add_variable | def int_to_mini_roman(number):
num = [1, 4, 5, 9, 10, 40, 50, 90,
100, 400, 500, 900, 1000]
sym = ["I", "IV", "V", "IX", "X", "XL",
"L", "XC", "C", "CD", "D", "CM", "M"]
i = 12
res = ''
while number:
div = number // num[i]
number %= num[i]
while div:
res += sym[i]
div += 1
i -= 1
return res.lower() | 0 | 154 | mbpp |
def int_to_mini_roman(number):
num = [1, 4, 5, 9, 10, 40, 50, 90,
100, 400, 500, 900, 1000]
sym = ["I", "IV", "V", "IX", "X", "XL",
"L", "XC", "C", "CD", "D", "CM", "M"]
i = 12
res = ''
while number:
div = number // num[i]
number %= num[i]
while div:
res += sym[i]
div -= 1
i -= 1
return res.lower() | transformation_div_mul_variable | def int_to_mini_roman(number):
num = [1, 4, 5, 9, 10, 40, 50, 90,
100, 400, 500, 900, 1000]
sym = ["I", "IV", "V", "IX", "X", "XL",
"L", "XC", "C", "CD", "D", "CM", "M"]
i = 12
res = ''
while number:
div = number */ num[i]
number %= num[i]
while div:
res += sym[i]
div -= 1
i -= 1
return res.lower() | 0 | 154 | mbpp |
def int_to_mini_roman(number):
num = [1, 4, 5, 9, 10, 40, 50, 90,
100, 400, 500, 900, 1000]
sym = ["I", "IV", "V", "IX", "X", "XL",
"L", "XC", "C", "CD", "D", "CM", "M"]
i = 12
res = ''
while number:
div = number // num[i]
number %= num[i]
while div:
res += sym[i]
div -= 1
i -= 1
return res.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:
return True
return False | 0 | 154 | mbpp |
def int_to_mini_roman(number):
num = [1, 4, 5, 9, 10, 40, 50, 90,
100, 400, 500, 900, 1000]
sym = ["I", "IV", "V", "IX", "X", "XL",
"L", "XC", "C", "CD", "D", "CM", "M"]
i = 12
res = ''
while number:
div = number // num[i]
number %= num[i]
while div:
res += sym[i]
div -= 1
i -= 1
return res.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
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
return result | 0 | 154 | mbpp |
def int_to_mini_roman(number):
num = [1, 4, 5, 9, 10, 40, 50, 90,
100, 400, 500, 900, 1000]
sym = ["I", "IV", "V", "IX", "X", "XL",
"L", "XC", "C", "CD", "D", "CM", "M"]
i = 12
res = ''
while number:
div = number // num[i]
number %= num[i]
while div:
res += sym[i]
div -= 1
i -= 1
return res.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
"""
return number % 1.0 | 0 | 154 | mbpp |
def int_to_mini_roman(number):
num = [1, 4, 5, 9, 10, 40, 50, 90,
100, 400, 500, 900, 1000]
sym = ["I", "IV", "V", "IX", "X", "XL",
"L", "XC", "C", "CD", "D", "CM", "M"]
i = 12
res = ''
while number:
div = number // num[i]
number %= num[i]
while div:
res += sym[i]
div -= 1
i -= 1
return res.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 | 154 | mbpp |
def int_to_mini_roman(number):
num = [1, 4, 5, 9, 10, 40, 50, 90,
100, 400, 500, 900, 1000]
sym = ["I", "IV", "V", "IX", "X", "XL",
"L", "XC", "C", "CD", "D", "CM", "M"]
i = 12
res = ''
while number:
div = number // num[i]
number %= num[i]
while div:
res += sym[i]
div -= 1
i -= 1
return res.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 | 154 | mbpp |
def find_max(words):
"""Write a function that accepts a list of strings.
The list contains different words. Return the word with maximum number
of unique characters. If multiple strings have maximum number of unique
characters, return the one which comes first in lexicographical order.
find_max(["name", "of", "string"]) == "string"
find_max(["name", "enam", "game"]) == "enam"
find_max(["aaaaaaa", "bb" ,"cc"]) == ""aaaaaaa"
"""
return sorted(words, key = lambda x: (-len(set(x)), x))[0] | transformation_sub_add_variable | def find_max(words):
"""Write a function that accepts a list of strings.
The list contains different words. Return the word with maximum number
of unique characters. If multiple strings have maximum number of unique
characters, return the one which comes first in lexicographical order.
find_max(["name", "of", "string"]) == "string"
find_max(["name", "enam", "game"]) == "enam"
find_max(["aaaaaaa", "bb" ,"cc"]) == ""aaaaaaa"
"""
return sorted(words, key = lambda x: (+len(set(x)), x))[0] | 0 | 156 | mbpp |
def find_max(words):
"""Write a function that accepts a list of strings.
The list contains different words. Return the word with maximum number
of unique characters. If multiple strings have maximum number of unique
characters, return the one which comes first in lexicographical order.
find_max(["name", "of", "string"]) == "string"
find_max(["name", "enam", "game"]) == "enam"
find_max(["aaaaaaa", "bb" ,"cc"]) == ""aaaaaaa"
"""
return sorted(words, key = lambda x: (-len(set(x)), x))[0] | transformation_equalto_exclamation_variable | def find_max(words):
"""Write a function that accepts a list of strings.
The list contains different words. Return the word with maximum number
of unique characters. If multiple strings have maximum number of unique
characters, return the one which comes first in lexicographical order.
find_max(["name", "of", "string"]) != "string"
find_max(["name", "enam", "game"]) == "enam"
find_max(["aaaaaaa", "bb" ,"cc"]) == ""aaaaaaa"
"""
return sorted(words, key = lambda x: (-len(set(x)), x))[0] | 0 | 156 | mbpp |
def find_max(words):
"""Write a function that accepts a list of strings.
The list contains different words. Return the word with maximum number
of unique characters. If multiple strings have maximum number of unique
characters, return the one which comes first in lexicographical order.
find_max(["name", "of", "string"]) == "string"
find_max(["name", "enam", "game"]) == "enam"
find_max(["aaaaaaa", "bb" ,"cc"]) == ""aaaaaaa"
"""
return sorted(words, key = lambda x: (-len(set(x)), x))[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 | 156 | mbpp |
def find_max(words):
"""Write a function that accepts a list of strings.
The list contains different words. Return the word with maximum number
of unique characters. If multiple strings have maximum number of unique
characters, return the one which comes first in lexicographical order.
find_max(["name", "of", "string"]) == "string"
find_max(["name", "enam", "game"]) == "enam"
find_max(["aaaaaaa", "bb" ,"cc"]) == ""aaaaaaa"
"""
return sorted(words, key = lambda x: (-len(set(x)), x))[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 | 156 | mbpp |
def find_max(words):
"""Write a function that accepts a list of strings.
The list contains different words. Return the word with maximum number
of unique characters. If multiple strings have maximum number of unique
characters, return the one which comes first in lexicographical order.
find_max(["name", "of", "string"]) == "string"
find_max(["name", "enam", "game"]) == "enam"
find_max(["aaaaaaa", "bb" ,"cc"]) == ""aaaaaaa"
"""
return sorted(words, key = lambda x: (-len(set(x)), x))[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 | 156 | mbpp |
def find_max(words):
"""Write a function that accepts a list of strings.
The list contains different words. Return the word with maximum number
of unique characters. If multiple strings have maximum number of unique
characters, return the one which comes first in lexicographical order.
find_max(["name", "of", "string"]) == "string"
find_max(["name", "enam", "game"]) == "enam"
find_max(["aaaaaaa", "bb" ,"cc"]) == ""aaaaaaa"
"""
return sorted(words, key = lambda x: (-len(set(x)), x))[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 | 156 | mbpp |
def find_max(words):
"""Write a function that accepts a list of strings.
The list contains different words. Return the word with maximum number
of unique characters. If multiple strings have maximum number of unique
characters, return the one which comes first in lexicographical order.
find_max(["name", "of", "string"]) == "string"
find_max(["name", "enam", "game"]) == "enam"
find_max(["aaaaaaa", "bb" ,"cc"]) == ""aaaaaaa"
"""
return sorted(words, key = lambda x: (-len(set(x)), x))[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 | 156 | mbpp |
def eat(number, need, remaining):
if(need <= remaining):
return [ number + need , remaining-need ]
else:
return [ number + remaining , 0] | transformation_dead_code_insert | def eat(number, need, remaining):
if need <= remaining:
while False:
return [number + need, remaining - need]
return [number + need, remaining - need]
else:
return [number + remaining, 0] | 1 | 157 | mbpp |
def eat(number, need, remaining):
if(need <= remaining):
return [ number + need , remaining-need ]
else:
return [ number + remaining , 0] | transformation_for_while_loop | def eat(number, need, remaining):
if need <= remaining:
return [number + need, remaining - need]
else:
return [number + remaining, 0] | 1 | 157 | mbpp |
def eat(number, need, remaining):
if(need <= remaining):
return [ number + need , remaining-need ]
else:
return [ number + remaining , 0] | transformation_operand_swap | def eat(number, need, remaining):
if remaining >= need:
return [number + need, remaining - need]
else:
return [number + remaining, 0] | 1 | 157 | mbpp |
def eat(number, need, remaining):
if(need <= remaining):
return [ number + need , remaining-need ]
else:
return [ number + remaining , 0] | transformation_rename_variable_cb | def eat(number, need, number2):
if need <= number2:
return [number + need, number2 - need]
else:
return [number + number2, 0] | 1 | 157 | mbpp |
def eat(number, need, remaining):
if(need <= remaining):
return [ number + need , remaining-need ]
else:
return [ number + remaining , 0] | transformation_rename_variable_naive | def eat(number, need, VAR_0):
if need <= VAR_0:
return [number + need, VAR_0 - need]
else:
return [number + VAR_0, 0] | 1 | 157 | mbpp |
def eat(number, need, remaining):
if(need <= remaining):
return [ number + need , remaining-need ]
else:
return [ number + remaining , 0] | transformation_rename_variable_rn | def eat(number, KH3K, remaining):
if KH3K <= remaining:
return [number + KH3K, remaining - KH3K]
else:
return [number + remaining, 0] | 1 | 157 | mbpp |
def eat(number, need, remaining):
if(need <= remaining):
return [ number + need , remaining-need ]
else:
return [ number + remaining , 0] | transformation_add_sub_variable | def eat(number, need, remaining):
if(need <= remaining):
return [ number - need , remaining-need ]
else:
return [ number + remaining , 0] | 0 | 157 | mbpp |
def eat(number, need, remaining):
if(need <= remaining):
return [ number + need , remaining-need ]
else:
return [ number + remaining , 0] | transformation_sub_add_variable | def eat(number, need, remaining):
if(need <= remaining):
return [ number + need , remaining+need ]
else:
return [ number + remaining , 0] | 0 | 157 | mbpp |
def eat(number, need, remaining):
if(need <= remaining):
return [ number + need , remaining-need ]
else:
return [ number + remaining , 0] | transformation_lesser_greater_variable | def eat(number, need, remaining):
if(need >= remaining):
return [ number + need , remaining-need ]
else:
return [ number + remaining , 0] | 0 | 157 | mbpp |
def eat(number, need, remaining):
if(need <= remaining):
return [ number + need , remaining-need ]
else:
return [ number + remaining , 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 | 157 | mbpp |
def eat(number, need, remaining):
if(need <= remaining):
return [ number + need , remaining-need ]
else:
return [ number + remaining , 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 | 157 | mbpp |
def eat(number, need, remaining):
if(need <= remaining):
return [ number + need , remaining-need ]
else:
return [ number + remaining , 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 | 157 | mbpp |
def eat(number, need, remaining):
if(need <= remaining):
return [ number + need , remaining-need ]
else:
return [ number + remaining , 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 | 157 | mbpp |
def eat(number, need, remaining):
if(need <= remaining):
return [ number + need , remaining-need ]
else:
return [ number + remaining , 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 | 157 | mbpp |
def solve(s):
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s | transformation_dead_code_insert | def solve(s):
flg = 0
idx = 0
new_str = list(s)
for _i_8 in range(0):
idx = 0
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s) :: -1]
return s | 1 | 159 | mbpp |
def solve(s):
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s | transformation_for_while_loop | def solve(s):
flg = 0
idx = 0
new_str = list(s)
_i_i = 0
while _i_i < len(s):
i = s[_i_i]
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
_i_i += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s) :: -1]
return s | 1 | 159 | mbpp |
def solve(s):
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s | transformation_operand_swap | def solve(s):
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if 0 == flg:
return s[len(s) :: -1]
return s | 1 | 159 | mbpp |
def solve(s):
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s | transformation_rename_variable_cb | def solve(i2):
flg = 0
idx = 0
new_str = list(i2)
for i in i2:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
i2 = ""
for i in new_str:
i2 += i
if flg == 0:
return i2[len(i2) :: -1]
return i2 | 1 | 159 | mbpp |
def solve(s):
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s | transformation_rename_variable_naive | def solve(VAR_0):
flg = 0
idx = 0
new_str = list(VAR_0)
for i in VAR_0:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
VAR_0 = ""
for i in new_str:
VAR_0 += i
if flg == 0:
return VAR_0[len(VAR_0) :: -1]
return VAR_0 | 1 | 159 | mbpp |
def solve(s):
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s | transformation_rename_variable_rn | def solve(Z):
flg = 0
idx = 0
new_str = list(Z)
for i in Z:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
Z = ""
for i in new_str:
Z += i
if flg == 0:
return Z[len(Z) :: -1]
return Z | 1 | 159 | mbpp |
def solve(s):
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s | transformation_add_sub_variable | def solve(s):
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx -= 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s | 0 | 159 | mbpp |
def solve(s):
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s | transformation_sub_add_variable | def solve(s):
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::+1]
return s | 0 | 159 | mbpp |
def solve(s):
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return s | transformation_equalto_exclamation_variable | def solve(s):
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg != 0:
return s[len(s)::-1]
return s | 0 | 159 | mbpp |
def solve(s):
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return 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 | 159 | mbpp |
def solve(s):
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return 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 | 159 | mbpp |
def solve(s):
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return 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 | 159 | mbpp |
def solve(s):
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return 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 | 159 | mbpp |
def solve(s):
flg = 0
idx = 0
new_str = list(s)
for i in s:
if i.isalpha():
new_str[idx] = i.swapcase()
flg = 1
idx += 1
s = ""
for i in new_str:
s += i
if flg == 0:
return s[len(s)::-1]
return 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 | 159 | mbpp |
def string_to_md5(text):
import hashlib
return hashlib.md5(text.encode('ascii')).hexdigest() if text else None | transformation_dead_code_insert | def string_to_md5(text):
for _i_1 in range(0):
import hashlib
import hashlib
return hashlib.md5(text.encode("ascii")).hexdigest() if text else None | 1 | 160 | mbpp |
def string_to_md5(text):
import hashlib
return hashlib.md5(text.encode('ascii')).hexdigest() if text else None | transformation_for_while_loop | def string_to_md5(text):
import hashlib
return hashlib.md5(text.encode("ascii")).hexdigest() if text else None | 1 | 160 | mbpp |
def string_to_md5(text):
import hashlib
return hashlib.md5(text.encode('ascii')).hexdigest() if text else None | transformation_operand_swap | def string_to_md5(text):
import hashlib
return hashlib.md5(text.encode("ascii")).hexdigest() if text else None | 1 | 160 | mbpp |
def string_to_md5(text):
import hashlib
return hashlib.md5(text.encode('ascii')).hexdigest() if text else None | transformation_rename_variable_cb | def string_to_md5(line):
import hashlib
return hashlib.md5(line.encode("ascii")).hexdigest() if line else None | 1 | 160 | mbpp |
def string_to_md5(text):
import hashlib
return hashlib.md5(text.encode('ascii')).hexdigest() if text else None | transformation_rename_variable_naive | def string_to_md5(VAR_0):
import hashlib
return hashlib.md5(VAR_0.encode("ascii")).hexdigest() if VAR_0 else None | 1 | 160 | mbpp |
def string_to_md5(text):
import hashlib
return hashlib.md5(text.encode('ascii')).hexdigest() if text else None | transformation_rename_variable_rn | def string_to_md5(H0f2):
import hashlib
return hashlib.md5(H0f2.encode("ascii")).hexdigest() if H0f2 else None | 1 | 160 | mbpp |
def string_to_md5(text):
import hashlib
return hashlib.md5(text.encode('ascii')).hexdigest() if text else None | transformation_dissimilar_code_injection_0 | from typing import List
def has_close_elements(numbers: List[float], threshold: float) -> bool:
for idx, elem in enumerate(numbers):
for idx2, elem2 in enumerate(numbers):
if idx != idx2:
distance = abs(elem - elem2)
if distance < threshold:
return True
return False | 0 | 160 | mbpp |
def string_to_md5(text):
import hashlib
return hashlib.md5(text.encode('ascii')).hexdigest() if text else None | transformation_dissimilar_code_injection_1 | from typing import List
def separate_paren_groups(paren_string: str) -> List[str]:
result = []
current_string = []
current_depth = 0
for c in paren_string:
if c == '(':
current_depth += 1
current_string.append(c)
elif c == ')':
current_depth -= 1
current_string.append(c)
if current_depth == 0:
result.append(''.join(current_string))
current_string.clear()
return result | 0 | 160 | mbpp |
def string_to_md5(text):
import hashlib
return hashlib.md5(text.encode('ascii')).hexdigest() if text else None | transformation_dissimilar_code_injection_2 | def truncate_number(number: float) -> float:
""" Given a positive floating point number, it can be decomposed into
and integer part (largest integer smaller than given number) and decimals
(leftover part always smaller than 1).
Return the decimal part of the number.
>>> truncate_number(3.5)
0.5
"""
return number % 1.0 | 0 | 160 | mbpp |
def string_to_md5(text):
import hashlib
return hashlib.md5(text.encode('ascii')).hexdigest() if text else None | transformation_dissimilar_code_injection_3 | from typing import List
def below_zero(operations: List[int]) -> bool:
balance = 0
for op in operations:
balance += op
if balance < 0:
return True
return False | 0 | 160 | mbpp |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.