code: def refresh_token(self, request, data, client):
          
          rt = self.get_refresh_token_grant(request, data, client)
  
          # this must be called first in case we need to purge expired tokens
          self.invalidate_refresh_token(rt)
          self.invalidate_access_token(rt.access_token)
  
          at = self.create_access_token(request, rt.user, rt.access_token.scope,
                  client)
          rt = self.create_refresh_token(request, at.user, at.scope, at, client)
  
          return self.access_token_response(at)
docs: Handle ``grant_type=refresh_token`` requests as defined in :rfc:`6`.