low level Callback used for running commands
548518
def command_run_callback(id, buffer, command)
      Weechat::Hooks::CommandRunHook.find_by_id(id).call(Weechat::Buffer.from_ptr(buffer), command)
    end
229360
function (cmd, cwd, callback) {
    var async = typeof callback === 'function';

    var result = exec(
        cmd,
        {cwd: cwd},
        async ? callback : undefined
    );

    return result.code !== 0 && !async ? result.stdout : undefined;
}
1095274
def _run_cmd(cmd):
    """"""
    if not os.path.exists(cmd[0]):
        cmd[0] = shutil.which(cmd[0])
        assert cmd[0] is not None

    shebang_parts = parseshebang.parse(cmd[0])

    proc = subprocess.Popen(shebang_parts + cmd,
                            stdout=subprocess.PIPE,
                            stderr=subprocess.PIPE)
    stdout, stderr = proc.communicate()
    return {
        "stdout": stdout,
        "stderr": stderr,
        "code": proc.returncode
    }
217510
def call(cmd, shell=True, **kwargs):
    "  "

    LOGGER.debug("Cmd: %s" % cmd)
    check_call(cmd, shell=shell, stdout=LOGFILE_HANDLER.stream, **kwargs)
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
27831
def node_cmd(cmd_name, node_dict):
    """"""
    sc = {"run": cmd_startstop, "stop": cmd_startstop,
          "connect": cmd_connect, "details": cmd_details}
    node_num = node_selection(cmd_name, len(node_dict))
    refresh_main = None
    if node_num != 0:
        (node_valid, node_info) = node_validate(node_dict, node_num, cmd_name)
        if node_valid:
            sub_cmd = sc[cmd_name]  # get sub-command
            refresh_main = sub_cmd(node_dict[node_num], cmd_name, node_info)
        else:  # invalid target
            ui_print_suffix(node_info, C_ERR)
            sleep(1.5)
    else:  # '0' entered - exit command but not program
        ui_print(" - Exit Command")
        sleep(0.5)
    return refresh_main
1372109
def shell_command(cmd, dry_run=False):
    
    if cmd[0] == '/usr/bin/rsync':
        if dry_run:
            cmd = [cmd[0], '-n'] + cmd[1:]
        LOGGER.info('run: %s', ' '.join(cmd))
        subprocess.check_call(cmd)
    else:
        LOGGER.info('run: %s', ' '.join(cmd))
        if not dry_run:
            subprocess.check_call(cmd)
1034124
def _run_atstart():
    ''''''
    global _atstart
    for callback, args, kwargs in _atstart:
        callback(*args, **kwargs)
    del _atstart[:]
1104768
def silent(cmd, **kwargs):
    
    return call(cmd, shell=True, stdout=NULL, stderr=NULL, **kwargs)
343783
def runctx(self, cmd, globals, locals):
        
        self.enable_by_count()
        try:
            exec(cmd, globals, locals)
        finally:
            self.disable_by_count()
        return self
89262
def runctx(self, cmd, globals, locals):
        """"""
        with self():
            exec(cmd, globals, locals)
        return self
81634
def call_command(self, cmdname, **kw):
        """"""
        for dirname in INSTALL_DIRECTORY_ATTRS:
            kw.setdefault(dirname, self.bdist_dir)
        kw.setdefault('skip_build', self.skip_build)
        kw.setdefault('dry_run', self.dry_run)
        cmd = self.reinitialize_command(cmdname, **kw)
        self.run_command(cmdname)
        return cmd
380290
function run(params, command, callback)
{
  var terminator
    , requiresContext = isArrowFunction(command)
    ;

  // make sure callback is invoked in real async way
  callback = async(callback);

  // check provided function if it expected
  // to be run in async or sync way

  // expects no arguments, run it as sync function
  // unless it's function straight outta factory
  // has `.commandDescription` property
  //
  // Or it has one argument and requires context
  // must be arrow function with `context` argument
  if ((command.length === 0 || (command.length === 1 && requiresContext)) && !command.commandDescription)
  {
    runSync(this, command, callback);
  }
  else // or run it as async
  {
    // async function may return terminator function
    terminator = runAsync(this, command, callback);
  }

  // return provided terminator or empty function
  // if there is none
  return terminator || function() {};
}
348087
def run(cmd, input=None, capture_output=False, check=False, quiet=False, **kwargs):
    """"""
    if input is not None:
        kwargs['stdin'] = subprocess.PIPE
    if capture_output:
        kwargs['stdout'] = kwargs['stderr'] = subprocess.PIPE

    try:
        proc = subprocess.Popen(cmd, startupinfo=get_startupinfo(), **kwargs)
    except OSError as e:
        if e.errno == errno.ENOENT:
            raise ExecutableNotFound(cmd)
        else:
            raise

    out, err = proc.communicate(input)

    if not quiet and err:
        stderr_write_bytes(err, flush=True)
    if check and proc.returncode:
        raise CalledProcessError(proc.returncode, cmd, output=out, stderr=err)

    return out, err
604000
def execute_callback(callback, *args)
      (callback.arity == 2 ? callback.call(*args[0, 2]) : callback.call(*args)) if callback
    end
993173
function run(cmd) {
        return function (callback, options) {
            grunt.verbose.or.ok("Executing " + cmd);
            exec(cmd, options || {}, function (error, stdout, stderr) {
                if (error) {
                    grunt.fatal("'" + cmd + "' failed with :" + stderr);
                } else {
                    grunt.verbose.writeln("Result of " + cmd + ':\n' + stdout);
                    callback();
                }
            });
        };
    }
503361
function execute(command, callback){
  exec(command, function(error, stdout, stderr){ callback(error, stdout); });
}