def get_user(self, request):
    '''check for gaema authenticated user and return the user
    '''
    if hasattr(request, settings.MARKETPLACE_DOMAIN_NAME_KEY):
      # marketplace
      domain = getattr(request, settings.MARKETPLACE_DOMAIN_NAME_KEY)
      user = get_gaema_user(domain)
      if user:
        user['_service'] = domain
        key_name = "%s:%s" % (domain, user['claimed_id'])
        return self.user_model.get_or_insert(key_name, user)
      else:
        return AnonymousUser()
    for service in self.valid_services:
      user = get_gaema_user(service)
      if user:
        user['_service'] = service
        key_name = services.get_key_name(user)
        return self.user_model.get_or_insert(key_name, user)
    return AnonymousUser()
dataset/ETHPy150Open IanLewis/kay/kay/auth/backends/gaema.py/GAEMABackend.get_user/original