'Refreshes the access_token.
This method first checks by reading the Storage object if available.
If a refresh is still needed, it holds the Storage lock until the
refresh is completed.
Args:
http_request: callable, a callable that matches the method signature of
httplib2.Http.request, used to make the refresh request.
Raises:
AccessTokenRefreshError: When the refresh fails.'

def _refresh(self, http_request):

    if (not self.store):
        self._do_refresh_request(http_request)
    else:
        self.store.acquire_lock()
        try:
            new_cred = self.store.locked_get()
            if (new_cred and (not new_cred.invalid) and (new_cred.access_token != self.access_token) and (not new_cred.access_token_expired)):
                logger.info('Updated    access_token    read    from    Storage')
                self._updateFromCredential(new_cred)
            else:
                self._do_refresh_request(http_request)
        finally:
            self.store.release_lock()
