code: def __init__(
      self,
      parent,
      constraints=None,
      batch_size=3,
      sequence_length=10,
      vocab_size=99,
      pad_token_id=0,
      max_length=20,
      num_beams=4,
      length_penalty=2.0,
      do_early_stopping=True,
      num_beam_hyps_to_keep=2,
  ):
      self.parent = parent
      self.batch_size = batch_size
      self.sequence_length = sequence_length
      self.vocab_size = vocab_size
      self.pad_token_id = pad_token_id
      self.max_length = max_length
      self.num_beams = num_beams
      self.length_penalty = length_penalty
      self.do_early_stopping = do_early_stopping
      self.num_beam_hyps_to_keep = num_beam_hyps_to_keep
  
      if constraints is None:
          force_tokens = torch.randint(10, 50, (1, 2))[0].tolist()
          disjunctive_tokens = torch.randint(10, 50, (2, 2)).tolist()
  
          constraints = [
              PhrasalConstraint(force_tokens),
              DisjunctiveConstraint(disjunctive_tokens),
          ]
          self.constraints = constraints
      # cannot be randomely generated
      self.eos_token_id = vocab_size + 1
  
imports: import unittest
  from transformers import is_torch_available
  from transformers.testing_utils import require_torch, torch_device
  from ..test_modeling_common import floats_tensor, ids_tensor
label_desc: Use image node_id 1 to create a new ConstrainedBeamSearchTester object  with example: obj = ConstrainedBeamSearchTester(parent, constraints, batch_size, sequence_length, vocab_size, pad_token_id, max_length, num_beams, length_penalty, do_early_stopping, num_beam_hyps_to_keep)