#NEWLINE# def parse_accept_header( accept_header ) : #NEWLINE# #INDENT# 'Parse accept header.\n\n  Args:\n    accept_header: Unparsed accept header.  Does not include name of header.\n\n  Returns:\n    List of AcceptItem instances sorted according to their priority.\n  ' #NEWLINE# accept_items = [ ] #NEWLINE# for ( index , header ) in enumerate ( accept_header . split ( ',' ) ) : #NEWLINE# #INDENT# accept_items . append ( AcceptItem ( header , accept_header ) ) #NEWLINE# #UNINDENT# return sorted ( accept_items )