class_docstr: Makes a WSGI-compatible function runnable on Tornado's HTTP server.
  
  .. warning::
  
     WSGI is a *synchronous* interface, while Tornado's concurrency model
     is based on single-threaded asynchronous execution.  This means that
     running a WSGI app with Tornado's `WSGIContainer` is *less scalable*
     than running the same app in a multi-threaded WSGI server like
     ``gunicorn`` or ``uwsgi``.  Use `WSGIContainer` only when there are
     benefits to combining Tornado and WSGI in the same process that
     outweigh the reduced scalability.
  
  Wrap a WSGI function in a `WSGIContainer` and pass it to `.HTTPServer` to
  run it. For example::
  
      def simple_app(environ, start_response):
          status = "200 OK"
          response_headers = [("Content-type", "text/plain")]
          start_response(status, response_headers)
          return ["Hello world!\n"]
  
      container = tornado.wsgi.WSGIContainer(simple_app)
      http_server = tornado.httpserver.HTTPServer(container)
      http_server.listen(8888)
      tornado.ioloop.IOLoop.current().start()
  
  This class is intended to let other frameworks (Django, web.py, etc)
  run on the Tornado HTTP server and I/O loop.
  
  The `tornado.web.FallbackHandler` class is often useful for mixing
  Tornado and WSGI apps in the same server.  See
  https://github.com/bdarnell/django-tornado-demo for a complete example.
class_docstr_tok: ["Makes","a","WSGI-compatible","function","runnable","on","Tornado","'s","HTTP","server",".","..","warning",":",":","WSGI","is","a","*","synchronous","*","interface",",","while","Tornado","'s","concurrency","model","is","based","on","single-threaded","asynchronous","execution",".","This","means","that","running","a","WSGI","app","with","Tornado","'s","`","WSGIContainer","`","is","*","less","scalable","*","than","running","the","same","app","in","a","multi-threaded","WSGI","server","like","``","gunicorn","``","or","``","uwsgi","``",".","Use","`","WSGIContainer","`","only","when","there","are","benefits","to","combining","Tornado","and","WSGI","in","the","same","process","that","outweigh","the","reduced","scalability",".","Wrap","a","WSGI","function","in","a","`","WSGIContainer","`","and","pass","it","to","`",".HTTPServer","`","to","run","it",".","For","example",":",":","def","simple_app","(","environ",",","start_response",")",":","status","=","``","200","OK","''","response_headers","=","[","(","``","Content-type","''",",","``","text\/plain","''",")","]","start_response","(","status",",","response_headers",")","return","[","``","Hello","world","!","\\n","''","]","container","=","tornado.wsgi.WSGIContainer","(","simple_app",")","http_server","=","tornado.httpserver.HTTPServer","(","container",")","http_server.listen","(","8888",")","tornado.ioloop.IOLoop.current","(",")",".start","(",")","This","class","is","intended","to","let","other","frameworks","(","Django",",","web.py",",","etc",")","run","on","the","Tornado","HTTP","server","and","I\/O","loop",".","The","`","tornado.web.FallbackHandler","`","class","is","often","useful","for","mixing","Tornado","and","WSGI","apps","in","the","same","server",".","See","https",":","\/\/github.com\/bdarnell\/django-tornado-demo","for","a","complete","example","."]
code: def _log(self, status_code, request):
      if status_code < 400:
          log_method = access_log.info
      elif status_code < 500:
          log_method = access_log.warning
      else:
          log_method = access_log.error
      request_time = 1000.0 * request.request_time()
      summary = (
          request.method
          + " "
          + request.uri
          + " ("
          + request.remote_ip
          + ")"
      )
      log_method("%d %s %.2fms", status_code, summary, request_time)
  
imports: from __future__ import absolute_import, division, print_function
  import sys
  from io import BytesIO
  import tornado
  from tornado.concurrent import Future
  from tornado import escape
  from tornado import httputil
  from tornado.log import access_log
  from tornado import web
  from tornado.escape import native_str
  from tornado.util import unicode_type, PY3
label_desc: Use image node_id 4 for calling the WSGIContainer obj's underlying member method code with example usage: obj._log(status_code, request) without return types