code: def _kwds_to_tuple_args(func, **kwds):
      # Returns keyword arguments formed as a tuple
      # (numba kernels cannot deal with kwargs as a dict)
      if not hasattr(func, "py_func"):
          raise TypeError(
              "Kernel function should be a numba device function."
          )
  
      # get all the possible extra function arguments, excluding x, y
      all_func_kwargs = list(
          inspect.signature(func.py_func).parameters.values()
      )
      if len(all_func_kwargs) < 2:
          raise ValueError(
              "Expected at least two arguments to kernel function."
          )
  
      all_func_kwargs = all_func_kwargs[2:]
      if any(
          p.default is inspect.Parameter.empty for p in all_func_kwargs
      ):
          raise ValueError(
              "Extra kernel parameters must be passed as keyword arguments."
          )
      all_func_kwargs = [(k.name, k.default) for k in all_func_kwargs]
  
      kwds_tuple = tuple(
          kwds[k] if k in kwds.keys() else v
          for (k, v) in all_func_kwargs
      )
      return kwds_tuple
  
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 11 for calling a global function with example usage: _kwds_to_tuple_args(func) and returns: kwds_tuple