def stage(func):

    def coro(*args):
        task = None
        while True:
            task = yield task
            task = func(*(args + (task,)))
    return coro
Decorate a function to become a simple stage.
dataset/ETHPy150Open beetbox/beets/beets/util/pipeline.py/stage