def close_stale_prs(self, update, pull_request):
        if self.bot_token and pull_request.type != "initial":
            for pr in self.pull_requests:
                # check that, the pr is an update, is open, the titles are not equal and that
                # the requirement matches
                if pr.type == "update" and \
                    pr.is_open and \
                        pr.title != pull_request.title and \
                        pr.requirement == update.requirement.key:
                    committer = self.provider.get_pull_request_committer(
                        self.user_repo, pr)
                    # check that there's exactly one committer in this PRs commit history and
                    # that the committer is the bot
                    if len(committer) == 1 and self.provider.is_same_user(self.bot, committer[0]):
                        self.provider.close_pull_request(
                            bot_repo=self.bot_repo,
                            user_repo=self.user_repo,
                            pull_request=pr,
                            comment="Closing this in favor of #{}".format(pull_request.number)
                        )
Closes stale pull requests for the given update, links to the new pull request and deletes
dataset/ETHPy150Open pyupio/pyup/pyup/bot.py/Bot.close_stale_prs