<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def subroutine(*effects):
 """ Returns an effect performing a list of effects. The value passed to each effect is a result of the previous effect. """


    def subroutine(value, context, *args, **kwargs):
        d = defer.succeed(value)
        for effect in effects:
            d.addCallback(effect, context, *args, **kwargs)
        return d

    return subroutine