id stringlengths 35 39 | content stringlengths 44 3.85k | max_stars_repo_path stringlengths 52 57 |
|---|---|---|
refactory_data_question_1_wrong_1_116 | def search(x, seq):
n = len(seq)
if seq ==():
return 0
for i in range(0,n):
currentvalue = seq[i]
position = i
if position >= 0 and x>currentvalue:
position = i+1
elif position >= 0 and x<= currentvalue:
return position
return position
| ./refactory/data/question_1/code/wrong/wrong_1_116.py |
refactory_data_question_1_wrong_1_039 | def search(x, seq):
counter = 0
for i in range(1, len(seq)+1):
if x < seq[i-1]:
counter = i-1
elif seq[i-1]<x<seq[i]:
counter = i
counter = i
return counter
| ./refactory/data/question_1/code/wrong/wrong_1_039.py |
refactory_data_question_1_wrong_1_257 | def search(x, seq):
position=enumerate(seq)
if x>seq[-1]:
return len(seq)
else:
for i in seq:
if x<=i:
for index in position:
if index[1]==i:
return index[0]
| ./refactory/data/question_1/code/wrong/wrong_1_257.py |
refactory_data_question_1_wrong_1_315 | def search(x, seq):
for i in range(len(seq)):
if x<=seq[i]:
return i
return i+1
| ./refactory/data/question_1/code/wrong/wrong_1_315.py |
refactory_data_question_1_wrong_1_291 | def search(x, seq):
for i in range(len(seq)):
if x < seq[i]:
continue
return i
| ./refactory/data/question_1/code/wrong/wrong_1_291.py |
refactory_data_question_1_wrong_1_400 | def search(x, seq):
if seq == () or seq == []:
return 0
else:
for i in range(len(seq)):
if x <= seq[i]:
return i
elif x >= max(seq):
return len(seq)
else:
continue
| ./refactory/data/question_1/code/wrong/wrong_1_400.py |
refactory_data_question_1_wrong_1_331 | def search(x, seq):
for i in range(len(seq)):
if x < seq[i]:
return i
| ./refactory/data/question_1/code/wrong/wrong_1_331.py |
refactory_data_question_1_wrong_1_266 | def search(x, seq):
if seq[0] >= x or seq == () or seq == []:
return 0
elif seq[len(seq)-1] < x:
return len(seq)
else:
for i in range(len(seq)-1):
if seq[i] < x and seq[i+1] >= x:
return i+1
break
| ./refactory/data/question_1/code/wrong/wrong_1_266.py |
refactory_data_question_1_wrong_1_096 | 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 """
if seq==[] or x<=seq[0]:
return 0
elif x>seq[-1]:
return len(seq)
else:
for i,elem in enumerate(seq):
if x>... | ./refactory/data/question_1/code/wrong/wrong_1_096.py |
refactory_data_question_1_wrong_1_305 | def search(x, seq):
for i,v in enumerate(seq):
if x>v and i!=len(seq)-1:
continue
elif x>v and i==len(seq)-1:
return i+1
else:
break
return i
| ./refactory/data/question_1/code/wrong/wrong_1_305.py |
refactory_data_question_1_wrong_1_361 | def search(x, seq):
if len(seq) == 0:
return 0
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_361.py |
refactory_data_question_1_wrong_1_520 | def search(x, seq):
if x not in seq:
result = 0
elif x > seq[len(seq) - 1]:
return len(seq)
else:
result = 0
for i, elem in enumerate(seq):
if x < (elem + 1):
result = i
return
return result
| ./refactory/data/question_1/code/wrong/wrong_1_520.py |
refactory_data_question_1_wrong_1_247 | def search(x, seq):
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_247.py |
refactory_data_question_1_wrong_1_341 | def search(x, seq):
for i in range(len(seq)):
if x > seq[-1]:
return len(seq)
elif x == seq[i]:
return i
elif x < seq[i]:
return i
| ./refactory/data/question_1/code/wrong/wrong_1_341.py |
refactory_data_question_1_wrong_1_151 | def search(x, seq):
for i in range(len(seq)):
if x <= seq[i]:
return seq.index(seq[i])
elif seq[-1] < x:
return seq.index(seq[-1])+1
| ./refactory/data/question_1/code/wrong/wrong_1_151.py |
refactory_data_question_1_wrong_1_017 | def search(x, seq):
if x < seq[0]:
return 0
elif x > seq[-1]:
return len(seq)
for i, elem in enumerate(seq):
if x < elem:
return i
| ./refactory/data/question_1/code/wrong/wrong_1_017.py |
refactory_data_question_1_wrong_1_399 | def search(x, seq):
if seq == ():
return 0
else:
for i in range(len(seq)):
if x <= seq[i]:
return i
elif x >= max(seq):
return len(seq)
else:
continue
| ./refactory/data/question_1/code/wrong/wrong_1_399.py |
refactory_data_question_1_wrong_1_517 | def search(x, seq):
if seq == []:
return 0
elif x >= seq[len(seq)-1]:
return len(seq)
else:
for i in range(len(seq)):
if x > seq[i]:
continue
else:
return i
| ./refactory/data/question_1/code/wrong/wrong_1_517.py |
refactory_data_question_1_wrong_1_275 | def search(x, seq):
for i in range(len(seq)):
if x < seq[i]:
return i
else:
continue
return len(seq)
| ./refactory/data/question_1/code/wrong/wrong_1_275.py |
refactory_data_question_1_wrong_1_252 | def search(x, seq):
if x <= seq[0]:
position = 0
if x >= seq[len(seq) - 1]:
position = len(seq)
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_252.py |
refactory_data_question_1_wrong_1_270 | def search(x, seq):
counter = 0
new_seq = list(seq)
if seq == ():
return 0
for element in seq:
if x <=element:
return counter
if x > seq[len(seq)-1]:
return len(seq)
else:
counter += 1
continue
| ./refactory/data/question_1/code/wrong/wrong_1_270.py |
refactory_data_question_1_wrong_1_570 | def search(x, seq):
for elem in seq:
if x <= elem:
break
position += 1
return position
| ./refactory/data/question_1/code/wrong/wrong_1_570.py |
refactory_data_question_1_wrong_1_264 | def search(x, seq):
if seq[len(seq)-1] < x:
return len(seq)
elif seq[0] >= x:
return 0
else:
for i in range(len(seq)-1):
if seq[i] < x and seq[i+1] >= x:
return i+1
break
| ./refactory/data/question_1/code/wrong/wrong_1_264.py |
refactory_data_question_1_wrong_1_507 | def search(x, seq):
for i in range(len(seq)):
if x < seq[i]:
return i
| ./refactory/data/question_1/code/wrong/wrong_1_507.py |
refactory_data_question_1_wrong_1_412 | def search(x, seq):
for i in range(len(seq)-1):
if x > seq[i]:
continue
else:
return i
| ./refactory/data/question_1/code/wrong/wrong_1_412.py |
refactory_data_question_1_wrong_1_267 | def search(x, seq):
if seq[0] >= x or seq == () or seq == []:
return 0
elif seq[len(seq)-1] < x:
return len(seq)
else:
for i in range(len(seq)-1):
if seq[i] < x and seq[i+1] >= x:
return i+1
break
| ./refactory/data/question_1/code/wrong/wrong_1_267.py |
refactory_data_question_1_wrong_1_119 | def search(x, seq):
if seq == [] or ():
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... | ./refactory/data/question_1/code/wrong/wrong_1_119.py |
refactory_data_question_1_wrong_1_523 | 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 """
counter = -1
for i in seq:
if len(seq) == 0:
return none
if x <= i:
counter += 1
return counter... | ./refactory/data/question_1/code/wrong/wrong_1_523.py |
refactory_data_question_1_wrong_1_319 | def search(x, seq):
for i, elem in enumerate(seq):
if x <= elem:
return i
else:
continue
""" 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_319.py |
refactory_data_question_1_wrong_1_549 | def search(x, seq):
if seq == tuple():
return 'not found'
for i, elem in enumerate(seq):
if x <= elem:
return i
return i+1
| ./refactory/data/question_1/code/wrong/wrong_1_549.py |
refactory_data_question_1_wrong_1_049 | def search(x, seq):
for i in range(len(seq)):
if x < seq[i]:
return i
elif seq[i]<x:
return i+1
elif seq[i]<x<=seq[i+1]:
return i+1
| ./refactory/data/question_1/code/wrong/wrong_1_049.py |
refactory_data_question_1_wrong_1_055 | 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 """
if x < seq[0]:
return 0
elif x > seq[len(seq)-1]:
return len(seq)
counter = 0
for i in seq:
counter = counter + 1
... | ./refactory/data/question_1/code/wrong/wrong_1_055.py |
refactory_data_question_1_wrong_1_299 | def search(x, seq):
for i in range(0, len(seq)):
no = len(seq)
if x > seq[i]:
continue
elif x <= seq[i]:
no = i
break
return no
| ./refactory/data/question_1/code/wrong/wrong_1_299.py |
refactory_data_question_1_wrong_1_342 | def search(x, seq):
for i in range(len(seq)):
if seq == [] or ():
return None
elif x > seq[-1]:
return len(seq)
elif x == seq[i]:
return i
elif x < seq[i]:
return i
| ./refactory/data/question_1/code/wrong/wrong_1_342.py |
refactory_data_question_1_wrong_1_317 | def search(x, seq):
for i in range(seq):
if x <= seq[i]:
return i
else:
continue
""" 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_317.py |
refactory_data_question_1_wrong_1_015 | def search(x, seq):
if x < seq[0]:
return 0
elif x > seq[-1]:
return len(seq)
for i, elem in enumerate(seq):
if elem <= x <= elem + 1:
return i
| ./refactory/data/question_1/code/wrong/wrong_1_015.py |
refactory_data_question_1_wrong_1_095 | 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 """
if seq==[] or x<=seq[0]:
return 0
if x>seq[-1]:
return len(seq)
else:
for i,elem in enumerate(seq):
if x>el... | ./refactory/data/question_1/code/wrong/wrong_1_095.py |
refactory_data_question_1_wrong_1_514 | 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 """
if type(seq) == tuple:
new_seq = list(seq)
sort = []
for i in range(len(new_seq)):
if max(new_seq) < x:
... | ./refactory/data/question_1/code/wrong/wrong_1_514.py |
refactory_data_question_1_wrong_1_318 | def search(x, seq):
n = len(seq)
for i in range(n):
next_element = seq[i]
if x > next_element:
return 0
else:
return i
return n
| ./refactory/data/question_1/code/wrong/wrong_1_318.py |
refactory_data_question_1_wrong_1_536 | def search(x,seq):
if max(seq) < x:
return len(seq)
if x <= min(seq):
return 0
| ./refactory/data/question_1/code/wrong/wrong_1_536.py |
refactory_data_question_1_wrong_1_165 | def search(x, seq):
for i in range(len(seq)):
if x<=seq[i]:break
if i==len(seq)-1: i+=1
return i
| ./refactory/data/question_1/code/wrong/wrong_1_165.py |
refactory_data_question_1_wrong_1_101 | def search(x, seq):
if seq == ():
return ()
else:
for i in range (len(seq)):
if x < seq[i]:
return i
elif x ==seq[i]:
return i
else:
continue
return i + 1
| ./refactory/data/question_1/code/wrong/wrong_1_101.py |
refactory_data_question_1_wrong_1_482 | def search(x, seq):
if seq == []:
return 0
else:
for i, elem in enumerate(seq):
if x < elem:
return i
elif x == elem:
return i
elif i == len(seq)-1:
return i+1
| ./refactory/data/question_1/code/wrong/wrong_1_482.py |
refactory_data_question_1_wrong_1_107 | def search(x, seq):
if len(seq) == 0:
return 0
elif x <= seq[0]:
return 0
elif x >= seq[-1]:
return len(seq)
else:
for i in range(len(seq)-1):
if x > seq[i] and x <= seq[i+1]:
return i+1
return None
| ./refactory/data/question_1/code/wrong/wrong_1_107.py |
refactory_data_question_1_wrong_1_143 | def search(x, seq):
n=[]
seq = list(seq)
a= seq.copy()
d = 0
if seq == ():
return 0
for i in a:
if i<x:
n.append(i)
seq.remove(i)
elif i == x:
n.append(i)
n.append(x)
n.extend(seq)
break
else... | ./refactory/data/question_1/code/wrong/wrong_1_143.py |
refactory_data_question_1_wrong_1_388 | def search(x, seq):
lst1 = list(seq)
if seq == ():
return 0
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 ... | ./refactory/data/question_1/code/wrong/wrong_1_388.py |
refactory_data_question_1_wrong_1_153 | def search(x, seq):
for i in range(len(seq)):
if x <= seq[i]:
return seq.index(seq[i])
elif seq[-1] < x:
return seq.index(seq[-1])+1
| ./refactory/data/question_1/code/wrong/wrong_1_153.py |
refactory_data_question_1_wrong_1_492 | def search(x, seq):
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_492.py |
refactory_data_question_1_wrong_1_244 | 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 x <= seq[i]:
return i
| ./refactory/data/question_1/code/wrong/wrong_1_244.py |
refactory_data_question_1_wrong_1_273 | 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 """
enumerated = list(enumerate(seq))
if seq == ():
return 0
elif x > max(seq):
return len(seq)
else:
for i in range(le... | ./refactory/data/question_1/code/wrong/wrong_1_273.py |
refactory_data_question_1_wrong_1_138 | 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 """
return
| ./refactory/data/question_1/code/wrong/wrong_1_138.py |
refactory_data_question_1_wrong_1_212 | def search(x, seq):
if not seq:
return 0
elif x < seq[0]:
return 0
elif x > seq[-1]:
return len(seq)
else:
for i in range(len(seq) - 1):
if seq[i] == x:
return i
elif seq[i] < x < seq[i+1]:
return i+1
| ./refactory/data/question_1/code/wrong/wrong_1_212.py |
refactory_data_question_1_wrong_1_170 | def search(x, seq):
for element in seq:
if x <= element:
return list(seq).index(element)
elif x >= max(seq):
return (list(seq).index(max(seq)))+1
elif seq == ():
return ()
| ./refactory/data/question_1/code/wrong/wrong_1_170.py |
refactory_data_question_1_wrong_1_546 | def search(x,seq):
if max(seq) < x:
return len(seq)
if x <= min(seq):
return 0
| ./refactory/data/question_1/code/wrong/wrong_1_546.py |
refactory_data_question_1_wrong_1_171 | def search(x, seq):
if seq == ():
return ()
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_171.py |
refactory_data_question_1_wrong_1_064 | def search(x, seq):
if type(seq) == tuple:
seq = list(seq)
seq.append(x)
sorted(seq)
return seq.index(x)
elif type(seq) == list:
seq.append(x)
sorted(seq)
return seq.index(x)
| ./refactory/data/question_1/code/wrong/wrong_1_064.py |
refactory_data_question_1_wrong_1_274 | 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 """
enumerated = list(enumerate(seq))
if seq == () or []:
return 0
elif x > max(seq):
return len(seq)
else:
for i in ra... | ./refactory/data/question_1/code/wrong/wrong_1_274.py |
refactory_data_question_1_wrong_1_135 | def search(x, seq):
for i,elem in enumerate(sort):
if elem==x:
return i
| ./refactory/data/question_1/code/wrong/wrong_1_135.py |
refactory_data_question_1_wrong_1_292 | def search(x, seq):
for i in range(len(seq)):
if x < seq[i]:
continue
elif x >= seq[i]:
return i
| ./refactory/data/question_1/code/wrong/wrong_1_292.py |
refactory_data_question_1_wrong_1_060 | def search(x, seq):
for i in seq:
if x <= i:
return seq.index(i)
elif x > max(seq):
return len(seq)
| ./refactory/data/question_1/code/wrong/wrong_1_060.py |
refactory_data_question_1_wrong_1_002 | 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 x <= seq[i]:
return i
return i + 1
| ./refactory/data/question_1/code/wrong/wrong_1_002.py |
refactory_data_question_1_wrong_1_167 | def search(x, seq):
if seq==() or []:
return 0
for i in range(len(seq)):
if x<=seq[i]:break
if i==len(seq)-1: i+=1
return i
| ./refactory/data/question_1/code/wrong/wrong_1_167.py |
refactory_data_question_1_wrong_1_510 | def search(x, seq):
if x>seq[len(seq)-1]:
return len(seq)
for i in range(len(seq)):
if x>seq[i]:
continue
return i
| ./refactory/data/question_1/code/wrong/wrong_1_510.py |
refactory_data_question_1_wrong_1_449 | def search(x, seq):
for i in seq:
if x == seq[i]:
return i
elif x < seq[0]:
return 0
elif x > seq[i] and x < seq[i+1]:
return i+1
else:
return len(seq)
""" Takes in a value x and a sorted sequence seq, and returns the
position ... | ./refactory/data/question_1/code/wrong/wrong_1_449.py |
refactory_data_question_1_wrong_1_558 | def search(x, seq):
for i,elem in enumerate(seq):
if elem<x:
pos=i+1
elif elem>x:
pos=i
return pos
| ./refactory/data/question_1/code/wrong/wrong_1_558.py |
refactory_data_question_1_wrong_1_105 | def search(x, seq):
for i in range(len(seq)-1):
if x > seq[i] and x <= seq[i+1]:
return i+1
return None
| ./refactory/data/question_1/code/wrong/wrong_1_105.py |
refactory_data_question_1_wrong_1_158 | 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 """
count = 0
if x <= seq[0]:
return 0
elif x > seq[len(seq)-1]:
return len(seq)
else:
while x > seq[count]:
... | ./refactory/data/question_1/code/wrong/wrong_1_158.py |
refactory_data_question_1_wrong_1_209 | def search(x, seq):
if x < seq[0]:
return 0
elif x > seq[-1]:
return len(seq)
elif seq == [] or seq == ():
return 0
else:
for i in range(len(seq) - 1):
if seq[i] == x:
return i
elif seq[i] < x < seq[i+1]:
return i+1
| ./refactory/data/question_1/code/wrong/wrong_1_209.py |
refactory_data_question_1_wrong_1_068 | def search(x, seq):
for i in range(0,len(seq)):
if len(seq)==0:
return 0
elif x<seq[i]:
return i
elif x==seq[i]:
return i
elif x>seq[len(seq)-1]:
return len(seq)
| ./refactory/data/question_1/code/wrong/wrong_1_068.py |
refactory_data_question_1_wrong_1_538 | def search(x, seq):
for i in range(len(seq)):
if seq[i]>=x:
break
return i
| ./refactory/data/question_1/code/wrong/wrong_1_538.py |
refactory_data_question_1_wrong_1_391 | def search(x, seq):
lst1 = list(seq)
if not seq:
return 0
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 se... | ./refactory/data/question_1/code/wrong/wrong_1_391.py |
refactory_data_question_1_wrong_1_179 | def search(x, seq):
for i, elem in enumerate(seq):
if len(seq) == 0:
return 0
elif x > seq[-1]:
return len(seq)
elif x > elem:
continue
else:
return i
| ./refactory/data/question_1/code/wrong/wrong_1_179.py |
refactory_data_question_1_wrong_1_038 | def search(x, seq):
for i in range(1, len(seq)+1):
if x < seq[i-1]:
return i-1
elif seq[i-1]<x<seq[i]:
return i
return i
| ./refactory/data/question_1/code/wrong/wrong_1_038.py |
refactory_data_question_1_wrong_1_285 | def search(x, seq):
for i in range(0, len(seq) + 1):
if len(seq) == 0:
return None
elif x < seq[0]:
return 0
elif seq[i] < x <= seq[i+1]:
return i + 1
elif seq[len(seq)-1] < x:
return len(seq)
| ./refactory/data/question_1/code/wrong/wrong_1_285.py |
refactory_data_question_1_wrong_1_021 | def search(x, seq):
if x < seq[0]:
return 0
elif x > seq[-1]:
return len(seq)
elif seq == () or seq ==[]:
return None
for i, elem in enumerate(seq):
if x <= elem:
return i
| ./refactory/data/question_1/code/wrong/wrong_1_021.py |
refactory_data_question_1_wrong_1_051 | def search(x, seq):
newseq = list(seq)
sortlist = []
if newseq[-1] < x:
return len(newseq)
while x not in sortlist and newseq:
start = newseq[0]
if x <= start:
sortlist.append(x)
else:
sortlist.append(start)
newseq.pop(0)
sortlist.e... | ./refactory/data/question_1/code/wrong/wrong_1_051.py |
refactory_data_question_1_wrong_1_374 | def search(x, seq):
for i in len(seq):
if seq[i] < x:
continue
else:
return i-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_374.py |
refactory_data_question_1_wrong_1_392 | def search(x, seq):
lst1 = list(seq)
if len(lst1) == 0:
return 0
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):
... | ./refactory/data/question_1/code/wrong/wrong_1_392.py |
refactory_data_question_1_wrong_1_284 | def search(x, seq):
for i in range(0, len(seq) + 1):
if seq == ():
return 0
elif x < seq[0]:
return 0
elif seq[i] < x <= seq[i+1]:
return i + 1
elif seq[len(seq)-1] < x:
return len(seq)
| ./refactory/data/question_1/code/wrong/wrong_1_284.py |
refactory_data_question_1_wrong_1_533 | 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 """
counter = 0
if len(seq) == 0:
return 0
for i in seq:
if x < i:
counter += 1
else:
retu... | ./refactory/data/question_1/code/wrong/wrong_1_533.py |
refactory_data_question_1_wrong_1_415 | def search(x, seq):
for i in range(len(seq)-1):
if x > seq[i]:
continue
elif x <= seq[i]:
return i
else:
return len(seq)
| ./refactory/data/question_1/code/wrong/wrong_1_415.py |
refactory_data_question_1_wrong_1_214 |
def search(x, seq):
seq = list(seq)
max_value = max(seq)
for i,elem in enumerate(seq):
if x > max_value:
seq.insert(seq.index(max_value) + 1,x)
break
elif x<elem:
y = max(0,i)
seq.insert(y,x)
break
return seq.index(x)
... | ./refactory/data/question_1/code/wrong/wrong_1_214.py |
refactory_data_question_1_wrong_1_204 | def search(x, seq):
l=len(seq)
if len(seq)==0:
return 0
elif x<=seq[0]:
return 0
elif x>=seq[l-1]:
return l
else:
for i in range (l):
if x>=seq[i] and x<=seq[i+1]:
return i+1
else:
continue
| ./refactory/data/question_1/code/wrong/wrong_1_204.py |
refactory_data_question_1_wrong_1_085 | def search(x, seq):
if seq == ():
return 0
if x <= seq[0]:
return 0
for i in range(len(seq)-1):
if seq[i] <= x <= seq[i+1]:
return i + 1
return len(seq)
| ./refactory/data/question_1/code/wrong/wrong_1_085.py |
refactory_data_question_1_wrong_1_130 | def search(x, seq):
if x <= seq[0] or seq == 0:
return 0
else:
for i in range(len(seq)-1):
if seq[i] < x <= seq[i+1]:
return i+1
return len(seq)
| ./refactory/data/question_1/code/wrong/wrong_1_130.py |
refactory_data_question_1_wrong_1_181 | def search(x, seq):
for i, elem in enumerate(seq):
if seq == ():
return 0
elif seq == []:
return 0
elif x > seq[-1]:
return len(seq)
elif x > elem:
continue
else:
return i
| ./refactory/data/question_1/code/wrong/wrong_1_181.py |
refactory_data_question_1_wrong_1_370 | def search(x, seq):
lst1 = list(seq)
if lst1 == []:
return 0
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... | ./refactory/data/question_1/code/wrong/wrong_1_370.py |
refactory_data_question_1_wrong_1_263 | def search(x, seq):
for i in range(len(seq)):
if x < seq[0]:
pos = 0
break
elif x <= seq[i]:
pos = i
break
elif x > seq[len(seq) - 1]:
pos = len(seq)
break
return pos
| ./refactory/data/question_1/code/wrong/wrong_1_263.py |
refactory_data_question_1_wrong_1_407 | def search(x, seq):
for i in seq:
if x <= i:
return seq.index(i)
elif x > seq[-1]:
return (seq.index(seq[-1])) + 1
| ./refactory/data/question_1/code/wrong/wrong_1_407.py |
refactory_data_question_1_wrong_1_503 | def search(x, seq):
i = 0
while (x<seq[i] and i < len(seq)):
i += 1
if i==len(seq):
seq.append(x)
else:
seq.insert(i, x)
return seq
| ./refactory/data/question_1/code/wrong/wrong_1_503.py |
refactory_data_question_1_wrong_1_552 | def search(x, seq):
if seq == ():
return 'not found'
for i, elem in enumerate(seq):
if x <= elem:
return i
return i+1
| ./refactory/data/question_1/code/wrong/wrong_1_552.py |
refactory_data_question_1_wrong_1_007 | def search(x, seq):
for i in range(len(seq)):
if x <= seq[i]:
return i
else:
return len(seq)
| ./refactory/data/question_1/code/wrong/wrong_1_007.py |
refactory_data_question_1_wrong_1_290 | def search(x, seq):
for i in range(len(seq)):
if x < len[i]:
continue
else:
return i
| ./refactory/data/question_1/code/wrong/wrong_1_290.py |
refactory_data_question_1_wrong_1_141 | def search(x, seq):
for i in range(len(seq)-1):
if seq[i] >= x:
return i
return len(seq)
| ./refactory/data/question_1/code/wrong/wrong_1_141.py |
refactory_data_question_1_wrong_1_005 | def search(x, seq):
if seq == ():
return 0
elif x < seq[0]:
return 0
elif x > seq[-1]:
return len(seq)
else:
seq_enum = [i for i in enumerate(seq)]
for j in range(len(seq_enum) - 1):
if x >= seq_enum[j][1] and x <= seq_enum[j+1][1]:
ret... | ./refactory/data/question_1/code/wrong/wrong_1_005.py |
refactory_data_question_1_wrong_1_283 | def search(x, seq):
for i in range(0, len(seq) + 1):
if seq == ():
return None
elif x < seq[0]:
return 0
elif seq[i] < x <= seq[i+1]:
return i + 1
elif seq[len(seq)-1] < x:
return len(seq)
| ./refactory/data/question_1/code/wrong/wrong_1_283.py |
refactory_data_question_1_wrong_1_280 | def search(x, seq):
for i in range(0, len(seq) + 1):
if (x < seq[0]) or (seq == ()):
return 0
elif seq[i] < x <= seq[i+1]:
return i + 1
elif seq[len(seq)-1] < x:
return len(seq)
| ./refactory/data/question_1/code/wrong/wrong_1_280.py |
refactory_data_question_1_wrong_1_088 | def search(x, seq):
count = 0
for i in range (0, len(seq)):
if seq[count] < x:
count += 1
return count if seq[-1] > x else len(seq)
| ./refactory/data/question_1/code/wrong/wrong_1_088.py |
refactory_data_question_1_wrong_1_091 | def search(x, seq):
if seq == () or seq == []:
return 0
else:
count = 0
for i in range (0, len(seq)):
if seq[count] < x:
count += 1
return count if seq[-1] > x else len(seq)
| ./refactory/data/question_1/code/wrong/wrong_1_091.py |
refactory_data_question_1_wrong_1_032 | 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 """
if seq == []:
return 0
if x < seq[0]:
return 0
elif x > seq[len(seq)-1]:
return len(seq)
else:
for i in ran... | ./refactory/data/question_1/code/wrong/wrong_1_032.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.