code: def _parse_and_sort_accept_header(accept_header):
      
      return sorted([_split_into_mimetype_and_priority(x) for x in accept_header.split(',')],
                    key=lambda x: x[1], reverse=True)
docs: Parse and sort the accept header items.
  
      >>> _parse_and_sort_accept_header('application/json;q=0.5, text/*')
      [('text/*', 1.0), ('application/json', 0.5)]