execute titanium commands
189234
function execCommand(command, options, callback) {
		var args = [],
			extraArgs = (options.args || []).slice(0),
			preferGlobal = options.preferGlobal || false,
			srcSuccess = options.success,
			srcFailure = options.failure,
			success, failure;

		// remove processed options
		delete options.args;
		delete options.command;
		delete options.failure;
		delete options.preferGlobal;
		delete options.success;

		// must have output to satisfy success/failure conditions
		if (srcSuccess || srcFailure) {
			delete options.quiet;
		}

		// determine succes and failure types
		if (_.isRegExp(srcSuccess)) {
			success = function(data) { return srcSuccess.test(data); };
		} else if (_.isString(srcSuccess)) {
			success = function(data) { return data.toString().indexOf(srcSuccess) !== -1; };
		} else if (_.isFunction(srcSuccess)) {
			success = srcSuccess;
		} else if (!!success) {
			success = undefined;
			grunt.fail.warn('invalid type for success option, must be string, regexp, or function');
		}

		if (_.isRegExp(srcFailure)) {
			failure = function(data) { return srcFailure.test(data); };
		} else if (_.isString(srcFailure)) {
			failure = function(data) { return data.toString().indexOf(srcFailure) !== -1; };
		} else if (_.isFunction(srcFailure)) {
			failure = srcFailure;
		} else if (!!failure) {
			failure = undefined;
			grunt.fail.warn('invalid type for failure option, must be string, regexp, or function');
		}

		// create the list of command arguments
		Object.keys(options).forEach(function(key) {
			var value = options[key],
				isBool = _.isBoolean(value);
			if (!isBool || (isBool && !!value)) {
				args.push(camelCaseToDash(key));
			}
			if (!isBool) { args.push(value); }
		});
		args.unshift(command);

		// add non-option, non-flag arguments
		args = args.concat(extraArgs);

		// spawn command and output
		grunt.log.writeln('titanium ' + args.join(' '));
		var tiOpts = process.env.GRUNT_TITANIUM_TEST || success || failure ?
				{} : {stdio: 'inherit'},
			ti = spawn(getTitaniumPath(preferGlobal), args, tiOpts);

		// prepare functions for killing this process
		function killer(data) {
			grunt.log.write(data);
			if (ti.killed) {
				return;
			} else if (success && success(data)) {
				ti.kill();
				grunt.log.ok('titanium run successful');
			} else if (failure && failure(data)) {
				ti.kill();
				grunt.fail.warn('titanium run failed');
			}
		}

		// listen for success or failure conditions
		if (success || failure) {
			ti.stdout.on('data', killer);
			ti.stderr.on('data', killer);
		}

		// handle titanium's exit
		ti.on('close', function(code) {
			if (command !== 'build' || options.buildOnly) {
				if (code) {
					grunt.fail.fatal('titanium ' + command + ' failed.');
				} else {
					grunt.log.ok('titanium ' + command + ' complete.');
				}
			}
			return callback(ti.killed ? null : code);
		});

		// write output to a file for analysis in test specs
		if (process.env.GRUNT_TITANIUM_TEST) {
			var testFile = path.resolve('tmp', preferGlobal ? 'tmp_global.txt' : 'tmp.txt');
			grunt.file.mkdir(path.dirname(testFile));
			fs.writeFileSync(testFile, '');
			ti.stdout.on('data', function(data) {
				fs.appendFileSync(testFile, data);
			});
		}
	}
343783
def runctx(self, cmd, globals, locals):
        
        self.enable_by_count()
        try:
            exec(cmd, globals, locals)
        finally:
            self.disable_by_count()
        return self
