def get_access_token(self, auto_set_token=True):
        data = {'grant_type': 'client_credentials'}
        
        try:
            response = self.session.post(self.request_token_url, auth=self.auth, data=data)
            data = json.loads(response.content.decode('utf-8'))
            access_token = data['access_token']
        except requests.RequestException as e:
            raise TwitterClientError(str(e))
        except (__HOLE__, KeyError):
            raise TwitterClientError('Response does not contain an access token.')
        
        if auto_set_token:
            self.access_token = access_token
            self.session = self.get_oauth_session()
        
        return access_token
dataset/ETHPy150Open inueni/birdy/birdy/twitter.py/AppClient.get_access_token