def _get_user_via_api_key(api_key):
 user = User(Participant._from_thing('api_key', api_key))
 if user.participant:
  p = user.participant
  today = date.today()
  if (p.old_auth_usage != today):
   Participant.db.run('\n                UPDATE participants\n                   SET old_auth_usage = %s\n                 WHERE id = %s\n            ', (today, p.id))
 return user

def _get_user_via_api_key ( api_key ) : user = User ( Participant . _from_thing ( 'api_key' , api_key ) ) if user . participant : p = user . participant today = date . today ( ) if ( p . old_auth_usage != today ) : Participant . db . run ( '\n                UPDATE participants\n                   SET old_auth_usage = %s\n                 WHERE id = %s\n            ' , ( today , p . id ) ) return user
given an api_key .