human
Complete the below
def canny(image, sigma=1.0, low_threshold=None, high_threshold=None, mask=None, use_quantiles=False):

    ''''Edge filter an image using the Canny algorithm.
    Parameters
    image : 2D array
    Greyscale input image to detect edges on.
can be of any dtype.
    sigma : float
    Standard deviation of the Gaussian filter.
    low_threshold : float
    Lower bound for hysteresis thresholding (linking edges).
    If None, low_threshold is set to 10% of dtype\'s max.
    high_threshold : float
    Upper bound for hysteresis thresholding (linking edges).
    If None, high_threshold is set to 20% of dtype\'s max.
    mask : array, dtype=bool, optional
    Mask to limit the application of Canny to a certain area.
    use_quantiles : bool, optional
    If True then treat low_threshold and high_threshold as quantiles of the
    edge magnitude image, rather than absolute edge magnitude values. If True
    then the thresholds must be in the range [0, 1].
    Returns
    output : 2D array (image)
    The binary edge map.
    See also
    skimage.sobel
    Notes
    The steps of the algorithm are as follows:
    * Smooth the image using a Gaussian with ``sigma`` width.
    * Apply the horizontal and vertical Sobel operators to get the gradients
    within the image. The edge strength is the norm of the gradient.
    * Thin potential edges to 1-pixel wide curves. First, find the normal
    to the edge at each point. This is done by looking at the
    signs and the relative magnitude of the X-Sobel and Y-Sobel
    to sort the points into 4 categories: horizontal, vertical,
    diagonal and antidiagonal. Then look in the normal and reverse
    directions to see if the values in either of those directions are
    greater than the point in question. Use interpolation to get a mix of
    points instead of picking the one that\'s the closest to the normal.
    * Perform a hysteresis thresholding: first label all points above the
    high threshold as edges. Then recursively label any point above the
    low threshold that is 8-connected to a labeled point as an edge.
    References
    .. [1] Canny, J., A Computational Approach To...'''

=====
Can you provide a Python code to find the normal?
assistant
#Here is Python code to find the normal
.
    assert_nD(image, 2)
    if (low_threshold is None):
        low_threshold = (0.1 * dtype_limits(image, clip_negative=False)[1])
    if (high_threshold is None):
        high_threshold = (0.2 * dtype_limits(image, clip_negative=False)[1])
    if (mask is None):
        mask = np.ones(image.shape, dtype=bool)
    def fsmooth(x):
        return gaussian_filter(x, sigma, mode='constant')
    smoothed = smooth_with_function_and_mask(image, fsmooth, mask)
    jsobel = ndi.sobel(smoothed, axis=1)
    isobel = ndi.sobel(smoothed, axis=0)
    abs_isobel = np.abs(isobel)
    abs_jsobel = np.abs(jsobel)
    magnitude = np.hypot(isobel, jsobel)
    s = generate_binary_structure(2, 2)
    eroded_mask = binary_erosion(mask, s, border_value=0)
    eroded_mask = (eroded_mask & (magnitude > 0))
    local_maxima = np.zeros(image.shape, bool)
    pts_plus = (((isobel >= 0) & (jsobel >= 0)) & (abs_isobel >= abs_jsobel))
    pts_minus = (((isobel <= 0) & (jsobel <= 0)) & (abs_isobel >= abs_jsobel))
    pts = (pts_plus | pts_minus)
    pts = (eroded_mask & pts)
    c1 = magnitude[1:, :][pts[:(-1), :]]
    c2 = magnitude[1:, 1:][pts[:(-1), :(-1)]]
    m = magnitude[pts]
    w = (abs_jsobel[pts] / abs_isobel[pts])
    c_plus = (((c2 * w) + (c1 * (1 - w))) <= m)
    c1 = magnitude[:(-1), :][pts[1:, :]]
    c2 = magnitude[:(-1), :(-1)][pts[1:, 1:]]
    c_minus = (((c2 * w) + (c1 * (1 - w))) <= m)
    local_maxima[pts] = (c_plus & c_minus)
    pts_plus = (((isobel >= 0) & (jsobel >= 0)) & (abs_isobel <= abs_jsobel))
    pts_minus = (((isobel <= 0) & (jsobel <= 0)) & (abs_isobel <= abs_jsobel))
    pts = (pts_plus | pts_minus)
    pts = (eroded_mask & pts)
    c1 = magnitude[:, 1:][pts[:, :(-1)]]
    c2 = magnitude[1:, 1:][pts[:(-1), :(-1)]]
    m = magnitude[pts]
    w = (abs_isobel[pts] / abs_jsobel[pts])
    c_plus = (((c2 * w) + (c1 * (1 - w))) <= m)
    c1 = magnitude[:, :(-1)][pts[:, 1:]]
    c2 = magnitude[:(-1), :(-1)][pts[1:, 1:]]
    c_minus = (((c2 * w) + (c1 * (1 - w))) <= m)
    local_maxima[pts] = (c_plus & c_minus)
  ...