code: def do_console(self) -> None:
          
          if not self._console_enabled:
              self._sout.write('Python console disabled for this sessiong\n')
              self._sout.flush()
              return
  
          h, p = self._host, self._console_port
          log.info('Starting console at %s:%d', h, p)
          fut = init_console_server(
              self._host, self._console_port, self._locals, self._loop)
          server = fut.result(timeout=3)
          try:
              console_proxy(
                  self._sin, self._sout, self._host, self._console_port)
          finally:
              coro = close_server(server)
              close_fut = asyncio.run_coroutine_threadsafe(coro, loop=self._loop)
              close_fut.result(timeout=15)
docs: Switch to async Python REPL