:return: result from running the task
770884
def get_results(self):
        '''
        
        '''
        self._event.wait()
        if self._exception is not None:
            #
            # Well... rethrownig the exception caught in execute
            # but on the caller thread
            #
            raise self._exception  # pylint: disable=E0702
        return self._result
48006
def get_completed_task(self, task, timeout=-1):
        
        self.__wait_task_completion(task, timeout)

        return self.get(task)
474459
def execute(self):
        
        while self.index < len(self.tasklist):
            res = self.step()
            self.logger.debug('SeqSet task %i has completed with result %s' %
                              (self.index, res))

        # Returns result of last task to quit
        return res
1335054
def _get_and_execute(self):
        
        try:
            work = self.queue.get(timeout=self.max_seconds_idle)
        except queue.Empty:
            # max_seconds_idle has been exhausted, exiting
            self.end_notify()
            return False
        else:
            self._work(work)
            self.queue.task_done()
            return True
421959
def run(self):
        '''
        '''
        if self.verbose:
            pbar = tqdm(total=100)
        while True:
            task_remain = self._task_queue.qsize()
            task_finished = int((float(self.total_task - task_remain) /
                                 float(self.total_task)) * 100)
            if task_finished % 20 == 0 and task_finished != self.current_state:
                self.current_state = task_finished
                logger.info('{0}% done'.format(task_finished))
                if self.verbose and task_finished > 0:
                    pbar.update(20)
            if task_remain == 0:
                break
        logger.debug('All task data cleared')
1132200
def finished(self):
    

    return self.__state in (Job.ERROR, Job.SUCCESS, Job.CANCELLED)
1118303
def results(self) -> List[TrialResult]:
        """"""
        if not self._results:
            job = self._update_job()
            for _ in range(1000):
                if job['executionStatus']['state'] in TERMINAL_STATES:
                    break
                time.sleep(0.5)
                job = self._update_job()
            if job['executionStatus']['state'] != 'SUCCESS':
                raise RuntimeError(
                    'Job %s did not succeed. It is in state %s.' % (
                        job['name'], job['executionStatus']['state']))
            self._results = self._engine.get_job_results(
                self.job_resource_name)
        return self._results
1281139
def result(self):
    
    self.wait()
    if self.failed:
      raise Exception('Query failed: %s' % str(self.errors))
    return self._table
554529
def get_result(self):
        
        __tracebackhide__ = True
        if self._excinfo is None:
            return self._result
        else:
            ex = self._excinfo
            if _py3:
                raise ex[1].with_traceback(ex[2])
            _reraise(*ex)
1148406
def result(self):
        """"""
        if not self.tasks:
            self.clean_all()
        tasks_length = len(self.tasks)
        self.logger_function(
            '%s tasks of request, will cost at least %s seconds.' %
            (tasks_length,
             round(self.req.interval / self.req.n * tasks_length, 2)))
        self.req.x
        for task in self.tasks:
            key, value, fut = task
            if fut.x and fut.cx:
                # fut.x == req success & fut.cx == response not changed.
                self.ignore[key].append(value)
        return self.reset_new_request()
887862
def process_result(self, context, result_body, exc, content_type):
        
        return process_result(self, context, result_body, exc, content_type)
1218409
def run(self):
        
        if not self._has_yielded and not self.task.local_workflow_require_branches:
            self._has_yielded = True

            yield list(self.task.get_branch_tasks().values())

        self._has_run = True
120479
def wait_for_tasks(self):
        
        finished_tasks_and_results = []
        while len(finished_tasks_and_results) == 0:
            if self.is_done():
                break
            self.start_tasks()
            self.process_all_messages_in_queue()
            finished_tasks_and_results = self.get_finished_results()
        return finished_tasks_and_results
304858
def run_task(task_cls, task_data):
    
    task = instantiate(task_cls)
    task_callable = get_callable(task)
    return task_callable(TaskData(task_data))
958657
def get_task_results(self):
        

        results = self.get_task_results_without_format()
        if options.tunnel.string_as_binary:
            return compat.OrderedDict([(k, bytes(result)) for k, result in six.iteritems(results)])
        else:
            return compat.OrderedDict([(k, str(result)) for k, result in six.iteritems(results)])
761858
def execute_task(self, task, parent_result):
        
        task.before_run(parent_result)
        context = task.create_context(self.message_queue)
        pending_result = self.pool.apply_async(execute_task_async, (task.func, task.id, context))
        self.pending_results.append(pending_result)
1350333
def execute(self):
        
        self.count = 0
        self.taskset = []
        self.results = {}
        self.totaltime = time.time()

        # Register termination callbacks for all my child tasks.
        for task in list(self.taskseq):
            self.taskset.append(task)
            task.add_callback('resolved', self.child_done, self.count)
            self.count += 1

        self.numtasks = self.count

        # Now start each child task.
        with self.regcond:
            for task in list(self.taskset):
                task.initialize(self)

                task.start()

            # Account for time needed to start subtasks
            self.totaltime = time.time() - self.totaltime

            # Now give up the critical section and wait for last child
            # task to terminate.
            while self.count > 0:
                self.regcond.wait()

        # Scan results for errors (exceptions) and raise the first one we find
        for key in self.results.keys():
            value = self.results[key]
            if isinstance(value, Exception):
                (count, task) = key
                self.logger.error("Child task %s terminated with exception: %s" % (
                    task.tag, str(value)))
                raise value

        return 0