code: def enable(cls, auto_colors=False, reset_atexit=False):
          
          if not IS_WINDOWS:
              return False  # Windows only.
  
          # Get values from init_kernel32().
          kernel32, stderr, stdout = init_kernel32()
          if stderr == INVALID_HANDLE_VALUE and stdout == INVALID_HANDLE_VALUE:
              return False  # No valid handles, nothing to do.
  
          # Get console info.
          bg_color, native_ansi = bg_color_native_ansi(kernel32, stderr, stdout)
  
          # Set auto colors:
          if auto_colors:
              if bg_color in (112, 96, 240, 176, 224, 208, 160):
                  ANSICodeMapping.set_light_background()
              else:
                  ANSICodeMapping.set_dark_background()
  
          # Don't replace streams if ANSI codes are natively supported.
          if native_ansi:
              return False
  
          # Reset on exit if requested.
          if reset_atexit:
              atexit.register(cls.disable)
  
          # Overwrite stream references.
          if stderr != INVALID_HANDLE_VALUE:
              sys.stderr.flush()
              sys.stderr = WindowsStream(kernel32, stderr, sys.stderr)
          if stdout != INVALID_HANDLE_VALUE:
              sys.stdout.flush()
              sys.stdout = WindowsStream(kernel32, stdout, sys.stdout)
  
          return True
docs: Enable color text with print() or sys.stdout.write() (stderr too).
  
          :param bool auto_colors: Automatically selects dark or light colors based on current terminal's background
              color. Only works with {autored} and related tags.
          :param bool reset_atexit: Resets original colors upon Python exit (in case you forget to reset it yourself with
              a closing tag). Does nothing on native ANSI consoles.
  
          :return: If streams replaced successfully.
          :rtype: bool