code: def _reduce_nbest_translations(
      nbest_translations_list: List[Translation],
  ) -> Translation:
      """
      Combines Translation objects that are nbest translations of the same sentence.
  
      :param nbest_translations_list: A list of Translation objects, all of them translations of
          the same source sentence.
      :return: A single Translation object where nbest lists are collapsed.
      """
      best_translation = nbest_translations_list[0]
  
      sequences = [
          translation.target_ids
          for translation in nbest_translations_list
      ]
      scores = [
          translation.scores for translation in nbest_translations_list
      ]
  
      nbest_translations = NBestTranslations(sequences, scores)
  
      return Translation(
          best_translation.target_ids,
          best_translation.scores,
          nbest_translations,
          best_translation.estimated_reference_length,
      )
  
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 11 for calling a global function with example usage: _reduce_nbest_translations(nbest_translations_list) and returns: Translation