<commit_before>from collections import deque


class StackMath(object):
    def __init__(self, stack):
        self.stack = stack

    def _get_operands(self):
        left = self.stack.pop()
        right = self.stack.pop()
        return (left, right)

    def add(self):
        operands = self._get_operands()
        self.stack.push(operands[0] + operands[1])

    def subtract(self):
        operands = self._get_operands()
        self.stack.push(operands[0] - operands[1])

    def multiply(self):
        operands = self._get_operands()
        self.stack.push(operands[0] * operands[1])

    def divide(self):
        operands = self._get_operands()
        self.stack.push(operands[0] // operands[1])

    def modulo(self):
        operands = self._get_operands()
        self.stack.push(operands[0] % operands[1])


class Stack(deque):<commit_msg>Cast stack value to int<commit_after>from collections import deque


class StackMath(object):
    def __init__(self, stack):
        self.stack = stack

    def _get_operands(self):
        # TODO: Exception handling if value can't be casted to int
        left = int(self.stack.pop())
        right = int(self.stack.pop())
        return (left, right)

    def add(self):
        operands = self._get_operands()
        self.stack.push(operands[0] + operands[1])

    def subtract(self):
        operands = self._get_operands()
        self.stack.push(operands[0] - operands[1])

    def multiply(self):
        operands = self._get_operands()
        self.stack.push(operands[0] * operands[1])

    def divide(self):
        operands = self._get_operands()
        self.stack.push(operands[0] // operands[1])

    def modulo(self):
        operands = self._get_operands()
        self.stack.push(operands[0] % operands[1])


class Stack(deque):
{'fraction_non_alphanumeric': 0.12797783933518006, 'fraction_numerical': 0.0110803324099723, 'mean_word_length': 2.6265060240963853, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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}}
{'dir': 'git-commits-cleaned', 'id': '2833005', 'n_tokens_mistral': 598, 'n_tokens_neox': 574, 'n_words': 117}