def user_by_anonymous_id(uid):
 if (uid is None):
  return None
 try:
  return User.objects.get(anonymoususerid__anonymous_user_id=uid)
 except ObjectDoesNotExist:
  return None

def user_by_anonymous_id ( uid ) : if ( uid is None ) : return None try : return User . objects . get ( anonymoususerid__anonymous_user_id = uid ) except ObjectDoesNotExist : return None
return user by anonymous_user_id using anonymoususerid lookup table .