MCPcopy Index your code
hub / github.com/fastapi/fastapi / get_contributors

Function get_contributors

scripts/contributors.py:175–204  ·  view source on GitHub ↗
(pr_nodes: list[PullRequestNode])

Source from the content-addressed store, hash-verified

173
174
175def get_contributors(pr_nodes: list[PullRequestNode]) -> ContributorsResults:
176 contributors = Counter[str]()
177 translation_reviewers = Counter[str]()
178 translators = Counter[str]()
179 authors: dict[str, Author] = {}
180
181 for pr in pr_nodes:
182 if pr.author:
183 authors[pr.author.login] = pr.author
184 is_lang = False
185 for label in pr.labels.nodes:
186 if label.name == "lang-all":
187 is_lang = True
188 break
189 for review in pr.reviews.nodes:
190 if review.author:
191 authors[review.author.login] = review.author
192 if is_lang:
193 translation_reviewers[review.author.login] += 1
194 if pr.state == "MERGED" and pr.author:
195 if is_lang:
196 translators[pr.author.login] += 1
197 else:
198 contributors[pr.author.login] += 1
199 return ContributorsResults(
200 contributors=contributors,
201 translation_reviewers=translation_reviewers,
202 translators=translators,
203 authors=authors,
204 )
205
206
207def get_users_to_write(

Callers 1

mainFunction · 0.85

Calls 1

ContributorsResultsClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…