code: def fourier_shift(input, shift, n=-1, axis=-1, output=None):
      """Multidimensional Fourier shift filter.
  
      The array is multiplied with the Fourier transform of a shift operation.
  
      Args:
          input (cupy.ndarray): The input array. This should be in the Fourier
              domain.
          shift (float or sequence of float):  The size of shift. If a float,
              `shift` is the same for all axes. If a sequence, `shift` has to
              contain one value for each axis.
          n (int, optional):  If `n` is negative (default), then the input is
              assumed to be the result of a complex fft. If `n` is larger than or
              equal to zero, the input is assumed to be the result of a real fft,
              and `n` gives the length of the array before transformation along
              the real transform direction.
          axis (int, optional): The axis of the real transform (only used when
              ``n > -1``).
          output (cupy.ndarray, optional):
              If given, the result of shifting the input is placed in this array.
  
      Returns:
          output (cupy.ndarray): The shifted output (in the Fourier domain).
      """
      ndim = input.ndim
      output = _get_output_fourier(output, input, complex_only=True)
      axis = internal._normalize_axis_index(axis, ndim)
      shifts = _util._fix_sequence_arg(shift, ndim, "shift")
  
      _core.elementwise_copy(input, output)
      for ax, (shiftk, ax_size) in enumerate(zip(shifts, output.shape)):
          if shiftk == 0:
              continue
          if ax == axis and n > 0:
              # cp.fft.rfftfreq(ax_size) * (-2j * numpy.pi * shiftk *  ax_size/n)
              arr = cupy.arange(ax_size, dtype=output.dtype)
              arr *= -2j * numpy.pi * shiftk / n
          else:
              arr = cupy.fft.fftfreq(ax_size)
              arr = arr * (-2j * numpy.pi * shiftk)
          cupy.exp(arr, out=arr)
  
          # reshape for broadcasting
          arr = _reshape_nd(arr, ndim=ndim, axis=ax)
          output *= arr
  
      return output
  
file_path: cupy/cupyx/scipy/ndimage/_fourier.py
imports: import numpy
  import cupy
  from cupy import _core
  from cupy._core import internal
  from cupyx.scipy.ndimage import _util
  from cupyx.scipy import special
label_desc: Use image node_id 5 for calling a global function with example usage: fourier_shift(input, shift, n, axis, output) and returns: output