code: def _filter_params(func, filter_params, **kwds):
      # get all the possible extra function arguments, excluding x, y
      py_func = func.py_func if hasattr(func, "py_func") else func
      all_func_kwargs = list(
          inspect.signature(py_func).parameters.values()
      )
      if len(all_func_kwargs) < 2:
          raise ValueError(
              "Expected at least two arguments to kernel function."
          )
  
      extra_arg_names = set(arg.name for arg in all_func_kwargs[2:])
      if not filter_params:
          if not set(kwds.keys()) <= extra_arg_names:
              raise ValueError(
                  "kwds contains arguments not used by kernel function"
              )
      return {k: v for k, v in kwds.items() if k in extra_arg_names}
  
file_path: cuml/python/cuml/metrics/pairwise_kernels.py
imports: from cuml.internals.input_utils import input_to_cupy_array
  from cuml.metrics import pairwise_distances
  import cuml.internals
  from cuml.internals.safe_imports import cpu_only_import
  from cuml.internals.safe_imports import gpu_only_import
  import inspect
  from cuml.internals.safe_imports import gpu_only_import_from
label_desc: Use image node_id 10 for calling a global function with example usage: _filter_params(func, filter_params) and returns: unknown