class_docstr: A mixin class to provide an interface for registering and
  triggering event callbacks on the Python side.
class_docstr_tok: ["A","mixin","class","to","provide","an","interface","for","registering","and","triggering","event","callbacks","on","the","Python","side","."]
docstr: Run callbacks when the specified event occurs on this Model
  
  Not all Events are supported for all Models.
  See specific Events in :ref:`bokeh.events` for more information on
  which Models are able to trigger them.
docstr_tok: ["Run","callbacks","when","the","specified","event","occurs","on","this","Model","Not","all","Events","are","supported","for","all","Models",".","See","specific","Events","in",":","ref",":","`","bokeh.events","`","for","more","information","on","which","Models","are","able","to","trigger","them","."]
code: def on_event(
      self, event: str | type[Event], *callbacks: EventCallback
  ) -> None:
      """Run callbacks when the specified event occurs on this Model
  
      Not all Events are supported for all Models.
      See specific Events in :ref:`bokeh.events` for more information on
      which Models are able to trigger them.
      """
      if not isinstance(event, str) and issubclass(event, Event):
          event = event.event_name
  
      for callback in callbacks:
          if _nargs(callback) != 0:
              _check_callback(
                  callback, ("event",), what="Event callback"
              )
          self._event_callbacks[event].append(callback)
  
      self.subscribed_events.add(event)
  
file_path: bokeh/src/bokeh/util/callback_manager.py
imports: from __future__ import annotations
  import logging
  from collections import defaultdict
  from inspect import signature
  from typing import TYPE_CHECKING, Any, Callable, Sequence, Union, cast
  from ..events import Event, ModelEvent
  from ..util.functions import get_param_info
label_desc: Use image node_id 2 for calling the EventCallbackManager obj's underlying member method code with example usage: obj.on_event(event) without return types