def get_user(request):
    from django.contrib.auth.models import AnonymousUser
    try:
        user_id = request.session[SESSION_KEY]
        backend_path = request.session[BACKEND_SESSION_KEY]
        backend = load_backend(backend_path)
        user = backend.get_user(user_id) or AnonymousUser()
    except __HOLE__:
        user = AnonymousUser()
    return user
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.2/django/contrib/auth/__init__.py/get_user