(
        self, base: Optional[str] = None, head: Optional[str] = None
    )
return open_prs
https://developer.github.com/v3/pulls/#list-pull-requests
https://developer.github.com/v3/pulls/#list-pull-requests
https : // developer . github . com / v3 / pulls / #list - pull - requests
async def get_open_pull_requests(
        self, base: Optional[str] = None, head: Optional[str] = None
    ) -> Optional[List[GetOpenPullRequestsResponseSchema]]:
        """
        https://developer.github.com/v3/pulls/#list-pull-requests
        """
        log = self.log.bind(base=base, head=head)
        headers = await get_headers(
            session=self.session, installation_id=self.installation_id
        )
        params = dict(state="open", sort="updated", per_page="100")
        if base is not None:
            params["base"] = base
        if head is not None:
            params["head"] = head

        open_prs = []

        page = None
        current_page = 0
        while page != []:
            current_page += 1
            if current_page > 20:
                log.info("hit pagination limit")
                break

            params["page"] = str(current_page)
            async with self.throttler:
                res = await self.session.get(
                    conf.v3_url(f"/repos/{self.owner}/{self.repo}/pulls"),
                    params=params,
                    headers=headers,
                )
            try:
                res.raise_for_status()
            except http.HTTPError:
                log.warning("problem finding prs", res=res, exc_info=True)
                return None

            page = res.json()
            open_prs += [GetOpenPullRequestsResponseSchema.parse_obj(pr) for pr in page]

        return open_prs
async def get_open_pull_requests ( self , base : Optional [ str ] = None , head : Optional [ str ] = None ) -> Optional [ List [ GetOpenPullRequestsResponseSchema ] ] : log = self . log . bind ( base = base , head = head ) headers = await get_headers ( session = self . session , installation_id = self . installation_id ) params = dict ( state = "open" , sort = "updated" , per_page = "100" ) if base is not None : params [ "base" ] = base if head is not None : params [ "head" ] = head open_prs = [ ] page = None current_page = 0 while page != [ ] : current_page += 1 if current_page > 20 : log . info ( "hit pagination limit" ) break params [ "page" ] = str ( current_page ) async with self . throttler : res = await self . session . get ( conf . v3_url ( f"/repos/{self.owner}/{self.repo}/pulls" ) , params = params , headers = headers , ) try : res . raise_for_status ( ) except http . HTTPError : log . warning ( "problem finding prs" , res = res , exc_info = True ) return None page = res . json ( ) open_prs += [ GetOpenPullRequestsResponseSchema . parse_obj ( pr ) for pr in page ] return open_prs