sequences class queuedef __init__(self)self items [self frontidx def __compress(self)newlst [for in range(self frontidx,len(self items))newlst append(self items[ ] self items newlst self frontidx def dequeue(self)if self isempty()raise runtimeerror("attempt to dequeue an empty queue" when queue is half fullcompress it this achieves an amortized complexity of ( while not letting the list continue to grow unchecked if self frontidx len(self items)self __compress( item self items[self frontidxself frontidx + return item def enqueue(self,item)self items append(item def front(self)if self isempty()raise runtimeerror("attempt to access front of empty queue" return self items[self frontidx def isempty(self)return self frontidx =len(self items def main() queue(lst list(range( )lst [ for in lstq enqueue( if front(= print("test passed"elseprint("test failed" while not isempty()lst append( dequeue() if lst !lstprint("test failed"elseprint("test passed"this copy belongs to 'acha