code: def _initialize_telnet(connection):
      logger.info("Initializing telnet connection")
  
      # Iac Do Linemode
      connection.send(IAC + DO + LINEMODE)
  
      # Suppress Go Ahead. (This seems important for Putty to do correct echoing.)
      # This will allow bi-directional operation.
      connection.send(IAC + WILL + SUPPRESS_GO_AHEAD)
  
      # Iac sb
      connection.send(
          IAC + SB + LINEMODE + MODE + int2byte(0) + IAC + SE
      )
  
      # IAC Will Echo
      connection.send(IAC + WILL + ECHO)
  
      # Negotiate window size
      connection.send(IAC + DO + NAWS)
  
imports: from __future__ import unicode_literals
  import socket
  import select
  import threading
  import os
  import fcntl
  from six import int2byte, text_type, binary_type
  from codecs import getincrementaldecoder
  from prompt_toolkit.enums import DEFAULT_BUFFER
  from prompt_toolkit.eventloop.base import EventLoop
  from prompt_toolkit.interface import CommandLineInterface, Application
  from prompt_toolkit.layout.screen import Size
  from prompt_toolkit.shortcuts import create_prompt_application
  from prompt_toolkit.terminal.vt100_input import InputStream
  from prompt_toolkit.terminal.vt100_output import Vt100_Output
  from .log import logger
  from .protocol import IAC, DO, LINEMODE, SB, MODE, SE, WILL, ECHO, NAWS, SUPPRESS_GO_AHEAD
  from .protocol import TelnetProtocolParser
  from .application import TelnetApplication
label_desc: Use image node_id 1 for calling a global function with example usage: _initialize_telnet(connection) without return types