def build_timeout_circuit(tor_state, reactor, path, timeout, using_guards=False):
    d = tor_state.build_circuit(path, using_guards)
    reactor.callLater(timeout, d.cancel)

    def trap_cancel(f):
        f.trap(defer.CancelledError)
        return Failure(CircuitBuildTimedOutError("circuit build timed out"))
    d.addCallback(lambda circuit: circuit.when_built())
    d.addErrback(trap_cancel)
    return d
returns a deferred which fires when the
dataset/ETHPy150Open meejah/txtorcon/txtorcon/circuit.py/build_timeout_circuit