code: def _reduce_nbest_translations(nbest_translations_list: List[Translation]) -> Translation:
      
      best_translation = nbest_translations_list[0]
  
      sequences = [translation.target_ids for translation in nbest_translations_list]
      attention_matrices = [translation.attention_matrix for translation in nbest_translations_list]
      scores = [translation.score for translation in nbest_translations_list]
  
      nbest_translations = NBestTranslations(sequences, attention_matrices, scores)
  
      return Translation(best_translation.target_ids,
                         best_translation.attention_matrix,
                         best_translation.score,
                         best_translation.beam_histories,
                         nbest_translations,
                         best_translation.estimated_reference_length)
docs: 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.