INNER CODE UNIT · Python
batch_lookup_emails
deltazefiro/Amarok-Hider · .github/scripts/summarize_translation_contrib.py:152
async def batch_lookup_emails(
emails: Set[str], verbose: bool = False, max_concurrent: int = 1
) -> Dict[str, Optional[str]]:
"""
Batch lookup multiple emails concurrently with semaphore.
Returns dict mapping email to username.
"""
semaphore = asyncio.Semaphore(max_concurrent)
# Create a dummy session object (we're using urllib in executor)
session = None
tasks = [
lookup_github_user_by_email(session, semaphore, email, verbose)
for email in emails
]
results = await asyncio.gather(*tasks, return_exceptions=True)