def facebook_decorator(func):
    def wrapper(request, *args, **kwargs):
        user = request.user

        # User must me logged via FB backend in order to ensure we talk about
        # the same person
        if not is_complete_authentication(request):
            try:
                user = social_complete(request, FacebookBackend.name)
            except __HOLE__:
                pass  # no matter if failed

        # Not recommended way for FB, but still something we need to be aware
        # of
        if isinstance(user, HttpResponse):
            kwargs.update({'auth_response': user})
        else:  # Need to re-check the completion
            if is_complete_authentication(request):
                kwargs.update({'access_token': get_access_token(request.user)})
            else:
                request.user = AnonymousUser()

        signed_request = FacebookBackend().load_signed_request(
            request.REQUEST.get('signed_request', '')
        )
        if signed_request:
            kwargs.update({'signed_request': signed_request})

        return func(request, *args, **kwargs)

    return wrapper
dataset/ETHPy150Open omab/django-social-auth/example/app/facebook.py/facebook_decorator