code: def prunebyscore(self, score, retainequalscore=False):
          
          if retainequalscore:
              if self.minimize:
                  f = lambda x: x[0] <= score
              else:
                  f = lambda x: x[0] >= score
          else:
              if self.minimize:
                  f = lambda x: x[0] < score
              else:
                  f = lambda x: x[0] > score
          self.data = filter(f, self.data)
docs: Deletes all items below/above a certain score from the queue, depending on whether minimize is True or False. Note: It is recommended (more efficient) to use blockworse=True / blockequal=True instead! Preventing the addition of 'worse' items.