code: def verify_matching_signatures(implementation, dispatcher):
      """Verify that a dispatcher function has the right signature."""
      implementation_spec = ArgSpec(*getargspec(implementation))
      dispatcher_spec = ArgSpec(*getargspec(dispatcher))
  
      if (
          implementation_spec.args != dispatcher_spec.args
          or implementation_spec.varargs != dispatcher_spec.varargs
          or implementation_spec.keywords != dispatcher_spec.keywords
          or (
              bool(implementation_spec.defaults)
              != bool(dispatcher_spec.defaults)
          )
          or (
              implementation_spec.defaults is not None
              and len(implementation_spec.defaults)
              != len(dispatcher_spec.defaults)
          )
      ):
          raise RuntimeError(
              "implementation and dispatcher for %s have "
              "different function signatures" % implementation
          )
  
      if implementation_spec.defaults is not None:
          if dispatcher_spec.defaults != (None,) * len(
              dispatcher_spec.defaults
          ):
              raise RuntimeError(
                  "dispatcher functions can only use None for "
                  "default argument values"
              )
  
file_path: catboost/contrib/python/numpy/py2/numpy/core/overrides.py
imports: import collections
  import functools
  import os
  from numpy.core._multiarray_umath import add_docstring, implement_array_function, _get_implementing_args
  from numpy.compat._inspect import getargspec
label_desc: Use image node_id 1 for calling a global function with example usage: verify_matching_signatures(implementation, dispatcher) without return types