def _simple_cache(context, request):
    normalized_name = normalize_name(context.name)

    if not request.access.has_permission(normalized_name, 'read'):
        if request.is_logged_in:
            return HTTPNotFound("No packages found named %r" % normalized_name)
        else:
            return request.request_login()

    packages = request.db.all(normalized_name)
    if packages:
        return _pkg_response(packages_to_dict(request, packages))

    if not request.access.can_update_cache():
        if request.is_logged_in:
            return HTTPNotFound("No packages found named %r" % normalized_name)
        else:
            return request.request_login()
    else:
        pkgs = get_fallback_packages(request, context.name, False)
        return _pkg_response(pkgs)
Service /simple with fallback=cache
dataset/ETHPy150Open mathcamp/pypicloud/pypicloud/views/simple.py/_simple_cache