Actual execution of the director.

        :return: None if successful, otherwise error message
        :rtype: str
174250
def do_execute(self):
        

        result = None
        self._stopped = False
        self._stopping = False

        for actor in self.owner.actors:
            if self.is_stopping() or self.is_stopped():
                break
            actor.input = self.owner.input
            result = actor.execute()
            if result is not None:
                break

        return result
772551
def execute(self, result=None):
        
        try:
            return self.unsafe_execute(result=result)
        except Exception as exc:
            return self._onerror(Result.from_exception(exc, uuid=self.uuid))
950921
async def execute(self, *, return_exceptions=False):
        
        assert not self._done, "Pipeline already executed. Create new one."
        self._done = True

        if self._pipeline:
            if isinstance(self._pool_or_conn, AbcPool):
                async with self._pool_or_conn.get() as conn:
                    return await self._do_execute(
                        conn, return_exceptions=return_exceptions)
            else:
                return await self._do_execute(
                    self._pool_or_conn,
                    return_exceptions=return_exceptions)
        else:
            return await self._gather_result(return_exceptions)
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"))
217445
def execute(cmd, cwd=None):
    
    try:
        lines = subprocess \
            .check_output(cmd, cwd=cwd, stderr=DEVNULL) \
            .splitlines()
    except subprocess.CalledProcessError:
        return None
    else:
        if lines:
            return decode(lines[0].strip())
        else:
            return None
450476
def perform_command(self):
        
        if len(self.actual_arguments) < 2:
            return self.print_help()
        audio_file_path = self.actual_arguments[0]
        mode = self.actual_arguments[1]
        if mode not in [u"speech", u"nonspeech", u"both"]:
            return self.print_help()
        output_file_path = None
        if len(self.actual_arguments) >= 3:
            output_file_path = self.actual_arguments[2]
        output_time = not self.has_option([u"-i", u"--index"])

        self.check_c_extensions("cmfcc")
        if not self.check_input_file(audio_file_path):
            return self.ERROR_EXIT_CODE
        if (output_file_path is not None) and (not self.check_output_file(output_file_path)):
            return self.ERROR_EXIT_CODE

        self.print_info(u"Reading audio...")
        try:
            audio_file_mfcc = AudioFileMFCC(audio_file_path, rconf=self.rconf, logger=self.logger)
        except AudioFileConverterError:
            self.print_error(u"Unable to call the ffmpeg executable '%s'" % (self.rconf[RuntimeConfiguration.FFMPEG_PATH]))
            self.print_error(u"Make sure the path to ffmpeg is correct")
            return self.ERROR_EXIT_CODE
        except (AudioFileUnsupportedFormatError, AudioFileNotInitializedError):
            self.print_error(u"Cannot read file '%s'" % (audio_file_path))
            self.print_error(u"Check that its format is supported by ffmpeg")
            return self.ERROR_EXIT_CODE
        except Exception as exc:
            self.print_error(u"An unexpected error occurred while reading the audio file:")
            self.print_error(u"%s" % exc)
            return self.ERROR_EXIT_CODE
        self.print_info(u"Reading audio... done")

        self.print_info(u"Executing VAD...")
        audio_file_mfcc.run_vad()
        self.print_info(u"Executing VAD... done")

        speech = audio_file_mfcc.intervals(speech=True, time=output_time)
        nonspeech = audio_file_mfcc.intervals(speech=False, time=output_time)
        if mode == u"speech":
            if output_time:
                intervals = [(i.begin, i.end) for i in speech]
                template = u"%.3f\t%.3f"
            else:
                intervals = speech
                template = u"%d\t%d"
        elif mode == u"nonspeech":
            if output_time:
                intervals = [(i.begin, i.end) for i in nonspeech]
                template = u"%.3f\t%.3f"
            else:
                intervals = nonspeech
                template = u"%d\t%d"
        elif mode == u"both":
            if output_time:
                speech = [(i.begin, i.end, u"speech") for i in speech]
                nonspeech = [(i.begin, i.end, u"nonspeech") for i in nonspeech]
                template = u"%.3f\t%.3f\t%s"
            else:
                speech = [(i[0], i[1], u"speech") for i in speech]
                nonspeech = [(i[0], i[1], u"nonspeech") for i in nonspeech]
                template = u"%d\t%d\t%s"
            intervals = sorted(speech + nonspeech)
        self.write_to_file(output_file_path, intervals, template)

        return self.NO_ERROR_EXIT_CODE
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
695045
def do_execute(self):
        
        result = None
        data = self.input.payload
        pltdataset.line_plot(
            data,
            atts=self.resolve_option("attributes"),
            percent=float(self.resolve_option("percent")),
            seed=int(self.resolve_option("seed")),
            title=self.resolve_option("title"),
            outfile=self.resolve_option("outfile"),
            wait=bool(self.resolve_option("wait")))
        return result
