async def _get_auth_headers(self):
    if (self.__auth_mechanism == Auth.Method.BASIC):
        if self.client_id:
            return {'Authorization': ('Basic %s' % self.basic_credentials), 'X-Ably-ClientId': base64.b64encode(self.client_id.encode('utf-8'))}
        return {'Authorization': ('Basic %s' % self.basic_credentials)}
    else:
        (await self.__authorize_when_necessary())
        return {'Authorization': ('Bearer %s' % self.token_credentials)}
async def _get_auth_headers(self):
    if (self.__auth_mechanism == Auth.Method.BASIC):
        if self.client_id:
            return {'Authorization': ('Basic %s' % self.basic_credentials), 'X-Ably-ClientId': base64.b64encode(self.client_id.encode('utf-8'))}
        return {'Authorization': ('Basic %s' % self.basic_credentials)}
    else:
        (await self.__authorize_when_necessary())
        return {'Authorization': ('Bearer %s' % self.token_credentials)}