code: def get_raw_spline1d_kernel(
      axis,
      ndim,
      mode,
      order,
      index_type="int",
      data_type="double",
      pole_type="double",
      block_size=128,
  ):
      """Generate a kernel for applying a spline prefilter along a given axis."""
      poles = get_poles(order)
  
      # determine number of samples for the boundary approximation
      # (SciPy uses n_boundary = n_samples but this is excessive)
      largest_pole = max([abs(p) for p in poles])
      # tol < 1e-7 fails test cases comparing to SciPy at atol = rtol = 1e-5
      tol = 1e-10 if pole_type == "float" else 1e-18
      n_boundary = math.ceil(math.log(tol, largest_pole))
  
      # headers and general utility function for extracting rows of data
      code = _FILTER_GENERAL.format(
          index_type=index_type,
          data_type=data_type,
          pole_type=pole_type,
      )
  
      # generate source for a 1d function for a given boundary mode and poles
      code += _get_spline1d_code(mode, poles, n_boundary)
  
      # generate code handling batch operation of the 1d filter
      mode_str = mode.replace(
          "-", "_"
      )  # cannot have '-' in kernel name
      kernel_name = (
          f"cupyx_scipy_ndimage_spline_filter_{ndim}d_ord{order}_"
          f"axis{axis}_{mode_str}"
      )
      code += _batch_spline1d_strided_template.format(
          ndim=ndim,
          axis=axis,
          block_size=block_size,
          kernel_name=kernel_name,
      )
      return cupy.RawKernel(code, kernel_name)
  
file_path: cupy/cupyx/scipy/ndimage/_spline_prefilter_core.py
imports: import functools
  import math
  import operator
  import textwrap
  import cupy
label_desc: Use image node_id 7 for calling a global function with example usage: get_raw_spline1d_kernel(axis, ndim, mode, order, index_type, data_type, pole_type, block_size) and returns: cupy