nodes: 0, module; 1, function_definition; 2, function_name:parse; 3, parameters; 4, type; 5, block; 6, identifier:cls; 7, typed_parameter; 8, string:"HTTPHeaders"; 9, expression_statement; 10, expression_statement; 11, for_statement; 12, return_statement; 13, identifier:headers; 14, type; 15, comment:"""Returns a dictionary from HTTP header text.
  
          >>> h = HTTPHeaders.parse("Content-Type: text/html\\r\\nContent-Length: 42\\r\\n")
          >>> sorted(h.items())
          [('Content-Length', '42'), ('Content-Type', 'text/html')]
  
          .. versionchanged:: 5.1
  
             Raises `HTTPInputError` on malformed headers instead of a
             mix of `KeyError`, and `ValueError`.
  
          """; 16, assignment; 17, identifier:line; 18, call; 19, block; 20, identifier:h; 21, identifier:str; 22, identifier:h; 23, call; 24, attribute; 25, argument_list; 26, if_statement; 27, identifier:cls; 28, argument_list; 29, identifier:_CRLF_RE; 30, identifier:split; 31, identifier:headers; 32, identifier:line; 33, block; 34, expression_statement; 35, call; 36, attribute; 37, argument_list; 38, identifier:h; 39, identifier:parse_line; 40, identifier:line
code: def parse(cls, headers: str) -> "HTTPHeaders":
          """Returns a dictionary from HTTP header text.
  
          >>> h = HTTPHeaders.parse("Content-Type: text/html\\r\\nContent-Length: 42\\r\\n")
          >>> sorted(h.items())
          [('Content-Length', '42'), ('Content-Type', 'text/html')]
  
          .. versionchanged:: 5.1
  
             Raises `HTTPInputError` on malformed headers instead of a
             mix of `KeyError`, and `ValueError`.
  
          """
          h = cls()
          for line in _CRLF_RE.split(headers):
              if line:
                  h.parse_line(line)
          return h