Skip to content

Instantly share code, notes, and snippets.

@elijahbenizzy
Last active August 16, 2023 19:40
Show Gist options
  • Save elijahbenizzy/3c37516ced0519c23a85e106c968fd8d to your computer and use it in GitHub Desktop.
Save elijahbenizzy/3c37516ced0519c23a85e106c968fd8d to your computer and use it in GitHub Desktop.
def stars_by_repo(star_count: Collect[Tuple[str, int]]) -> Dict[str, int]:
"""Aggregates the star count for each repo into a dictionary, so we
can generate paginated requests.
:param star_count: A tuple of the repo name and the star count
:return: The star count for each repo
"""
star_count_dict = {}
for repo_name, stars in star_count:
star_count_dict[repo_name] = stars
return star_count_dict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment