code: def sobel(input, axis=-1, output=None, mode="reflect", cval=0.0):
      """Calculate a Sobel 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.sobel(ascent)
      >>> ax1.imshow(ascent)
      >>> ax2.imshow(result)
      >>> plt.show()
      """
      input = numpy.asarray(input)
      axis = _ni_support._check_axis(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, 2, 1], ii, output, modes[ii], cval, 0)
      return output
  
imports: from __future__ import division, print_function, absolute_import
  import warnings
  import numbers
  import numpy
  import operator
  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: sobel(input, axis, output, mode, cval) and returns: output