def refresh_token(<EOL>self,<EOL>token_url,<EOL>refresh_token=None,<EOL>body="<STR_LIT>",<EOL>auth=None,<EOL>timeout=None,<EOL>headers=None,<EOL>verify=True,<EOL>proxies=None,<EOL>**kwargs<EOL>):
if not token_url:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if not is_secure_transport(token_url):<EOL><INDENT>raise InsecureTransportError()<EOL><DEDENT>refresh_token = refresh_token or self.token.get("<STR_LIT>")<EOL>log.debug(<EOL>"<STR_LIT>", self.auto_refresh_kwargs<EOL>)<EOL>kwargs.update(self.auto_refresh_kwargs)<EOL>body = self._client.prepare_refresh_body(<EOL>body=body, refresh_token=refresh_token, scope=self.scope, **kwargs<EOL>)<EOL>log.debug("<STR_LIT>", body)<EOL>if headers is None:<EOL><INDENT>headers = {<EOL>"<STR_LIT>": "<STR_LIT:application/json>",<EOL>"<STR_LIT:Content-Type>": ("<STR_LIT>"),<EOL>}<EOL><DEDENT>r = self.post(<EOL>token_url,<EOL>data=dict(urldecode(body)),<EOL>auth=auth,<EOL>timeout=timeout,<EOL>headers=headers,<EOL>verify=verify,<EOL>withhold_token=True,<EOL>proxies=proxies,<EOL>)<EOL>log.debug("<STR_LIT>", r.status_code)<EOL>log.debug("<STR_LIT>", r.headers, r.text)<EOL>log.debug(<EOL>"<STR_LIT>",<EOL>len(self.compliance_hook["<STR_LIT>"]),<EOL>)<EOL>for hook in self.compliance_hook["<STR_LIT>"]:<EOL><INDENT>log.debug("<STR_LIT>", hook)<EOL>r = hook(r)<EOL><DEDENT>self.token = self._client.parse_request_body_response(r.text, scope=self.scope)<EOL>if not "<STR_LIT>" in self.token:<EOL><INDENT>log.debug("<STR_LIT>")<EOL>self.token["<STR_LIT>"] = refresh_token<EOL><DEDENT>return self.token<EOL>
Fetch a new access token using a refresh token.

        :param token_url: The token endpoint, must be HTTPS.
        :param refresh_token: The refresh_token to use.
        :param body: Optional application/x-www-form-urlencoded body to add the
                     include in the token request. Prefer kwargs over body.
        :param auth: An auth tuple or method as accepted by `requests`.
        :param timeout: Timeout of the request in seconds.
        :param headers: A dict of headers to be used by `requests`.
        :param verify: Verify SSL certificate.
        :param proxies: The `proxies` argument will be passed to `requests`.
        :param kwargs: Extra parameters to include in the token request.
        :return: A token dict