def rebase_finalizer(expr, offset):
    assert isinstance(expr, Expression)

    def convert(n):
        if isinstance(n, RemoteAggregateOutput):
            return UnnamedAttributeRef(n.index + offset)
        n.apply(convert)
        return n
    return convert(expr)
Converts a function based decorator into a class based decorator usable
dataset/ETHPy150Open uwescience/raco/raco/expression/aggregate.py/rebase_finalizer--crossover with--dataset/ETHPy150Open Bouke/django-two-factor-auth/two_factor/views/utils.py/class_view_decorator