def refresh_token(self, token):
        if not hasattr(token, "key"):
            token = YahooToken.from_string(token)

        params = self.get_base_params()
        params['oauth_token'] = token.key
        params['oauth_token_secret'] = token.secret
        params['oauth_session_handle'] = token.session_handle

        oauth_request = oauth.Request.from_consumer_and_token(
                               self.consumer, token=token,
                               http_url=ACCESS_TOKEN_URL,
                               http_method="POST",
                               parameters=params)

        yql_logger.debug("oauth_request: %s", oauth_request)
        oauth_request.sign_request(
                self.hmac_sha1_signature, self.consumer, token)

        url = oauth_request.to_url()
        yql_logger.debug("oauth_url: %s", url)
        postdata = oauth_request.to_postdata()
        yql_logger.debug("oauth_postdata: %s", postdata)
        resp, content = self.http.request(url, "POST", postdata)

        if resp.get('status') == '200':
            access_token = YahooToken.from_string(content)
            yql_logger.debug("oauth_access_token: %s", access_token)
            access_token.timestamp = oauth_request['oauth_timestamp']
            return access_token
        else:
            raise YQLError(resp, content, url)
invariant : INVARIANT expr
dataset/ETHPy150Open project-fondue/python-yql/yql/__init__.py/ThreeLegged.refresh_token--crossover with--dataset/ETHPy150Open Microsoft/ivy/src/ivy/ivy_dafny_grammar.py/p_invariant_invariant_expr