code: def test_beam_lm_update_src_len_when_finished(self):
      beam = BeamSearchLM(
          self.BEAM_SZ,
          self.BATCH_SZ,
          0,
          1,
          2,
          3,
          1,
          self.N_BEST,
          GlobalScorerStub(),
          0,
          30,
          False,
          0,
          set(),
          False,
          0.0,
          False,
      )
      device_init = torch.zeros(1, 1)
      src_len = torch.randint(0, 30, (self.BATCH_SZ,))
      fn_map_state, _, _ = beam.initialize(device_init, src_len)
      self.init_step(beam, 1)
      self.finish_first_beam_step(beam)
  
      n_steps = beam.alive_seq.shape[-1] - 1
      self.assertTrue(
          beam.src_len.equal(n_steps + fn_map_state(src_len[1:], dim=0))
      )
  
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 3 for calling the TestBeamSearchLM obj's underlying member method code with example usage: obj.test_beam_lm_update_src_len_when_finished() without return types