def lookup_user_by_login(login, password):
  try:
    current_user = authenticate_user_login(login, password)
    if current_user:
      return current_user
  except exception.ValidationError:
    pass # let's try the email address next
  # login can be confirmed email address
  actor_ref = api.actor_lookup_email(api.ROOT, login)
  if actor_ref:
    return authenticate_user_login(actor_ref.nick, password)
  return None
Looks up user by a given login. Returns None on failure.
dataset/ETHPy150Open CollabQ/CollabQ/common/user.py/lookup_user_by_login