def fetch_issues()

in link-verifier/verify-links.py [0:0]


def fetch_issues(repo, issue_type, limit):
    """Uses the GitHub CLI to fetch a list of PRs or issues"""

    global use_gh_cache
    global main_repo_list
    if shutil.which('gh') is not None:
        # List PRs or issues for repository and extract numbers.
        cmd = f'gh {issue_type} list -R {repo} -s all -L {limit} | awk \'{{print $1}}\''
        process = subprocess.run(
            cmd,
            stdout=subprocess.PIPE,
            stderr=subprocess.STDOUT,
            shell=True,
            encoding="utf-8",
            universal_newlines=True
        )
        if process.returncode == 0:
            key = issue_type + 's'
            for issue in process.stdout.split():
                main_repo_list[repo][key].add(int(issue))
        return 0
    else:
        use_gh_cache = False