class_docstr: Manage the invocation of a WSGI application
class_docstr_tok: ["Manage","the","invocation","of","a","WSGI","application"]
docstr: Compute Content-Length or switch to chunked encoding if possible
docstr_tok: ["Compute","Content-Length","or","switch","to","chunked","encoding","if","possible"]
code: def set_content_length(self):
      """Compute Content-Length or switch to chunked encoding if possible"""
      try:
          blocks = len(self.result)
      except (TypeError, AttributeError, NotImplementedError):
          pass
      else:
          if blocks == 1:
              self.headers["Content-Length"] = str(self.bytes_sent)
              return
  
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 5 for calling the BaseHandler obj's underlying member method code with example usage: obj.set_content_length() without return types