The actual execution of the actor.

        :return: None if successful, otherwise error message
        :rtype: str
500687
def do_execute(self):
        
        result = None
        cont = self.input.payload
        serialization.write_all(
            str(self.resolve_option("output")),
            [cont.get("Model").jobject, cont.get("Header").jobject])
        return result
206885
def do_execute(self):
        
        result = None
        cont = self.input.payload
        name = str(self.resolve_option("value"))
        value = cont.get(name)
        switch = bool(self.resolve_option("switch"))
        if switch:
            if self.first_active is not None:
                self.first_active.input = self.input
                result = self._director.execute()
            if result is None:
                self._output.append(Token(value))
        else:
            if self.first_active is not None:
                self.first_active.input = Token(value)
                result = self._director.execute()
            if result is None:
                self._output.append(self.input)
        return result
518805
def _execute(self, logger: Logger, options: Dict[str, Dict[str, Any]]) -> T:
        
        pass
80079
def execute(self, dataman):
        '''
        
        '''
        self._event.clear()
        try:
            self._result = self._task(dataman, *self._args)
        #
        # We are going to re-throw this exception from get_results,
        # so we are doing such a general eception handling at the point.
        # however, we do want to print it here as well
        #
        except Exception as ex:  # pylint: disable=W0703
            self._exception = ex
            KittyObject.get_logger().error(traceback.format_exc())
        self._event.set()
999335
def do_execute(self):
        
        if isinstance(self.input.payload, Instances):
            inst = None
            data = self.input.payload
        elif isinstance(self.input.payload, Instance):
            inst = self.input.payload
            data = inst.dataset

        index = str(self.resolve_option("index"))
        unset = bool(self.resolve_option("unset"))
        if unset:
            data.no_class()
        else:
            if index == "first":
                data.class_is_first()
            elif index == "last":
                data.class_is_last()
            else:
                data.class_index = int(index) - 1

        if inst is None:
            self._output.append(Token(data))
        else:
            self._output.append(Token(inst))

        return None
1069288
def execution_cls(self):
        
        name = self.campaign.process.type
        for clazz in [ExecutionDriver, SrunExecutionDriver]:
            if name == clazz.name:
                return clazz
        raise NameError("Unknown execution layer: '%s'" % name)
532217
def can_be_executed(self):
        
        missingParams = filter(lambda rp: rp not in self._parameters, self._requiredParameters)
        return len(missingParams) == 0
605815
def stop(self, actor, exc=None, exit_code=None):
        
        if actor.state <= ACTOR_STATES.RUN:
            # The actor has not started the stopping process. Starts it now.
            actor.state = ACTOR_STATES.STOPPING
            actor.event('start').clear()
            if exc:
                if not exit_code:
                    exit_code = getattr(exc, 'exit_code', 1)
                if exit_code == 1:
                    exc_info = sys.exc_info()
                    if exc_info[0] is not None:
                        actor.logger.critical('Stopping', exc_info=exc_info)
                    else:
                        actor.logger.critical('Stopping: %s', exc)
                elif exit_code == 2:
                    actor.logger.error(str(exc))
                elif exit_code:
                    actor.stream.writeln(str(exc))
            else:
                if not exit_code:
                    exit_code = getattr(actor._loop, 'exit_code', 0)
            #
            # Fire stopping event
            actor.exit_code = exit_code
            actor.stopping_waiters = []
            actor.event('stopping').fire()

            if actor.stopping_waiters and actor._loop.is_running():
                actor.logger.info('asynchronous stopping')
                # make sure to return the future (used by arbiter for waiting)
                return actor._loop.create_task(self._async_stopping(actor))
            else:
                if actor.logger:
                    actor.logger.info('stopping')
                self._stop_actor(actor)

        elif actor.stopped():
            return self._stop_actor(actor, True)
717989
def _execute(self, handler, *args, **kwargs):
        
        # difference to Axel Events: we don't use a timeout and execute all handlers in same thread
        # FIXME: =>possible problem:
        #                       blocking of event firing when user gives a long- or infinitly-running callback function
        # (in Python it doesn't seem possible to forcefully kill a thread with clean ressource releasing,
        #  a thread has to cooperate und behave nice...
        #  execution and killing a process would be possible, but has data corruption problems with queues
        #  and possible interprocess communication problems with given handler/callback function)

        result = None
        exc_info = None

        try:
            result = handler(*args, **kwargs)
        except Exception:
            exc_info = sys.exc_info()
        if exc_info:
            return exc_info
        return result
