def METHOD_NAME(gh: Github, head: str, base: Optional[str] = None) -> Dict[int, str]:
    repo = gh.get_repo("TileDB-Inc/TileDB")
    if base is None:
        base = latest_release.tag_name
        base_sha = latest_release.target_commitish
    else:
        base_sha = repo.get_commit(base).sha
    logging.info(f"Base: {base} ({base_sha})")
    if head is None:
        head = check_output(["git", "branch", "--show-current"]).strip().decode()
        head_sha = check_output(["git", "rev-parse", head]).strip().decode()
    else:
        head_sha = repo.get_commit(head).sha
    logging.info(f"Head: {head} ({head_sha})")
    comparison = repo.compare(base_sha, head_sha)
    if comparison.behind_by != 0:
        find_common_ancestor = input(
            f"Head is {comparison.behind_by} commits behind base: do you want to use the "
            f"latest common ancestor of {base} and {head} as base? [y/n] "
        )
        if find_common_ancestor.lower() == "y":
            base_sha = comparison.merge_base_commit.sha
            comparison = repo.compare(base_sha, head_sha)
            assert comparison.behind_by == 0, comparison.behind_by
        else:
            sys.exit(f"Aborting: head is {comparison.behind_by} commits behind base")
    logging.info(f"Head is {comparison.ahead_by} commits ahead of base")
    prs = {}
    for commit in comparison.commits:
        for pr in commit.get_pulls():
            backport = re.match(r"^backport-(\d+)", pr.head.ref)
            if backport:
                pr = repo.get_pull(int(backport.group(1)))
            # If the pr is open or the reserved keyword "NO_HISTORY" is included anywhere
            # in the PR body, ignore the PR
            if pr.state != "open" and pr.body and "NO_HISTORY" not in pr.body:
                prs[pr.number] = pr.body
    return prs