75273
def execute(self, args):
        
        import colorama

        self.cli_ctx.raise_event(EVENT_INVOKER_PRE_CMD_TBL_CREATE, args=args)
        cmd_tbl = self.commands_loader.load_command_table(args)
        command = self._rudimentary_get_command(args)
        self.cli_ctx.invocation.data['command_string'] = command
        self.commands_loader.load_arguments(command)

        self.cli_ctx.raise_event(EVENT_INVOKER_POST_CMD_TBL_CREATE, cmd_tbl=cmd_tbl)
        self.parser.load_command_table(self.commands_loader)
        self.cli_ctx.raise_event(EVENT_INVOKER_CMD_TBL_LOADED, parser=self.parser)

        arg_check = [a for a in args if a not in ['--verbose', '--debug']]
        if not arg_check:
            self.cli_ctx.completion.enable_autocomplete(self.parser)
            subparser = self.parser.subparsers[tuple()]
            self.help.show_welcome(subparser)
            return CommandResultItem(None, exit_code=0)

        if args[0].lower() == 'help':
            args[0] = '--help'

        self.cli_ctx.completion.enable_autocomplete(self.parser)

        self.cli_ctx.raise_event(EVENT_INVOKER_PRE_PARSE_ARGS, args=args)
        parsed_args = self.parser.parse_args(args)
        self.cli_ctx.raise_event(EVENT_INVOKER_POST_PARSE_ARGS, command=parsed_args.command, args=parsed_args)

        self._validation(parsed_args)

        # save the command name (leaf in the tree)
        self.data['command'] = parsed_args.command
        cmd = parsed_args.func
        if hasattr(parsed_args, 'cmd'):
            parsed_args.cmd = cmd
        deprecations = getattr(parsed_args, '_argument_deprecations', [])
        if cmd.deprecate_info:
            deprecations.append(cmd.deprecate_info)

        params = self._filter_params(parsed_args)

        # search for implicit deprecation
        path_comps = cmd.name.split()[:-1]
        implicit_deprecate_info = None
        while path_comps and not implicit_deprecate_info:
            implicit_deprecate_info = resolve_deprecate_info(self.cli_ctx, ' '.join(path_comps))
            del path_comps[-1]

        if implicit_deprecate_info:
            deprecate_kwargs = implicit_deprecate_info.__dict__.copy()
            deprecate_kwargs['object_type'] = 'command'
            del deprecate_kwargs['_get_tag']
            del deprecate_kwargs['_get_message']
            deprecations.append(ImplicitDeprecated(**deprecate_kwargs))

        colorama.init()
        for d in deprecations:
            print(d.message, file=sys.stderr)
        colorama.deinit()

        cmd_result = parsed_args.func(params)
        cmd_result = todict(cmd_result)

        event_data = {'result': cmd_result}
        self.cli_ctx.raise_event(EVENT_INVOKER_TRANSFORM_RESULT, event_data=event_data)
        self.cli_ctx.raise_event(EVENT_INVOKER_FILTER_RESULT, event_data=event_data)

        return CommandResultItem(event_data['result'],
                                 exit_code=0,
                                 table_transformer=cmd_tbl[parsed_args.command].table_transformer,
                                 is_query_active=self.data['query_active'])
221046
def execute(self, *, args: Union[list, tuple], options: dict) -> tuple:
        ''''''
        cmd = self._build_cmd(args)
        process = subprocess.Popen(cmd, stdout=PIPE, stderr=PIPE, stdin=PIPE,
                                   encoding='utf-8', shell=options.get('shell', False), env=options.get('env'))
        return process
1191975
function execute(args){
    var options = optionator.parse(args);

    if(options.help){
        console.log(optionator.generateHelp());
    }
    else if(options.version){
        console.log("v" + require("../package.json").version);
    }
    else{
        printResults(loadPerf(options));
    }
}
1187834
def execute_command(self, request, command, frame):
        """"""
        return Response(frame.console.eval(command), mimetype="text/html")
830638
def _execute(self, *args):
        
        command = (
            [
                'task',
                'rc:%s' % self.config_filename,
            ]
            + self.get_configuration_override_args()
            + [six.text_type(arg) for arg in args]
        )

        # subprocess is expecting bytestrings only, so nuke unicode if present
        # and remove control characters
        for i in range(len(command)):
            if isinstance(command[i], six.text_type):
                command[i] = (
                    taskw.utils.clean_ctrl_chars(command[i].encode('utf-8')))

        try:
            proc = subprocess.Popen(
                command,
                stdout=subprocess.PIPE,
                stderr=subprocess.PIPE,
            )
            stdout, stderr = proc.communicate()
        except OSError as e:
            if e.errno == errno.ENOENT:
                raise OSError("Unable to find the 'task' command-line tool.")
            raise

        if proc.returncode != 0:
            raise TaskwarriorError(command, stderr, stdout, proc.returncode)

        # We should get bytes from the outside world.  Turn those into unicode
        # as soon as we can.
        # Everything going into and coming out of taskwarrior *should* be
        # utf-8, but there are weird edge cases where something totally unusual
        # made it in.. so we need to be able to handle (or at least try to
        # handle) whatever.  Kitchen tries its best.
        try:
            stdout = stdout.decode(self.config.get('encoding', 'utf-8'))
        except UnicodeDecodeError as e:
            stdout = kitchen.text.converters.to_unicode(stdout)
        try:
            stderr = stderr.decode(self.config.get('encoding', 'utf-8'))
        except UnicodeDecodeError as e:
            stderr = kitchen.text.converters.to_unicode(stderr)

        # strip any crazy terminal escape characters like bells, backspaces,
        # and form feeds
        for c in ('\a', '\b', '\f', ''):
            stdout = stdout.replace(c, '?')
            stderr = stderr.replace(c, '?')

        return stdout, stderr
