<commit_before>
# priority queue with custom sorting of objects

class Test:
	def __init__(self,priority,desc):
		self.priority = priority
		self.desc = desc
		return
	def __cmp__(self,other):
		return cmp(self.priority,other.priority)

import Queue as Q
apq=Q.PriorityQueue()
apq.put(Test(10,'ten'))
apq.put(Test(1,'one'))
apq.put(Test(12,'rwewn'))
apq.put(Test(2,'two'))

while not apq.empty():
    next_level = apq.get()
    print 'Processing level:', next_level.desc
<commit_msg>custom compare on priority Queue<commit_after>
# priority queue with custom sorting of objects

class Test:
	def __init__(self,priority,desc):
		self.priority = priority
		self.desc = desc
		return
	def __cmp__(self,other):
		return cmp(self.priority,other.priority)

import Queue as Q
apq=Q.PriorityQueue()
apq.put(Test(10,'ten'))
apq.put(Test(1,'one'))
apq.put(Test(12,'rwewn'))
apq.put(Test(2,'two'))

while not apq.empty():
    next_level = apq.get()
    print 'Processing level:', next_level.desc

"""
class ComparableMixin:
  def __eq__(self, other):
    return not self<other and not other<self
  def __ne__(self, other):
    return self<other or other<self
  def __gt__(self, other):
    return other<self
  def __ge__(self, other):
    return not self<other
  def __le__(self, other):
    return not other<self
"""
{'fraction_non_alphanumeric': 0.1362940275650842, 'fraction_numerical': 0.009188361408882083, 'mean_word_length': 4.834821428571429, 'pattern_counts': {'":': 0, '<': 10, '<?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': '4306727', 'n_tokens_mistral': 473, 'n_tokens_neox': 458, 'n_words': 117}