<commit_before>from queue import Queue


class Priority_Queue(object):

    def __init__(self):
        self.high = Queue()
        self.low = Queue()

    def insert(self, item, priority="high"):
        if priority == "high":
            self.high.enqueue(item)
        elif priority == "low":
            self.low.enqueue(item)
        else:
            raise ValueError("Priorty must be literal 'high' or 'low'.")

    def pop(self):
        """
        Dequeue higher priority objects first, then those of lower priority.

        If the Priority_Queue is empty, the Queue underneath will raise a
        IndexError.
        """
        if self.high.size():
            return self.high.dequeue()
        else:
            return self.low.dequeue()

    def peek(self):
        if self.high.size():
            return self.high.head.data
        else:
            return self.low.head.data<commit_msg>Updated peek() to return None when the queue is empty.<commit_after>from queue import Queue


class Priority_Queue(object):

    def __init__(self):
        self.high = Queue()
        self.low = Queue()

    def insert(self, item, priority="high"):
        if priority == "high":
            self.high.enqueue(item)
        elif priority == "low":
            self.low.enqueue(item)
        else:
            raise ValueError("Priorty must be literal 'high' or 'low'.")

    def pop(self):
        """
        Dequeue higher priority objects first, then those of lower priority.

        If the Priority_Queue is empty, the Queue underneath will raise a
        IndexError.
        """
        if self.high.size():
            return self.high.dequeue()
        else:
            return self.low.dequeue()

    def peek(self):
        if self.high.size():
            return self.high.head.data
        elif self.low.size():
            return self.low.head.data
{'fraction_non_alphanumeric': 0.1054039593365436, 'fraction_numerical': 0.0, 'mean_word_length': 1.8593272171253823, 'pattern_counts': {'":': 4, '<': 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': '4287436', 'n_tokens_mistral': 531, 'n_tokens_neox': 511, 'n_words': 155}