id
stringlengths 35
39
| content
stringlengths 44
3.85k
| max_stars_repo_path
stringlengths 52
57
|
|---|---|---|
refactory_data_question_1_wrong_1_506
|
def search(x, seq):
i = 0
while (i<len(seq) and x<seq[i]):
i += 1
i -= 1
return i
|
./refactory/data/question_1/code/wrong/wrong_1_506.py
|
refactory_data_question_1_wrong_1_349
|
def search(x, seq):
#Takes in a value x and a sorted sequence seq, and returns the
#position that x should go to such that the sequence remains sorted
for i, x in enumerate(seq):
if x < seq[i]:
return i
return len(seq)
|
./refactory/data/question_1/code/wrong/wrong_1_349.py
|
refactory_data_question_1_wrong_1_123
|
def search(x, seq):
if len(seq) == 0:
return 0
elif x >= seq[-1]:
return len(seq)
else:
for i, elem in enumerate(seq):
if elem >= x:
return i
""" Takes in a value x and a sorted sequence seq, and returns the
position that x should go to such that the sequence remains sorted """
|
./refactory/data/question_1/code/wrong/wrong_1_123.py
|
refactory_data_question_1_wrong_1_426
|
def search(x,seq):
for i, elem in enumerate(seq):
if x <= elem:
return i
else:
return len(seq)
|
./refactory/data/question_1/code/wrong/wrong_1_426.py
|
refactory_data_question_1_wrong_1_118
|
def search(x, seq):
if seq == []:
return 0
elif x >= seq[-1]:
return len(seq)
else:
for i, elem in enumerate(seq):
if elem >= x:
return i
""" Takes in a value x and a sorted sequence seq, and returns the
position that x should go to such that the sequence remains sorted """
return
|
./refactory/data/question_1/code/wrong/wrong_1_118.py
|
refactory_data_question_1_wrong_1_387
|
def search(x, seq):
for i in range(len(seq)):
if seq[i] < x:
continue
elif x <= seq[i]:
return i
else:
return len(seq)+1
""" Takes in a value x and a sorted sequence seq, and returns the
position that x should go to such that the sequence remains sorted """
|
./refactory/data/question_1/code/wrong/wrong_1_387.py
|
refactory_data_question_1_wrong_1_422
|
def search(x, seq):
for i in range (len(seq)):
if seq == ():
return
if x <= seq[i]:
return i
elif x > seq[len(seq)-1]:
return len(seq)
|
./refactory/data/question_1/code/wrong/wrong_1_422.py
|
refactory_data_question_1_wrong_1_336
|
def search(x, seq):
if seq == ():
return 0
if x <= seq[0]:
return 0
for i in range(len(seq)-1):
if seq[i+1]>=x and x>seq[i]:
return i+1
return len(seq)
|
./refactory/data/question_1/code/wrong/wrong_1_336.py
|
refactory_data_question_1_wrong_1_198
|
def search(x, seq):
for i in len(range(seq)):
if x>seq[i]:
return i
|
./refactory/data/question_1/code/wrong/wrong_1_198.py
|
refactory_data_question_1_wrong_1_504
|
def search(x, seq):
i = 0
while (i<len(seq) and x<seq[i]):
i += 1
if i==len(seq):
seq += (x,)
else:
seq.insert(i, x)
return seq
|
./refactory/data/question_1/code/wrong/wrong_1_504.py
|
refactory_data_question_1_wrong_1_430
|
def search(x, seq):
for i,elem in enumerate(seq):
if seq==() or []:
return 0
elif elem>=x:
return i
elif i+1==len(seq):
return len(seq)
else:
continue
|
./refactory/data/question_1/code/wrong/wrong_1_430.py
|
refactory_data_question_1_wrong_1_354
|
def search(x, seq):
""" Takes in a value x and a sorted sequence seq, and returns the
position that x should go to such that the sequence remains sorted """
position = 0
found = False
while position < len(seq) and not found:
if x > seq[position]:
found = True
else:
position += position
return position
|
./refactory/data/question_1/code/wrong/wrong_1_354.py
|
refactory_data_question_1_wrong_1_379
|
def search(x, seq):
for i in range(len(seq)):
if seq[i] < x:
continue
elif seq[len(seq)-1] < x:
return len(seq)-1
else:
return i
""" Takes in a value x and a sorted sequence seq, and returns the
position that x should go to such that the sequence remains sorted """
|
./refactory/data/question_1/code/wrong/wrong_1_379.py
|
refactory_data_question_1_wrong_1_429
|
def search(x, seq):
for i,elem in enumerate(seq):
if elem>=x:
return i
elif i+1==len(seq):
return len(seq)
else:
continue
|
./refactory/data/question_1/code/wrong/wrong_1_429.py
|
refactory_data_question_1_wrong_1_335
|
def search(x, seq):
if x <= seq[0]:
return 0
for i in range(len(seq)-1):
if seq[i+1]>=x and x>seq[i]:
return i+1
return len(seq)
|
./refactory/data/question_1/code/wrong/wrong_1_335.py
|
refactory_data_question_1_wrong_1_261
|
def search(x, seq):
""" Takes in a value x and a sorted sequence seq, and returns the
position that x should go to such that the sequence remains sorted """
for i in range(len(seq)):
if seq[i] >= x:
return i
else:
return len(seq)
|
./refactory/data/question_1/code/wrong/wrong_1_261.py
|
refactory_data_question_1_wrong_1_406
|
def search(x, seq):
for i in seq:
if x <= i:
return seq.index[i]
else:
return (seq.index[-1] + 1)
|
./refactory/data/question_1/code/wrong/wrong_1_406.py
|
refactory_data_question_1_wrong_1_565
|
def search(x, seq):
for i, elem in enumerate(seq):
if seq == ():
return 0
elif x <= elem:
return i
elif i == (len(seq)-1):
return i+1
else:
continue
|
./refactory/data/question_1/code/wrong/wrong_1_565.py
|
refactory_data_question_1_wrong_1_025
|
def search(x, seq):
a = len(seq)
if x < seq[0]:
return 0
elif x > seq[-1]:
return a
else:
for i in range(a):
if x == seq[i]:
return i
elif x < seq[i]:
return i
|
./refactory/data/question_1/code/wrong/wrong_1_025.py
|
refactory_data_question_1_wrong_1_472
|
def search(x, seq):
for i, element in enumerate(seq):
if seq == ():
return 0
else:
for element in seq:
if x > element:
i+=1
return i
|
./refactory/data/question_1/code/wrong/wrong_1_472.py
|
refactory_data_question_1_wrong_1_173
|
def search(x, seq):
if seq == ():
return 0
else:
for element in seq:
if x <= element:
return list(seq).index(element)
elif x >= max(seq):
return (list(seq).index(max(seq)))+1
|
./refactory/data/question_1/code/wrong/wrong_1_173.py
|
refactory_data_question_1_wrong_1_401
|
def search(x, seq):
for i, elem in enumerate(seq):
if x > elem:
continue
else:
return i
|
./refactory/data/question_1/code/wrong/wrong_1_401.py
|
refactory_data_question_1_wrong_1_013
|
def search(x, seq):
for i, elem in enumerate(seq):
if elem < x < elem + 1:
return i
|
./refactory/data/question_1/code/wrong/wrong_1_013.py
|
refactory_data_question_1_wrong_1_231
|
def search(x, seq):
if x <= seq[0]:
return 0
elif x >= seq[len(seq)-1]:
return len(seq)
elif seq == ():
return 0
else:
for i, elem in enumerate(seq):
if elem <= x <= seq[i+1]:
return i+1
|
./refactory/data/question_1/code/wrong/wrong_1_231.py
|
refactory_data_question_1_wrong_1_249
|
def search(x, seq):
if x <= seq[0]:
position = 0
for i in range(len(seq)):
if x <= seq[i] and x > seq[i-1]:
position = i
return position
|
./refactory/data/question_1/code/wrong/wrong_1_249.py
|
refactory_data_question_1_wrong_1_461
|
def search(x, seq):
if seq == []:
return 0
elif len(seq) == 1:
if seq[0] < x:
return 0
else:
return 1
elif seq[-1] <= x:
return len(seq)
elif seq[0] >= x:
return 0
else:
for i in range(len(seq)):
if x >= seq[i] and x <= seq[i+1]:
return i + 1
|
./refactory/data/question_1/code/wrong/wrong_1_461.py
|
refactory_data_question_1_wrong_1_420
|
def search(x, seq):
for i in range(len(seq)-1):
if x <= seq[i+1]:
return i
return len(seq)
|
./refactory/data/question_1/code/wrong/wrong_1_420.py
|
refactory_data_question_1_wrong_1_512
|
def search(x, seq):
Index = 0
for i in range(0,len(seq)+1):
Index = i
if int(x) < seq[0]:
return 0
elif int(x)> list1[len(seq)-1]:
return len(seq)
elif int(x) > seq[i]:
continue
return Index
|
./refactory/data/question_1/code/wrong/wrong_1_512.py
|
refactory_data_question_1_wrong_1_358
|
def search(x, seq):
if x <= seq[0]:
return 0
elif x >= seq[-1]:
return len(seq)
else:
for i in range(0, len(seq)-1):
if seq[i] <= x <= seq[i+1]:
return i+1
|
./refactory/data/question_1/code/wrong/wrong_1_358.py
|
refactory_data_question_1_wrong_1_027
|
def search(x, seq):
if seq == ():
return 0
else:
for i, elem in enumerate(seq):
if x <= elem:
return i
elif x > seq[-1]:
return len(seq)
|
./refactory/data/question_1/code/wrong/wrong_1_027.py
|
refactory_data_question_1_wrong_1_079
|
def search(x, seq):
if seq==[]:
return 0
for count, ele in enumerate(seq):
if x<=ele:
return count
for ele in seq:
if x>ele:
return len(seq)
|
./refactory/data/question_1/code/wrong/wrong_1_079.py
|
refactory_data_question_1_wrong_1_414
|
def search(x, seq):
for i, elem in enumerate(seq):
if x <= elem:
return i
return i + 1
|
./refactory/data/question_1/code/wrong/wrong_1_414.py
|
refactory_data_question_1_wrong_1_501
|
def search(x, seq):
for i in range(len(seq)):
if seq[i] >= x:
return i
return len(seq)
""" Takes in a value x and a sorted sequence seq, and returns the
position that x should go to such that the sequence remains sorted """
|
./refactory/data/question_1/code/wrong/wrong_1_501.py
|
refactory_data_question_1_wrong_1_521
|
def search(x, seq):
if len(seq) == 0 or x < seq[0] :
return 0
elif x > seq[len(seq)-1]:
return len(seq)
else:
result = 0
for i, element in enumerate(seq):
if x < (element + 1):
result = i
return
return result
|
./refactory/data/question_1/code/wrong/wrong_1_521.py
|
refactory_data_question_1_wrong_1_380
|
def search(x, seq):
for i in range(len(seq)):
if seq[i] < x:
continue
elif seq[len(seq)] < x:
return len(seq)
else:
return i
""" Takes in a value x and a sorted sequence seq, and returns the
position that x should go to such that the sequence remains sorted """
|
./refactory/data/question_1/code/wrong/wrong_1_380.py
|
refactory_data_question_1_wrong_1_111
|
def search(x, seq):
""" Takes in a value x and a sorted sequence seq, and returns the
position that x should go to such that the sequence remains sorted """
for i,j in enumerate(seq[:len(seq)-1]):
if seq == []:
return 0
elif x < seq[0]:
return 0
elif x > j and x <= seq[i+1]:
return i+1
elif x > seq[len(seq)-1]:
return len(seq)
else:
continue
|
./refactory/data/question_1/code/wrong/wrong_1_111.py
|
refactory_data_question_1_wrong_1_369
|
def search(x, seq):
lst1 = list(seq)
if lst1 == []:
return [x]
else:
length = len(lst1)
lst2 = []
if x < seq[0]:
lst2 = [x] + lst1
elif x > seq[length -1]:
lst2 = lst1 + [x]
else:
for i in range(0, length):
if seq[i] <= x <= seq[i+1]:
lst2 = lst1[:i+1] + [x] + lst1[i+1:]
for i in range(len(lst2)):
if x == lst2[i]:
return i
|
./refactory/data/question_1/code/wrong/wrong_1_369.py
|
refactory_data_question_1_wrong_1_489
|
def search(x, seq):
l=len(seq)
for i in range(l+1):
if x<=seq[i]:
break
return i
|
./refactory/data/question_1/code/wrong/wrong_1_489.py
|
refactory_data_question_1_wrong_1_356
|
def search(x, seq):
""" Takes in a value x and a sorted sequence seq, and returns the
position that x should go to such that the sequence remains sorted """
position = 0
found = False
while position < len(seq) and not found:
if x < seq[position]:
found = True
else:
position += 1
return position
|
./refactory/data/question_1/code/wrong/wrong_1_356.py
|
refactory_data_question_1_wrong_1_444
|
def search(x, seq):
if x < seq[0]:
return 0
else:
y = len(seq)
for i in range(y-1):
if x > seq[i] and x <= seq[i+1]:
return i + 1
return y
|
./refactory/data/question_1/code/wrong/wrong_1_444.py
|
refactory_data_question_1_wrong_1_445
|
def search(x, seq):
y = len(seq)
if y == 0:
return None
if x < seq[0]:
return 0
else:
for i in range(y-1):
if x > seq[i] and x <= seq[i+1]:
return i + 1
return y
|
./refactory/data/question_1/code/wrong/wrong_1_445.py
|
refactory_data_question_1_wrong_1_456
|
def search(x, seq):
if seq == []:
return 0
elif len(seq) == 1:
if seq[0] < x:
return 0
else:
return 1
elif seq[-1] <= x:
return len(seq) + 1
else:
for i in range(len(seq)):
if x >= seq[i] and x <= seq[i + 1]:
return i + 1
|
./refactory/data/question_1/code/wrong/wrong_1_456.py
|
refactory_data_question_1_wrong_1_378
|
def search(x, seq):
for i in range(len(seq)):
if seq[i] < x:
continue
elif seq[len(seq)-1] < x:
return len(seq)
else:
return i
""" Takes in a value x and a sorted sequence seq, and returns the
position that x should go to such that the sequence remains sorted """
|
./refactory/data/question_1/code/wrong/wrong_1_378.py
|
refactory_data_question_1_wrong_1_163
|
def search(x, seq):
if seq==():
return 0
for i in range(len(seq)-1):
if x<=seq[0]:
return 0
if seq[i]<=x<=seq[i+1]:
return i+1
if x>=seq[-1]:
return len(seq)
|
./refactory/data/question_1/code/wrong/wrong_1_163.py
|
refactory_data_question_1_wrong_1_063
|
def search(x, seq):
if type(seq) == tuple:
seq = list(seq)
seq.append(x)
sorted(seq)
return seq.index(x)
|
./refactory/data/question_1/code/wrong/wrong_1_063.py
|
refactory_data_question_1_wrong_1_330
|
def search(x, seq):
for item in seq:
if x < item:
return index(item)
|
./refactory/data/question_1/code/wrong/wrong_1_330.py
|
refactory_data_question_2_correct_2_133
|
def unique_day(day, possible_birthdays):
a = 0
for date in possible_birthdays:
cb = date[1]
if day == cb:
a+= 1
else:
continue
if a==1:
return True
else:
return False
def unique_month(month, possible_birthdays):
a = 0
for date in possible_birthdays:
lj = date[0]
if month == lj:
a+= 1
else:
continue
if a == 1:
return True
else:
return False
def contains_unique_day(month, possible_birthdays):
#find the possible days in that month
#determine if they are unique days one by one
possible_days = ()
for date in possible_birthdays:
if month == date[0]:
possible_days += (date[1],)
else:
continue
for day in possible_days:
if unique_day(day,possible_birthdays):
return True
else:
continue
return False
|
./refactory/data/question_2/code/correct/correct_2_133.py
|
refactory_data_question_2_correct_2_274
|
def unique_day(day, possible_birthdays):
counter = 0
for elem in possible_birthdays:
birthday = elem[1]
if birthday == day:
counter += 1
if counter == 1:
return True
else:
return False
def unique_month(month, possible_birthdays):
counter = 0
for elem in possible_birthdays:
birthmonth = elem[0]
if birthmonth == month:
counter += 1
if counter == 1:
return True
else:
return False
def contains_unique_day(month, possible_birthdays):
for elem in possible_birthdays:
birthmonth = elem[0]
if birthmonth == month:
if unique_day(elem[1], possible_birthdays) == True:
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_274.py
|
refactory_data_question_2_correct_2_093
|
def unique_day(day, possible_birthdays):
if (tuple(map(lambda x: x[1], possible_birthdays))).count(day) == 1:
return True
return False
def unique_month(month, possible_birthdays):
if (tuple(map(lambda x: x[0], possible_birthdays))).count(month) == 1:
return True
return False
def contains_unique_day(month, possible_birthdays):
b =()
for p in possible_birthdays:
if month == p[0]:
b += (p[1],) #tuple of all the days of that month
for d in b:
if unique_day(d, possible_birthdays) == False:
continue
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_093.py
|
refactory_data_question_2_correct_2_071
|
def count_dates(date, possible_birthdays):
count = 0
for i in possible_birthdays:
if i[1] == date:
count += 1
return count
def unique_day(date, possible_birthdays):
if count_dates(date, possible_birthdays) == 1:
return True
else:
return False
def count_months(month, possible_birthdays):
count = 0
for i in possible_birthdays:
if i[0] == month:
count += 1
return count
def unique_month(month, possible_birthdays):
if count_months(month, possible_birthdays) == 1:
return True
else:
return False
def days(month, possible_birthdays):
days_in_month = ()
for i in range(len(possible_birthdays)):
if possible_birthdays[i][0] == month:
days_in_month += (possible_birthdays[i],)
return days_in_month
def contains_unique_day(month, possible_birthdays):
for x in range(len(days(month, possible_birthdays))):
if unique_day(days(month, possible_birthdays)[x][1], possible_birthdays):
return True
elif unique_day(days(month, possible_birthdays)[len(days(month, possible_birthdays))-1][1], possible_birthdays) == False:
return False
|
./refactory/data/question_2/code/correct/correct_2_071.py
|
refactory_data_question_2_correct_2_017
|
def unique_day(day, possible_birthdays):
count = 0
for i in range(len(possible_birthdays)):
if day == possible_birthdays[i][1]:
count += 1
if count == 1:
return True
else:
return False
def unique_month(month, possible_birthdays):
count = 0
for i in range(len(possible_birthdays)):
if month == possible_birthdays[i][0]:
count += 1
if count == 1:
return True
else:
return False
def contains_unique_day(month, possible_birthdays):
for date in possible_birthdays:
if unique_day(date[1], possible_birthdays) == True and month == date[0]:
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_017.py
|
refactory_data_question_2_correct_2_181
|
def unique_day(date, possible_birthdays):
lenth=len(possible_birthdays)
count=0
for i in range(0,lenth):
if date==possible_birthdays[i][1]:
count=count+1
if count==1:
return True
else:
return False
def unique_month(month, possible_birthdays):
lenth=len(possible_birthdays)
count=0
for i in range(0,lenth):
if month==possible_birthdays[i][0]:
count=count+1
if count==1:
return True
else:
return False
def contains_unique_day(month, possible_birthdays):
count=()
for i in possible_birthdays:
if i[0]==month:
if i not in count:
count=count+(i,)
for j in count:
if unique_day(j[1], possible_birthdays):
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_181.py
|
refactory_data_question_2_correct_2_092
|
def unique_day(day, possible_birthdays):
if (tuple(map(lambda x: x[1], possible_birthdays))).count(day) == 1:
return True
return False
def unique_month(month, possible_birthdays):
if (tuple(map(lambda x: x[0], possible_birthdays))).count(month) == 1:
return True
return False
def contains_unique_day(month, possible_birthdays):
b =()
for p in possible_birthdays:
if month == p[0]:
b += (p[1],) #tuple of all the days of that month
for d in b:
if unique_day(d, possible_birthdays) == False:
continue
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_092.py
|
refactory_data_question_2_correct_2_057
|
def map(fn, seq):
res = ()
for ele in seq:
res = res + (fn(ele), )
return res
def filter(pred, seq):
res = ()
for ele in seq:
if pred(ele):
res = res + (ele, )
return res
def unique_day(day, possible_birthdays):
possible_days=map(lambda x:x[1],possible_birthdays)
def count(day,possible_days):
count_day=0
for i in possible_days:
if i==day:
count_day=count_day+1
return count_day
return count(day,possible_days)==1
def unique_month(month, possible_birthdays):
possible_months=map(lambda x:x[0],possible_birthdays)
def count(month,possible_months):
count_month=0
for i in possible_months:
if i==month:
count_month=count_month+1
return count_month
return count(month,possible_months)==1
def contains_unique_day(month, possible_birthdays):
tuple_with_unique_day=filter(lambda x:unique_day(x[1],possible_birthdays)==True,possible_birthdays)
month_with_unique_day=map(lambda x:x[0],tuple_with_unique_day)
return month in month_with_unique_day
|
./refactory/data/question_2/code/correct/correct_2_057.py
|
refactory_data_question_2_correct_2_112
|
def unique_day(day, possible_birthdays):
checker=0
for k in possible_birthdays:
if k[1]==day:
checker+=1
return checker==1
def unique_month(day, possible_birthdays):
checker=0
for k in possible_birthdays:
if k[0]==day:
checker+=1
return checker==1
def contains_unique_day(month, possible_birthdays):
collect=()
for i in possible_birthdays:
if i[0]==month:
collect+=(i[1],)
for i in collect:
if unique_day(i,possible_birthdays):
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_112.py
|
refactory_data_question_2_correct_2_147
|
def unique_day(day, possible_birthdays):
count=0
for i in possible_birthdays:
if i[1]==day:
count+=1
return count==1
def unique_month(month, possible_birthdays):
count=0
for i in possible_birthdays:
if i[0]==month:
count+=1
return count==1
def contains_unique_day(month, possible_birthdays):
for i in possible_birthdays:
if i[0]==month:
if unique_day(i[1],possible_birthdays):
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_147.py
|
refactory_data_question_2_correct_2_154
|
def unique_day(date, possible_birthdays):
count = 0
for tup in possible_birthdays:
if tup[1] == date:
count+=1
return count == 1
def unique_month(month, possible_birthdays):
count = 0
for tup in possible_birthdays:
if tup[0] == month:
count+=1
return count == 1
def contains_unique_day(month, possible_birthdays):
month_tup = ()
for tup in possible_birthdays:
if month in tup:
month_tup += (tup,)
for tup in month_tup:
if unique_day(tup[1],possible_birthdays):
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_154.py
|
refactory_data_question_2_correct_2_029
|
def unique_day(day, possible_birthdays):
tup = ()
for i in possible_birthdays:
if i[1] == day:
tup += (i[1],)
if len(tup) == 1:
return True
else:
return False
def unique_month(month, possible_birthdays):
tup = ()
for i in possible_birthdays:
if i[0] == month:
tup += (i[0],)
if len(tup) == 1:
return True
else:
return False
def contains_unique_day(month, possible_birthdays):
tup = ()
for date in possible_birthdays:
if date[0] == month:
tup += (date,)
for bday in tup:
if unique_day(bday[1], possible_birthdays):
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_029.py
|
refactory_data_question_2_correct_2_137
|
def unique_day(day, possible_birthdays):
a = 0
for date in possible_birthdays:
cb = date[1]
if day == cb:
a+= 1
else:
continue
if a==1:
return True
else:
return False
def unique_month(month, possible_birthdays):
a = 0
for date in possible_birthdays:
lj = date[0]
if month == lj:
a+= 1
else:
continue
if a == 1:
return True
else:
return False
def contains_unique_day(month, possible_birthdays):
#find the possible days in that month
#determine if they are unique days one by one
possible_days = ()
for date in possible_birthdays:
if month == date[0]:
possible_days += (date[1],)
else:
continue
for day in possible_days:
if unique_day(day,possible_birthdays):
return True
else:
continue
return False
|
./refactory/data/question_2/code/correct/correct_2_137.py
|
refactory_data_question_2_correct_2_073
|
def unique_day(day, possible_birthdays):
counter = 0
for dates in possible_birthdays:
if day == dates[1]:
possible_birthdays = possible_birthdays[1:]
counter = counter + 1
if counter == 1:
return True
else:
return False
return
def unique_month(month, possible_birthdays):
counter = 0
for dates in possible_birthdays:
if month == dates[0]:
possible_birthdays = possible_birthdays[1:]
counter = counter + 1
if counter == 1:
return True
else:
return False
def keep_month(month,possible_birthdays):
new_list = ()
for date in possible_birthdays:
if month == date[0]:
new_list = new_list + (date,)
return new_list
def contains_unique_day(month, possible_birthdays):
counter = 0
revised_list = keep_month(month,possible_birthdays)
for i in revised_list:
if unique_day(i[1], possible_birthdays) == True:
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_073.py
|
refactory_data_question_2_correct_2_235
|
def unique_day(date, possible_birthdays):
count=0
for i in possible_birthdays:
if i[1] == date:
count+=1
return count==1
def unique_month(month, possible_birthdays):
count=0
for i in possible_birthdays:
if i[0] == month:
count=count+1
return count==1
def contains_unique_day(month, possible_birthdays):
tf=False
for i in possible_birthdays:
if i[0]==month:
tf=tf or unique_day(i[1],possible_birthdays)
return tf
|
./refactory/data/question_2/code/correct/correct_2_235.py
|
refactory_data_question_2_correct_2_195
|
def unique_day(day, possible_birthdays):
the_day = ()
for i in possible_birthdays:
if i[1] == day:
the_day += (day,)
return len(the_day) == 1
def unique_month(month, possible_birthdays):
the_month = ()
for i in possible_birthdays:
if i[0] == month:
the_month += (month,)
return len(the_month) == 1
def contains_unique_day(month, possible_birthdays):
wanted_month = ()
for i in possible_birthdays:
if i[0] == month:
wanted_month += (i,)
wanted_month_days = list(map(lambda x: x[1], wanted_month))
unique_days = list(filter(lambda x: unique_day(x, possible_birthdays), wanted_month_days))
return len(unique_days) > 0
|
./refactory/data/question_2/code/correct/correct_2_195.py
|
refactory_data_question_2_correct_2_179
|
def unique_day(day, possible_birthdays):
if len(tuple(filter(lambda x: x[1] == day, possible_birthdays))) == 1:
return True
else:
return False
def unique_month(month, possible_birthdays):
if len(tuple(filter(lambda x: x[0] == month, possible_birthdays))) == 1:
return True
else:
return False
def contains_unique_day(month, possible_birthdays):
total = ()
i = 0
while i < len(possible_birthdays):
if possible_birthdays[i][0] == month:
total = total + (possible_birthdays[i],)
else:
total = total
i = i + 1
for t in total:
if unique_day(t[1], possible_birthdays) == True:
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_179.py
|
refactory_data_question_2_correct_2_148
|
def unique_day(day, possible_birthdays):
counter = 0
for i in possible_birthdays:
if day == i[1]:
counter = counter + 1
if counter != 1:
return False
return True
def unique_month(month, possible_birthdays):
counter = 0
for i in possible_birthdays:
if month == i[0]:
counter = counter + 1
if counter != 1:
return False
return True
def contains_unique_day(month, possible_birthdays):
count_of_days = ()
for i in possible_birthdays:
if month == i[0]:
count_of_days = count_of_days + (i[1], )
for i2 in count_of_days:
if unique_day(i2, possible_birthdays) == True:
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_148.py
|
refactory_data_question_2_correct_2_061
|
def unique_day(day, possible_birthdays):
unique = ()
for birthday in possible_birthdays:
if day == birthday[1]:
unique = unique + (day,)
if len(unique) == 1:
return True
return False
def unique_month(month, possible_birthdays):
unique = ()
for birthday in possible_birthdays:
if month == birthday[0]:
unique = unique + (month,)
if len(unique) == 1:
return True
return False
def contains_unique_day(month, possible_birthdays):
correct_months = ()
for birthday in possible_birthdays:
if unique_day(birthday[1], possible_birthdays):
correct_months = correct_months + (birthday[0],)
if month in correct_months:
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_061.py
|
refactory_data_question_2_correct_2_046
|
def unique_day(day, possible_birthdays):
counter = 0
for date in possible_birthdays:
if day in date:
counter += 1
if counter != 1:
return False
return True
def unique_month(month, possible_birthdays):
counter = 0
for date in possible_birthdays:
if month in date:
counter += 1
return True if counter ==1 else False
def contains_unique_day(month, possible_birthdays):
contains = ()
for date in possible_birthdays:
if month in date and unique_day(date[1],possible_birthdays):
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_046.py
|
refactory_data_question_2_correct_2_068
|
def unique_day(day, possible_birthdays):
count = 0
for possible_birthday in possible_birthdays:
if day == possible_birthday[1]:
count += 1
return count == 1
def unique_month(month, possible_birthdays):
count = 0
for possible_birthday in possible_birthdays:
if month == possible_birthday[0]:
count += 1
return count == 1
def contains_unique_day(month, possible_birthdays):
for possible_birthday in possible_birthdays:
if month == possible_birthday[0] and unique_day(possible_birthday[1], possible_birthdays):
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_068.py
|
refactory_data_question_2_correct_2_125
|
def unique_day(day, possible_birthdays):
count = 0
for element in possible_birthdays:
if element[1] == day:
count += 1
if count != 1:
return False
return True
def unique_month(month, possible_birthdays):
count = 0
for element in possible_birthdays:
if element[0] == month:
count += 1
if count != 1:
return False
return True
def contains_unique_day(month, possible_birthdays):
month_collection = ()
outside_month_collection = ()
for element in possible_birthdays:
if element[0] == month:
month_collection += (element, )
else:
outside_month_collection += (element, )
for days in month_collection:
count = 0
for dates in outside_month_collection:
if days[1] == dates[1]:
count += 1
if count == 0:
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_125.py
|
refactory_data_question_2_correct_2_234
|
def unique_day(date, possible_birthdays):
lenth=len(possible_birthdays)
count=0
for i in range(0,lenth):
if date==possible_birthdays[i][1]:
count=count+1
if count==1:
return True
else:
return False
def unique_month(month, possible_birthdays):
lenth=len(possible_birthdays)
count=0
for i in range(0,lenth):
if month==possible_birthdays[i][0]:
count=count+1
if count==1:
return True
else:
return False
def contains_unique_day(month, possible_birthdays):
count=()
for i in possible_birthdays:
if i[0]==month:
if i not in count:
count=count+(i,)
for j in count:
if unique_day(j[1], possible_birthdays):
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_234.py
|
refactory_data_question_2_correct_2_072
|
def unique_day(day, possible_birthdays):
counter = 0
for dates in possible_birthdays:
if day == dates[1]:
possible_birthdays = possible_birthdays[1:]
counter = counter + 1
if counter == 1:
return True
else:
return False
return
def unique_month(month, possible_birthdays):
counter = 0
for dates in possible_birthdays:
if month == dates[0]:
possible_birthdays = possible_birthdays[1:]
counter = counter + 1
if counter == 1:
return True
else:
return False
def keep_month(month,possible_birthdays):
new_list = ()
for date in possible_birthdays:
if month == date[0]:
new_list = new_list + (date,)
return new_list
def contains_unique_day(month, possible_birthdays):
counter = 0
revised_list = keep_month(month,possible_birthdays)
for i in revised_list:
if unique_day(i[1], possible_birthdays) == True:
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_072.py
|
refactory_data_question_2_correct_2_221
|
def unique_day(day, possible_birthdays):
result = 0
for i in possible_birthdays:
if day in i:
result = result + 1
if result > 1:
return False
elif result == 0:
return False
else:
return True
def unique_month(month, possible_birthdays):
result = 0
for i in possible_birthdays:
if month in i:
result = result + 1
if result > 1:
return False
elif result == 0:
return False
else:
return True
def contains_unique_day(month, possible_birthdays):
month_tup = ()
helper = 0
for i in possible_birthdays:
if month in i:
month_tup = month_tup + possible_birthdays[helper]
helper = helper + 1
for i in range(1, 32):
if unique_day(str(i), possible_birthdays) == True:
if str(i) in month_tup:
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_221.py
|
refactory_data_question_2_correct_2_168
|
def unique_day(day, possible_birthdays):
value = 0
for i in range(0, len(possible_birthdays)):
if (day == possible_birthdays[i][1]):
value += 1
if (value > 1) or (value == 0):
return False
else:
return True
def unique_month(month, possible_birthdays):
value = 0
for i in range(0, len(possible_birthdays)):
if (month == possible_birthdays[i][0]):
value += 1
if (value > 1) or (value == 0):
return False
else:
return True
def contains_unique_day(month, possible_birthdays):
unique_days = ()
for i in range(0, len(possible_birthdays)):
if (unique_day(possible_birthdays[i][1], possible_birthdays) == True):
unique_days += (possible_birthdays[i][1],)
for j in range(0, len(unique_days)):
if ((month, unique_days[j]) in possible_birthdays):
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_168.py
|
refactory_data_question_2_correct_2_074
|
def unique_day(day, possible_birthdays):
counter = 0
for i in possible_birthdays:
if day in i:
counter += 1
return True if counter == 1 else False
def unique_month(month, possible_birthdays):
counter = 0
for i in possible_birthdays:
if month in i:
counter += 1
return True if counter == 1 else False
def contains_unique_day(month, possible_birthdays):
counter = 0
result = False
for i in possible_birthdays:
if month == i[0]:
result = result or unique_day(i[1], possible_birthdays)
return result
|
./refactory/data/question_2/code/correct/correct_2_074.py
|
refactory_data_question_2_correct_2_248
|
def unique_day(day, possible_birthdays):
i = 0
for days in possible_birthdays:
if int(day) == int(days[1]):
i += 1
if i == 1:
return True
else:
return False
def unique_month(month, possible_birthdays):
i = 0
for months in possible_birthdays:
if month == months[0]:
i += 1
if i == 1:
return True
else:
return False
def contains_unique_day(month, possible_birthdays):
data = ()
number = 0
for datas in possible_birthdays:
if month in datas:
data += (datas,)
for days in data:
number += unique_day(days[1], possible_birthdays)
if number >= 1:
return True
else:
return False
|
./refactory/data/question_2/code/correct/correct_2_248.py
|
refactory_data_question_2_correct_2_089
|
def unique_day(day, possible_birthdays):
count = 0
for i in possible_birthdays:
if day in i:
count += 1
if count == 1:
return True
else:
return False
def unique_month(month, possible_birthdays):
count = 0
for i in possible_birthdays:
if month in i:
count += 1
if count == 1:
return True
else:
return False
def contains_unique_day(month, possible_birthdays):
for i in possible_birthdays:
if month in i:
if unique_day(i[1],possible_birthdays):
return True
else:
continue
return False
|
./refactory/data/question_2/code/correct/correct_2_089.py
|
refactory_data_question_2_correct_2_211
|
def unique_day(day, possible_birthdays):
counter = 0
for i in possible_birthdays:
if day == i[1]:
counter = counter + 1
if counter == 1:
return True
else:
return False
def unique_month(month, possible_birthdays):
counter = 0
for i in possible_birthdays:
if month == i[0]:
counter = counter + 1
if counter == 1:
return True
else:
return False
def contains_unique_day(month, possible_birthdays):
month_day = ()
for j in possible_birthdays:
if month == j[0]:
month_day = month_day + (j,)
for t in month_day:
if unique_day(t[1], possible_birthdays) == True:
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_211.py
|
refactory_data_question_2_correct_2_201
|
def unique_day(day, possible_birthdays):
count = 0
for birthday in possible_birthdays:
if day == birthday[1]:
count+=1
if count==1:
return True
return False
def unique_month(month, possible_birthdays):
count = 0
for birthday in possible_birthdays:
if month == birthday[0]:
count+=1
if count==1:
return True
return False
def contains_unique_day(month, possible_birthdays):
days=()
for birthday in possible_birthdays:
if month== birthday[0]:
days += (birthday[1],)
for day in days:
if unique_day(day, possible_birthdays)== False:
continue
else:
return unique_day(day, possible_birthdays)
return False
|
./refactory/data/question_2/code/correct/correct_2_201.py
|
refactory_data_question_2_correct_2_212
|
def unique_day(day, possible_birthdays):
new = ()
for i in range (len(possible_birthdays)):
new = new + (possible_birthdays[i][1],)
if new.count(day) == 1:
return True
else:
return False
def unique_month(month, possible_birthdays):
new = ()
for i in range (len(possible_birthdays)):
new = new + (possible_birthdays[i][0],)
if new.count(month) == 1:
return True
else:
return False
def contains_unique_day(month, possible_birthdays):
new = ()
for i in possible_birthdays:
if i[0] == month:
new = new + (i[1],)
for i in new:
if unique_day(i, possible_birthdays):
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_212.py
|
refactory_data_question_2_correct_2_022
|
def unique_day(day, possible_birthdays):
count_day = 0
for i in possible_birthdays:
if i[1] == day:
count_day += 1
if count_day == 1:
return True
return False
def unique_month(month, possible_birthdays):
count_month = 0
for i in possible_birthdays:
if i[0] == month:
count_month += 1
if count_month == 1:
return True
return False
def contains_unique_day(month, possible_birthdays):
possible_days = ()
for i in possible_birthdays:
if i[0] == month:
possible_days += (i[1],)
for i in possible_days:
if unique_day(i, possible_birthdays) == True:
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_022.py
|
refactory_data_question_2_correct_2_049
|
def unique_day(day, possible_birthdays):
days = ()
for birthdays in possible_birthdays:
days += (birthdays[1],)
a = 0
for dates in days:
if day == dates:
a +=1
if a !=1:
return False
return True
def unique_month(month, possible_birthdays):
months = ()
for birthdays in possible_birthdays:
months += (birthdays[0],)
a = 0
for dates in months:
if month == dates:
a +=1
if a !=1:
return False
return True
def contains_unique_day(month, possible_birthdays):
dates =()
for birthdays in possible_birthdays:
if unique_day(birthdays[1], possible_birthdays):
dates += (birthdays[0],)
for days in dates:
if month in dates:
return True
break
return False
|
./refactory/data/question_2/code/correct/correct_2_049.py
|
refactory_data_question_2_correct_2_087
|
def unique_day(date, possible_birthdays):
count = 0
for i in possible_birthdays:
if date == i[1]:
count += 1
return count == 1
def unique_month(month, possible_birthdays):
count = 0
for birthday in possible_birthdays:
if month == birthday[0]:
count += 1
return count == 1
def contains_unique_day(month, possible_birthdays):
singlemonthbirthday = ()
for birthmonth in possible_birthdays:
if month == birthmonth[0]:
singlemonthbirthday += (birthmonth,)
for birthday in singlemonthbirthday:
if unique_day(birthday[1], possible_birthdays) == True:
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_087.py
|
refactory_data_question_2_correct_2_026
|
def unique_day(day, possible_birthdays):
counter = 0
for birthday in possible_birthdays:
counter += 1 if day == birthday[1] else 0
return (counter == 1)
def unique_month(month, possible_birthdays):
counter = 0
for birthday in possible_birthdays:
counter += 1 if month == birthday[0] else 0
return (counter == 1)
def contains_unique_day(month, possible_birthdays):
birthdays_in_month = ()
for birthday in possible_birthdays:
if birthday[0] == month: birthdays_in_month += (birthday,)
for birthday in birthdays_in_month:
if unique_day(birthday[1], possible_birthdays):
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_026.py
|
refactory_data_question_2_correct_2_268
|
def unique_day(date, possible_birthdays):
total= 0
for i in possible_birthdays:
if date == i[1]:
total= total + 1
return total == 1
def unique_month(month, possible_birthdays):
total= 0
for i in possible_birthdays:
if month == i[0]:
total= total + 1
return total == 1
def contains_unique_day(month, possible_birthdays):
for a in possible_birthdays:
if unique_day(a[1],possible_birthdays):
if month == a[0]:
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_268.py
|
refactory_data_question_2_correct_2_115
|
def unique_day(day, possible_birthdays):
product = 0
for i in possible_birthdays:
if i[1] == day:
product +=1
if product == 1:
return True
else:
return False
def unique_month(month, possible_birthdays):
product = 0
for i in possible_birthdays:
if i[0] == month:
product +=1
if product == 1:
return True
else:
return False
def contains_unique_day(month, possible_birthdays):
for i in possible_birthdays:
if i[0] == month and unique_day(i[1], possible_birthdays) == True:
return True
else:
return False
|
./refactory/data/question_2/code/correct/correct_2_115.py
|
refactory_data_question_2_correct_2_244
|
def unique_day(day, possible_birthdays):
result = 0
for i in range(len(possible_birthdays)):
if day in possible_birthdays[i]:
result += 1
if result == 1:
return True
else:
return False
def unique_month(month, possible_birthdays):
result = 0
for i in range(len(possible_birthdays)):
if month in possible_birthdays[i]:
result += 1
if result == 1:
return True
else:
return False
def contains_unique_day(month, possible_birthdays):
days = ()
for i in possible_birthdays:
if i[0] == month:
days += (i[1],)
for i in days:
if unique_day(i, possible_birthdays):
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_244.py
|
refactory_data_question_2_correct_2_053
|
def unique_day(day, possible_birthdays):
day_count = 0
for i in possible_birthdays:
if day in i:
day_count += 1
if day_count > 1:
return False
if day_count == 0:
return False
return True
def unique_month(month, possible_birthdays):
month_count = 0
for i in possible_birthdays:
if month in i:
month_count += 1
if month_count > 1:
return False
if month_count == 0:
return False
return True
def contains_unique_day(month, possible_birthdays):
days_in_month = ()
for i in possible_birthdays:
if month in i:
days_in_month += (i[1],)
for i in days_in_month:
if unique_day(i, possible_birthdays):
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_053.py
|
refactory_data_question_2_correct_2_246
|
def unique_day(day, possible_birthdays):
data=()
for birthday in possible_birthdays:
if day == birthday[1]:
data += (birthday,)
if len(data)==1:
return True
else:
return False
def unique_month(month, possible_birthdays):
data = ()
for birthday in possible_birthdays:
if month == birthday[0]:
data += (birthday,)
if len(data)==1:
return True
else:
return False
def contains_unique_day(month, possible_birthdays):
data, outcome = (),()
for birthday in possible_birthdays:
if month == birthday[0]:
data += (birthday,)
for birthday in data:
if unique_day(birthday[1], possible_birthdays) == True:
outcome += birthday
else:
continue
if outcome == ():
return False
else:
return unique_day(outcome[1],possible_birthdays)
|
./refactory/data/question_2/code/correct/correct_2_246.py
|
refactory_data_question_2_correct_2_267
|
def unique_day(date, possible_birthdays):
if len(tuple(filter(lambda x: x[1] == date, possible_birthdays))) != 1:
return False
else:
return True
def unique_month(month, possible_birthdays):
if len(tuple(filter(lambda x: x[0] == month, possible_birthdays))) != 1:
return False
else:
return True
def contains_unique_day(month, possible_birthdays):
singledays = tuple(filter((lambda x: unique_day(x[1], possible_birthdays)), possible_birthdays))
for i in singledays:
if i[0] == month:
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_267.py
|
refactory_data_question_2_correct_2_105
|
def unique_day(day, possible_birthdays):
count = 0
for birthday in possible_birthdays:
if day == birthday[1]:
count += 1
else:
continue
if count == 1:
return True
else:
return False
def unique_month(month, possible_birthdays):
count = 0
for birthday in possible_birthdays:
if month == birthday[0]:
count +=1
else:
continue
if count == 1:
return True
else:
return False
def contains_unique_day(month, possible_birthdays):
for birthday in possible_birthdays:
if unique_day(birthday[1],possible_birthdays):
months = birthday[0]
if months == month:
return True
else:
continue
else:
continue
return False
|
./refactory/data/question_2/code/correct/correct_2_105.py
|
refactory_data_question_2_correct_2_041
|
def unique_day(day, possible_birthdays):
day_count = 0
for i in possible_birthdays:
if day in i:
day_count += 1
if day_count > 1:
return False
if day_count == 0:
return False
return True
def unique_month(month, possible_birthdays):
month_count = 0
for i in possible_birthdays:
if month in i:
month_count += 1
if month_count > 1:
return False
if month_count == 0:
return False
return True
def contains_unique_day(month, possible_birthdays):
days_in_month = ()
for i in possible_birthdays:
if month in i:
days_in_month += (i[1],)
for i in days_in_month:
if unique_day(i, possible_birthdays):
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_041.py
|
refactory_data_question_2_correct_2_178
|
def unique_day(day, possible_birthdays):
number=0
for i in possible_birthdays:
if i[1]==day:
number+=1
return number==1
def unique_month(month, possible_birthdays):
number=0
for i in possible_birthdays:
if i[0]==month:
number+=1
return number==1
def contains_unique_day(month, possible_birthdays):
number=0
for i in possible_birthdays:
if i[0]==month:
if unique_day(i[1], possible_birthdays)== True:
number+=1
return number>0
|
./refactory/data/question_2/code/correct/correct_2_178.py
|
refactory_data_question_2_correct_2_043
|
def unique_day(date, possible_birthdays):
num = 0
for birthday in possible_birthdays:
if date == birthday[1]:
num += 1
return num == 1
def unique_month(month, possible_birthdays):
num = 0
for birthday in possible_birthdays:
if month == birthday[0]:
num += 1
return num == 1
def contains_unique_day(month, possible_birthdays):
for birthday in possible_birthdays:
if month == birthday[0]:
if unique_day(birthday[1], possible_birthdays):
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_043.py
|
refactory_data_question_2_correct_2_098
|
def unique_day(day, possible_birthdays):
days = ()
unique = ()
for i in possible_birthdays:
days += (i[1],)
for i in days:
if i == day:
unique += (i,)
else:
continue
if len(unique) == 1:
return True
else:
return False
def unique_month(month, possible_birthdays):
months = ()
unique = ()
for i in possible_birthdays:
months += (i[0],)
for i in months:
if i == month:
unique += (i,)
else:
continue
if len(unique) == 1:
return True
else:
return False
def contains_unique_day(month, possible_birthdays):
selected_month = ()
unique = ()
for i in possible_birthdays:
if i[0] == month:
selected_month += (i,)
else:
continue
for i in selected_month:
if unique_day(i[1], possible_birthdays) == True:
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_098.py
|
refactory_data_question_2_correct_2_106
|
def unique_day(date, possible_birthdays):
dates = ()
for d in possible_birthdays:
dates += (d[1],)
if dates.count(date) == 1:
return True
else:
return False
def unique_month(month, possible_birthdays):
months = ()
for a in possible_birthdays:
months += (a[0],)
if months.count(month) == 1:
return True
else:
return False
def contains_unique_day(month, possible_birthdays):
dates = ()
for z in possible_birthdays:
if unique_day(z[1], possible_birthdays):
dates += (z,)
else:
continue
for i in dates:
if i[0] == month:
return True
else:
return False
|
./refactory/data/question_2/code/correct/correct_2_106.py
|
refactory_data_question_2_correct_2_290
|
def unique_day(day, possible_birthdays):
a=0
for i in range(len(possible_birthdays)):
if day==possible_birthdays[i][1]:
a+=1
if a==1:
return True
else:
return False
def contains_unique_day(month, possible_birthdays):
b=0
for i in range(len(possible_birthdays)):
if month==possible_birthdays[i][0]:
b+=unique_day(possible_birthdays[i][1],possible_birthdays)
if b==0:
return False
else:
return True
def unique_month(month, possible_birthdays):
a=0
for i in range(len(possible_birthdays)):
if month==possible_birthdays[i][0]:
a+=1
if a==1:
return True
else:
return False
|
./refactory/data/question_2/code/correct/correct_2_290.py
|
refactory_data_question_2_correct_2_184
|
def unique_day(day, possible_birthdays):
n=0
for tup in possible_birthdays:
if tup[1]==day:
n+=1
if n==1:
return True
return False
def unique_month(month, possible_birthdays):
n=0
for tup in possible_birthdays:
if tup[0]==month:
n+=1
if n==1:
return True
return False
def contains_unique_day(month, possible_birthdays):
n=0
for tup in possible_birthdays:
if tup[0]==month:
if unique_day(tup[1],possible_birthdays):
n+=1
if n>=1:
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_184.py
|
refactory_data_question_2_correct_2_065
|
def unique_day(date, possible_birthdays):
count = 0
for i in range(len(possible_birthdays)):
if possible_birthdays[i][1] == date:
count += 1
if count == 1:
return True
else:
return False
def unique_month(month, possible_birthdays):
count = 0
for i in range(len(possible_birthdays)):
if possible_birthdays[i][0] == month:
count += 1
if count == 1:
return True
else:
return False
def contains_unique_day(month, possible_birthdays):
for i in range(len(possible_birthdays)):
if possible_birthdays[i][0] == month and unique_day(possible_birthdays[i][1], possible_birthdays) == True:
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_065.py
|
refactory_data_question_2_correct_2_136
|
def unique_day(day, possible_birthdays):
counter=0
for date in possible_birthdays:
if day == date[1]:
counter+=1
return counter==1
def unique_month(month, possible_birthdays):
counter=0
for date in possible_birthdays:
if month == date[0]:
counter+=1
return counter==1
def contains_unique_day(month, possible_birthdays):
for date in possible_birthdays:
if month==date[0]:
if unique_day(date[1], possible_birthdays):
return True
return False
|
./refactory/data/question_2/code/correct/correct_2_136.py
|
refactory_data_question_2_correct_2_270
|
def unique_day(day, possible_birthdays):
result = 0
for i in possible_birthdays:
if day == i[1]:
result = result + 1
else:
continue
if result == 1:
return True
else:
return False
def unique_month(month, possible_birthdays):
result = 0
for i in possible_birthdays:
if month == i[0]:
result = result + 1
else:
continue
if result == 1:
return True
else:
return False
def contains_unique_day(month, possible_birthdays):
for i in possible_birthdays:
if month == i[0]:
if unique_day(i[1], possible_birthdays) == False:
continue
else:
return True
return False
return True
|
./refactory/data/question_2/code/correct/correct_2_270.py
|
refactory_data_question_2_correct_2_059
|
def unique_day(day, possible_birthdays):
count = 0
for x in possible_birthdays:
if day == x[1]:
count += 1
if count == 1:
return True
else:
return False
def unique_month(month, possible_birthdays):
count = 0
for x in possible_birthdays:
if month == x[0]:
count += 1
if count == 1:
return True
else:
return False
def contains_unique_day(month, possible_birthdays):
possible_days = ()
for x in possible_birthdays:
if x[0] == month:
possible_days += (x,)
for day in possible_days:
if unique_day(day[1], possible_birthdays) == True:
return True
else:
return False
|
./refactory/data/question_2/code/correct/correct_2_059.py
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.