code: def _get_best_indexes(logits, n_best_size):
      
      index_and_score = sorted(enumerate(logits), key=lambda x: x[1], reverse=True)
  
      best_indexes = []
      for i in range(len(index_and_score)):
          if i >= n_best_size:
              break
          best_indexes.append(index_and_score[i][0])
      return best_indexes
docs: Get the n-best logits from a list.