class_docstr: Implements the HTTP/1.x protocol.
  
  This class can be on its own for clients, or via `HTTP1ServerConnection`
  for servers.
class_docstr_tok: ["Implements","the","HTTP\/1.x","protocol",".","This","class","can","be","on","its","own","for","clients",",","or","via","`","HTTP1ServerConnection","`","for","servers","."]
code: def _parse_headers(
      self, data: bytes
  ) -> Tuple[str, httputil.HTTPHeaders]:
      # The lstrip removes newlines that some implementations sometimes
      # insert between messages of a reused connection.  Per RFC 7230,
      # we SHOULD ignore at least one empty line before the request.
      # http://tools.ietf.org/html/rfc7230#section-3.5
      data_str = native_str(data.decode("latin1")).lstrip("\r\n")
      # RFC 7230 section allows for both CRLF and bare LF.
      eol = data_str.find("\n")
      start_line = data_str[:eol].rstrip("\r")
      headers = httputil.HTTPHeaders.parse(data_str[eol:])
      return start_line, headers
  
imports: import asyncio
  import logging
  import re
  import types
  from tornado.concurrent import Future, future_add_done_callback, future_set_result_unless_cancelled
  from tornado.escape import native_str, utf8
  from tornado import gen
  from tornado import httputil
  from tornado import iostream
  from tornado.log import gen_log, app_log
  from tornado.util import GzipDecompressor
  from typing import cast, Optional, Type, Awaitable, Callable, Union, Tuple
label_desc: Use image node_id 17 for calling the HTTP1Connection obj's underlying member method code with example usage: obj._parse_headers(data) and returns: start_line,  headers