human
I wrote the below code

    patch_list = _preproecss_patch_list(patch_list)
    if (lclick_cb is not None):
        viz = True
    (ph, pw) = patch_list.shape[1:3]
    if (border is None):
        border = int((0.1 * min(ph, pw)))
    if (nr_row is None):
        nr_row = int((max_height / (ph + border)))
    if (nr_col is None):
        nr_col = int((max_width / (pw + border)))
    canvas = Canvas(ph, pw, nr_row, nr_col, patch_list.shape[(-1)], border, bgcolor)
    nr_patch = (nr_row * nr_col)
    start = 0
    if (lclick_cb is not None):
        def lclick_callback(img, x, y):
            idx = canvas.get_patchid_from_coord(x, y)
            idx = (idx + start)
            if (idx < end):
                lclick_cb(patch_list[idx], idx)
    else:
        lclick_callback = None
    while True:
        end = (start + nr_patch)
        cur_list = patch_list[start:end]
        if (not len(cur_list)):
            return
        canvas.draw_patches(cur_list)
        if viz:
            interactive_imshow(canvas.canvas, lclick_cb=lclick_callback)
        (yield canvas.canvas)
        start = end

What's a good function header?

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

def gen_stack_patches(patch_list, nr_row=None, nr_col=None, border=None, max_width=1000, max_height=1000, bgcolor=255, viz=False, lclick_cb=None):