code: def _concat_nbest_translations(
      translations: List[Translation],
      stop_ids: Set[int],
      scorer: CandidateScorer,
  ) -> Translation:
      """
      Combines nbest translations through concatenation.
  
      :param translations: A list of translations (sequence starting with BOS symbol), score and length.
      :param stop_ids: The EOS symbols.
      :param scorer: Candidate scorer for recomputing score of concatenated translations.
      :return: A concatenation of the translations with a score.
      """
      expanded_translations = (
          _expand_nbest_translation(translation)
          for translation in translations
      )
  
      concatenated_translations = []  # type: List[Translation]
  
      for translations_to_concat in zip(*expanded_translations):
          concatenated_translations.append(
              _concat_translations(
                  translations=list(translations_to_concat),
                  stop_ids=stop_ids,
                  scorer=scorer,
              )
          )
  
      return _reduce_nbest_translations(concatenated_translations)
  
imports: import copy
  import itertools
  import json
  import logging
  from dataclasses import dataclass
  from functools import partial
  from typing import Any, Callable, Dict, Generator, List, Optional, Set, Tuple, Union
  import numpy
  import torch
  from .None import constants
  from .None import lexicon
  from .None import utils
  from .None import vocab
  from .beam_search import CandidateScorer, get_search_algorithm, GreedySearch, SearchResult
  from .data_io import tokens2ids, get_prepended_token_length
  from .model import SockeyeModel
label_desc: Use image node_id 10 for calling a global function with example usage: _concat_nbest_translations(translations, stop_ids, scorer) and returns: _reduce_nbest_translations