Here is a python version with commented code:
class QueueUsingStacks:
    def __init__(self):
        # Initialize two stacks: input_stack and output_stack
        self.input_stack = []
        self.output_stack = []

    def enqueue(self, item):
        # Add elements to the input_stack
        self.input_stack.append(item)

    def dequeue(self):
        # If the output_stack is empty, transfer all elements from the input_stack to the output_stack
        if not self.output_stack:
            while self.input_stack:
                self.output_stack.append(self.input_stack.pop())
        # Return the top element from the output_stack, which is the element at the front of the queue
        return self.output_stack.pop()
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence