nodes: 0, module; 1, function_definition; 2, function_name:parse_header; 3, parameters; 4, block; 5, identifier:cls; 6, default_parameter; 7, expression_statement; 8, expression_statement; 9, identifier:value; 10, string; 11, comment:"""Parse HTTP accept header and return instances sorted by weight."""; 12, yield; 13, string_content:*/*; 14, call; 15, identifier:sorted; 16, argument_list; 17, generator_expression; 18, keyword_argument; 19, call; 20, for_in_clause; 21, if_clause; 22, identifier:reverse; 23, True; 24, attribute; 25, argument_list; 26, identifier:token; 27, call; 28, call; 29, identifier:cls; 30, identifier:from_string; 31, call; 32, attribute; 33, argument_list; 34, attribute; 35, argument_list; 36, attribute; 37, argument_list; 38, identifier:value; 39, identifier:split; 40, string; 41, identifier:token; 42, identifier:strip; 43, identifier:token; 44, identifier:strip; 45, string_content:,
code: def parse_header(cls, value='*/*'):
          """Parse HTTP accept header and return instances sorted by weight."""
          yield from sorted((
              cls.from_string(token.strip())
              for token in value.split(',')
              if token.strip()
          ), reverse=True)