code: def _validate_jupyter_backend(backend):
      """Validate that a jupyter backend is valid.
  
      Returns the normalized name of the backend. Raises if the backend is invalid.
  
      """
      # Must be a string
      if backend is None:
          backend = "none"
      backend = backend.lower()
  
      try:
          import IPython
      except ImportError:  # pragma: no cover
          raise ImportError(
              "Install IPython to display with pyvista in a notebook."
          )
  
      if backend not in ALLOWED_BACKENDS:
          backend_list_str = ", ".join(
              [f'"{item}"' for item in ALLOWED_BACKENDS]
          )
          raise ValueError(
              f'Invalid Jupyter notebook plotting backend "{backend}".\n'
              f"Use one of the following:\n{backend_list_str}"
          )
  
      if backend in ["server", "client", "trame", "html"]:
          try:
              from pyvista.trame.jupyter import show_trame
          except ImportError:  # pragma: no cover
              raise ImportError(
                  "Please install `trame` and `ipywidgets` to use this feature."
              )
  
      if backend == "none":
          backend = None
      return backend
  
imports: import warnings
  import pyvista
  from pyvista.core.errors import PyVistaDeprecationWarning
label_desc: Use image node_id 1 for calling a global function with example usage: _validate_jupyter_backend(backend) and returns: backend