code: def create_output(stdout=None, true_color=False, ansi_colors_only=None):
      
      stdout = stdout or sys.__stdout__
      true_color = to_simple_filter(true_color)
  
      if is_windows():
          if is_conemu_ansi():
              return ConEmuOutput(stdout)
          else:
              return Win32Output(stdout)
      else:
          term = os.environ.get('TERM', '')
          if PY2:
              term = term.decode('utf-8')
  
          return Vt100_Output.from_pty(
              stdout, true_color=true_color,
              ansi_colors_only=ansi_colors_only, term=term)
docs: Return an :class:`~prompt_toolkit.output.Output` instance for the command
      line.
  
      :param true_color: When True, use 24bit colors instead of 256 colors.
          (`bool` or :class:`~prompt_toolkit.filters.SimpleFilter`.)
      :param ansi_colors_only: When True, restrict to 16 ANSI colors only.
          (`bool` or :class:`~prompt_toolkit.filters.SimpleFilter`.)