def METHOD_NAME(self, refresh_token=None, trakt_pin=None, count=0):
    """Function or refreshing a trakt token."""
    if count > 3:
        self.access_token = ''
        return False, False
    elif count > 0:
        time.sleep(2)
    data = {
        'client_id': self.trakt_settings.get('trakt_api_key'),
        'client_secret': self.trakt_settings.get('trakt_api_secret'),
        'redirect_uri': 'urn:ietf:wg:oauth:2.0:oob'
    }
    if refresh_token and self.refresh_token and not trakt_pin:
        data['grant_type'] = 'refresh_token'
        data['refresh_token'] = self.refresh_token
    else:
        data['grant_type'] = 'authorization_code'
        if trakt_pin is not None:
            data['code'] = trakt_pin
    headers = {
        'Content-Type': 'application/json'
    }
    resp = self.request('oauth/token', data=data, headers=headers, url=self.auth_url, method='POST', count=count)
    if 'access_token' in resp:
        self.access_token = resp['access_token']
        if 'refresh_token' in resp:
            self.refresh_token = resp['refresh_token']
            self.access_token_refreshed = True
        return self.access_token, self.refresh_token
    return None, None