@LocalProxy
def _proxy_stream():
 ctx = _request_ctx_stack.top
 if (ctx is not None):
  return ctx.request.environ['wsgi.errors']
 return sys.stderr

@ LocalProxy def _proxy_stream ( ) : ctx = _request_ctx_stack . top if ( ctx is not None ) : return ctx . request . environ [ 'wsgi.errors' ] return sys . stderr
finds the most appropriate error stream for the application .