code: def test_trame_plotter_ui(client_type):
      # give different names for servers so different instances are created
      name = (
          f"{pv.global_theme.trame.jupyter_server_name}-{client_type}"
      )
      pv.set_jupyter_backend("trame")
      elegantly_launch(name, client_type=client_type)
      server = get_server(name=name)
      assert server.running
  
      pl = pv.Plotter(notebook=True)
  
      for mode in ["trame", "client", "server"]:
          ui = plotter_ui(pl, mode=mode, server=server)
          assert isinstance(ui, _BasePyVistaView)
  
      # Test invalid mode
      mode = "invalid"
      with pytest.raises(
          ValueError,
          match=f"`{mode}` is not a valid mode choice. Use one of: (.*)",
      ):
          ui = plotter_ui(pl, mode=mode, server=server)
  
      # Test when mode and server are None
      ui = plotter_ui(pl)
      assert isinstance(ui, _BasePyVistaView)
  
imports: import os
  from IPython.display import IFrame
  import numpy
  import pytest
  import pyvista
  from pyvista import examples
label_desc: Use image node_id 4 for calling a global function with example usage: test_trame_plotter_ui(client_type) without return types