def update_counters(rex, db=None):
    def wrapper(func):
        @functools.wraps(func)
        def wrapped(*args, **kwargs):
            ret = func(*args, **kwargs)
            page = build_page(rex, kwargs)
            update_counter(page, db or database)
            return ret
        return wrapped
    return wrapper
Create a decorator that updates analytics in `pagecounters` when the
dataset/ETHPy150Open CenterForOpenScience/osf.io/framework/analytics/__init__.py/update_counters