human
I wrote the below code

    def enumerate(elts):
        'Return    an    iterable    that    pairs    the    index    of    an    element    with\n                                that    element.\n\n                                For    Python    2.2    compatibility'
        return zip(range(len(elts)), elts)
    def bestMatchingService(service):
        'Return    the    index    of    the    first    matching    type,    or    something\n                                higher    if    no    type    matches.\n\n                                This    provides    an    ordering    in    which    service    elements    that\n                                contain    a    type    that    comes    earlier    in    the    preferred    types    list\n                                come    before    service    elements    that    come    later.    If    a    service\n                                element    has    more    than    one    type,    the    most    preferred    one    wins.\n                                '
        for (i, t) in enumerate(preferred_types):
            if (preferred_types[i] in service.type_uris):
                return i
        return len(preferred_types)
    prio_services = [(bestMatchingService(s), orig_index, s) for (orig_index, s) in enumerate(service_list)]
    prio_services.sort()
    for i in range(len(prio_services)):
        prio_services[i] = prio_services[i][2]
    return prio_services

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

def arrangeByType(service_list, preferred_types):