code: def _set_concurrent_future_state(concurrent, source):
      
      assert source.done()
      if source.cancelled():
          concurrent.cancel()
      if not concurrent.set_running_or_notify_cancel():
          return
      exception = source.exception()
      if exception is not None:
          concurrent.set_exception(exception)
      else:
          result = source.result()
          concurrent.set_result(result)
docs: Copy state from a future to a concurrent.futures.Future.