def install_twisted():
    """
    If twisted is available, make `emit' return a DeferredList

    This has been successfully tested with Twisted 14.0 and later.
    """
    global emit, _call_partial
    try:
        from twisted.internet import defer
        emit = _emit_twisted
        _call_partial = defer.maybeDeferred
        return True
    except __HOLE__:
        _call_partial = lambda fn, *a, **kw: fn(*a, **kw)
        return False
dataset/ETHPy150Open shaunduncan/smokesignal/smokesignal.py/install_twisted