human
Solve the following python programming problem given the following code:
@api_handle_error_with_json
def content_recommender(request):
assistant
#Here is the Python code you requested.

    """Populate response with recommendation(s)
    """
    user_id = request.GET.get('user')
    user = request.session.get('facility_user')
    if (not user):
        if (request.user.is_authenticated() and request.user.is_superuser):
            user = get_object_or_404(FacilityUser, pk=user_id)
        else:
            return JsonResponseMessageError('You    are    not    authorized    to    view    these    recommendations.', status=401)
    resume = request.GET.get('resume')
    next = request.GET.get('next')
    explore = request.GET.get('explore')
    def set_bool_flag(flag_name, rec_dict):
        rec_dict[flag_name] = True
        return rec_dict
    resume_recommendations = ([set_bool_flag('resume', rec) for rec in get_resume_recommendations(user, request)] if resume else [])
    next_recommendations = ([set_bool_flag('next', rec) for rec in get_next_recommendations(user, request)] if next else [])
    explore_recommendations = ([set_bool_flag('explore', rec) for rec in get_explore_recommendations(user, request)] if explore else [])
    return JsonResponse(((resume_recommendations + next_recommendations) + explore_recommendations))