Execute a named command with the supplied args
356647
function(name, args){
      name = arguments[0];
      args = Array.prototype.slice.call(arguments, 1);

      if (this.hasHandler(name)){
        this.getHandler(name).apply(this, args);
      } else {
        this.storage.addCommand(name, args);
      }

    }
871573
def execute_command(command):
    """"""

    command = shlex.split(command)
    try:
        process = subprocess.Popen(
            command,
            stdin=subprocess.PIPE,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
        )
    except FileNotFoundError:
        raise RuntimeError("Command not found: {}".format(repr(command)))
    process.wait()
    # TODO: may use another codec to decode
    if process.returncode > 0:
        stderr = process.stderr.read().decode("utf-8")
        raise ValueError("Error executing command: {}".format(repr(stderr)))
    return process.stdout.read().decode("utf-8")
1289208
def call(self, name, options=None, o=None):
        
        if options is None:
            options = []

        command = self.get_application().find(name)

        options = [('command', command.get_name())] + options

        return command.run(ListInput(options), o)
1342717
def cmd_wrapper(cmd_name, **kwds):
    """"""
    cmd = si.Commands(cmd_name)
    if not cmd:
        raise Exception(cmd_name + " doesnt found!")
    for arg in cmd.Arguments:
        value = kwds.get(arg.Name)
        if value:
            arg.Value = value
    return cmd.Execute()
174181
def _execute(self, *args: str, **kwargs) -> tuple:
        ''''''
        process = self.execute(
            args=args, options=merge_dict(self.options, kwargs))
        command = ' '.join(process.args)
        if self._dev:
            output, error = process.communicate()
            print(
                "Debug Information",
                "Command: {!r}".format(command),
                "Output: {!r}".format(output.encode('utf-8')),
                "Error: {!r}".format(error.encode('utf-8')),
                sep='\n', end='\n{}\n'.format('=' * 80)
            )
        return process.communicate()
804153
def cmd(self, args=None, interact=True):
        """"""
        if args is None:
            parsed_args = arguments.parse_args()
        else:
            parsed_args = arguments.parse_args(args)
        self.exit_code = 0
        with self.handling_exceptions():
            self.use_args(parsed_args, interact, original_args=args)
        self.exit_on_error()
1245374
function execute(args) {
    try {
        const currentOptions = options.parse(args)
        return executeOptions(currentOptions)
    } catch (error) {
        console.error(error.message)
        return 1
    }
}
821505
function execute(/*args*/) {

  const command = prepare_command(arguments);
  ensure_executable(command);
  create_result_file_name(command);

  return platform.execute(command)
  //Handle Results
  .then(() => new Promise((resolve,reject) => {

    const results = get_results(command);
    if (results == null)
      resolve();

    if (is(results, Error))
      reject(Errors.NoResult);

    if (is(results.returned, Error))
      reject(new AfterEffectsError(results.returned.message));
    else
      resolve(results.returned);
  }));
}
934054
def run (cmd, verbosity=0, **kwargs):
    """"""
    # Note that shell_quote_nt() result is not suitable for copy-paste
    # (especially on Unix systems), but it looks nicer than shell_quote().
    if verbosity >= 0:
        log_info("running %s" % " ".join(map(shell_quote_nt, cmd)))
    if kwargs:
        if verbosity >= 0:
            log_info("    with %s" % ", ".join("%s=%s" % (k, shell_quote(str(v)))\
                                           for k, v in kwargs.items()))
        if kwargs.get("shell"):
            # for shell calls the command must be a string
            cmd = " ".join(cmd)
    if verbosity < 1:
        # hide command output on stdout
        with open(os.devnull, 'wb') as devnull:
            kwargs['stdout'] = devnull
            res = subprocess.call(cmd, **kwargs)
    else:
        res = subprocess.call(cmd, **kwargs)
    return res
1043013
def run(self, argv):
        """"""
        command = argv[0]
        handlers = { 
            'clean': self.clean,
            'create': self.create,
            'disable': self.disable,
            'enable': self.enable,
            'list': self.list,
            'update': self.update,
        }
        handler = handlers.get(command, None)
        if handler is None:
            error("Unrecognized command: %s" % command, 2)
        handler(argv[1:])
324329
def _execute(self, *args: str, **kwargs: Any) -> tuple:
        ''''''
        return self.execute(args=args, options=merge_dict(self.options, kwargs)).communicate()
533686
def _execute(self,
                 command,        # type: str
                 args,           # type: List[str]
                 env_vars=None,  # type: EnvVars
                 shim=None       # type: OptStr
                 ):
        # type: (...) -> Tuple[int, bytes, bytes]
        """"""
        main_args = [command] + args
        logger.debug("calling pip %s", ' '.join(main_args))
        rc, out, err = self._wrapped_pip.main(main_args, env_vars=env_vars,
                                              shim=shim)
        return rc, out, err
570293
def run_cmd(call, cmd, *, echo=True, **kwargs):
    """"""
    if echo:
        print('$> ' + ' '.join(map(pipes.quote, cmd)))
    return call(cmd, **kwargs)
696384
def execute(*args, **kwargs):
    """"""
    if kwargs:
        # TODO: Remove this when pyntcontrib's execute does this
        args = list(args)
        args.extend(_kwargs_to_execute_args(kwargs))
    _execute(*args)
136842
def _execute_command(cmd, at_time=None):
    '''
    
    '''
    if at_time:
        cmd = 'echo \'{0}\' | at {1}'.format(cmd, _cmd_quote(at_time))
    return not bool(__salt__['cmd.retcode'](cmd, python_shell=True))
131496
def _execute(cmd):
        """"""
        cmd_parts = shlex.split(cmd)
        if sys.version_info[0] < 3:

            cmd_parts = shlex.split(cmd.encode('ascii'))

        proc = subprocess.Popen(
            cmd_parts,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
        )
        out, err = proc.communicate()
        if proc.returncode != 0:

            raise subprocess.CalledProcessError(
                returncode=proc.returncode,
                cmd=cmd,
                output=err,
            )

        return CommandResult(
            code=proc.returncode,
            out=out.decode('utf8'),
            err=err.decode('utf8'),
        )
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