def _set_concurrent_future_state(concurr: concurrent.futures.Future, source: Union[(concurrent.futures.Future, Future)]) -> None:
    'Copy state from a future to a concurrent.futures.Future.'
    assert source.done()
    if source.cancelled():
        concurr.cancel()
    if (not concurr.set_running_or_notify_cancel()):
        return
    exception = source.exception()
    if (exception is not None):
        concurr.set_exception(exception)
    else:
        result = source.result()
        concurr.set_result(result)
Copy state from a future to a concurrent.futures.Future.
def _set_concurrent_future_state(concurr: concurrent.futures.Future, source: Union[(concurrent.futures.Future, Future)]) -> None:
    
    assert source.done()
    if source.cancelled():
        concurr.cancel()
    if (not concurr.set_running_or_notify_cancel()):
        return
    exception = source.exception()
    if (exception is not None):
        concurr.set_exception(exception)
    else:
        result = source.result()
        concurr.set_result(result)