docstr: Initialize n-best list of hypotheses.
docstr_tok: ["Initialize","n-best","list","of","hypotheses","."]
code: def __init__(
      self, num_beams: int, length_penalty: float, early_stopping: bool
  ):
      """
      Initialize n-best list of hypotheses.
      """
      self.length_penalty = length_penalty
      self.early_stopping = early_stopping
      self.num_beams = num_beams
      self.beams = []
      self.worst_score = 1e9
  
imports: import warnings
  from abc import ABC, abstractmethod
  from collections import UserDict
  from typing import List, Optional, Tuple
  import numpy
  import torch
  from .generation_beam_constraints import Constraint, ConstraintListState
  from .utils import add_start_docstrings
label_desc: Use image node_id 1 to create a new BeamHypotheses object  with example: obj = BeamHypotheses(num_beams, length_penalty, early_stopping)