def coroutine(f):
    """
    Decorator that automatically primes a coroutine
    """
    # the wrapper
    def wrapper(*args, **kwds):
        # instantiate the generator
        gen = f(*args, **kwds)
        # prime it
        next(gen)
        # and return it
        return gen
    # return the wrapper to the caller
    return wrapper