Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async def login(username: str, password: str, websession: ClientSession = None) -> API:
"""Log in to the API."""
api = API(websession)
await api.authenticate(username, password)
return api