INNER CODE UNIT · Python

merged_pr_authors

futo-org/android-keyboard · tools/contributors.py:29

def merged_pr_authors(owner_repo: str,
                      label: str | None = None) -> Set[str]:
    """Return the *login* of everyone whose PR is merged. If `label` is given then only looks for the label."""
    url = f"{GH_API}/repos/{owner_repo}/pulls"
    prs = fetch_all(url, {"state": "closed"})
    authors: Set[str] = set()
    for pr in prs:
        if label is None and pr.get("merged_at") is None:
            continue
        if label and all(l["name"] != label for l in pr.get("labels", [])):
            continue
        authors.add(pr["user"]["login"])
    return authors

def translation_contribs(repo_dir: Path) -> Dict[str, Set[str]]:
    """
    Extract mapping {name -> {languages}} from 'Co-authored-by' lines.
    Expected pattern:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…