<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def delay(effect, result=None, delay=0.001):
 """ Returns a new effect that will delay the execution of the given effect and return the specified result right away. @param effect: the effect to delay @type effect: callable @param result: the value to return right away @type result: Any @param delay: the time to wait before performing the specified effect, in seconds @type delay: float @return: a new effect that will delay the given effect @rtype: callable """


    def delay(value, context, **params):
        d = defer.Deferred()
        d.addCallback(effect, context, **params)
        time.call_next(d.callback, value)
        return result

    return delay