code: def write(self, chunk):
          
          if not self.started_response:
              raise AssertionError('WSGI write called before start_response.')
  
          chunklen = len(chunk)
          rbo = self.remaining_bytes_out
          if rbo is not None and chunklen > rbo:
              if not self.req.sent_headers:
                  # Whew. We can send a 500 to the client.
                  self.req.simple_response(
                      '500 Internal Server Error',
                      'The requested resource returned more bytes than the '
                      'declared Content-Length.',
                  )
              else:
                  # Dang. We have probably already sent data. Truncate the chunk
                  # to fit (so the client doesn't hang) and raise an error later.
                  chunk = chunk[:rbo]
  
          self.req.ensure_headers_sent()
  
          self.req.write(chunk)
  
          if rbo is not None:
              rbo -= chunklen
              if rbo < 0:
                  raise ValueError(
                      'Response body exceeds the declared Content-Length.',
                  )
docs: WSGI callable to write unbuffered data to the client.
  
          This method is also used internally by start_response (to write
          data from the iterable returned by the WSGI application).