human
I wrote the below code

    (w, h) = clip.size
    if (newsize is not None):
        def trans_newsize(ns):
            if isinstance(ns, (int, float)):
                return [(ns * w), (ns * h)]
            else:
                return ns
        if hasattr(newsize, '__call__'):
            newsize2 = (lambda t: trans_newsize(newsize(t)))
            if clip.ismask:
                fun = (lambda gf, t: ((1.0 * resizer((255 * gf(t)).astype('uint8'), newsize2(t))) / 255))
            else:
                fun = (lambda gf, t: resizer(gf(t).astype('uint8'), newsize2(t)))
            return clip.fl(fun, keep_duration=True, apply_to=(['mask'] if apply_to_mask else []))
        else:
            newsize = trans_newsize(newsize)
    elif (height is not None):
        if hasattr(height, '__call__'):
            fun = (lambda t: ((1.0 * int(height(t))) / h))
            return resize(clip, fun)
        else:
            newsize = [((w * height) / h), height]
    elif (width is not None):
        if hasattr(width, '__call__'):
            fun = (lambda t: ((1.0 * width(t)) / w))
            return resize(clip, fun)
        newsize = [width, ((h * width) / w)]
    if clip.ismask:
        fl = (lambda pic: ((1.0 * resizer((255 * pic).astype('uint8'), newsize)) / 255.0))
    else:
        fl = (lambda pic: resizer(pic.astype('uint8'), newsize))
    newclip = clip.fl_image(fl)
    if (apply_to_mask and (clip.mask is not None)):
        newclip.mask = resize(clip.mask, newsize, apply_to_mask=False)
    return newclip

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

def resize(clip, newsize=None, height=None, width=None, apply_to_mask=True):