'Refreshes :class:`.Credentials` if it gives sense.
:param credentials:
:class:`.Credentials` to be refreshed.
:returns:
:class:`.Response`.'

def refresh_credentials(self, credentials):

    if (not self._x_refresh_credentials_if(credentials)):
        return
    cfg = credentials.config.get(credentials.provider_name)
    credentials.consumer_key = cfg.get('consumer_key')
    credentials.consumer_secret = cfg.get('consumer_secret')
    request_elements = self.create_request_elements(request_type=self.REFRESH_TOKEN_REQUEST_TYPE, credentials=credentials, url=self.access_token_url, method='POST')
    self._log(logging.INFO, u'Refreshing    credentials.')
    response = self._fetch(*request_elements)
    credentials.consumer_key = None
    credentials.consumer_secret = None
    access_token = response.data.get('access_token')
    refresh_token = response.data.get('refresh_token')
    if access_token:
        credentials.token = access_token
        credentials.expire_in = response.data.get('expires_in')
        if refresh_token:
            credentials.refresh_token = refresh_token
        credentials = self._x_credentials_parser(credentials, response.data)
    return response
