@must_be_logged_in
def watched_logs_get(**kwargs):
    user = kwargs['auth'].user
    try:
        page = int(request.args.get('page', 0))
    except __HOLE__:
        raise HTTPError(http.BAD_REQUEST, data=dict(
            message_long='Invalid value for "page".'
        ))
    try:
        size = int(request.args.get('size', 10))
    except ValueError:
        raise HTTPError(http.BAD_REQUEST, data=dict(
            message_long='Invalid value for "size".'
        ))

    total = sum(1 for x in user.get_recent_log_ids())
    paginated_logs, pages = paginate(user.get_recent_log_ids(), total, page, size)
    logs = (model.NodeLog.load(id) for id in paginated_logs)

    return {
        "logs": [serialize_log(log) for log in logs],
        "total": total,
        "pages": pages,
        "page": page
    }
dataset/ETHPy150Open CenterForOpenScience/osf.io/website/views.py/watched_logs_get