def parse_media_range(range):
    (type, subtype, params) = parse_mime_type(range)
    if not params.has_key('q') or not params['q'] or \
            not float(params['q']) or float(params['q']) > 1\
            or float(params['q']) < 0:
        params['q'] = '1'
    return (type, subtype, params)
Carves up a media range and returns a tuple of the
dataset/ETHPy150Open mozilla/inventory/vendor-local/src/mimeparse/mimeparse.py/parse_media_range