code: def get_app(self):
          
          # First see to connection stack
          ctx = connection_stack.top
          if ctx is not None:
              return ctx.app
  
          # Next return app from instance cache
          if self.app is not None:
              return self.app
  
          # Something went wrong, in most cases app just not instantiated yet
          # and we cannot locate it
          raise RuntimeError(
              'Flask application not registered on Redis instance '
              'and no applcation bound to current context')
docs: Get current app from Flast stack to use.
  
          This will allow to ensure which Redis connection to be used when
          accessing Redis connection public methods via plugin.