code: def rotate(
      input,
      angle,
      axes=(1, 0),
      reshape=True,
      output=None,
      order=3,
      mode="constant",
      cval=0.0,
      prefilter=True,
  ):
      """Rotate an array.
  
      The array is rotated in the plane defined by the two axes given by the
      ``axes`` parameter using spline interpolation of the requested order.
  
      Args:
          input (cupy.ndarray): The input array.
          angle (float): The rotation angle in degrees.
          axes (tuple of 2 ints): The two axes that define the plane of rotation.
              Default is the first two axes.
          reshape (bool): If ``reshape`` is True, the output shape is adapted so
              that the input array is contained completely in the output. Default
              is True.
          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 or None:
              The rotated input.
  
      .. seealso:: :func:`scipy.ndimage.rotate`
      """
  
      _check_parameter("rotate", order, mode)
  
      if mode == "opencv":
          mode = "_opencv_edge"
  
      input_arr = input
      axes = list(axes)
      if axes[0] < 0:
          axes[0] += input_arr.ndim
      if axes[1] < 0:
          axes[1] += input_arr.ndim
      if axes[0] > axes[1]:
          axes = [axes[1], axes[0]]
      if axes[0] < 0 or input_arr.ndim <= axes[1]:
          raise ValueError("invalid rotation plane specified")
  
      ndim = input_arr.ndim
      rad = numpy.deg2rad(angle)
      sin = math.sin(rad)
      cos = math.cos(rad)
  
      # determine offsets and output shape as in scipy.ndimage.rotate
      rot_matrix = numpy.array([[cos, sin], [-sin, cos]])
  
      img_shape = numpy.asarray(input_arr.shape)
      in_plane_shape = img_shape[axes]
      if reshape:
          # Compute transformed input bounds
          iy, ix = in_plane_shape
          out_bounds = rot_matrix @ [[0, 0, iy, iy], [0, ix, 0, ix]]
          # Compute the shape of the transformed input plane
          out_plane_shape = (out_bounds.ptp(axis=1) + 0.5).astype(
              cupy.int64
          )
      else:
          out_plane_shape = img_shape[axes]
  
      out_center = rot_matrix @ ((out_plane_shape - 1) / 2)
      in_center = (in_plane_shape - 1) / 2
  
      output_shape = img_shape
      output_shape[axes] = out_plane_shape
      output_shape = tuple(output_shape)
  
      matrix = numpy.identity(ndim)
      matrix[axes[0], axes[0]] = cos
      matrix[axes[0], axes[1]] = sin
      matrix[axes[1], axes[0]] = -sin
      matrix[axes[1], axes[1]] = cos
  
      offset = numpy.zeros(ndim, dtype=cupy.float64)
      offset[axes] = in_center - out_center
  
      matrix = cupy.asarray(matrix)
      offset = cupy.asarray(offset)
  
      return affine_transform(
          input,
          matrix,
          offset,
          output_shape,
          output,
          order,
          mode,
          cval,
          prefilter,
      )
  
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 11 for calling a global function with example usage: rotate(input, angle, axes, reshape, output, order, mode, cval, prefilter) and returns: affine_transform