def desired_matches(desired, header):
 parsed_ranges = list(map(parse_media_range, header.split(',')))
 return [mimetype for mimetype in desired if quality_parsed(mimetype, parsed_ranges)]

def desired_matches ( desired , header ) : parsed_ranges = list ( map ( parse_media_range , header . split ( ',' ) ) ) return [ mimetype for mimetype in desired if quality_parsed ( mimetype , parsed_ranges ) ]
takes a list of desired mime-types in the order the server prefers to send them regardless of the browsers preference .