code: def test_beam_advance_against_known_reference(self):
      scorer = GNMTGlobalScorer(1.0, 0.0, "avg", "none")
      beam = BeamSearch(
          self.BEAM_SZ,
          self.BATCH_SZ,
          0,
          1,
          2,
          3,
          1,
          self.N_BEST,
          scorer,
          0,
          30,
          False,
          0,
          set(),
          False,
          0.0,
          False,
      )
      device_init = torch.zeros(1, 1)
      beam.initialize(
          device_init, torch.randint(0, 30, (self.BATCH_SZ,))
      )
      expected_beam_scores = self.init_step(beam, 1.0)
      expected_beam_scores = self.first_step(
          beam, expected_beam_scores, 3
      )
      expected_beam_scores = self.second_step(
          beam, expected_beam_scores, 4
      )
      self.third_step(beam, expected_beam_scores, 5)
  
imports: import unittest
  from onmt.translate.beam_search import BeamSearch, GNMTGlobalScorer
  from onmt.translate.beam_search import BeamSearchLM
  from copy import deepcopy
  import torch
label_desc: Use image node_id 1 for calling the TestBeamWithLengthPenalty obj's underlying member method code with example usage: obj.test_beam_advance_against_known_reference() without return types