Execute method with arg and return the result.

    If the method fails, return a RayTaskError so it can be sealed in the
    resultOID and retried by user.
504418
def _execute_and_seal_error(method, arg, method_name):
    
    try:
        return method(arg)
    except Exception:
        return ray.worker.RayTaskError(method_name, traceback.format_exc())
1193210
@Override
    public T execute() {
        try {
            return getHttpClient().executeWithRetries(this);
        } catch (InvalidStateException e) {
            Optional<ApiError> conflictError = Iterables.tryFind(e.getErrors(), CONFLICT_ERROR);
            if (conflictError.isPresent()) {
                String id = conflictError.get().getLinks().get("conflicting_resource_id");
                return handleConflict(getHttpClient(), id).execute();
            } else {
                throw Throwables.propagate(e);
            }
        }
    }
955357
def throw(self, method, args={}, nowait=False, **kwargs):
        
        r = self.call_or_cast(method, args, type=ACTOR_TYPE.RR,
                              nowait=nowait, **kwargs)
        if not nowait:
            return r
1016805
def get_results(self, **kwargs):
        
        # Check whether the process completed.
        if self.returncode is None:
            raise self.Error("return code is None, you should call wait, communicate or poll")

        if self.status is None or self.status < self.S_DONE:
            raise self.Error("Task is not completed")

        return self.Results.from_node(self)
440092
def callback(func):
    
    @functools.wraps(func)
    def wrapped(*args, **kwargs):
        result = func(*args, **kwargs)
        if inspect.iscoroutine(result):
            aio_loop.create_task(result)

    return wrapped
360172
def execute(self, return_results=True):
        '''
        
        '''
        if self.results:
            return self.results if return_results else None

        self.execute_raw()

        if self._raw_results_only:
            self.results = self.raw_results
        else:
            self.map_results()

        if return_results:
            return self.results
644255
def execute(args = [], **options)
      execute_internal(args, options)
      Executor::ExitCode.code(:success)
    rescue Cliqr::Error::CliqrError => e
      puts e.message
      Executor::ExitCode.code(e)
    end
721818
def get(self, *args, **kwargs):
        
        args, kwargs = self.__process__(*args, **kwargs)
        return check_output(args, **kwargs)
747359
def result_worker(ctx, result_cls, get_object=False):
    
    g = ctx.obj
    ResultWorker = load_cls(None, None, result_cls)

    result_worker = ResultWorker(resultdb=g.resultdb, inqueue=g.processor2result)

    g.instances.append(result_worker)
    if g.get('testing_mode') or get_object:
        return result_worker

    result_worker.run()
998229
def execute_return_success(cmd):
    '''
    
    '''

    ret = _run_all(cmd)

    if ret['retcode'] != 0 or 'not supported' in ret['stdout'].lower():
        msg = 'Command Failed: {0}\n'.format(cmd)
        msg += 'Return Code: {0}\n'.format(ret['retcode'])
        msg += 'Output: {0}\n'.format(ret['stdout'])
        msg += 'Error: {0}\n'.format(ret['stderr'])
        raise CommandExecutionError(msg)

    return True
1200293
def execute(self, *args, **kwargs):
        
        num_clients = len(self._seed_clients)
        start_client = (self._client_idx + 1) % num_clients

        def _client_error(failure, client_i):
            failure.trap(ConnectError)
            client_i = (client_i + 1) % num_clients
            if client_i == start_client:
                return failure
            else:
                return _try_execute(client_i)

        def _try_execute(client_i):
            self._client_idx = client_i
            d = self._seed_clients[client_i].execute(*args, **kwargs)
            return d.addErrback(_client_error, client_i)

        return _try_execute(start_client)
1347026
def Execute(self, action, *args, **kw):
        
        action = self.Action(action, *args, **kw)
        result = action([], [], self)
        if isinstance(result, SCons.Errors.BuildError):
            errstr = result.errstr
            if result.filename:
                errstr = result.filename + ': ' + errstr
            sys.stderr.write("scons: *** %s\n" % errstr)
            return result.status
        else:
            return result
88619
def do_execute(self):
        
        result = None
        evl = self.input.payload
        pltclassifier.plot_classifier_errors(
            evl.predictions,
            absolute=bool(self.resolve_option("absolute")),
            max_relative_size=int(self.resolve_option("max_relative_size")),
            absolute_size=int(self.resolve_option("absolute_size")),
            title=self.resolve_option("title"),
            outfile=self.resolve_option("outfile"),
            wait=bool(self.resolve_option("wait")))
        return result
1105155
def none_returns(func):
    

    @functools.wraps(func)
    def _execute(*args, **kwargs):
        """Executes function, if error returns None else value of function

        :param args: args of function
        :param kwargs: extra args of function
        :param *args: args
        :param **kwargs: extra args
        :return: None else value of function
        """

        try:
            return func(*args, **kwargs)
        except:
            return None

    return _execute
603775
def return_value(self, *args, **kwargs):
        

        self._called()
        return self._return_value(*args, **kwargs)
732699
def execute(opts={})
      @result = result_class.new(session.execute(statement, execution_options.merge(opts)), result_opts)
      result.success?
    end
549053
public <T> T execute(final Object[] args, final Class<T> clazz, final boolean failOnError) {
        if (this.groovyScript != null) {
            return ScriptingUtils.executeGroovyScript(this.groovyScript, args, clazz, failOnError);
        }
        return null;
    }