class_docstr: Manage the invocation of a WSGI application
class_docstr_tok: ["Manage","the","invocation","of","a","WSGI","application"]
docstr: 'write()' callable as specified by PEP 3333
docstr_tok: ["'write","(",")","'","callable","as","specified","by","PEP","3333"]
code: def write(self, data):
      """'write()' callable as specified by PEP 3333"""
  
      assert (
          type(data) is bytes
      ), "write() argument must be a bytes instance"
  
      if not self.status:
          raise AssertionError("write() before start_response()")
  
      elif not self.headers_sent:
          # Before the first output, send the stored headers
          self.bytes_sent = len(
              data
          )  # make sure we know content-length
          self.send_headers()
      else:
          self.bytes_sent += len(data)
  
      # XXX check Content-Length and truncate if too many bytes written?
      self._write(data)
      self._flush()
  
imports: from .util import FileWrapper, guess_scheme, is_hop_by_hop
  from .headers import Headers
  import sys, os, time
label_desc: Use image node_id 10 for calling the BaseHandler obj's underlying member method code with example usage: obj.write(data) without return types