def _copy_future_state(source: Union[(concurrent.futures.Future, Future)], dest: Union[(concurrent.futures.Future, Future)]) -> None:
    'Copy state from another Future.\n\n    The other Future may be a concurrent.futures.Future.\n    '
    assert source.done()
    if dest.cancelled():
        return
    assert (not dest.done())
    if source.cancelled():
        dest.cancel()
    else:
        exception = source.exception()
        if (exception is not None):
            dest.set_exception(exception)
        else:
            result = source.result()
            dest.set_result(result)
Copy state from another Future.

The other Future may be a concurrent.futures.Future.
def _copy_future_state(source: Union[(concurrent.futures.Future, Future)], dest: Union[(concurrent.futures.Future, Future)]) -> None:
    'Copy state from another Future.\n\n    The other Future may be a concurrent.futures.Future.\n    '
    assert source.done()
    if dest.cancelled():
        return
    assert (not dest.done())
    if source.cancelled():
        dest.cancel()
    else:
        exception = source.exception()
        if (exception is not None):
            dest.set_exception(exception)
        else:
            result = source.result()
            dest.set_result(result)