code: def translate(self, trans_inputs: List[TranslatorInput]) -> List[TranslatorOutput]:
          
          batch_size = self.max_batch_size
          # translate in batch-sized blocks over input chunks
          translations = []
          for batch_id, batch in enumerate(utils.grouper(trans_inputs, batch_size)):
              logger.debug("Translating batch %d", batch_id)
              # underfilled batch will be filled to a full batch size with copies of the 1st input
              rest = batch_size - len(batch)
              if rest > 0:
                  logger.debug("Extending the last batch to the full batch size (%d)", batch_size)
                  batch = batch + [batch[0]] * rest
              batch_translations = self._translate_nd(*self._get_inference_input(batch))
              # truncate to remove filler translations
              if rest > 0:
                  batch_translations = batch_translations[:-rest]
              translations.extend(batch_translations)
  
          # Concatenate results
          results = []  # type: List[TranslatorOutput]
          for trans_input, translation in zip(trans_inputs, translations):
              results.append(self._make_result(trans_input, translation))
          return results
docs: Batch-translates a list of TranslatorInputs, returns a list of TranslatorOutputs.
          Splits oversized sentences to sentence chunks of size less than max_input_length.
  
          :param trans_inputs: List of TranslatorInputs as returned by make_input().
          :return: List of translation results.