code: def _check_callback(
      callback: Callable[..., Any],
      fargs: Sequence[str],
      what: str = "Callback functions",
  ) -> None:
      """Bokeh-internal function to check callback signature"""
      sig = signature(callback)
      formatted_args = str(sig)
      error_msg = what + " must have signature func(%s), got func%s"
  
      all_names, default_values = get_param_info(sig)
  
      nargs = len(all_names) - len(default_values)
      if nargs != len(fargs):
          raise ValueError(
              error_msg % (", ".join(fargs), formatted_args)
          )
  
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 a global function with example usage: _check_callback(callback, fargs, what) without return types