def best_match(supported, header):
    parsed_header = [parse_media_range(r) for r in _filter_blank(header.split(","))]
    weighted_matches = []
    pos = 0
    for mime_type in supported:
        weighted_matches.append((fitness_and_quality_parsed(mime_type,
                                 parsed_header), pos, mime_type)) 
        pos += 1
    weighted_matches.sort()
    return weighted_matches[-1][0][1] and weighted_matches[-1][2] or ''
Takes a list of supported mime-types and finds the best
dataset/ETHPy150Open mozilla/inventory/vendor-local/src/mimeparse/mimeparse.py/best_match