human
I wrote the below code

    name = 'tensorpack_viz_window'
    cv2.imshow(name, img)
    def mouse_cb(event, x, y, *args):
        if ((event == cv2.EVENT_LBUTTONUP) and (lclick_cb is not None)):
            lclick_cb(img, x, y)
        elif ((event == cv2.EVENT_RBUTTONUP) and (rclick_cb is not None)):
            rclick_cb(img, x, y)
    cv2.setMouseCallback(name, mouse_cb)
    key = chr((cv2.waitKey((-1)) & 255))
    cb_name = ('key_cb_' + key)
    if (cb_name in kwargs):
        kwargs[cb_name](img)
    elif (key == 'q'):
        cv2.destroyWindow(name)
    elif (key == 'x'):
        sys.exit()
    elif (key == 's'):
        cv2.imwrite('out.png', img)

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

def interactive_imshow(img, lclick_cb=None, rclick_cb=None, **kwargs):