code: def translate(output_handler: OutputHandler,
                trans_inputs: List[inference.TranslatorInput],
                translator: inference.Translator) -> float:
      
      tic = time.time()
      trans_outputs = translator.translate(trans_inputs)
      total_time = time.time() - tic
      batch_time = total_time / len(trans_inputs)
      for trans_input, trans_output in zip(trans_inputs, trans_outputs):
          output_handler.handle(trans_input, trans_output, batch_time)
      return total_time
docs: Translates each line from source_data, calling output handler after translating a batch.
  
      :param output_handler: A handler that will be called once with the output of each translation.
      :param trans_inputs: A enumerable list of translator inputs.
      :param translator: The translator that will be used for each line of input.
      :return: Total time taken.