code: def print_event(attributes=[]):
      """
      Function that returns a Python callback to pretty print the events.
      """
  
      def python_callback(event):
          cls_name = event.__class__.__name__
          attrs = ", ".join(
              [f"{attr}={event.__dict__[attr]}" for attr in attributes]
          )
          print(f"{cls_name}({attrs})")
  
      return python_callback
  
file_path: bokeh/examples/server/app/events_app.py
imports: import numpy
  from bokeh import events
  from bokeh.io import curdoc
  from bokeh.layouts import column, row
  from bokeh.models import Button, CustomJS, Div
  from bokeh.plotting import figure
label_desc: Use image node_id 2 for calling a global function with example usage: print_event(attributes) and returns: python_callback