class_docstr: Implements a 'write()' method which, on Windows, will strip ANSI character
  sequences from the text, and if outputting to a tty, will convert them into
  win32 function calls.
code: def __init__(
      self, wrapped, convert=None, strip=None, autoreset=False
  ):
      # The wrapped stream (normally sys.stdout or sys.stderr)
      self.wrapped = wrapped
  
      # should we reset colors to defaults after every .write()
      self.autoreset = autoreset
  
      # create the proxy wrapping our output stream
      self.stream = StreamWrapper(wrapped, self)
  
      on_windows = os.name == "nt"
      # We test if the WinAPI works, because even if we are on Windows
      # we may be using a terminal that doesn't support the WinAPI
      # (e.g. Cygwin Terminal). In this case it's up to the terminal
      # to support the ANSI codes.
      conversion_supported = on_windows and winapi_test()
      try:
          fd = wrapped.fileno()
      except Exception:
          fd = -1
      system_has_native_ansi = not on_windows or enable_vt_processing(
          fd
      )
      have_tty = not self.stream.closed and self.stream.isatty()
      need_conversion = (
          conversion_supported and not system_has_native_ansi
      )
  
      # should we strip ANSI sequences from our output?
      if strip is None:
          strip = need_conversion or not have_tty
      self.strip = strip
  
      # should we should convert ANSI sequences into win32 calls?
      if convert is None:
          convert = need_conversion and have_tty
      self.convert = convert
  
      # dict of ansi codes to win32 functions and parameters
      self.win32_calls = self.get_win32_calls()
  
      # are we wrapping stderr?
      self.on_stderr = self.wrapped is sys.stderr
  
imports: import re
  import sys
  import os
  from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style, BEL
  from .winterm import enable_vt_processing, WinTerm, WinColor, WinStyle
  from .win32 import windll, winapi_test
label_desc: Use image node_id 1 to create a new AnsiToWin32 object from inherited base classes: object with example: obj = AnsiToWin32(wrapped, convert, strip, autoreset)