921289
def execute():
    """"""

    if len(sys.argv) <= 1:
        raise SystemExit(
            'No Arguments provided. use [--help] for more information.'
        )

    # Capture user arguments
    _args = arguments.ArgumentParserator(
        arguments_dict=turbolift.ARGUMENTS,
        env_name='TURBO',
        epilog=turbolift.VINFO,
        title='Turbolift',
        detail='Multiprocessing Swift CLI tool.',
        description='Manage Swift easily and fast.'
    )
    user_args = _args.arg_parser()
    user_args['run_indicator'] = True
    debug_log = False
    stream_logs = True

    # Load system logging
    if user_args.get('debug'):
        debug_log = True
        user_args['run_indicator'] = False

    # Load system logging
    if user_args.get('quiet'):
        stream_logs = False
        user_args['run_indicator'] = False

    _logging = logger.LogSetup(
        debug_logging=debug_log,
        colorized_messages=user_args.get('colorized', False)
    )
    _logging.default_logger(name='turbolift', enable_stream=stream_logs)
    job = worker.Worker(job_args=user_args)
    job.run_manager()
125629
def command(epilog=None, help=None, width=140, **attrs):
    """"""
    if epilog is None:
        epilog = _get_caller_doc()
    attrs = settings(epilog=epilog, help=help, width=width, **attrs)
    return click.command(**attrs)
943333
def execute_command(self, cmd, params=None, callback=None, raw=False):
        '''
        
        '''
        def execute_with_callbacks(cmd, params=None, callback=None, raw=False):
            code, params = self.send_command(cmd, params, raw)
            if callback:
                callback(code, params)
            return code, params

        if self.daemon:
            t = Thread(target=execute_with_callbacks,
                    args=(cmd, ), kwargs={'params':params, 'callback':callback, 'raw':raw})
            t.daemon = True
            t.start()
        else:
            return execute_with_callbacks(cmd, params, callback, raw)
866647
def run(self, command, variables=[], board=None, packages=[]):
        """"""

        # -- Check for the SConstruct file
        if not isfile(util.safe_join(util.get_project_dir(), 'SConstruct')):
            variables += ['-f']
            variables += [util.safe_join(
                util.get_folder('resources'), 'SConstruct')]
        else:
            click.secho('Info: use custom SConstruct file')

        # -- Resolve packages
        if self.profile.check_exe_default():
            # Run on `default` config mode
            if not util.resolve_packages(
              packages,
              self.profile.packages,
              self.resources.distribution.get('packages')
             ):
                # Exit if a package is not installed
                raise Exception
        else:
            click.secho('Info: native config mode')

        # -- Execute scons
        return self._execute_scons(command, variables, board)
876731
def run_module_command(cmd_list, env_vars, exit_on_error=True):
    """"""
    if exit_on_error:
        try:
            subprocess.check_call(cmd_list, env=env_vars)
        except subprocess.CalledProcessError as shelloutexc:
            sys.exit(shelloutexc.returncode)
    else:
        subprocess.check_call(cmd_list, env=env_vars)
785636
function execute(req, res) {
  var t = systime();
  res.send(null, [t.s, t.m]);
}
1331991
def execute(state, host, callback, *args, **kwargs):
    '''
    
    '''

    # COMPAT w/ <0.4
    # TODO: remove this function

    logger.warning((
        'Use of `python.execute` is deprecated, '
        'please use `python.call` instead.'
    ))

    # Pre pyinfra 0.4 the operation execution passed (state, host, host.name)
    # as args, so here we replicate that - hence ``python.call`` which replaces
    # this function going forward.
    args = (host.name,) + args

    yield (callback, args, kwargs)
774621
def cli(ctx, list, dir, files, project_dir, sayno):
    """"""

    exit_code = 0

    if list:
        exit_code = Examples().list_examples()
    elif dir:
        exit_code = Examples().copy_example_dir(dir, project_dir, sayno)
    elif files:
        exit_code = Examples().copy_example_files(files, project_dir, sayno)
    else:
        click.secho(ctx.get_help())
        click.secho(Examples().examples_of_use_cad())

    ctx.exit(exit_code)
699680
def execute(self, args):
        """"""
        _run_atstart()
        hook_name = os.path.basename(args[0])
        if hook_name in self._hooks:
            try:
                self._hooks[hook_name]()
            except SystemExit as x:
                if x.code is None or x.code == 0:
                    _run_atexit()
                raise
            _run_atexit()
        else:
            raise UnregisteredHookError(hook_name)
808395
def execute_code(self, lines, current_client=True, clear_variables=False):
        """"""
        sw = self.get_current_shellwidget()
        if sw is not None:
            if sw._reading:
                pass
            else:
                if not current_client:
                    # Clear console and reset namespace for
                    # dedicated clients
                    # See issue 5748
                    try:
                        sw.sig_prompt_ready.disconnect()
                    except TypeError:
                        pass
                    sw.reset_namespace(warning=False)
                elif current_client and clear_variables:
                    sw.reset_namespace(warning=False)
                # Needed to handle an error when kernel_client is none
                # See issue 6308
                try:
                    sw.execute(to_text_string(lines))
                except AttributeError:
                    pass
            self.activateWindow()
            self.get_current_client().get_control().setFocus()