class_docstr: Output handler to write translation score to a stream.
  
  :param stream: Stream to write translations to (e.g., sys.stdout).
class_docstr_tok: ["Output","handler","to","write","translation","score","to","a","stream",".",":","param","stream",":","Stream","to","write","translations","to","(","e.g.",",","sys.stdout",")","."]
docstr: :param t_input: Translator input.
  :param t_output: Translator output.
  :param t_walltime: Total walltime for translation.
docstr_tok: [":","param","t_input",":","Translator","input",".",":","param","t_output",":","Translator","output",".",":","param","t_walltime",":","Total","walltime","for","translation","."]
code: def handle(
      self,
      t_input: inference.TranslatorInput,
      t_output: inference.TranslatorOutput,
      t_walltime: float = 0.0,
  ):
      """
      :param t_input: Translator input.
      :param t_output: Translator output.
      :param t_walltime: Total walltime for translation.
      """
      result = "{:.6f}".format(t_output.score)
      if (
          hasattr(t_output, "factor_scores")
          and t_output.factor_scores is not None
      ):
          factor_scores = "\t".join(
              "{:.6f}".format(fs) for fs in t_output.factor_scores
          )
          result = f"{result}\t{factor_scores}"
      print(result, file=self.stream, flush=True)
  
imports: import json
  import sys
  from abc import ABC, abstractmethod
  from itertools import chain
  from typing import Optional
  import sockeye.constants
  from sockeye.utils import smart_open
  from .None import inference
label_desc: Use image node_id 2 for calling the ScoreOutputHandler obj's underlying member method code with example usage: obj.handle(t_input, t_output, t_walltime) without return types