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","."]
docstr: Implements `.HTTPConnection.write`.
  
  For backwards compatibility is is allowed but deprecated to
  skip `write_headers` and instead call `write()` with a
  pre-encoded header block.
docstr_tok: ["Implements","`",".HTTPConnection.write","`",".","For","backwards","compatibility","is","is","allowed","but","deprecated","to","skip","`","write_headers","`","and","instead","call","`","write","(",")","`","with","a","pre-encoded","header","block","."]
code: def write(self, chunk, callback=None):
      """Implements `.HTTPConnection.write`.
  
      For backwards compatibility is is allowed but deprecated to
      skip `write_headers` and instead call `write()` with a
      pre-encoded header block.
      """
      future = None
      if self.stream.closed():
          future = self._write_future = Future()
          self._write_future.set_exception(iostream.StreamClosedError())
          self._write_future.exception()
      else:
          if callback is not None:
              self._write_callback = stack_context.wrap(callback)
          else:
              future = self._write_future = Future()
          self._pending_write = self.stream.write(
              self._format_chunk(chunk)
          )
          self._pending_write.add_done_callback(self._on_write_complete)
      return future
  
imports: from __future__ import absolute_import, division, print_function
  import re
  from tornado.concurrent import Future
  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 import stack_context
  from tornado.util import GzipDecompressor, PY3
label_desc: Use image node_id 13 for calling the HTTP1Connection obj's underlying member method code with example usage: obj.write(chunk, callback) and returns: future