code: def spline_filter(
      input, order=3, output=numpy.float64, mode="mirror"
  ):
      """
      Multidimensional spline filter.
  
      For more details, see `spline_filter1d`.
  
      See Also
      --------
      spline_filter1d : Calculate a 1-D spline filter along the given axis.
  
      Notes
      -----
      The multidimensional filter is implemented as a sequence of
      1-D spline filters. The intermediate arrays are stored
      in the same data type as the output. Therefore, for output types
      with a limited precision, the results may be imprecise because
      intermediate results may be stored with insufficient precision.
  
      For complex-valued `input`, this function processes the real and imaginary
      components independently.
  
      .. versionadded:: 1.6.0
          Complex-valued support added.
  
      Examples
      --------
      We can filter an image using multidimentional splines:
  
      >>> from scipy.ndimage import spline_filter
      >>> import matplotlib.pyplot as plt
      >>> orig_img = np.eye(20)  # create an image
      >>> orig_img[10, :] = 1.0
      >>> sp_filter = spline_filter(orig_img, order=3)
      >>> f, ax = plt.subplots(1, 2, sharex=True)
      >>> for ind, data in enumerate([[orig_img, "original image"],
      ...                             [sp_filter, "spline filter"]]):
      ...     ax[ind].imshow(data[0], cmap='gray_r')
      ...     ax[ind].set_title(data[1])
      >>> plt.tight_layout()
      >>> plt.show()
  
      """
      if order < 2 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_filter(input.real, order, output.real, mode)
          spline_filter(input.imag, order, output.imag, mode)
          return output
      if order not in [0, 1] and input.ndim > 0:
          for axis in range(input.ndim):
              spline_filter1d(
                  input, order, axis, output=output, mode=mode
              )
              input = output
      else:
          output[...] = input[...]
      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 2 for calling a global function with example usage: spline_filter(input, order, output, mode) and returns: output, output