code: def write(self, data):
      self._register_log_path()
  
      # write into file
      self.file.write(data)
      # force flush to make sure `fetch_log` can get stdout in time
      self.file.flush()
      # write into previous stdout
      self.raw_stdout.write(data)
  
imports: import functools
  import io
  import os
  import sys
  import textwrap
  import weakref
  from typing import List, Callable, Type
  from ..typing import OperandType, TileableType, SessionType
  from .context import Context
label_desc: Use image node_id 5 for calling the _LogWrapper obj's underlying member method code with example usage: obj.write(data) without return types