def METHOD_NAME(context, request):
    result = wrapped(context, request)
    total = result.count()
    page = paginate(request, total, page_size)
    offset = (page["cur"] - 1) * page_size
    return {
        "results": result.offset(offset).limit(page_size).all(),
        "total": total,
        "page": page,
    }