code: def test_trame_custom_menu_items(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)
      algo = pv.ConeSource()
      mesh_actor = pl.add_mesh(algo)
  
      viewer = get_viewer(pl, server=server)
  
      # setup vuetify items
      slider = vue2_slider if client_type == "vue2" else vue3_slider
      text_field = (
          vue2_text_field if client_type == "vue2" else vue3_text_field
      )
      select = vue2_select if client_type == "vue2" else vue3_select
      divider = vue2_divider if client_type == "vue2" else vue3_divider
  
      # vuetify items to pass as argument
      def custom_tools():
          divider(vertical=True, classes="mx-1")
          slider(
              ("resolution", 3),
              "Resolution slider",
              min=3,
              max=20,
              step=1,
          )
          text_field(
              ("resolution", 3), "Resolution value", type="number"
          )
          divider(vertical=True, classes="mx-1")
          select(
              model=("visibility", "Show"),
              tooltip="Toggle visibility",
              items=["Visibility", ["Hide", "Show"]],
          )
  
      with viewer.make_layout(server, template_name=pl._id_name):
          viewer.ui(
              mode="trame",
              default_server_rendering=True,
              collapse_menu=False,
              add_menu_items=custom_tools,
          )
  
      src = build_url(
          server, ui=pl._id_name, host="localhost", protocol="http"
      )
      widget = Widget(viewer, src, "99%", "600px")
  
      state, ctrl = server.state, server.controller
      ctrl.view_update = widget.viewer.update
  
      @state.change("resolution")
      def update_resolution(resolution, **kwargs):
          algo.resolution = resolution
          ctrl.view_update()
  
      @state.change("visibility")
      def set_visibility(visibility, **kwargs):
          toggle = {"Hide": 0, "Show": 1}
          mesh_actor.visibility = toggle[visibility]
          ctrl.view_update()
  
      assert server.state["resolution"] == 3
      server.state.update({"resolution": 5, "visibility": "Hide"})
      server.state.flush()
      assert algo.resolution == 5
      assert not mesh_actor.visibility
  
imports: import os
  from IPython.display import IFrame
  import numpy
  import pytest
  import pyvista
  from pyvista import examples
label_desc: Use image node_id 6 for calling a global function with example usage: test_trame_custom_menu_items(client_type) without return types