1227813
def stop_execution(self):
        
        if not (self._stopping or self._stopped):
            for actor in self.owner.actors:
                actor.stop_execution()
            self._stopping = True
1374098
def perform_command(self):
        
        if len(self.actual_arguments) < 2:
            return self.print_help()
        input_file_path = self.actual_arguments[0]
        output_file_path = self.actual_arguments[1]

        if not self.check_input_file(input_file_path):
            return self.ERROR_EXIT_CODE
        if not self.check_output_file(output_file_path):
            return self.ERROR_EXIT_CODE

        try:
            converter = FFMPEGWrapper(rconf=self.rconf, logger=self.logger)
            converter.convert(input_file_path, output_file_path)
            self.print_success(u"Converted '%s' into '%s'" % (input_file_path, output_file_path))
            return self.NO_ERROR_EXIT_CODE
        except FFMPEGPathError:
            self.print_error(u"Unable to call the ffmpeg executable '%s'" % (self.rconf[RuntimeConfiguration.FFMPEG_PATH]))
            self.print_error(u"Make sure the path to ffmpeg is correct")
        except OSError:
            self.print_error(u"Cannot convert file '%s' into '%s'" % (input_file_path, output_file_path))
            self.print_error(u"Make sure the input file has a format supported by ffmpeg")

        return self.ERROR_EXIT_CODE
499819
def execute(self, compiled=None, path=None, use_eval=False, allow_show=True):
        """"""
        self.check_runner()
        if compiled is not None:
            if allow_show and self.show:
                print(compiled)
            if path is not None:  # path means header is included, and thus encoding must be removed
                compiled = rem_encoding(compiled)
            self.runner.run(compiled, use_eval=use_eval, path=path, all_errors_exit=(path is not None))
            self.run_mypy(code=self.runner.was_run_code())
881576
def do_execute(self):
        
        for i in range(
                int(self.resolve_option("min")),
                int(self.resolve_option("max")) + 1,
                int(self.resolve_option("step"))):
            self._output.append(Token(i))
        return None
300750
def execution():
    '''
    
    '''
    client = salt.client.get_local_client(__opts__['conf_file'])

    docs = {}
    try:
        for ret in client.cmd_iter('*', 'sys.doc', timeout=__opts__['timeout']):
            for v in six.itervalues(ret):
                docs.update(v)
    except SaltClientError as exc:
        print(exc)
        return []

    i = itertools.chain.from_iterable([six.iteritems(docs['ret'])])
    ret = dict(list(i))

    return ret
365298
def execute(self):
        
        last_operation = len(self._operations) - 1
        for i, operation in enumerate(self._operations):
            command = self._cmd(operation)

            if command.execute() is False:
                return False
            else:
                action = command.execute_post_archive_actions
                self._post_archive_actions.append(action)

                if i == last_operation:
                    return True
573498
def execute(self, request, target_route):
		
		presenter = self.create_presenter(request, target_route)
		presenter_name = target_route.presenter_name()
		action_name = target_route.presenter_action()
		presenter_args = target_route.presenter_args()

		if hasattr(presenter, action_name) is False:
			raise RuntimeError('No such action "%s" for "%s" presenter' % (action_name, presenter_name))

		action = getattr(presenter, action_name)
		if ismethod(action) is False:
			raise RuntimeError(
				'Unable to execute "%s" action for "%s" presenter' % (action_name, presenter_name)
			)

		args_spec = getfullargspec(action)
		defaults = len(args_spec.defaults) if args_spec.defaults is not None else 0
		action_args = list()
		action_kwargs = dict()

		for i in range(len(args_spec.args)):
			arg = args_spec.args[i]
			if arg == 'self':
				continue

			is_kwarg = i >= (len(args_spec.args) - defaults)

			if is_kwarg is False:
				action_args.append(presenter_args[arg])
			elif arg in presenter_args:
				action_kwargs[arg] = presenter_args[arg]

		return action(*action_args, **action_kwargs)
958129
def do_execute(self):
        
        directory = str(self.resolve_option("dir"))
        if not os.path.exists(directory):
            return "Directory '" + directory + "' does not exist!"
        if not os.path.isdir(directory):
            return "Location '" + directory + "' is not a directory!"
        collected = []
        result = self._list(directory, collected)
        if result is None:
            for c in collected:
                self._output.append(Token(c))
        return result
128919
def do_execute(self):
        
        for s in self.resolve_option("strings"):
            self._output.append(Token(s))
        return None