@contextmanager
def view_change_timeout(tconf, vc_timeout, propose_timeout=None):
    old_view_change_timeout = tconf.NEW_VIEW_TIMEOUT
    old_propose_timeout = tconf.INITIAL_PROPOSE_VIEW_CHANGE_TIMEOUT
    old_propagate_request_delay = tconf.PROPAGATE_REQUEST_DELAY
    tconf.NEW_VIEW_TIMEOUT = vc_timeout
    tconf.INITIAL_PROPOSE_VIEW_CHANGE_TIMEOUT = (vc_timeout if (propose_timeout is None) else propose_timeout)
    tconf.PROPAGATE_REQUEST_DELAY = 0
    (yield tconf)
    tconf.NEW_VIEW_TIMEOUT = old_view_change_timeout
    tconf.INITIAL_PROPOSE_VIEW_CHANGE_TIMEOUT = old_propose_timeout
    tconf.PROPAGATE_REQUEST_DELAY = old_propagate_request_delay
@contextmanager
def view_change_timeout(tconf, vc_timeout, propose_timeout=None):
    old_view_change_timeout = tconf.NEW_VIEW_TIMEOUT
    old_propose_timeout = tconf.INITIAL_PROPOSE_VIEW_CHANGE_TIMEOUT
    old_propagate_request_delay = tconf.PROPAGATE_REQUEST_DELAY
    tconf.NEW_VIEW_TIMEOUT = vc_timeout
    tconf.INITIAL_PROPOSE_VIEW_CHANGE_TIMEOUT = (vc_timeout if (propose_timeout is None) else propose_timeout)
    tconf.PROPAGATE_REQUEST_DELAY = 0
    (yield tconf)
    tconf.NEW_VIEW_TIMEOUT = old_view_change_timeout
    tconf.INITIAL_PROPOSE_VIEW_CHANGE_TIMEOUT = old_propose_timeout
    tconf.PROPAGATE_REQUEST_DELAY = old_propagate_request_delay