code: def _nargs(fn: Callable[..., Any]) -> int:
      sig = signature(fn)
      all_names, default_values = get_param_info(sig)
      return len(all_names) - len(default_values)
  
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 1 for calling a global function with example usage: _nargs(fn) and returns: unknown