The result from realising the future

        If the result is not available, block until done.

        :return: result of the future
        :raises: any exception encountered during realising the future
9431
def result(self):
        
        if self._result is None:
            self.await_result()
        chunks, exception = self._result
        if exception is None:
            return chunks
        raise exception
625447
def fetchone(self):
        
        self._assert_valid_result_set()
        result = self.result_set.fetch_row()
        if len(result) == 0:
            return None
        else:
            return result
154209
def result(self):
        
        final_result = {'epoch_idx': self.global_epoch_idx}

        for key, value in self.frozen_results.items():
            final_result[key] = value

        return final_result
600216
def set_result(self, result):
        
        with self.__condition:
            self.__result = result
            self.__state = FINISHED
            self.__condition.notify_all()
        self._invoke_callbacks()
1043236
def waitResult(self):
    
    self.thread.execute_queue.join()
    try:
      e = self.thread.exception_queue[threading.get_ident()].get_nowait()
    except queue.Empty:
      return self.thread.result_queue[threading.get_ident()].get_nowait()
    else:
      raise e
933688
def set_result(self, result):
        """"""
        result = result.result()[0]
        if self.future is not None:
            if isinstance(result, Exception):
                self.future.set_exception(result)
            else:
                self.future.set_result(result)
            self.future = None
        elif isinstance(result, Exception):
            raise result
910135
async def wait_change(self):
        
        future = asyncio.Future(loop=self.loop)
        self._change_futures.add(future)
        future.add_done_callback(self._change_futures.discard)
        await future
239628
def sendResult(self, future):
        """"""
        future = copy.copy(future)

        # Remove the (now) extraneous elements from future class
        future.callable = future.args = future.kargs = future.greenlet = None

        if not future.sendResultBack:
            # Don't reply back the result if it isn't asked
            future.resultValue = None

        self._sendReply(
            future.id.worker,
            pickle.dumps(
                future,
                pickle.HIGHEST_PROTOCOL,
            ),
        )
76591
def result(self):
        
        if not self.is_done():
            raise ValueError("Cannot get a result for a program that isn't completed.")

        if self._raw['status'] == 'CANCELLED':
            raise CancellationError(self._raw['result'])
        elif self._raw['status'] == 'ERROR':
            if self._machine == 'QVM':
                raise QVMError(self._raw['result'])
            elif self._machine == 'QPU':
                raise QPUError(self._raw['result'])
            elif self._machine == 'QUILC':
                raise QUILCError(self._raw['result'])
            else:
                raise UnknownApiError(self._raw['result'])

        if self._raw['program']['type'] == 'wavefunction':
            return Wavefunction.from_bit_packed_string(
                base64.b64decode(self._raw['result']), self._raw['program']['addresses'])
        elif self._raw['program']['type'] in ['multishot', 'multishot-measure', 'expectation']:
            return np.asarray(self._raw['result'])
        else:
            return self._raw['result']
291821
def wait(self):
        
        self.thread.join()
        if self.error is not None:
            return self.error
        return self.result
1224512
def collect_results(self) -> Optional[Tuple[int, Dict[str, float]]]:
        
        self.wait_to_finish()
        if self.decoder_metric_queue.empty():
            if self._results_pending:
                self._any_process_died = True
            self._results_pending = False
            return None
        decoded_checkpoint, decoder_metrics = self.decoder_metric_queue.get()
        assert self.decoder_metric_queue.empty()
        self._results_pending = False
        logger.info("Decoder-%d finished: %s", decoded_checkpoint, decoder_metrics)
        return decoded_checkpoint, decoder_metrics
835246
def finalize_concurrency_state(self, outcome):
        
        final_outcome = outcome
        self.write_output_data()
        self.check_output_data_type()
        self.execution_history.push_return_history_item(self, CallType.CONTAINER, self, self.output_data)
        self.state_execution_status = StateExecutionStatus.WAIT_FOR_NEXT_STATE

        singleton.state_machine_execution_engine._modify_run_to_states(self)

        if self.preempted:
            final_outcome = Outcome(-2, "preempted")
        return self.finalize(final_outcome)
864640
private boolean waitForTasksToFinish() throws Exception {
        for (Future<Boolean> future : futures) {
            try {
                if (!future.get()) {
                    cancel();
                    return false;
                }
            } catch (Exception e) {
                error.compareAndSet(null, e);
                cancel();
                throw e;
            }
        }
        return true;
    }
245734
def and_raise_future(self, exception):
        
        future = _get_future()
        future.set_exception(exception)
        return self.and_return(future)
503045
private void complete(T result, Throwable error) {
    synchronized (orderedFutures) {
      this.result = result;
      this.error = error;
      this.complete = true;
      if (error == null) {
        for (CompletableFuture<T> future : orderedFutures) {
          future.complete(result);
        }
      } else {
        for (CompletableFuture<T> future : orderedFutures) {
          future.completeExceptionally(error);
        }
      }
      orderedFutures.clear();
    }
  }
273936
def set_result(self, result):
        
        self._result = result
        self._state = self.FINISHED
559247
def get_results(self):
        
        return IterResult(self._loop(), self.name, self.argnames,
                          self.sent, self.monitor.hdf5)