class_docstr: Wrapper around socket which provides `write` and `flush` methods for the
  Vt100_Output output.
code: def write(self, data: str) -> None:
      data = data.replace("\n", "\r\n")
      self._buffer.append(
          data.encode(self._encoding, errors=self._errors)
      )
      self.flush()
  
imports: from __future__ import annotations
  import asyncio
  import contextvars
  import socket
  from asyncio import get_running_loop
  from typing import Any, Callable, Coroutine, TextIO, cast
  from prompt_toolkit.application.current import create_app_session, get_app
  from prompt_toolkit.application.run_in_terminal import run_in_terminal
  from prompt_toolkit.data_structures import Size
  from prompt_toolkit.formatted_text import AnyFormattedText, to_formatted_text
  from prompt_toolkit.input import PipeInput, create_pipe_input
  from prompt_toolkit.output.vt100 import Vt100_Output
  from prompt_toolkit.renderer import print_formatted_text
  from prompt_toolkit.styles import BaseStyle, DummyStyle
  from .log import logger
  from .protocol import DO, ECHO, IAC, LINEMODE, MODE, NAWS, SB, SE, SEND, SUPPRESS_GO_AHEAD, TTYPE, WILL, TelnetProtocolParser
label_desc: Use image node_id 2 for calling the _ConnectionStdout obj's underlying member method code with example usage: obj.write(data) without return types