[docs]classOAuth2Client(aiohttp.ClientSession):""" The `OAuth2Client` is an :py:class:`aiohttp.ClientSession` with support for OAuth2 access tokens. """def__init__(self,grant:OAuth2Grant,**kwargs):""" :param grant: OAuth2Grant object providing an OAuth2 grant implementation. """super().__init__(**kwargs)self.grant=grantasyncdef_request(self,method:str,str_or_url:StrOrURL,*,headers:Optional[LooseHeaders]=None,**kwargs,)->ClientResponse:headers=awaitself.grant.prepare_request(headers)returnawaitsuper()._request(method,str_or_url,headers=headers,**kwargs)