code: def prewitt(input, axis=-1, output=None, mode="reflect", cval=0.0):
      """Calculate a Prewitt filter.
  
      Parameters
      ----------
      %(input)s
      %(axis)s
      %(output)s
      %(mode_multiple)s
      %(cval)s
  
      Examples
      --------
      >>> from scipy import ndimage, misc
      >>> import matplotlib.pyplot as plt
      >>> fig = plt.figure()
      >>> plt.gray()  # show the filtered result in grayscale
      >>> ax1 = fig.add_subplot(121)  # left side
      >>> ax2 = fig.add_subplot(122)  # right side
      >>> ascent = misc.ascent()
      >>> result = ndimage.prewitt(ascent)
      >>> ax1.imshow(ascent)
      >>> ax2.imshow(result)
      >>> plt.show()
      """
      input = numpy.asarray(input)
      axis = normalize_axis_index(axis, input.ndim)
      output = _ni_support._get_output(output, input)
      modes = _ni_support._normalize_sequence(mode, input.ndim)
      correlate1d(input, [-1, 0, 1], axis, output, modes[axis], cval, 0)
      axes = [ii for ii in range(input.ndim) if ii != axis]
      for ii in axes:
          correlate1d(
              output,
              [1, 1, 1],
              ii,
              output,
              modes[ii],
              cval,
              0,
          )
      return output
  
imports: from collections.abc import Iterable
  import warnings
  import numpy
  import operator
  from numpy.core.multiarray import normalize_axis_index
  from .None import _ni_support
  from .None import _nd_image
  from .None import _ni_docstrings
label_desc: Use image node_id 8 for calling a global function with example usage: prewitt(input, axis, output, mode, cval) and returns: output