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

    def _get_weight(val):
        u'    weights    the    completions    with    required    things    first    the    lexicographically'
        priority = u''
        if (val.display_meta and val.display_meta.startswith(u'[REQUIRED]')):
            priority = u'    '
        return (priority + val.text)
    completions = []
    for comp in gen:
        if (comp.text not in BLACKLISTED_COMPLETIONS):
            completions.append(comp)
    return sorted(completions, key=_get_weight)

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

def sort_completions(gen):