class_docstr: Collection of _Hypothesis objects
class_docstr_tok: ["Collection","of","_Hypothesis","objects"]
code: def threshold_prune(self):
      if not self.items:
          return
      #  log(score * beam_threshold) = log(score) + log(beam_threshold)
      threshold = self.items[0].score() + self.__log_beam_threshold
      for hypothesis in reversed(self.items):
          if hypothesis.score() < threshold:
              self.items.pop()
          else:
              break
  
imports: import warnings
  from collections import defaultdict
  from math import log
label_desc: Use image node_id 3 for calling the _Stack obj's underlying member method code with example usage: obj.threshold_prune() without return types