human
I wrote the below code

    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)
  ...

What's a good function header?

Here's a good function header?
assistant
#Here's a good function header.

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