nodes: 0, module; 1, function_definition; 2, function_name:_parse_and_sort_accept_header; 3, parameters; 4, block; 5, identifier:accept_header; 6, expression_statement; 7, return_statement; 8, comment:"""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)]
      """; 9, call; 10, identifier:sorted; 11, argument_list; 12, list_comprehension; 13, keyword_argument; 14, keyword_argument; 15, call; 16, for_in_clause; 17, identifier:key; 18, lambda; 19, identifier:reverse; 20, True; 21, identifier:_split_into_mimetype_and_priority; 22, argument_list; 23, identifier:x; 24, call; 25, lambda_parameters; 26, subscript; 27, identifier:x; 28, attribute; 29, argument_list; 30, identifier:x; 31, identifier:x; 32, integer:1; 33, identifier:accept_header; 34, identifier:split; 35, string; 36, string_content:,
code: def _parse_and_sort_accept_header(accept_header):
      """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)]
      """
      return sorted([_split_into_mimetype_and_priority(x) for x in accept_header.split(',')],
                    key=lambda x: x[1], reverse=True)