human
Here's a good function header given the following:
I wrote the below code

    maxres = (maxres or config.MAX_RES.get)
    slist = (slist['meta'] if isinstance(slist, dict) else slist)
    def okres(x):
        '    Return    True    if    resolution    is    within    user    specified    maxres.    '
        return (int(x['quality'].split('x')[1]) <= maxres)
    def getq(x):
        '    Return    height    aspect    of    resolution,    eg    640x480    =>    480.    '
        return int(x['quality'].split('x')[1])
    def getbitrate(x):
        'Return    the    bitrate    of    a    stream.'
        return x['rawbitrate']
    if audio:
        streams = [x for x in slist if (x['mtype'] == 'audio')]
        if (not m4a_ok):
            streams = [x for x in streams if (not (x['ext'] == 'm4a'))]
        if (not (config.AUDIO_FORMAT.get == 'auto')):
            if (m4a_ok and (config.AUDIO_FORMAT.get == 'm4a')):
                streams = [x for x in streams if (x['ext'] == 'm4a')]
            if (config.AUDIO_FORMAT.get == 'webm'):
                streams = [x for x in streams if (x['ext'] == 'webm')]
            if (not streams):
                streams = [x for x in slist if (x['mtype'] == 'audio')]
        streams = sorted(streams, key=getbitrate, reverse=True)
    else:
        streams = [x for x in slist if ((x['mtype'] == 'normal') and okres(x))]
        if (not (config.VIDEO_FORMAT.get == 'auto')):
            if (config.VIDEO_FORMAT.get == 'mp4'):
                streams = [x for x in streams if (x['ext'] == 'mp4')]
            if (config.VIDEO_FORMAT.get == 'webm'):
                streams = [x for x in streams if (x['ext'] == 'webm')]
            if (config.VIDEO_FORMAT.get == '3gp'):
                streams = [x for x in streams if (x['ext'] == '3gp')]
            if (not streams):
                streams = [x for x in slist if ((x['mtype'] == 'normal') and okres(x))]
        streams = sorted(streams, key=getq, reverse=True)
    util.dbg('select    stream,    q:    %s,    audio:    %s,    len:    %s', q, audio, len(streams))
    try:
        ret = streams[q]
    except...

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

def select(slist, q=0, audio=False, m4a_ok=True, maxres=None):