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 lower_ctr(str):
lower_ctr= 0
for i in range(len(str)):
if str[i] >= 'a' and str[i] <= 'z': lower_ctr += 1
return lower_ctr
|
transformation_dead_code_insert
|
def lower_ctr(str):
while False:
return lower_ctr
lower_ctr = 0
for i in range(len(str)):
if str[i] >= "a" and str[i] <= "z":
lower_ctr += 1
return lower_ctr
| 1 | 815 |
mbpp
|
def lower_ctr(str):
lower_ctr= 0
for i in range(len(str)):
if str[i] >= 'a' and str[i] <= 'z': lower_ctr += 1
return lower_ctr
|
transformation_for_while_loop
|
def lower_ctr(str):
lower_ctr = 0
i = 0
while i < len(str):
if str[i] >= "a" and str[i] <= "z":
lower_ctr += 1
i += 1
return lower_ctr
| 1 | 815 |
mbpp
|
def lower_ctr(str):
lower_ctr= 0
for i in range(len(str)):
if str[i] >= 'a' and str[i] <= 'z': lower_ctr += 1
return lower_ctr
|
transformation_operand_swap
|
def lower_ctr(str):
lower_ctr = 0
for i in range(len(str)):
if "a" <= str[i] and str[i] <= "z":
lower_ctr += 1
return lower_ctr
| 1 | 815 |
mbpp
|
def lower_ctr(str):
lower_ctr= 0
for i in range(len(str)):
if str[i] >= 'a' and str[i] <= 'z': lower_ctr += 1
return lower_ctr
|
transformation_rename_variable_cb
|
def lower_ctr(str):
lower_ctr = 0
for i2 in range(len(str)):
if str[i2] >= "a" and str[i2] <= "z":
lower_ctr += 1
return lower_ctr
| 1 | 815 |
mbpp
|
def lower_ctr(str):
lower_ctr= 0
for i in range(len(str)):
if str[i] >= 'a' and str[i] <= 'z': lower_ctr += 1
return lower_ctr
|
transformation_rename_variable_naive
|
def lower_ctr(str):
lower_ctr = 0
for VAR_0 in range(len(str)):
if str[VAR_0] >= "a" and str[VAR_0] <= "z":
lower_ctr += 1
return lower_ctr
| 1 | 815 |
mbpp
|
def lower_ctr(str):
lower_ctr= 0
for i in range(len(str)):
if str[i] >= 'a' and str[i] <= 'z': lower_ctr += 1
return lower_ctr
|
transformation_rename_variable_rn
|
def lower_ctr(str):
lower_ctr = 0
for T in range(len(str)):
if str[T] >= "a" and str[T] <= "z":
lower_ctr += 1
return lower_ctr
| 1 | 815 |
mbpp
|
def lower_ctr(str):
lower_ctr= 0
for i in range(len(str)):
if str[i] >= 'a' and str[i] <= 'z': lower_ctr += 1
return lower_ctr
|
transformation_add_sub_variable
|
def lower_ctr(str):
lower_ctr= 0
for i in range(len(str)):
if str[i] >= 'a' and str[i] <= 'z': lower_ctr -= 1
return lower_ctr
| 0 | 815 |
mbpp
|
def lower_ctr(str):
lower_ctr= 0
for i in range(len(str)):
if str[i] >= 'a' and str[i] <= 'z': lower_ctr += 1
return lower_ctr
|
transformation_lesser_greater_variable
|
def lower_ctr(str):
lower_ctr= 0
for i in range(len(str)):
if str[i] >= 'a' and str[i] >= 'z': lower_ctr += 1
return lower_ctr
| 0 | 815 |
mbpp
|
def lower_ctr(str):
lower_ctr= 0
for i in range(len(str)):
if str[i] >= 'a' and str[i] <= 'z': lower_ctr += 1
return lower_ctr
|
transformation_greater_lesser_variable
|
def lower_ctr(str):
lower_ctr= 0
for i in range(len(str)):
if str[i] <= 'a' and str[i] <= 'z': lower_ctr += 1
return lower_ctr
| 0 | 815 |
mbpp
|
def lower_ctr(str):
lower_ctr= 0
for i in range(len(str)):
if str[i] >= 'a' and str[i] <= 'z': lower_ctr += 1
return lower_ctr
|
transformation_and_or_variable
|
def lower_ctr(str):
lower_ctr= 0
for i in range(len(str)):
if str[i] >= 'a' or str[i] <= 'z': lower_ctr += 1
return lower_ctr
| 0 | 815 |
mbpp
|
def lower_ctr(str):
lower_ctr= 0
for i in range(len(str)):
if str[i] >= 'a' and str[i] <= 'z': lower_ctr += 1
return lower_ctr
|
transformation_dissimilar_code_injection_0
|
def min_cost(cost, m, n):
R = 3
C = 3
tc = [[0 for x in range(C)] for x in range(R)]
tc[0][0] = cost[0][0]
for i in range(1, m+1):
tc[i][0] = tc[i-1][0] + cost[i][0]
for j in range(1, n+1):
tc[0][j] = tc[0][j-1] + cost[0][j]
for i in range(1, m+1):
for j in range(1, n+1):
tc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j]
return tc[m][n]
| 0 | 815 |
mbpp
|
def lower_ctr(str):
lower_ctr= 0
for i in range(len(str)):
if str[i] >= 'a' and str[i] <= 'z': lower_ctr += 1
return lower_ctr
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 815 |
mbpp
|
def lower_ctr(str):
lower_ctr= 0
for i in range(len(str)):
if str[i] >= 'a' and str[i] <= 'z': lower_ctr += 1
return lower_ctr
|
transformation_dissimilar_code_injection_2
|
def is_not_prime(n):
import math
result = False
for i in range(2,int(math.sqrt(n)) + 1):
if n % i == 0:
result = True
return result
| 0 | 815 |
mbpp
|
def lower_ctr(str):
lower_ctr= 0
for i in range(len(str)):
if str[i] >= 'a' and str[i] <= 'z': lower_ctr += 1
return lower_ctr
|
transformation_dissimilar_code_injection_3
|
def heap_queue_largest(nums,n):
import heapq as hq
largest_nums = hq.nlargest(n, nums)
return largest_nums
| 0 | 815 |
mbpp
|
def lower_ctr(str):
lower_ctr= 0
for i in range(len(str)):
if str[i] >= 'a' and str[i] <= 'z': lower_ctr += 1
return lower_ctr
|
transformation_dissimilar_code_injection_4
|
def count_ways(n):
A = [0] * (n + 1)
B = [0] * (n + 1)
A[0] = 1
A[1] = 0
B[0] = 0
B[1] = 1
for i in range(2, n+1):
A[i] = A[i - 2] + 2 * B[i - 1]
B[i] = A[i - 1] + B[i - 2]
return A[n]
| 0 | 815 |
mbpp
|
def count_duplic(lists):
element = []
frequency = []
if not lists:
return element
running_count = 1
for i in range(len(lists)-1):
if lists[i] == lists[i+1]:
running_count += 1
else:
frequency.append(running_count)
element.append(lists[i])
running_count = 1
frequency.append(running_count)
element.append(lists[i+1])
return element,frequency
|
transformation_dead_code_insert
|
def count_duplic(lists):
element = []
frequency = []
if not lists:
return element
if False:
running_count = 1
running_count = 1
for i in range(len(lists) - 1):
if lists[i] == lists[i + 1]:
running_count += 1
else:
frequency.append(running_count)
element.append(lists[i])
running_count = 1
frequency.append(running_count)
element.append(lists[i + 1])
return element, frequency
| 1 | 816 |
mbpp
|
def count_duplic(lists):
element = []
frequency = []
if not lists:
return element
running_count = 1
for i in range(len(lists)-1):
if lists[i] == lists[i+1]:
running_count += 1
else:
frequency.append(running_count)
element.append(lists[i])
running_count = 1
frequency.append(running_count)
element.append(lists[i+1])
return element,frequency
|
transformation_for_while_loop
|
def count_duplic(lists):
element = []
frequency = []
if not lists:
return element
running_count = 1
i = 0
while i < len(lists) - 1:
if lists[i] == lists[i + 1]:
running_count += 1
else:
frequency.append(running_count)
element.append(lists[i])
running_count = 1
i += 1
frequency.append(running_count)
element.append(lists[i + 1])
return element, frequency
| 1 | 816 |
mbpp
|
def count_duplic(lists):
element = []
frequency = []
if not lists:
return element
running_count = 1
for i in range(len(lists)-1):
if lists[i] == lists[i+1]:
running_count += 1
else:
frequency.append(running_count)
element.append(lists[i])
running_count = 1
frequency.append(running_count)
element.append(lists[i+1])
return element,frequency
|
transformation_operand_swap
|
def count_duplic(lists):
element = []
frequency = []
if not lists:
return element
running_count = 1
for i in range(len(lists) - 1):
if lists[i + 1] == lists[i]:
running_count += 1
else:
frequency.append(running_count)
element.append(lists[i])
running_count = 1
frequency.append(running_count)
element.append(lists[i + 1])
return element, frequency
| 1 | 816 |
mbpp
|
def count_duplic(lists):
element = []
frequency = []
if not lists:
return element
running_count = 1
for i in range(len(lists)-1):
if lists[i] == lists[i+1]:
running_count += 1
else:
frequency.append(running_count)
element.append(lists[i])
running_count = 1
frequency.append(running_count)
element.append(lists[i+1])
return element,frequency
|
transformation_rename_variable_cb
|
def count_duplic(frequency2):
element = []
frequency = []
if not frequency2:
return element
running_count = 1
for i in range(len(frequency2) - 1):
if frequency2[i] == frequency2[i + 1]:
running_count += 1
else:
frequency.append(running_count)
element.append(frequency2[i])
running_count = 1
frequency.append(running_count)
element.append(frequency2[i + 1])
return element, frequency
| 1 | 816 |
mbpp
|
def count_duplic(lists):
element = []
frequency = []
if not lists:
return element
running_count = 1
for i in range(len(lists)-1):
if lists[i] == lists[i+1]:
running_count += 1
else:
frequency.append(running_count)
element.append(lists[i])
running_count = 1
frequency.append(running_count)
element.append(lists[i+1])
return element,frequency
|
transformation_rename_variable_naive
|
def count_duplic(VAR_0):
element = []
frequency = []
if not VAR_0:
return element
running_count = 1
for i in range(len(VAR_0) - 1):
if VAR_0[i] == VAR_0[i + 1]:
running_count += 1
else:
frequency.append(running_count)
element.append(VAR_0[i])
running_count = 1
frequency.append(running_count)
element.append(VAR_0[i + 1])
return element, frequency
| 1 | 816 |
mbpp
|
def count_duplic(lists):
element = []
frequency = []
if not lists:
return element
running_count = 1
for i in range(len(lists)-1):
if lists[i] == lists[i+1]:
running_count += 1
else:
frequency.append(running_count)
element.append(lists[i])
running_count = 1
frequency.append(running_count)
element.append(lists[i+1])
return element,frequency
|
transformation_rename_variable_rn
|
def count_duplic(Z9095):
element = []
frequency = []
if not Z9095:
return element
running_count = 1
for i in range(len(Z9095) - 1):
if Z9095[i] == Z9095[i + 1]:
running_count += 1
else:
frequency.append(running_count)
element.append(Z9095[i])
running_count = 1
frequency.append(running_count)
element.append(Z9095[i + 1])
return element, frequency
| 1 | 816 |
mbpp
|
def count_duplic(lists):
element = []
frequency = []
if not lists:
return element
running_count = 1
for i in range(len(lists)-1):
if lists[i] == lists[i+1]:
running_count += 1
else:
frequency.append(running_count)
element.append(lists[i])
running_count = 1
frequency.append(running_count)
element.append(lists[i+1])
return element,frequency
|
transformation_add_sub_variable
|
def count_duplic(lists):
element = []
frequency = []
if not lists:
return element
running_count = 1
for i in range(len(lists)-1):
if lists[i] == lists[i-1]:
running_count += 1
else:
frequency.append(running_count)
element.append(lists[i])
running_count = 1
frequency.append(running_count)
element.append(lists[i+1])
return element,frequency
| 0 | 816 |
mbpp
|
def count_duplic(lists):
element = []
frequency = []
if not lists:
return element
running_count = 1
for i in range(len(lists)-1):
if lists[i] == lists[i+1]:
running_count += 1
else:
frequency.append(running_count)
element.append(lists[i])
running_count = 1
frequency.append(running_count)
element.append(lists[i+1])
return element,frequency
|
transformation_sub_add_variable
|
def count_duplic(lists):
element = []
frequency = []
if not lists:
return element
running_count = 1
for i in range(len(lists)+1):
if lists[i] == lists[i+1]:
running_count += 1
else:
frequency.append(running_count)
element.append(lists[i])
running_count = 1
frequency.append(running_count)
element.append(lists[i+1])
return element,frequency
| 0 | 816 |
mbpp
|
def count_duplic(lists):
element = []
frequency = []
if not lists:
return element
running_count = 1
for i in range(len(lists)-1):
if lists[i] == lists[i+1]:
running_count += 1
else:
frequency.append(running_count)
element.append(lists[i])
running_count = 1
frequency.append(running_count)
element.append(lists[i+1])
return element,frequency
|
transformation_equalto_exclamation_variable
|
def count_duplic(lists):
element = []
frequency = []
if not lists:
return element
running_count = 1
for i in range(len(lists)-1):
if lists[i] != lists[i+1]:
running_count += 1
else:
frequency.append(running_count)
element.append(lists[i])
running_count = 1
frequency.append(running_count)
element.append(lists[i+1])
return element,frequency
| 0 | 816 |
mbpp
|
def count_duplic(lists):
element = []
frequency = []
if not lists:
return element
running_count = 1
for i in range(len(lists)-1):
if lists[i] == lists[i+1]:
running_count += 1
else:
frequency.append(running_count)
element.append(lists[i])
running_count = 1
frequency.append(running_count)
element.append(lists[i+1])
return element,frequency
|
transformation_dissimilar_code_injection_0
|
def min_cost(cost, m, n):
R = 3
C = 3
tc = [[0 for x in range(C)] for x in range(R)]
tc[0][0] = cost[0][0]
for i in range(1, m+1):
tc[i][0] = tc[i-1][0] + cost[i][0]
for j in range(1, n+1):
tc[0][j] = tc[0][j-1] + cost[0][j]
for i in range(1, m+1):
for j in range(1, n+1):
tc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j]
return tc[m][n]
| 0 | 816 |
mbpp
|
def count_duplic(lists):
element = []
frequency = []
if not lists:
return element
running_count = 1
for i in range(len(lists)-1):
if lists[i] == lists[i+1]:
running_count += 1
else:
frequency.append(running_count)
element.append(lists[i])
running_count = 1
frequency.append(running_count)
element.append(lists[i+1])
return element,frequency
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 816 |
mbpp
|
def count_duplic(lists):
element = []
frequency = []
if not lists:
return element
running_count = 1
for i in range(len(lists)-1):
if lists[i] == lists[i+1]:
running_count += 1
else:
frequency.append(running_count)
element.append(lists[i])
running_count = 1
frequency.append(running_count)
element.append(lists[i+1])
return element,frequency
|
transformation_dissimilar_code_injection_2
|
def is_not_prime(n):
import math
result = False
for i in range(2,int(math.sqrt(n)) + 1):
if n % i == 0:
result = True
return result
| 0 | 816 |
mbpp
|
def count_duplic(lists):
element = []
frequency = []
if not lists:
return element
running_count = 1
for i in range(len(lists)-1):
if lists[i] == lists[i+1]:
running_count += 1
else:
frequency.append(running_count)
element.append(lists[i])
running_count = 1
frequency.append(running_count)
element.append(lists[i+1])
return element,frequency
|
transformation_dissimilar_code_injection_3
|
def heap_queue_largest(nums,n):
import heapq as hq
largest_nums = hq.nlargest(n, nums)
return largest_nums
| 0 | 816 |
mbpp
|
def count_duplic(lists):
element = []
frequency = []
if not lists:
return element
running_count = 1
for i in range(len(lists)-1):
if lists[i] == lists[i+1]:
running_count += 1
else:
frequency.append(running_count)
element.append(lists[i])
running_count = 1
frequency.append(running_count)
element.append(lists[i+1])
return element,frequency
|
transformation_dissimilar_code_injection_4
|
def count_ways(n):
A = [0] * (n + 1)
B = [0] * (n + 1)
A[0] = 1
A[1] = 0
B[0] = 0
B[1] = 1
for i in range(2, n+1):
A[i] = A[i - 2] + 2 * B[i - 1]
B[i] = A[i - 1] + B[i - 2]
return A[n]
| 0 | 816 |
mbpp
|
def merge_dictionaries(dict1,dict2):
import collections as ct
merged_dict = dict(ct.ChainMap({}, dict1, dict2))
return merged_dict
|
transformation_dead_code_insert
|
def merge_dictionaries(dict1, dict2):
for _i_8 in range(0):
import collections as ct
import collections as ct
merged_dict = dict(ct.ChainMap({}, dict1, dict2))
return merged_dict
| 1 | 818 |
mbpp
|
def merge_dictionaries(dict1,dict2):
import collections as ct
merged_dict = dict(ct.ChainMap({}, dict1, dict2))
return merged_dict
|
transformation_for_while_loop
|
def merge_dictionaries(dict1, dict2):
import collections as ct
merged_dict = dict(ct.ChainMap({}, dict1, dict2))
return merged_dict
| 1 | 818 |
mbpp
|
def merge_dictionaries(dict1,dict2):
import collections as ct
merged_dict = dict(ct.ChainMap({}, dict1, dict2))
return merged_dict
|
transformation_operand_swap
|
def merge_dictionaries(dict1, dict2):
import collections as ct
merged_dict = dict(ct.ChainMap({}, dict1, dict2))
return merged_dict
| 1 | 818 |
mbpp
|
def merge_dictionaries(dict1,dict2):
import collections as ct
merged_dict = dict(ct.ChainMap({}, dict1, dict2))
return merged_dict
|
transformation_rename_variable_cb
|
def merge_dictionaries(dict1, dictionary):
import collections as ct
merged_dict = dict(ct.ChainMap({}, dict1, dictionary))
return merged_dict
| 1 | 818 |
mbpp
|
def merge_dictionaries(dict1,dict2):
import collections as ct
merged_dict = dict(ct.ChainMap({}, dict1, dict2))
return merged_dict
|
transformation_rename_variable_naive
|
def merge_dictionaries(dict1, VAR_0):
import collections as ct
merged_dict = dict(ct.ChainMap({}, dict1, VAR_0))
return merged_dict
| 1 | 818 |
mbpp
|
def merge_dictionaries(dict1,dict2):
import collections as ct
merged_dict = dict(ct.ChainMap({}, dict1, dict2))
return merged_dict
|
transformation_rename_variable_rn
|
def merge_dictionaries(dict1, dict2):
import collections as ct
E5754sQ4789 = dict(ct.ChainMap({}, dict1, dict2))
return E5754sQ4789
| 1 | 818 |
mbpp
|
def merge_dictionaries(dict1,dict2):
import collections as ct
merged_dict = dict(ct.ChainMap({}, dict1, dict2))
return merged_dict
|
transformation_dissimilar_code_injection_0
|
def min_cost(cost, m, n):
R = 3
C = 3
tc = [[0 for x in range(C)] for x in range(R)]
tc[0][0] = cost[0][0]
for i in range(1, m+1):
tc[i][0] = tc[i-1][0] + cost[i][0]
for j in range(1, n+1):
tc[0][j] = tc[0][j-1] + cost[0][j]
for i in range(1, m+1):
for j in range(1, n+1):
tc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j]
return tc[m][n]
| 0 | 818 |
mbpp
|
def merge_dictionaries(dict1,dict2):
import collections as ct
merged_dict = dict(ct.ChainMap({}, dict1, dict2))
return merged_dict
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 818 |
mbpp
|
def merge_dictionaries(dict1,dict2):
import collections as ct
merged_dict = dict(ct.ChainMap({}, dict1, dict2))
return merged_dict
|
transformation_dissimilar_code_injection_2
|
def is_not_prime(n):
import math
result = False
for i in range(2,int(math.sqrt(n)) + 1):
if n % i == 0:
result = True
return result
| 0 | 818 |
mbpp
|
def merge_dictionaries(dict1,dict2):
import collections as ct
merged_dict = dict(ct.ChainMap({}, dict1, dict2))
return merged_dict
|
transformation_dissimilar_code_injection_3
|
def heap_queue_largest(nums,n):
import heapq as hq
largest_nums = hq.nlargest(n, nums)
return largest_nums
| 0 | 818 |
mbpp
|
def merge_dictionaries(dict1,dict2):
import collections as ct
merged_dict = dict(ct.ChainMap({}, dict1, dict2))
return merged_dict
|
transformation_dissimilar_code_injection_4
|
def count_ways(n):
A = [0] * (n + 1)
B = [0] * (n + 1)
A[0] = 1
A[1] = 0
B[0] = 0
B[1] = 1
for i in range(2, n+1):
A[i] = A[i - 2] + 2 * B[i - 1]
B[i] = A[i - 1] + B[i - 2]
return A[n]
| 0 | 818 |
mbpp
|
def pass_validity(p):
import re
x = True
while x:
if (len(p)<6 or len(p)>12):
break
elif not re.search("[a-z]",p):
break
elif not re.search("[0-9]",p):
break
elif not re.search("[A-Z]",p):
break
elif not re.search("[$#@]",p):
break
elif re.search("\s",p):
break
else:
return True
x=False
break
if x:
return False
|
transformation_dead_code_insert
|
def pass_validity(p):
import re
x = True
while x:
if len(p) < 6 or len(p) > 12:
break
elif not re.search("[a-z]", p):
break
elif not re.search("[0-9]", p):
_i_4 = 0
if _i_4 > _i_4:
if x:
return False
break
elif not re.search("[A-Z]", p):
break
elif not re.search("[$#@]", p):
break
elif re.search("s", p):
break
else:
return True
x = False
break
if x:
return False
| 1 | 819 |
mbpp
|
def pass_validity(p):
import re
x = True
while x:
if (len(p)<6 or len(p)>12):
break
elif not re.search("[a-z]",p):
break
elif not re.search("[0-9]",p):
break
elif not re.search("[A-Z]",p):
break
elif not re.search("[$#@]",p):
break
elif re.search("\s",p):
break
else:
return True
x=False
break
if x:
return False
|
transformation_for_while_loop
|
def pass_validity(p):
import re
x = True
while x:
if len(p) < 6 or len(p) > 12:
break
elif not re.search("[a-z]", p):
break
elif not re.search("[0-9]", p):
break
elif not re.search("[A-Z]", p):
break
elif not re.search("[$#@]", p):
break
elif re.search("s", p):
break
else:
return True
x = False
break
if x:
return False
| 1 | 819 |
mbpp
|
def pass_validity(p):
import re
x = True
while x:
if (len(p)<6 or len(p)>12):
break
elif not re.search("[a-z]",p):
break
elif not re.search("[0-9]",p):
break
elif not re.search("[A-Z]",p):
break
elif not re.search("[$#@]",p):
break
elif re.search("\s",p):
break
else:
return True
x=False
break
if x:
return False
|
transformation_operand_swap
|
def pass_validity(p):
import re
x = True
while x:
if 6 > len(p) or len(p) > 12:
break
elif not re.search("[a-z]", p):
break
elif not re.search("[0-9]", p):
break
elif not re.search("[A-Z]", p):
break
elif not re.search("[$#@]", p):
break
elif re.search("s", p):
break
else:
return True
x = False
break
if x:
return False
| 1 | 819 |
mbpp
|
def pass_validity(p):
import re
x = True
while x:
if (len(p)<6 or len(p)>12):
break
elif not re.search("[a-z]",p):
break
elif not re.search("[0-9]",p):
break
elif not re.search("[A-Z]",p):
break
elif not re.search("[$#@]",p):
break
elif re.search("\s",p):
break
else:
return True
x=False
break
if x:
return False
|
transformation_rename_variable_cb
|
def pass_validity(x2):
import re
x = True
while x:
if len(x2) < 6 or len(x2) > 12:
break
elif not re.search("[a-z]", x2):
break
elif not re.search("[0-9]", x2):
break
elif not re.search("[A-Z]", x2):
break
elif not re.search("[$#@]", x2):
break
elif re.search("s", x2):
break
else:
return True
x = False
break
if x:
return False
| 1 | 819 |
mbpp
|
def pass_validity(p):
import re
x = True
while x:
if (len(p)<6 or len(p)>12):
break
elif not re.search("[a-z]",p):
break
elif not re.search("[0-9]",p):
break
elif not re.search("[A-Z]",p):
break
elif not re.search("[$#@]",p):
break
elif re.search("\s",p):
break
else:
return True
x=False
break
if x:
return False
|
transformation_rename_variable_naive
|
def pass_validity(VAR_0):
import re
x = True
while x:
if len(VAR_0) < 6 or len(VAR_0) > 12:
break
elif not re.search("[a-z]", VAR_0):
break
elif not re.search("[0-9]", VAR_0):
break
elif not re.search("[A-Z]", VAR_0):
break
elif not re.search("[$#@]", VAR_0):
break
elif re.search("s", VAR_0):
break
else:
return True
x = False
break
if x:
return False
| 1 | 819 |
mbpp
|
def pass_validity(p):
import re
x = True
while x:
if (len(p)<6 or len(p)>12):
break
elif not re.search("[a-z]",p):
break
elif not re.search("[0-9]",p):
break
elif not re.search("[A-Z]",p):
break
elif not re.search("[$#@]",p):
break
elif re.search("\s",p):
break
else:
return True
x=False
break
if x:
return False
|
transformation_rename_variable_rn
|
def pass_validity(l):
import re
x = True
while x:
if len(l) < 6 or len(l) > 12:
break
elif not re.search("[a-z]", l):
break
elif not re.search("[0-9]", l):
break
elif not re.search("[A-Z]", l):
break
elif not re.search("[$#@]", l):
break
elif re.search("s", l):
break
else:
return True
x = False
break
if x:
return False
| 1 | 819 |
mbpp
|
def pass_validity(p):
import re
x = True
while x:
if (len(p)<6 or len(p)>12):
break
elif not re.search("[a-z]",p):
break
elif not re.search("[0-9]",p):
break
elif not re.search("[A-Z]",p):
break
elif not re.search("[$#@]",p):
break
elif re.search("\s",p):
break
else:
return True
x=False
break
if x:
return False
|
transformation_sub_add_variable
|
def pass_validity(p):
import re
x = True
while x:
if (len(p)<6 or len(p)>12):
break
elif not re.search("[a+z]",p):
break
elif not re.search("[0-9]",p):
break
elif not re.search("[A-Z]",p):
break
elif not re.search("[$#@]",p):
break
elif re.search("\s",p):
break
else:
return True
x=False
break
if x:
return False
| 0 | 819 |
mbpp
|
def pass_validity(p):
import re
x = True
while x:
if (len(p)<6 or len(p)>12):
break
elif not re.search("[a-z]",p):
break
elif not re.search("[0-9]",p):
break
elif not re.search("[A-Z]",p):
break
elif not re.search("[$#@]",p):
break
elif re.search("\s",p):
break
else:
return True
x=False
break
if x:
return False
|
transformation_lesser_greater_variable
|
def pass_validity(p):
import re
x = True
while x:
if (len(p)>6 or len(p)>12):
break
elif not re.search("[a-z]",p):
break
elif not re.search("[0-9]",p):
break
elif not re.search("[A-Z]",p):
break
elif not re.search("[$#@]",p):
break
elif re.search("\s",p):
break
else:
return True
x=False
break
if x:
return False
| 0 | 819 |
mbpp
|
def pass_validity(p):
import re
x = True
while x:
if (len(p)<6 or len(p)>12):
break
elif not re.search("[a-z]",p):
break
elif not re.search("[0-9]",p):
break
elif not re.search("[A-Z]",p):
break
elif not re.search("[$#@]",p):
break
elif re.search("\s",p):
break
else:
return True
x=False
break
if x:
return False
|
transformation_greater_lesser_variable
|
def pass_validity(p):
import re
x = True
while x:
if (len(p)<6 or len(p)<12):
break
elif not re.search("[a-z]",p):
break
elif not re.search("[0-9]",p):
break
elif not re.search("[A-Z]",p):
break
elif not re.search("[$#@]",p):
break
elif re.search("\s",p):
break
else:
return True
x=False
break
if x:
return False
| 0 | 819 |
mbpp
|
def pass_validity(p):
import re
x = True
while x:
if (len(p)<6 or len(p)>12):
break
elif not re.search("[a-z]",p):
break
elif not re.search("[0-9]",p):
break
elif not re.search("[A-Z]",p):
break
elif not re.search("[$#@]",p):
break
elif re.search("\s",p):
break
else:
return True
x=False
break
if x:
return False
|
transformation_true_false_variable
|
def pass_validity(p):
import re
x = False
while x:
if (len(p)<6 or len(p)>12):
break
elif not re.search("[a-z]",p):
break
elif not re.search("[0-9]",p):
break
elif not re.search("[A-Z]",p):
break
elif not re.search("[$#@]",p):
break
elif re.search("\s",p):
break
else:
return True
x=False
break
if x:
return False
| 0 | 819 |
mbpp
|
def pass_validity(p):
import re
x = True
while x:
if (len(p)<6 or len(p)>12):
break
elif not re.search("[a-z]",p):
break
elif not re.search("[0-9]",p):
break
elif not re.search("[A-Z]",p):
break
elif not re.search("[$#@]",p):
break
elif re.search("\s",p):
break
else:
return True
x=False
break
if x:
return False
|
transformation_false_true_variable
|
def pass_validity(p):
import re
x = True
while x:
if (len(p)<6 or len(p)>12):
break
elif not re.search("[a-z]",p):
break
elif not re.search("[0-9]",p):
break
elif not re.search("[A-Z]",p):
break
elif not re.search("[$#@]",p):
break
elif re.search("\s",p):
break
else:
return True
x=False
break
if x:
return True
| 0 | 819 |
mbpp
|
def pass_validity(p):
import re
x = True
while x:
if (len(p)<6 or len(p)>12):
break
elif not re.search("[a-z]",p):
break
elif not re.search("[0-9]",p):
break
elif not re.search("[A-Z]",p):
break
elif not re.search("[$#@]",p):
break
elif re.search("\s",p):
break
else:
return True
x=False
break
if x:
return False
|
transformation_or_and_variable
|
def pass_validity(p):
import re
x = True
while x:
if (len(p)<6 and len(p)>12):
break
elif not re.search("[a-z]",p):
break
elif not re.search("[0-9]",p):
break
elif not re.search("[A-Z]",p):
break
elif not re.search("[$#@]",p):
break
elif re.search("\s",p):
break
else:
return True
x=False
break
if x:
return False
| 0 | 819 |
mbpp
|
def pass_validity(p):
import re
x = True
while x:
if (len(p)<6 or len(p)>12):
break
elif not re.search("[a-z]",p):
break
elif not re.search("[0-9]",p):
break
elif not re.search("[A-Z]",p):
break
elif not re.search("[$#@]",p):
break
elif re.search("\s",p):
break
else:
return True
x=False
break
if x:
return False
|
transformation_dissimilar_code_injection_0
|
def min_cost(cost, m, n):
R = 3
C = 3
tc = [[0 for x in range(C)] for x in range(R)]
tc[0][0] = cost[0][0]
for i in range(1, m+1):
tc[i][0] = tc[i-1][0] + cost[i][0]
for j in range(1, n+1):
tc[0][j] = tc[0][j-1] + cost[0][j]
for i in range(1, m+1):
for j in range(1, n+1):
tc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j]
return tc[m][n]
| 0 | 819 |
mbpp
|
def pass_validity(p):
import re
x = True
while x:
if (len(p)<6 or len(p)>12):
break
elif not re.search("[a-z]",p):
break
elif not re.search("[0-9]",p):
break
elif not re.search("[A-Z]",p):
break
elif not re.search("[$#@]",p):
break
elif re.search("\s",p):
break
else:
return True
x=False
break
if x:
return False
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 819 |
mbpp
|
def pass_validity(p):
import re
x = True
while x:
if (len(p)<6 or len(p)>12):
break
elif not re.search("[a-z]",p):
break
elif not re.search("[0-9]",p):
break
elif not re.search("[A-Z]",p):
break
elif not re.search("[$#@]",p):
break
elif re.search("\s",p):
break
else:
return True
x=False
break
if x:
return False
|
transformation_dissimilar_code_injection_2
|
def is_not_prime(n):
import math
result = False
for i in range(2,int(math.sqrt(n)) + 1):
if n % i == 0:
result = True
return result
| 0 | 819 |
mbpp
|
def pass_validity(p):
import re
x = True
while x:
if (len(p)<6 or len(p)>12):
break
elif not re.search("[a-z]",p):
break
elif not re.search("[0-9]",p):
break
elif not re.search("[A-Z]",p):
break
elif not re.search("[$#@]",p):
break
elif re.search("\s",p):
break
else:
return True
x=False
break
if x:
return False
|
transformation_dissimilar_code_injection_3
|
def heap_queue_largest(nums,n):
import heapq as hq
largest_nums = hq.nlargest(n, nums)
return largest_nums
| 0 | 819 |
mbpp
|
def pass_validity(p):
import re
x = True
while x:
if (len(p)<6 or len(p)>12):
break
elif not re.search("[a-z]",p):
break
elif not re.search("[0-9]",p):
break
elif not re.search("[A-Z]",p):
break
elif not re.search("[$#@]",p):
break
elif re.search("\s",p):
break
else:
return True
x=False
break
if x:
return False
|
transformation_dissimilar_code_injection_4
|
def count_ways(n):
A = [0] * (n + 1)
B = [0] * (n + 1)
A[0] = 1
A[1] = 0
B[0] = 0
B[1] = 1
for i in range(2, n+1):
A[i] = A[i - 2] + 2 * B[i - 1]
B[i] = A[i - 1] + B[i - 2]
return A[n]
| 0 | 819 |
mbpp
|
def check_substring(string, sample) :
import re
if (sample in string):
y = "\A" + sample
x = re.search(y, string)
if x :
return ("string starts with the given substring")
else :
return ("string doesnt start with the given substring")
else :
return ("entered string isnt a substring")
|
transformation_dead_code_insert
|
def check_substring(string, sample):
import re
if sample in string:
y = "A" + sample
_i_8 = 0
while _i_8 > _i_8:
if x:
return "string starts with the given substring"
else:
return "string doesnt start with the given substring"
x = re.search(y, string)
if x:
return "string starts with the given substring"
else:
return "string doesnt start with the given substring"
else:
return "entered string isnt a substring"
| 1 | 820 |
mbpp
|
def check_substring(string, sample) :
import re
if (sample in string):
y = "\A" + sample
x = re.search(y, string)
if x :
return ("string starts with the given substring")
else :
return ("string doesnt start with the given substring")
else :
return ("entered string isnt a substring")
|
transformation_for_while_loop
|
def check_substring(string, sample):
import re
if sample in string:
y = "A" + sample
x = re.search(y, string)
if x:
return "string starts with the given substring"
else:
return "string doesnt start with the given substring"
else:
return "entered string isnt a substring"
| 1 | 820 |
mbpp
|
def check_substring(string, sample) :
import re
if (sample in string):
y = "\A" + sample
x = re.search(y, string)
if x :
return ("string starts with the given substring")
else :
return ("string doesnt start with the given substring")
else :
return ("entered string isnt a substring")
|
transformation_operand_swap
|
def check_substring(string, sample):
import re
if sample in string:
y = "A" + sample
x = re.search(y, string)
if x:
return "string starts with the given substring"
else:
return "string doesnt start with the given substring"
else:
return "entered string isnt a substring"
| 1 | 820 |
mbpp
|
def check_substring(string, sample) :
import re
if (sample in string):
y = "\A" + sample
x = re.search(y, string)
if x :
return ("string starts with the given substring")
else :
return ("string doesnt start with the given substring")
else :
return ("entered string isnt a substring")
|
transformation_rename_variable_cb
|
def check_substring(y2, sample):
import re
if sample in y2:
y = "A" + sample
x = re.search(y, y2)
if x:
return "string starts with the given substring"
else:
return "string doesnt start with the given substring"
else:
return "entered string isnt a substring"
| 1 | 820 |
mbpp
|
def check_substring(string, sample) :
import re
if (sample in string):
y = "\A" + sample
x = re.search(y, string)
if x :
return ("string starts with the given substring")
else :
return ("string doesnt start with the given substring")
else :
return ("entered string isnt a substring")
|
transformation_rename_variable_naive
|
def check_substring(VAR_0, sample):
import re
if sample in VAR_0:
y = "A" + sample
x = re.search(y, VAR_0)
if x:
return "string starts with the given substring"
else:
return "string doesnt start with the given substring"
else:
return "entered string isnt a substring"
| 1 | 820 |
mbpp
|
def check_substring(string, sample) :
import re
if (sample in string):
y = "\A" + sample
x = re.search(y, string)
if x :
return ("string starts with the given substring")
else :
return ("string doesnt start with the given substring")
else :
return ("entered string isnt a substring")
|
transformation_rename_variable_rn
|
def check_substring(string, L6Q329):
import re
if L6Q329 in string:
y = "A" + L6Q329
x = re.search(y, string)
if x:
return "string starts with the given substring"
else:
return "string doesnt start with the given substring"
else:
return "entered string isnt a substring"
| 1 | 820 |
mbpp
|
def check_substring(string, sample) :
import re
if (sample in string):
y = "\A" + sample
x = re.search(y, string)
if x :
return ("string starts with the given substring")
else :
return ("string doesnt start with the given substring")
else :
return ("entered string isnt a substring")
|
transformation_add_sub_variable
|
def check_substring(string, sample) :
import re
if (sample in string):
y = "\A" - sample
x = re.search(y, string)
if x :
return ("string starts with the given substring")
else :
return ("string doesnt start with the given substring")
else :
return ("entered string isnt a substring")
| 0 | 820 |
mbpp
|
def check_substring(string, sample) :
import re
if (sample in string):
y = "\A" + sample
x = re.search(y, string)
if x :
return ("string starts with the given substring")
else :
return ("string doesnt start with the given substring")
else :
return ("entered string isnt a substring")
|
transformation_dissimilar_code_injection_0
|
def min_cost(cost, m, n):
R = 3
C = 3
tc = [[0 for x in range(C)] for x in range(R)]
tc[0][0] = cost[0][0]
for i in range(1, m+1):
tc[i][0] = tc[i-1][0] + cost[i][0]
for j in range(1, n+1):
tc[0][j] = tc[0][j-1] + cost[0][j]
for i in range(1, m+1):
for j in range(1, n+1):
tc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j]
return tc[m][n]
| 0 | 820 |
mbpp
|
def check_substring(string, sample) :
import re
if (sample in string):
y = "\A" + sample
x = re.search(y, string)
if x :
return ("string starts with the given substring")
else :
return ("string doesnt start with the given substring")
else :
return ("entered string isnt a substring")
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 820 |
mbpp
|
def check_substring(string, sample) :
import re
if (sample in string):
y = "\A" + sample
x = re.search(y, string)
if x :
return ("string starts with the given substring")
else :
return ("string doesnt start with the given substring")
else :
return ("entered string isnt a substring")
|
transformation_dissimilar_code_injection_2
|
def is_not_prime(n):
import math
result = False
for i in range(2,int(math.sqrt(n)) + 1):
if n % i == 0:
result = True
return result
| 0 | 820 |
mbpp
|
def check_substring(string, sample) :
import re
if (sample in string):
y = "\A" + sample
x = re.search(y, string)
if x :
return ("string starts with the given substring")
else :
return ("string doesnt start with the given substring")
else :
return ("entered string isnt a substring")
|
transformation_dissimilar_code_injection_3
|
def heap_queue_largest(nums,n):
import heapq as hq
largest_nums = hq.nlargest(n, nums)
return largest_nums
| 0 | 820 |
mbpp
|
def check_substring(string, sample) :
import re
if (sample in string):
y = "\A" + sample
x = re.search(y, string)
if x :
return ("string starts with the given substring")
else :
return ("string doesnt start with the given substring")
else :
return ("entered string isnt a substring")
|
transformation_dissimilar_code_injection_4
|
def count_ways(n):
A = [0] * (n + 1)
B = [0] * (n + 1)
A[0] = 1
A[1] = 0
B[0] = 0
B[1] = 1
for i in range(2, n+1):
A[i] = A[i - 2] + 2 * B[i - 1]
B[i] = A[i - 1] + B[i - 2]
return A[n]
| 0 | 820 |
mbpp
|
def remove_even(l):
for i in l:
if i % 2 == 0:
l.remove(i)
return l
|
transformation_dead_code_insert
|
def remove_even(l):
for i in l:
_i_2 = 0
while _i_2 < _i_2:
l.remove(i)
if i % 2 == 0:
l.remove(i)
return l
| 1 | 821 |
mbpp
|
def remove_even(l):
for i in l:
if i % 2 == 0:
l.remove(i)
return l
|
transformation_for_while_loop
|
def remove_even(l):
_i_i = 0
while _i_i < len(l):
i = l[_i_i]
if i % 2 == 0:
l.remove(i)
_i_i += 1
return l
| 1 | 821 |
mbpp
|
def remove_even(l):
for i in l:
if i % 2 == 0:
l.remove(i)
return l
|
transformation_operand_swap
|
def remove_even(l):
for i in l:
if 0 == i % 2:
l.remove(i)
return l
| 1 | 821 |
mbpp
|
def remove_even(l):
for i in l:
if i % 2 == 0:
l.remove(i)
return l
|
transformation_rename_variable_cb
|
def remove_even(i2):
for i in i2:
if i % 2 == 0:
i2.remove(i)
return i2
| 1 | 821 |
mbpp
|
def remove_even(l):
for i in l:
if i % 2 == 0:
l.remove(i)
return l
|
transformation_rename_variable_naive
|
def remove_even(VAR_0):
for i in VAR_0:
if i % 2 == 0:
VAR_0.remove(i)
return VAR_0
| 1 | 821 |
mbpp
|
def remove_even(l):
for i in l:
if i % 2 == 0:
l.remove(i)
return l
|
transformation_rename_variable_rn
|
def remove_even(D):
for i in D:
if i % 2 == 0:
D.remove(i)
return D
| 1 | 821 |
mbpp
|
def remove_even(l):
for i in l:
if i % 2 == 0:
l.remove(i)
return l
|
transformation_equalto_exclamation_variable
|
def remove_even(l):
for i in l:
if i % 2 != 0:
l.remove(i)
return l
| 0 | 821 |
mbpp
|
def remove_even(l):
for i in l:
if i % 2 == 0:
l.remove(i)
return l
|
transformation_dissimilar_code_injection_0
|
def min_cost(cost, m, n):
R = 3
C = 3
tc = [[0 for x in range(C)] for x in range(R)]
tc[0][0] = cost[0][0]
for i in range(1, m+1):
tc[i][0] = tc[i-1][0] + cost[i][0]
for j in range(1, n+1):
tc[0][j] = tc[0][j-1] + cost[0][j]
for i in range(1, m+1):
for j in range(1, n+1):
tc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j]
return tc[m][n]
| 0 | 821 |
mbpp
|
def remove_even(l):
for i in l:
if i % 2 == 0:
l.remove(i)
return l
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 821 |
mbpp
|
def remove_even(l):
for i in l:
if i % 2 == 0:
l.remove(i)
return l
|
transformation_dissimilar_code_injection_2
|
def is_not_prime(n):
import math
result = False
for i in range(2,int(math.sqrt(n)) + 1):
if n % i == 0:
result = True
return result
| 0 | 821 |
mbpp
|
def remove_even(l):
for i in l:
if i % 2 == 0:
l.remove(i)
return l
|
transformation_dissimilar_code_injection_3
|
def heap_queue_largest(nums,n):
import heapq as hq
largest_nums = hq.nlargest(n, nums)
return largest_nums
| 0 | 821 |
mbpp
|
def remove_even(l):
for i in l:
if i % 2 == 0:
l.remove(i)
return l
|
transformation_dissimilar_code_injection_4
|
def count_ways(n):
A = [0] * (n + 1)
B = [0] * (n + 1)
A[0] = 1
A[1] = 0
B[0] = 0
B[1] = 1
for i in range(2, n+1):
A[i] = A[i - 2] + 2 * B[i - 1]
B[i] = A[i - 1] + B[i - 2]
return A[n]
| 0 | 821 |
mbpp
|
def access_elements(nums, list_index):
result = [nums[i] for i in list_index]
return result
|
transformation_dead_code_insert
|
def access_elements(nums, list_index):
for _i_0 in range(0):
return result
result = [nums[i] for i in list_index]
return result
| 1 | 822 |
mbpp
|
def access_elements(nums, list_index):
result = [nums[i] for i in list_index]
return result
|
transformation_for_while_loop
|
def access_elements(nums, list_index):
result = [nums[i] for i in list_index]
return result
| 1 | 822 |
mbpp
|
def access_elements(nums, list_index):
result = [nums[i] for i in list_index]
return result
|
transformation_operand_swap
|
def access_elements(nums, list_index):
result = [nums[i] for i in list_index]
return result
| 1 | 822 |
mbpp
|
def access_elements(nums, list_index):
result = [nums[i] for i in list_index]
return result
|
transformation_rename_variable_cb
|
def access_elements(nums, list_index):
result = [nums[i2] for i2 in list_index]
return result
| 1 | 822 |
mbpp
|
def access_elements(nums, list_index):
result = [nums[i] for i in list_index]
return result
|
transformation_rename_variable_naive
|
def access_elements(VAR_0, list_index):
result = [VAR_0[i] for i in list_index]
return result
| 1 | 822 |
mbpp
|
def access_elements(nums, list_index):
result = [nums[i] for i in list_index]
return result
|
transformation_rename_variable_rn
|
def access_elements(nums, H4TmVUp8cs):
result = [nums[i] for i in H4TmVUp8cs]
return result
| 1 | 822 |
mbpp
|
def access_elements(nums, list_index):
result = [nums[i] for i in list_index]
return result
|
transformation_dissimilar_code_injection_0
|
def min_cost(cost, m, n):
R = 3
C = 3
tc = [[0 for x in range(C)] for x in range(R)]
tc[0][0] = cost[0][0]
for i in range(1, m+1):
tc[i][0] = tc[i-1][0] + cost[i][0]
for j in range(1, n+1):
tc[0][j] = tc[0][j-1] + cost[0][j]
for i in range(1, m+1):
for j in range(1, n+1):
tc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j]
return tc[m][n]
| 0 | 822 |
mbpp
|
def access_elements(nums, list_index):
result = [nums[i] for i in list_index]
return result
|
transformation_dissimilar_code_injection_1
|
def similar_elements(test_tup1, test_tup2):
res = tuple(set(test_tup1) & set(test_tup2))
return (res)
| 0 | 822 |
mbpp
|
def access_elements(nums, list_index):
result = [nums[i] for i in list_index]
return result
|
transformation_dissimilar_code_injection_2
|
def is_not_prime(n):
import math
result = False
for i in range(2,int(math.sqrt(n)) + 1):
if n % i == 0:
result = True
return result
| 0 | 822 |
mbpp
|
def access_elements(nums, list_index):
result = [nums[i] for i in list_index]
return result
|
transformation_dissimilar_code_injection_3
|
def heap_queue_largest(nums,n):
import heapq as hq
largest_nums = hq.nlargest(n, nums)
return largest_nums
| 0 | 822 |
mbpp
|
def access_elements(nums, list_index):
result = [nums[i] for i in list_index]
return result
|
transformation_dissimilar_code_injection_4
|
def count_ways(n):
A = [0] * (n + 1)
B = [0] * (n + 1)
A[0] = 1
A[1] = 0
B[0] = 0
B[1] = 1
for i in range(2, n+1):
A[i] = A[i - 2] + 2 * B[i - 1]
B[i] = A[i - 1] + B[i - 2]
return A[n]
| 0 | 822 |
mbpp
|
def check_Type_Of_Triangle(a,b,c):
sqa = pow(a,2)
sqb = pow(b,2)
sqc = pow(c,2)
if (sqa == sqa + sqb or sqb == sqa + sqc or sqc == sqa + sqb):
return ("Right-angled Triangle")
elif (sqa > sqc + sqb or sqb > sqa + sqc or sqc > sqa + sqb):
return ("Obtuse-angled Triangle")
else:
return ("Acute-angled Triangle")
|
transformation_dead_code_insert
|
def check_Type_Of_Triangle(a, b, c):
sqa = pow(a, 2)
_i_1 = 0
while _i_1 > _i_1:
return "Right-angled Triangle"
sqb = pow(b, 2)
sqc = pow(c, 2)
if sqa == sqa + sqb or sqb == sqa + sqc or sqc == sqa + sqb:
return "Right-angled Triangle"
elif sqa > sqc + sqb or sqb > sqa + sqc or sqc > sqa + sqb:
return "Obtuse-angled Triangle"
else:
return "Acute-angled Triangle"
| 1 | 823 |
mbpp
|
def check_Type_Of_Triangle(a,b,c):
sqa = pow(a,2)
sqb = pow(b,2)
sqc = pow(c,2)
if (sqa == sqa + sqb or sqb == sqa + sqc or sqc == sqa + sqb):
return ("Right-angled Triangle")
elif (sqa > sqc + sqb or sqb > sqa + sqc or sqc > sqa + sqb):
return ("Obtuse-angled Triangle")
else:
return ("Acute-angled Triangle")
|
transformation_for_while_loop
|
def check_Type_Of_Triangle(a, b, c):
sqa = pow(a, 2)
sqb = pow(b, 2)
sqc = pow(c, 2)
if sqa == sqa + sqb or sqb == sqa + sqc or sqc == sqa + sqb:
return "Right-angled Triangle"
elif sqa > sqc + sqb or sqb > sqa + sqc or sqc > sqa + sqb:
return "Obtuse-angled Triangle"
else:
return "Acute-angled Triangle"
| 1 | 823 |
mbpp
|
def check_Type_Of_Triangle(a,b,c):
sqa = pow(a,2)
sqb = pow(b,2)
sqc = pow(c,2)
if (sqa == sqa + sqb or sqb == sqa + sqc or sqc == sqa + sqb):
return ("Right-angled Triangle")
elif (sqa > sqc + sqb or sqb > sqa + sqc or sqc > sqa + sqb):
return ("Obtuse-angled Triangle")
else:
return ("Acute-angled Triangle")
|
transformation_operand_swap
|
def check_Type_Of_Triangle(a, b, c):
sqa = pow(a, 2)
sqb = pow(b, 2)
sqc = pow(c, 2)
if sqa == sqa + sqb or sqb == sqa + sqc or sqa + sqb == sqc:
return "Right-angled Triangle"
elif sqa > sqc + sqb or sqb > sqa + sqc or sqc > sqa + sqb:
return "Obtuse-angled Triangle"
else:
return "Acute-angled Triangle"
| 1 | 823 |
mbpp
|
def check_Type_Of_Triangle(a,b,c):
sqa = pow(a,2)
sqb = pow(b,2)
sqc = pow(c,2)
if (sqa == sqa + sqb or sqb == sqa + sqc or sqc == sqa + sqb):
return ("Right-angled Triangle")
elif (sqa > sqc + sqb or sqb > sqa + sqc or sqc > sqa + sqb):
return ("Obtuse-angled Triangle")
else:
return ("Acute-angled Triangle")
|
transformation_rename_variable_cb
|
def check_Type_Of_Triangle(a, b, c):
a2 = pow(a, 2)
sqb = pow(b, 2)
sqc = pow(c, 2)
if a2 == a2 + sqb or sqb == a2 + sqc or sqc == a2 + sqb:
return "Right-angled Triangle"
elif a2 > sqc + sqb or sqb > a2 + sqc or sqc > a2 + sqb:
return "Obtuse-angled Triangle"
else:
return "Acute-angled Triangle"
| 1 | 823 |
mbpp
|
def check_Type_Of_Triangle(a,b,c):
sqa = pow(a,2)
sqb = pow(b,2)
sqc = pow(c,2)
if (sqa == sqa + sqb or sqb == sqa + sqc or sqc == sqa + sqb):
return ("Right-angled Triangle")
elif (sqa > sqc + sqb or sqb > sqa + sqc or sqc > sqa + sqb):
return ("Obtuse-angled Triangle")
else:
return ("Acute-angled Triangle")
|
transformation_rename_variable_naive
|
def check_Type_Of_Triangle(a, b, c):
VAR_0 = pow(a, 2)
sqb = pow(b, 2)
sqc = pow(c, 2)
if VAR_0 == VAR_0 + sqb or sqb == VAR_0 + sqc or sqc == VAR_0 + sqb:
return "Right-angled Triangle"
elif VAR_0 > sqc + sqb or sqb > VAR_0 + sqc or sqc > VAR_0 + sqb:
return "Obtuse-angled Triangle"
else:
return "Acute-angled Triangle"
| 1 | 823 |
mbpp
|
def check_Type_Of_Triangle(a,b,c):
sqa = pow(a,2)
sqb = pow(b,2)
sqc = pow(c,2)
if (sqa == sqa + sqb or sqb == sqa + sqc or sqc == sqa + sqb):
return ("Right-angled Triangle")
elif (sqa > sqc + sqb or sqb > sqa + sqc or sqc > sqa + sqb):
return ("Obtuse-angled Triangle")
else:
return ("Acute-angled Triangle")
|
transformation_rename_variable_rn
|
def check_Type_Of_Triangle(a, b, c):
hk6 = pow(a, 2)
sqb = pow(b, 2)
sqc = pow(c, 2)
if hk6 == hk6 + sqb or sqb == hk6 + sqc or sqc == hk6 + sqb:
return "Right-angled Triangle"
elif hk6 > sqc + sqb or sqb > hk6 + sqc or sqc > hk6 + sqb:
return "Obtuse-angled Triangle"
else:
return "Acute-angled Triangle"
| 1 | 823 |
mbpp
|
def check_Type_Of_Triangle(a,b,c):
sqa = pow(a,2)
sqb = pow(b,2)
sqc = pow(c,2)
if (sqa == sqa + sqb or sqb == sqa + sqc or sqc == sqa + sqb):
return ("Right-angled Triangle")
elif (sqa > sqc + sqb or sqb > sqa + sqc or sqc > sqa + sqb):
return ("Obtuse-angled Triangle")
else:
return ("Acute-angled Triangle")
|
transformation_add_sub_variable
|
def check_Type_Of_Triangle(a,b,c):
sqa = pow(a,2)
sqb = pow(b,2)
sqc = pow(c,2)
if (sqa == sqa - sqb or sqb == sqa + sqc or sqc == sqa + sqb):
return ("Right-angled Triangle")
elif (sqa > sqc + sqb or sqb > sqa + sqc or sqc > sqa + sqb):
return ("Obtuse-angled Triangle")
else:
return ("Acute-angled Triangle")
| 0 | 823 |
mbpp
|
def check_Type_Of_Triangle(a,b,c):
sqa = pow(a,2)
sqb = pow(b,2)
sqc = pow(c,2)
if (sqa == sqa + sqb or sqb == sqa + sqc or sqc == sqa + sqb):
return ("Right-angled Triangle")
elif (sqa > sqc + sqb or sqb > sqa + sqc or sqc > sqa + sqb):
return ("Obtuse-angled Triangle")
else:
return ("Acute-angled Triangle")
|
transformation_sub_add_variable
|
def check_Type_Of_Triangle(a,b,c):
sqa = pow(a,2)
sqb = pow(b,2)
sqc = pow(c,2)
if (sqa == sqa + sqb or sqb == sqa + sqc or sqc == sqa + sqb):
return ("Right+angled Triangle")
elif (sqa > sqc + sqb or sqb > sqa + sqc or sqc > sqa + sqb):
return ("Obtuse-angled Triangle")
else:
return ("Acute-angled Triangle")
| 0 | 823 |
mbpp
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.