398572
def execute(self):
        
        self._state_machine.transition_to_execute()
        for action in self._actions:
            self._executed_actions.append(action)
            self.execute_with_retries(action, lambda a: a.execute())
        self._state_machine.transition_to_execute_complete()
912684
def do_execute(self):
        
        data = self.input.payload
        cls = self.resolve_option("setup")
        if isinstance(cls, Classifier):
            cls = Classifier.make_copy(cls)
            evl = Evaluation(data)
            evl.discard_predictions = bool(self.resolve_option("discard_predictions"))
            evl.crossvalidate_model(
                cls,
                data,
                int(self.resolve_option("folds")),
                Random(int(self.resolve_option("seed"))),
                self.resolve_option("output"))
            self._output.append(Token(evl))
        elif isinstance(cls, Clusterer):
            cls = Clusterer.make_copy(cls)
            evl = ClusterEvaluation()
            llh = evl.crossvalidate_model(
                cls,
                data,
                int(self.resolve_option("folds")),
                Random(int(self.resolve_option("seed"))))
            self._output.append(Token(llh))
        else:
            return "Unhandled class: " + classes.get_classname(cls)
        return None
159653
def do_execute(self):
        
        formatstr = str(self.resolve_option("format"))
        expanded = self.storagehandler.expand(formatstr)
        self._output.append(Token(expanded))
        return None
1000323
def executions(self) -> List[Execution]:
        
        return list(fill.execution for fill in self.wrapper.fills.values())
520725
def do_execute(self):
        
        relname = self.resolve_option("name")
        if isinstance(self.input.payload, Instance):
            self.input.payload.dataset.relationname = relname
        else:
            self.input.payload.relationname = relname
        self._output.append(self.input)
        return None
258160
def run(self):
        
        if self.is_root_state:
            self.execution_history.push_call_history_item(self, CallType.EXECUTE, None, self.input_data)

        logger.debug("Running {0}{1}".format(self, " (backwards)" if self.backward_execution else ""))
        if self.backward_execution:
            self.setup_backward_run()
        else:
            self.setup_run()

        try:
            outcome = self._execute(self.input_data, self.output_data, self.backward_execution)
            self.state_execution_status = StateExecutionStatus.WAIT_FOR_NEXT_STATE

            if self.backward_execution:
                # outcome handling is not required as we are in backward mode and the execution order is fixed
                result = self.finalize()
            else:
                # check output data
                self.check_output_data_type()
                result = self.finalize(outcome)

            if self.is_root_state:
                self.execution_history.push_return_history_item(self, CallType.EXECUTE, None, self.output_data)
            return result
        except Exception as e:
            exc_type, exc_value, exc_traceback = sys.exc_info()
            formatted_exc = traceback.format_exception(exc_type, exc_value, exc_traceback)
            truncated_exc = []
            for line in formatted_exc:
                if os.path.join("rafcon", "core") not in line:
                    truncated_exc.append(line)
            logger.error("{0} had an internal error: {1}: {2}\n{3}".format(self, type(e).__name__, e,
                                                                           ''.join(truncated_exc)))
            # write error to the output_data of the state
            self.output_data["error"] = e
            self.state_execution_status = StateExecutionStatus.WAIT_FOR_NEXT_STATE
            return self.finalize(Outcome(-1, "aborted"))
774680
def get_event_action(cls) -> Optional[str]:
        
        if not cls.actor:
            return None
        return event_context.get_event_action(cls.event_type)
561620
def Execute(self, http):
        

        self._Execute(http)

        for key in self.__request_response_handlers:
            response = self.__request_response_handlers[key].response
            callback = self.__request_response_handlers[key].handler

            exception = None

            if response.status_code >= 300:
                exception = exceptions.HttpError.FromResponse(response)

            if callback is not None:
                callback(response, exception)
            if self.__callback is not None:
                self.__callback(response, exception)