code: def middleware_in_executor(middleware):
      '''Use this middleware to run a synchronous middleware in the event loop
      executor.
  
      Useful when using synchronous web-frameworks such as :django:`django <>`.
      '''
      @wraps(middleware)
      def _(environ, start_response):
          loop = get_event_loop()
          return loop.run_in_executor(None, middleware, environ, start_response)
  
      return f middleware_in_executor(middleware):
      '''Use this middleware to run a synchronous middleware in the event loop
      executor.
  
      Useful when using synchronous web-frameworks such as :django:`django <>`.
      '''
      @wraps(middleware)
      def _(environ, start_response):
          loop = get_event_loop()
          return loop.run_in_executor(None, middleware, environ, start_response)
  
      return _
docs: Use this middleware to run a synchronous middleware in the event loop
      executor.
  
      Useful when using synchronous web-frameworks such as :django:`django <>`.