code: def spline_filter1d(
      input, order=3, axis=-1, output=numpy.float64, mode="mirror"
  ):
      """
      Calculate a 1-D spline filter along the given axis.
  
      The lines of the array along the given axis are filtered by a
      spline filter. The order of the spline must be >= 2 and <= 5.
  
      Parameters
      ----------
      %(input)s
      order : int, optional
          The order of the spline, default is 3.
      axis : int, optional
          The axis along which the spline filter is applied. Default is the last
          axis.
      output : ndarray or dtype, optional
          The array in which to place the output, or the dtype of the returned
          array. Default is ``numpy.float64``.
      %(mode_interp_mirror)s
  
      Returns
      -------
      spline_filter1d : ndarray
          The filtered input.
  
      Notes
      -----
      All functions in `ndimage.interpolation` do spline interpolation of
      the input image. If using B-splines of `order > 1`, the input image
      values have to be converted to B-spline coefficients first, which is
      done by applying this 1-D filter sequentially along all
      axes of the input. All functions that require B-spline coefficients
      will automatically filter their inputs, a behavior controllable with
      the `prefilter` keyword argument. For functions that accept a `mode`
      parameter, the result will only be correct if it matches the `mode`
      used when filtering.
  
      For complex-valued `input`, this function processes the real and imaginary
      components independently.
  
      .. versionadded:: 1.6.0
          Complex-valued support added.
  
      See Also
      --------
      spline_filter : Multidimensional spline filter.
  
      Examples
      --------
      We can filter an image using 1-D spline along the given axis:
  
      >>> from scipy.ndimage import spline_filter1d
      >>> import matplotlib.pyplot as plt
      >>> orig_img = np.eye(20)  # create an image
      >>> orig_img[10, :] = 1.0
      >>> sp_filter_axis_0 = spline_filter1d(orig_img, axis=0)
      >>> sp_filter_axis_1 = spline_filter1d(orig_img, axis=1)
      >>> f, ax = plt.subplots(1, 3, sharex=True)
      >>> for ind, data in enumerate([[orig_img, "original image"],
      ...             [sp_filter_axis_0, "spline filter (axis=0)"],
      ...             [sp_filter_axis_1, "spline filter (axis=1)"]]):
      ...     ax[ind].imshow(data[0], cmap='gray_r')
      ...     ax[ind].set_title(data[1])
      >>> plt.tight_layout()
      >>> plt.show()
  
      """
      if order < 0 or order > 5:
          raise RuntimeError("spline order not supported")
      input = numpy.asarray(input)
      complex_output = numpy.iscomplexobj(input)
      output = _ni_support._get_output(
          output, input, complex_output=complex_output
      )
      if complex_output:
          spline_filter1d(input.real, order, axis, output.real, mode)
          spline_filter1d(input.imag, order, axis, output.imag, mode)
          return output
      if order in [0, 1]:
          output[...] = numpy.array(input)
      else:
          mode = _ni_support._extend_mode_to_code(mode)
          axis = normalize_axis_index(axis, input.ndim)
          _nd_image.spline_filter1d(input, order, axis, output, mode)
      return output
  
file_path: catboost/contrib/python/scipy/py3/scipy/ndimage/interpolation.py
imports: import itertools
  import warnings
  import numpy
  from numpy.core.multiarray import normalize_axis_index
  from scipy import special
  from .None import _ni_support
  from .None import _nd_image
  from ._ni_docstrings import docfiller
label_desc: Use image node_id 1 for calling a global function with example usage: spline_filter1d(input, order, axis, output, mode) and returns: output, output