code: def refresh_token(func):
          
          @wraps(func)
          def inner(self, *args, **kwargs):
              """
              Before calling the wrapped function, we check if the JWT token is expired, and if so, re-connect.
              """
              if self.token_expired():
                  self.connect()
              return func(self, *args, **kwargs)
          return inner
docs: Use this method decorator to ensure the JWT token is refreshed when needed.