code: def map_coordinates(
      input,
      coordinates,
      output=None,
      order=3,
      mode="constant",
      cval=0.0,
      prefilter=True,
  ):
      """Map the input array to new coordinates by interpolation.
  
      The array of coordinates is used to find, for each point in the output, the
      corresponding coordinates in the input. The value of the input at those
      coordinates is determined by spline interpolation of the requested order.
  
      The shape of the output is derived from that of the coordinate array by
      dropping the first axis. The values of the array along the first axis are
      the coordinates in the input array at which the output value is found.
  
      Args:
          input (cupy.ndarray): The input array.
          coordinates (array_like): The coordinates at which ``input`` is
              evaluated.
          output (cupy.ndarray or ~cupy.dtype): The array in which to place the
              output, or the dtype of the returned array.
          order (int): The order of the spline interpolation, default is 3. Must
              be in the range 0-5.
          mode (str): Points outside the boundaries of the input are filled
              according to the given mode (``'constant'``, ``'nearest'``,
              ``'mirror'``, ``'reflect'``, ``'wrap'``, ``'grid-mirror'``,
              ``'grid-wrap'``, ``'grid-constant'`` or ``'opencv'``).
          cval (scalar): Value used for points outside the boundaries of
              the input if ``mode='constant'`` or ``mode='opencv'``. Default is
              0.0
          prefilter (bool): Determines if the input array is prefiltered with
              ``spline_filter`` before interpolation. The default is True, which
              will create a temporary ``float64`` array of filtered values if
              ``order > 1``. If setting this to False, the output will be
              slightly blurred if ``order > 1``, unless the input is prefiltered,
              i.e. it is the result of calling ``spline_filter`` on the original
              input.
  
      Returns:
          cupy.ndarray:
              The result of transforming the input. The shape of the output is
              derived from that of ``coordinates`` by dropping the first axis.
  
      .. seealso:: :func:`scipy.ndimage.map_coordinates`
      """
  
      _check_parameter("map_coordinates", order, mode)
  
      if mode == "opencv" or mode == "_opencv_edge":
          input = cupy.pad(
              input,
              [(1, 1)] * input.ndim,
              "constant",
              constant_values=cval,
          )
          coordinates = cupy.add(coordinates, 1)
          mode = "constant"
  
      ret = _util._get_output(output, input, coordinates.shape[1:])
      integer_output = ret.dtype.kind in "iu"
      _util._check_cval(mode, cval, integer_output)
  
      if input.dtype.kind in "iu":
          input = input.astype(cupy.float32)
      coordinates = _check_coordinates(coordinates, order)
      filtered, nprepad = _filter_input(
          input, prefilter, mode, cval, order
      )
      large_int = (
          max(_prod(input.shape), coordinates.shape[0]) > 1 << 31
      )
      kern = _interp_kernels._get_map_kernel(
          input.ndim,
          large_int,
          yshape=coordinates.shape,
          mode=mode,
          cval=cval,
          order=order,
          integer_output=integer_output,
          nprepad=nprepad,
      )
      kern(filtered, coordinates, ret)
      return ret
  
imports: import math
  import warnings
  import cupy
  import numpy
  from cupy import _core
  from cupy._core import internal
  from cupy.cuda import runtime
  from cupyx import _texture
  from cupyx.scipy.ndimage import _util
  from cupyx.scipy.ndimage import _interp_kernels
  from cupyx.scipy.ndimage import _spline_prefilter_core
label_desc: Use image node_id 8 for calling a global function with example usage: map_coordinates(input, coordinates, output, order, mode, cval, prefilter) and returns: ret