docs: def wsgi_handler(event, context, app, logger):
      """lambda handler function.
      This function runs the WSGI app with it and collects its response, then
      translates the response back into the format expected by the API Gateway
      proxy integration.
      """
  
      environ = build_wsgi_environ_from_event(event)
      wsgi_status = []
      wsgi_headers = []
  
      logger.info('Processing {} request'.format(environ['REQUEST_METHOD']))
  
      def start_response(status, headers):
          if len(wsgi_status) or len(wsgi_headers):
              raise RuntimeError('start_response called more than once!')
          wsgi_status.append(status)
          wsgi_headers.append(headers)
  
      resp = list(app(environ, start_response))
      proxy = {'statusCode': int(wsgi_status[0].split()[0]),
               'headers': {h[0]: h[1] for h in wsgi_headers[0]},
               'body': b''.join(resp).decode('utf-8')}
  
      logger.info("Returning {}".format(proxy['statusCode']),
                  http_status=proxy['statusCode'])
  
      return proxy