id
stringlengths
35
39
content
stringlengths
44
3.85k
max_stars_repo_path
stringlengths
52
57
refactory_data_question_3_correct_3_309
def remove_extras(lst): new_lst = [] for i in range (len(lst)): if lst[i] not in new_lst: new_lst.append(lst[i]) return new_lst print(remove_extras([1,5,1,1,3,2]))
./refactory/data/question_3/code/correct/correct_3_309.py
refactory_data_question_3_correct_3_533
def remove_extras(lst): # your code here l=[] for i in lst: if i not in l: l.append(i) return l
./refactory/data/question_3/code/correct/correct_3_533.py
refactory_data_question_3_correct_3_001
def remove_extras(lst): new_lst = [] for i in lst: if i not in new_lst: new_lst.append(i) else: continue return new_lst
./refactory/data/question_3/code/correct/correct_3_001.py
refactory_data_question_3_correct_3_244
def remove_extras(lst): # your code here lst.reverse() for item in lst: while lst.count(item) != 1: lst.remove(item) lst.reverse() return lst
./refactory/data/question_3/code/correct/correct_3_244.py
refactory_data_question_3_correct_3_405
def remove_extras(lst): new=[] for i in lst: if i not in new: new.append(i) return new pass
./refactory/data/question_3/code/correct/correct_3_405.py
refactory_data_question_3_correct_3_041
def remove_extras(lst): copy_list = lst.copy() copy_list.reverse() for i in lst: x = lst.count(i) if x > 1: for j in range(x-1): copy_list.remove(i) lst = copy_list lst.reverse() return lst
./refactory/data/question_3/code/correct/correct_3_041.py
refactory_data_question_3_correct_3_492
def remove_extras(lst): result = [] for i in lst: if i in result: continue else: result.append(i) return result
./refactory/data/question_3/code/correct/correct_3_492.py
refactory_data_question_3_correct_3_231
def remove_extras(lst): new_lst = [] for i in lst: if i not in new_lst: new_lst.append(i) return new_lst
./refactory/data/question_3/code/correct/correct_3_231.py
refactory_data_question_3_correct_3_255
def remove_extras(lst): store = [] for ele in lst: if ele not in store: store += [ele] return store
./refactory/data/question_3/code/correct/correct_3_255.py
refactory_data_question_3_correct_3_410
def remove_extras(lst): # your code here n = 0 a = lst while n < len(a): if a[n] in a[n+1:]: b = a[n+1:] b.remove(a[n]) a = a[:n+1] + b else: n = n + 1 return a
./refactory/data/question_3/code/correct/correct_3_410.py
refactory_data_question_3_correct_3_048
def remove_extras(lst): new=[] for i in lst: if not i in new: new+=[i] return new# your code here pass
./refactory/data/question_3/code/correct/correct_3_048.py
refactory_data_question_3_correct_3_011
def remove_extras(lst): new_lst = [] for num in lst: if num not in new_lst: new_lst.append(num) return new_lst
./refactory/data/question_3/code/correct/correct_3_011.py
refactory_data_question_3_correct_3_446
def remove_extras(lst): new_lst = [] for num in lst: if num not in new_lst: new_lst.append(num) return new_lst
./refactory/data/question_3/code/correct/correct_3_446.py
refactory_data_question_3_correct_3_105
def remove_extras(lst): newlist = [] for number in lst: if number not in newlist: newlist.append(number) return newlist # your code here pass
./refactory/data/question_3/code/correct/correct_3_105.py
refactory_data_question_3_correct_3_542
def remove_extras(lst): a = [] for i in lst: if i not in a: a.append(i) return a
./refactory/data/question_3/code/correct/correct_3_542.py
refactory_data_question_3_correct_3_046
def remove_extras(lst): remove_indices = [] for i in range(len(lst)): this = lst[i] for j in range(i): if lst[j] == this: remove_indices.append(i) for i in remove_indices: lst[i] = None while None in lst: del lst[lst.index(None)] return lst
./refactory/data/question_3/code/correct/correct_3_046.py
refactory_data_question_3_correct_3_422
def remove_extras(lst): result=[] for i in lst: if i in result: continue else: result+=[i,] return result pass
./refactory/data/question_3/code/correct/correct_3_422.py
refactory_data_question_3_correct_3_056
def remove_extras(lst): l=[] for i in lst: checker=True for k in l: if k==i: checker=False if checker: l+=[i] return l
./refactory/data/question_3/code/correct/correct_3_056.py
refactory_data_question_3_correct_3_480
def remove_extras(lst): new_lst = [] for i in range(len(lst)): if lst[i] not in new_lst: new_lst.append(lst[i]) return new_lst
./refactory/data/question_3/code/correct/correct_3_480.py
refactory_data_question_3_correct_3_241
def remove_extras(lst): new_lst = [] for i in lst: if not i in new_lst: new_lst.append(i) return new_lst
./refactory/data/question_3/code/correct/correct_3_241.py
refactory_data_question_3_correct_3_435
def remove_extras(lst): def position(i,seq): n = len(seq) for j in range(n): if seq[j] == i: return j def helper(start,i): for k in lst[start:]: if k == i: n_pos = position(k,lst[start:])+ index +1 print(k,n_pos) lst.pop(n_pos) for i in lst: index = position(i,lst) helper(index+1,i) return lst
./refactory/data/question_3/code/correct/correct_3_435.py
refactory_data_question_3_correct_3_288
def remove_extras(lst): new_list = [] for x in lst: if x not in new_list: new_list.append(x) return new_list
./refactory/data/question_3/code/correct/correct_3_288.py
refactory_data_question_3_correct_3_055
def remove_extras(lst): lst.reverse() for i in lst: if lst.count(i) >1: j = 0 while j < lst.count(i): lst.remove(i) j += 1 lst.reverse() return lst
./refactory/data/question_3/code/correct/correct_3_055.py
refactory_data_question_3_correct_3_109
def remove_extras(lst): new_lst = [] for item in lst: if item not in new_lst: new_lst.append(item) return new_lst
./refactory/data/question_3/code/correct/correct_3_109.py
refactory_data_question_3_correct_3_297
def remove_extras(lst): result = [] for i in range(len(lst)): if lst[i] not in result: result += [lst[i],] continue return result
./refactory/data/question_3/code/correct/correct_3_297.py
refactory_data_question_3_correct_3_097
def remove_extras(lst): new_lst=[] for element in lst: if element not in new_lst: new_lst += [element] return new_lst
./refactory/data/question_3/code/correct/correct_3_097.py
refactory_data_question_3_correct_3_291
def remove_extras(lst): lst1 = [] for i in lst: if i not in lst1: lst1.append(i) return lst1
./refactory/data/question_3/code/correct/correct_3_291.py
refactory_data_question_3_correct_3_210
def remove_extras(lst): a = () c = () n = len(lst) for i in range(n): for j in range(i,n): if lst[i] == lst[j] and i != j: a += (j,) #j is the jth index of the list else: continue d = tuple(set(a)) #[repeated_index1, repeated_index2] for i in d: c += (lst[i],) lst.reverse() for j in range(len(c)): lst.remove(c[j]) lst.reverse() return lst
./refactory/data/question_3/code/correct/correct_3_210.py
refactory_data_question_3_correct_3_271
def remove_extras(lst): answer = [] for i in lst: unique = True for a in answer: if i == a: unique = False break if unique: answer += [i] return answer
./refactory/data/question_3/code/correct/correct_3_271.py
refactory_data_question_3_correct_3_034
def remove_extras(lst): result=[] for i in lst: if i not in result: result+=[i] return result
./refactory/data/question_3/code/correct/correct_3_034.py
refactory_data_question_3_correct_3_030
def remove_extras(lst): s = [] for i in lst: if i not in s: s.append(i) return s
./refactory/data/question_3/code/correct/correct_3_030.py
refactory_data_question_3_correct_3_151
def remove_extras(lst): if lst==[]: return [] new_lst=[lst[0]] for i in range(len(lst)): a=lst[i] for h in range(i,len(lst)): if a!=lst[h]: ele=lst[h] if ele in new_lst: continue new_lst.append(ele) return new_lst
./refactory/data/question_3/code/correct/correct_3_151.py
refactory_data_question_3_correct_3_220
def remove_extras(lst): seq = [] for i in lst: if i in seq: continue else: seq += [i] return seq
./refactory/data/question_3/code/correct/correct_3_220.py
refactory_data_question_3_correct_3_293
def remove_extras(lst): new_lst = [] for ele in lst: if ele not in new_lst: new_lst.append(ele) return new_lst
./refactory/data/question_3/code/correct/correct_3_293.py
refactory_data_question_3_correct_3_122
def remove_extras(lst): s =[] for i in lst: if i not in s: s.append(i) return s
./refactory/data/question_3/code/correct/correct_3_122.py
refactory_data_question_3_correct_3_477
def remove_extras(lst): a=[] for i in lst: if i not in a: a+=[i] return a
./refactory/data/question_3/code/correct/correct_3_477.py
refactory_data_question_3_correct_3_353
def remove_extras(lst): new_lst = [] for i in lst: if i not in new_lst: new_lst += [i,] return new_lst
./refactory/data/question_3/code/correct/correct_3_353.py
refactory_data_question_3_correct_3_258
def remove_extras(lst): newlist = [] for i in lst: if i in newlist: continue else: newlist += [i] return newlist
./refactory/data/question_3/code/correct/correct_3_258.py
refactory_data_question_3_correct_3_400
def remove_extras(lst): product = [] for i in lst: if i not in product: product = product + [i] return product
./refactory/data/question_3/code/correct/correct_3_400.py
refactory_data_question_3_correct_3_156
def remove_extras(lst): new_lst = [] for i in lst: if i not in new_lst: new_lst.append(i) return new_lst
./refactory/data/question_3/code/correct/correct_3_156.py
refactory_data_question_3_correct_3_445
def remove_extras(lst): new = [] for i in lst: if i not in new: new.append(i) return new
./refactory/data/question_3/code/correct/correct_3_445.py
refactory_data_question_3_correct_3_408
def remove_extras(lst): rev_lst=lst.copy() rev_lst.reverse() ori_len=len(lst) new_lst=lst.copy() for i in range(ori_len): if rev_lst[i] in rev_lst[i+1:]: new_lst.pop(ori_len-i-1) return new_lst
./refactory/data/question_3/code/correct/correct_3_408.py
refactory_data_question_3_correct_3_025
def remove_extras(lst): new_lst = [] for numbers in lst: if numbers not in new_lst: new_lst.append(numbers) return new_lst
./refactory/data/question_3/code/correct/correct_3_025.py
refactory_data_question_3_correct_3_476
from collections import OrderedDict def remove_extras(lst): return list(OrderedDict.fromkeys(lst))
./refactory/data/question_3/code/correct/correct_3_476.py
refactory_data_question_3_correct_3_144
def remove_extras(lst): new_lst = [] for i in lst: if i not in new_lst: new_lst += [i] return new_lst pass
./refactory/data/question_3/code/correct/correct_3_144.py
refactory_data_question_3_correct_3_296
def remove_extras(lst): newlst = [] for elem in lst: if elem not in newlst: newlst.append(elem) return newlst
./refactory/data/question_3/code/correct/correct_3_296.py
refactory_data_question_3_correct_3_436
def remove_extras(lst): new = [] for element in lst: if element not in new: new.append(element) return new
./refactory/data/question_3/code/correct/correct_3_436.py
refactory_data_question_3_correct_3_162
def remove_extras(lst): # your code here if lst == []: return [] else: result = (lst[0],) for item in lst[1:]: if item in result: continue else: result +=(item,) return list(result)
./refactory/data/question_3/code/correct/correct_3_162.py
refactory_data_question_3_correct_3_165
def remove_extras(lst): lst.reverse() for element in lst: if lst.count(element)>1: lst.remove(element) lst.reverse() return lst
./refactory/data/question_3/code/correct/correct_3_165.py
refactory_data_question_3_correct_3_240
def remove_extras(lst): new_lst = [] for num in lst: if num not in new_lst: new_lst.append(num) return new_lst
./refactory/data/question_3/code/correct/correct_3_240.py
refactory_data_question_3_correct_3_440
def remove_extras(lst): listt = [] for i in lst: if i in listt: continue else: listt += [i] return listt
./refactory/data/question_3/code/correct/correct_3_440.py
refactory_data_question_3_correct_3_344
def remove_extras(lst): newlst = [] for elem in lst: if elem not in newlst: newlst.append(elem) return newlst
./refactory/data/question_3/code/correct/correct_3_344.py
refactory_data_question_3_correct_3_393
def remove_extras(lst): newlst=[] for i in lst: while i not in newlst: newlst.append(i) return newlst
./refactory/data/question_3/code/correct/correct_3_393.py
refactory_data_question_3_correct_3_317
def remove_extras(lst): new_lst = [] for i in lst: new_lst.append(i) if new_lst.count(i) > 1: new_lst.pop() continue return new_lst
./refactory/data/question_3/code/correct/correct_3_317.py
refactory_data_question_3_correct_3_398
def remove_extras(lst): new_lst = [] for x in lst: if x not in new_lst: new_lst = new_lst + [x] else: continue return new_lst
./refactory/data/question_3/code/correct/correct_3_398.py
refactory_data_question_3_correct_3_338
def remove_extras(lst): l=[] for i in lst: if i not in l: l.append(i) return l
./refactory/data/question_3/code/correct/correct_3_338.py
refactory_data_question_3_correct_3_129
def remove_extras(lst): result = [] for i in lst: if i not in result: result += [i] return result
./refactory/data/question_3/code/correct/correct_3_129.py
refactory_data_question_3_correct_3_507
def remove_extras(lst): lst2 = [] for x in lst: if x not in lst2: lst2.append(x) return lst2
./refactory/data/question_3/code/correct/correct_3_507.py
refactory_data_question_3_correct_3_415
def remove_extras(lst): x = [] for i in lst: if i not in x: x = x + [i,] else: continue return x
./refactory/data/question_3/code/correct/correct_3_415.py
refactory_data_question_3_correct_3_088
def remove_extras(lst): new=[] for i in lst: new=new+[i] if i not in new else new return new
./refactory/data/question_3/code/correct/correct_3_088.py
refactory_data_question_3_correct_3_262
def remove_extras(n): result = [] counter = 0 while counter < len(n): temp = n[counter] if temp not in result: result.append(temp) counter = counter + 1 return result
./refactory/data/question_3/code/correct/correct_3_262.py
refactory_data_question_3_correct_3_287
def remove_extras(lst): result=[] for i in lst: if i not in result: result.append(i) else: continue return result
./refactory/data/question_3/code/correct/correct_3_287.py
refactory_data_question_3_correct_3_221
def remove_extras(lst): result=[] for i in lst: if i in result: continue result+= [i] return result
./refactory/data/question_3/code/correct/correct_3_221.py
refactory_data_question_3_correct_3_214
def remove_extras(lst): result = [] for item in lst: if item not in result: result += [item] return result
./refactory/data/question_3/code/correct/correct_3_214.py
refactory_data_question_3_correct_3_286
def remove_extras(lst): result = [] for elem in lst: if elem not in result: result.append(elem) return result
./refactory/data/question_3/code/correct/correct_3_286.py
refactory_data_question_3_correct_3_146
def remove_extras(lst): new = [] for num in lst: if num in new: continue new.append(num) return new
./refactory/data/question_3/code/correct/correct_3_146.py
refactory_data_question_3_correct_3_236
def remove_extras(lst): a = [] for i in lst: if i not in a: a.append(i) return a
./refactory/data/question_3/code/correct/correct_3_236.py
refactory_data_question_3_correct_3_137
def remove_extras(lst): new_lst=[] for i in lst: if i in new_lst: continue else: new_lst.append(i) return new_lst
./refactory/data/question_3/code/correct/correct_3_137.py
refactory_data_question_3_correct_3_026
def remove_extras(lst): new=[] for i in lst: new=new+[i] if i not in new else new return new
./refactory/data/question_3/code/correct/correct_3_026.py
refactory_data_question_3_correct_3_450
def remove_extras(lst): result = [] for i in lst: if i not in result: result.append(i) else: continue return result
./refactory/data/question_3/code/correct/correct_3_450.py
refactory_data_question_3_correct_3_257
def remove_extras(lst): removed = [] for e in lst: if (e in lst) and (e not in removed): removed.append(e) return removed
./refactory/data/question_3/code/correct/correct_3_257.py
refactory_data_question_3_correct_3_391
def remove_extras(lst): l=[] for i in lst: if i not in l: l.append(i) return l
./refactory/data/question_3/code/correct/correct_3_391.py
refactory_data_question_3_correct_3_177
def remove_extras(lst): new_lst = [] for i in lst: if i in new_lst: continue else: new_lst.append(i) return new_lst
./refactory/data/question_3/code/correct/correct_3_177.py
refactory_data_question_3_correct_3_485
def remove_extras(lst): lst.reverse() for element in lst: if lst.count(element) > 1: lst.remove(element) lst.reverse() return lst
./refactory/data/question_3/code/correct/correct_3_485.py
refactory_data_question_3_correct_3_179
def remove_extras(lst): newlst=[] for i in lst: if i not in newlst: newlst.append(i) return newlst # your code here pass
./refactory/data/question_3/code/correct/correct_3_179.py
refactory_data_question_3_correct_3_119
def remove_extras(lst): lst2=[] for x in lst: if x not in lst2: lst2+=[x] return lst2
./refactory/data/question_3/code/correct/correct_3_119.py
refactory_data_question_3_correct_3_153
def remove_extras(lst): lst_final = [] for i in lst: if i not in lst_final: lst_final.append(i) return lst_final
./refactory/data/question_3/code/correct/correct_3_153.py
refactory_data_question_3_correct_3_138
def remove_extras(lst): s = [] for n in lst: if n not in s: s.append(n) return s
./refactory/data/question_3/code/correct/correct_3_138.py
refactory_data_question_3_correct_3_428
def remove_extras(lst): lst.reverse() for elem in lst: while elem in lst[lst.index(elem)+1:]: lst.remove(elem) #reversing list to remove elements from the back.. I think? lst.reverse() new_lst = lst.copy() return new_lst #Don't really understand the new list part. Does this mean they don't want me to modify #the list that was input? Will making a shallow copy at the end suffice?
./refactory/data/question_3/code/correct/correct_3_428.py
refactory_data_question_3_correct_3_183
def remove_extras(lst): lst.reverse() for element in lst: if lst.count(element)>1: lst.remove(element) lst.reverse() return lst
./refactory/data/question_3/code/correct/correct_3_183.py
refactory_data_question_3_correct_3_116
def remove_extras(lst): result = [] for i in lst: if i not in result: result.append(i) return result
./refactory/data/question_3/code/correct/correct_3_116.py
refactory_data_question_3_correct_3_461
def remove_extras(lst): newlist = [] for element in lst: if newlist.count(element)==0: newlist.append(element) return newlist pass
./refactory/data/question_3/code/correct/correct_3_461.py
refactory_data_question_3_correct_3_239
def remove_extras(lst): if len(lst)==0: return lst l=[lst[0],] for i in lst[1:]: if i not in l: l+=[i,] return l #qn3 #list1 = [1] * 4 #list2 = [5, 5, 5] #while not 0: # list1[0] += 1 # if list1[0] == 5: # break #break out of the while loop # list1[1] += 2 # list1[2] += 3 #list1[2]+=3 every time it loops #list1=[5, 1, 10, 1] #list2 is [5, 5, 5]
./refactory/data/question_3/code/correct/correct_3_239.py
refactory_data_question_3_correct_3_143
def remove_extras(lst): lst1 = [] for i in lst: if i not in lst1: lst1 += [i,] return lst1
./refactory/data/question_3/code/correct/correct_3_143.py
refactory_data_question_3_correct_3_333
def remove_extras(lst): index = 0 listNumber = [] result = [] for i in lst: listNumber.append(i) count = 0 for j in listNumber: if i == j: count += 1 if count <= 1: result.append(i) index += 1 return result
./refactory/data/question_3/code/correct/correct_3_333.py
refactory_data_question_3_correct_3_216
def remove_extras(lst): final=[] for i in lst: if i not in final: final+=[i,] else: continue return final
./refactory/data/question_3/code/correct/correct_3_216.py
refactory_data_question_3_correct_3_454
def remove_extras(lst): i=1 if lst==[]: return lst while i!=len(lst): if lst[i] in lst[:i]: del lst[i] continue i+=1 return lst
./refactory/data/question_3/code/correct/correct_3_454.py
refactory_data_question_3_correct_3_365
def remove_extras(lst): new = [] for i in lst: if i not in new: new.append(i) return new
./refactory/data/question_3/code/correct/correct_3_365.py
refactory_data_question_3_correct_3_319
def remove_extras(lst): new_lst = [] for element in lst: if element in new_lst: continue else: new_lst += [element] return new_lst
./refactory/data/question_3/code/correct/correct_3_319.py
refactory_data_question_3_correct_3_188
def remove_extras(lst): newlst = [] for element in lst: if element not in newlst: newlst = newlst + [element] return newlst
./refactory/data/question_3/code/correct/correct_3_188.py
refactory_data_question_3_correct_3_314
def remove_extras(lst): product = [] for element in lst: if element in product: continue else: product = product + [element] return product
./refactory/data/question_3/code/correct/correct_3_314.py
refactory_data_question_3_correct_3_328
def remove_extras(lst): result = [] for ele in lst: if ele not in result: result.append(ele) return result
./refactory/data/question_3/code/correct/correct_3_328.py
refactory_data_question_3_correct_3_278
def remove_extras(lst): lst.reverse() for i in lst: if lst.count(i) > 1: lst.remove(i) lst.reverse() return lst
./refactory/data/question_3/code/correct/correct_3_278.py
refactory_data_question_3_correct_3_514
def remove_extras(lst): new_list = [] if lst == []: return lst else: for i in lst: if i in new_list: continue else: new_list.append(i) return new_list
./refactory/data/question_3/code/correct/correct_3_514.py
refactory_data_question_3_correct_3_525
def remove_extras(lst): new_lst = [] for ele in lst: if ele in new_lst: continue else: new_lst += [ele] return new_lst
./refactory/data/question_3/code/correct/correct_3_525.py
refactory_data_question_3_correct_3_518
def remove_extras(lst): l = [] for i in lst: if i not in l: l.append(i) return l
./refactory/data/question_3/code/correct/correct_3_518.py
refactory_data_question_3_correct_3_059
def remove_extras(lst): s = [] for element in lst: if element not in s: s.append(element) return s
./refactory/data/question_3/code/correct/correct_3_059.py
refactory_data_question_3_correct_3_102
def remove_extras(lst): new_lst = [] for i in lst: if i not in new_lst: new_lst.append(i) return new_lst
./refactory/data/question_3/code/correct/correct_3_102.py
refactory_data_question_3_correct_3_022
def remove_extras(lst): length = len(lst) if length == 0: return [] result = [lst[0]] for i in range(1,length): if lst[i] not in result: result = result + [lst[i]] return result
./refactory/data/question_3/code/correct/correct_3_022.py
refactory_data_question_3_correct_3_418
def remove_extras(lst): new_lst = [] for i in lst: if i not in new_lst: new_lst = new_lst + [i,] else: continue return new_lst
./refactory/data/question_3/code/correct/correct_3_418.py