code: def __init__(self, ctx: Context, op: OperandType, log_path: str):
      self.ctx = ctx
      self.op = op
      self.log_path = log_path
  
      self.file = open(log_path, "w")
      self.stdout = sys.stdout
  
      self.raw_stdout = self.stdout
      while isinstance(self.raw_stdout, _LogWrapper):
          self.raw_stdout = self.raw_stdout.stdout
  
      # flag about registering log path
      self.is_log_path_registered = False
  
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 1 to create a new _LogWrapper object  with example: obj = _LogWrapper(ctx, op, log_path)