<jupyter_start><jupyter_text>--- Queue<jupyter_code>class Queue:
    """This is an implementation of a Queue."""
    
    def __init__(self, items=tuple()):
        self.items = deque(items)

    def push(self, item):
        self.items.append(item)
        
    def pop(self):
        try:
            return self.items.popleft()
        except IndexError:
            raise IndexError("cannot pop empty queue")
    
    def peek(self):
        return self.items.peekleft()
    
    def __bool__(self):
        return bool(self.items)
    
    def __repr__(self):
        args_str = ", ".join((str(item) for item in self.items))
        return f"Queue([{args_str}])"

xqueue = Queue()

xqueue.push(1)
xqueue.push(2)
xqueue.push(3)

while xqueue:
    print(xqueue.pop())
class Stack:
    """This is an implementation of a Stack."""
    
    def __init__(self, items=tuple()):
        self.items = deque(items)

    def push(self, item):
        self.items.append(item)
        
    def pop(self):
        try:
            return self.items.pop()
        except IndexError:
            raise IndexError("cannot pop empty queue")
    
    def peek(self):
        return self.items.peekleft()
    
    def __bool__(self):
        return bool(self.items)
    
    def __repr__(self):
        args_str = ", ".join((str(item) for item in self.items))
        return f"Stack([{args_str}])"
xstack = Stack()

xstack.push(1)
xstack.push(2)
xstack.push(3)

while xstack:
    print(xstack.pop())<jupyter_output>3
2
1
{'fraction_non_alphanumeric': 0.13222591362126246, 'fraction_numerical': 0.005980066445182724, 'mean_word_length': 2.2668112798264644, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '391004', 'license': 'MIT', 'n_tokens_mistral': 511, 'n_tokens_neox': 504, 'n_words': 115, 'path': 'data-structs/stack_and_queue.ipynb', 'repo_name': 'naondo88/datastruct-n-algos', 'size': '1505'}