code: def test_repeated_ngram_blocking_constraint_init_state(self):
      ngram_size = 3
      batch_size = 2
      constraint = RepeatedNGramBlockingConstraint(ngram_size)
  
      state = constraint.init_state(batch_size)
      assert len(state) == batch_size
      for beam_states in state:
          assert len(beam_states) == 1
          beam_state = beam_states[0]
          assert len(beam_state.keys()) == 2
          assert len(beam_state["current_prefix"]) == 0
          assert len(beam_state["seen_ngrams"]) == 0
  
imports: from typing import Dict, Tuple, Union
  import numpy
  import pytest
  import torch
  from allennlp.common.checks import ConfigurationError
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.nn.beam_search import MultinomialSampler, BeamSearch, TopKSampler, TopPSampler, GumbelSampler, LengthNormalizedSequenceLogProbabilityScorer, RepeatedNGramBlockingConstraint, StepFunctionTypeWithTimestep, StepFunctionTypeNoTimestep
  from allennlp.common.params import Params
  from allennlp.nn.util import min_value_of_dtype
label_desc: Use image node_id 29 for calling the BeamSearchTest obj's underlying member method code with example usage: obj.test_repeated_ngram_blocking_constraint_init_state() without return types