code: def launch_server(
      server=None, port=None, host=None, wslink_backend=None, **kwargs
  ):
      """Launch a trame server for use with Jupyter.
  
      Parameters
      ----------
      server : str, optional
          By default this uses :attr:`pyvista.global_theme.trame.jupyter_server_name
          <pyvista.plotting.themes._TrameConfig.jupyter_server_name>`, which by default is
          set to ``'pyvista-jupyter'``.
  
          If a server name is given and such server is not available yet, it will
          be created otherwise the previously created instance will be returned.
  
      port : int, optional
          The port on which to bind the server. Defaults to 0 to automatically
          find an available port.
  
      host : str, optional
          The host name to bind the server to on launch. Server will bind to
          ``127.0.0.1`` by default unless user sets the environment variable ``TRAME_DEFAULT_HOST``.
  
      wslink_backend : str, optional
          The the wslink backend that the server should use
          ``aiohttp`` by default, ``jupyter`` if the `trame_jupyter_extension <https://github.com/Kitware/trame-jupyter-extension>`_ is used.
  
      **kwargs : dict, optional
          Any additional keyword arguments to pass to ``pyvista.trame.views.get_server``.
  
      Returns
      -------
      trame_server.core.Server
          The launched Trame server. To ``await`` the launch, use the
          ``.ready`` future attribute on the server.
  
      """
      if server is None:
          server = pyvista.global_theme.trame.jupyter_server_name
      if isinstance(server, str):
          server = get_server(server, **kwargs)
      if port is None:
          port = pyvista.global_theme.trame.jupyter_server_port
      if host is None:
          # Default to `127.0.0.1` unless user sets TRAME_DEFAULT_HOST
          host = os.environ.get("TRAME_DEFAULT_HOST", "127.0.0.1")
      if (
          wslink_backend is None
          and pyvista.global_theme.trame.jupyter_extension_enabled
      ):  # pragma: no cover
          wslink_backend = "jupyter"
  
      # Must enable all used modules
      html_widgets.initialize(server)
      vtk_widgets.initialize(server)
  
      if server.client_type == "vue2":
          vuetify2_widgets.initialize(server)
      else:
          vuetify3_widgets.initialize(server)
  
      def on_ready(**_):  # numpydoc ignore=GL08
          logger.debug(f"Server ready: {server}")
  
      if server._running_stage == 0:
          server.controller.on_server_ready.add(on_ready)
          server.start(
              exec_mode="task",
              host=host,
              port=port,
              open_browser=False,
              show_connection_info=False,
              disable_logging=True,
              timeout=0,
              backend=wslink_backend,
          )
      # else, server is already running or launching
      return server
  
imports: import asyncio
  import logging
  import os
  import warnings
  from trame.widgets import html, vtk, vuetify, vuetify3
  import pyvista
  from pyvista.trame.ui import UI_TITLE, get_viewer
  from pyvista.trame.views import CLOSED_PLOTTER_ERROR, get_server
label_desc: Use image node_id 1 for calling a global function with example usage: launch_server(server, port, host, wslink_backend) and returns: server