code: def create_telnet_shell(shell, loop=None):
      
  
      if loop is None:
          loop = asyncio.get_event_loop()
  
      def factory(reader, writer):
          return ShellConnection(reader, writer, shell, loop)
  
      return AsyncioTelnetServer(binary=True, echo=True, naws=True, connection_factory=factory)
docs: Run a shell application with a telnet frontend
      :param application: An EmbedShell instance
      :param loop: The event loop
      :returns: Telnet server