code: def test_concat_translations(
      lp_alpha: float, lp_beta: float, bp_weight: float
  ):
      expected_target_ids = [
          [0],
          [1],
          [2],
          [0],
          [8],
          [9],
          [0],
          [3],
          [4],
          [5],
          [-1],
      ]
  
      scorer = sockeye.beam_search.CandidateScorer(
          lp_alpha, lp_beta, bp_weight
      )
  
      raw_score = 1 + 2 + 3
      length = len(expected_target_ids)
      reference_length = 10 + 11 + 12
      expected_score = [scorer(raw_score, length, reference_length)]
      # expected_score = (1 + 2 + 3) / length_penalty.get(len(expected_target_ids)) - \
      #                  brevity_penalty.get(len(expected_target_ids), 10 + 11 + 12)
      translations = [
          sockeye.inference.Translation(
              [[0], [1], [2], [-1]], [scorer(1.0, 4, 10)], None, 10
          ),
          # Translation without EOS
          sockeye.inference.Translation(
              [[0], [8], [9]], [scorer(2.0, 3, 11)], None, 11
          ),
          sockeye.inference.Translation(
              [[0], [3], [4], [5], [-1]], [scorer(3.0, 5, 12)], None, 12
          ),
      ]
      combined = sockeye.inference._concat_translations(
          translations, stop_ids={_EOS}, scorer=scorer
      )
  
      assert combined.target_ids == expected_target_ids
      assert np.isclose(combined.scores, expected_score)
  
imports: import itertools
  import json
  from math import ceil
  from unittest.mock import patch, Mock
  import numpy
  import pytest
  import torch
  import sockeye.beam_search
  import sockeye.constants
  import sockeye.data_io
  import sockeye.inference
  import sockeye.lexicon
  import sockeye.model
  import sockeye.utils
label_desc: Use image node_id 2 for calling a global function with example usage: test_concat_translations(lp_alpha, lp_beta, bp_weight) without return types