class_docstr: Collection of _Hypothesis objects
class_docstr_tok: ["Collection","of","_Hypothesis","objects"]
docstr: :param beam_threshold: Hypotheses that score less than this
      factor of the best hypothesis are discarded from the stack.
      Value must be between 0.0 and 1.0.
  :type beam_threshold: float
docstr_tok: [":","param","beam_threshold",":","Hypotheses","that","score","less","than","this","factor","of","the","best","hypothesis","are","discarded","from","the","stack",".","Value","must","be","between","0.0","and","1.0.",":","type","beam_threshold",":","float"]
code: def __init__(self, max_size=100, beam_threshold=0.0):
      """
      :param beam_threshold: Hypotheses that score less than this
          factor of the best hypothesis are discarded from the stack.
          Value must be between 0.0 and 1.0.
      :type beam_threshold: float
      """
      self.max_size = max_size
      self.items = []
  
      if beam_threshold == 0.0:
          self.__log_beam_threshold = float("-inf")
      else:
          self.__log_beam_threshold = log(beam_threshold)
  
imports: import warnings
  from collections import defaultdict
  from math import log
label_desc: Use image node_id 1 to create a new _Stack object  with example: obj = _Stack(max_size, beam_threshold)