Append san executable os command to the list to be called.

        Argument:
          executable (str): os callable executable.
162379
def append_executable(self, executable):
        
        if isinstance(executable, str) and not isinstance(executable, unicode):
            executable = unicode(executable)
        if not isinstance(executable, unicode):
            raise TypeError("expected executable name as str, not {}".
                            format(executable.__class__.__name__))
        self._executables.append(executable)
1142833
public static Execed appAs(String as, Iterable<String> command) throws IOException
	{
		Exec e = new Exec(command);
		if (as != null)
			e.runAs(as);
		e.setRedirectError(false);

		return e.start();
	}
528680
def executable(name)
      define_method(name) do |*command|
        Executable.execute_command(name, Array(command).flatten, false)
      end

      define_method(name.to_s + '!') do |*command|
        Executable.execute_command(name, Array(command).flatten, true)
      end
    end
468654
def exec_cmd(self, command, **kwargs):
        

        if command == 'load':
            if kwargs:
                kwargs = dict(options=[kwargs])
        return self._exec_cmd(command, **kwargs)
695168
def make_executable(path_str):
  ''' 
  '''
  try:
    mode = os.stat(path_str).st_mode
    os.chmod(path_str, mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
  except Exception as e:
    print 'Exception: %s' % e
    return None
  return path_str
390316
def cmdline(executable):
    

    args = [executable.executable]
    indexed_args = []

    for parameter in executable:

        optional = (parameter.type == 'boolean') or parameter.default
        has_value = parameter.type != 'boolean'


        if parameter.longflag:  # use longflag where possible
            flag = "--%s" % parameter.longflag
        elif parameter.flag:
            flag = "-%s VALUE" % parameter.flag
        elif parameter.index:
            flag = parameter.name
            optional = False


        if has_value:
            flag += " VALUE"

        if optional:
            flag = "[" + flag + "]"

        if parameter.index:
            indexed_args.insert(int(parameter.index), flag)
        else:
            args.append(flag)

    return args + indexed_args
845265
def _extcap_call(prog, args, keyword, values):
    """"""
    p = subprocess.Popen(
        [prog] + args,
        stdout=subprocess.PIPE, stderr=subprocess.PIPE
    )
    data, err = p.communicate()
    if p.returncode != 0:
        raise OSError("%s returned with error code %s: %s" % (prog,
                                                              p.returncode,
                                                              err))
    data = plain_str(data)
    res = []
    for ifa in data.split("\n"):
        ifa = ifa.strip()
        if not ifa.startswith(keyword):
            continue
        res.append(tuple([re.search(r"{%s=([^}]*)}" % val, ifa).group(1)
                   for val in values]))
    return res
401448
def chmod_add_executable(fpath, group=True, user=True):
    
    import stat
    orig_mode = os.stat(fpath).st_mode
    new_mode = orig_mode
    if group:
        new_mode |= stat.S_IXGRP
    if user:
        # new_mode |= stat.S_IXUSR | stat.S_IEXEC
        new_mode |= stat.S_IXGRP | stat.S_IEXEC
    os.chmod(fpath, new_mode)
1171962
def execute(cls, command, shell=True):
        
        cls.debug('execute command (shell flag:%r): %r ' % (shell, command))
        try:
            check_call(command, shell=shell)
            return True
        except CalledProcessError:
            return False
1200099
function executable(file) {
  try {
    fs.accessSync(file, fs.X_OK);
    return true;
  } catch (e) {
    return false;
  }
}
329647
def is_executable(command):
    """"""

    paths = os.environ.get("PATH", "").split(os.path.pathsep)
    candidates = [command] + [os.path.join(p, command) for p in paths]
    return any(os.access(path, os.X_OK) for path in candidates)
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)
925570
def call(exe, *argv):
    
    exes = which(exe)
    if not exes:
        returnValue(None)
    stdout, stderr, value = yield getProcessOutputAndValue(
        exes[0], argv, env=os.environ.copy()
    )
    if value:
        returnValue(None)
    returnValue(stdout.decode('utf-8').rstrip('\n'))
115157
def _get_args_for_reloading():
    
    rv = [sys.executable]
    py_script = sys.argv[0]
    if os.name == 'nt' and not os.path.exists(py_script) and \
       os.path.exists(py_script + '.exe'):
        py_script += '.exe'
    rv.append(py_script)
    rv.extend(sys.argv[1:])
    return rv
1246091
def _exec_callers(xinst, result):
    
    for depkey, depval in xinst.dependencies.items():
        if depval.target is not None:
            if depval.target.name in result:
                if xinst not in result[depval.target.name]:
                    result[depval.target.name].append(xinst)
            else:
                result[depval.target.name] = [xinst]

    for xname, xvalue in xinst.executables:
        _exec_callers(xvalue, result)
1041232
def execute(self, arg_list):
        
        arg_map = self.parser.parse_args(arg_list).__dict__
        command = arg_map.pop(self._COMMAND_FLAG)
        return command(**arg_map)
182738
def shell(args, wait=True, msg=None):
    

    # Fix Windows error if passed a string
    if isinstance(args, str):
        args = shlex.split(args, posix=(os.name != "nt"))
        if os.name == "nt":
            args = [arg.replace('/', '\\') for arg in args]

    if wait:
        proc = Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE)
        out, err = proc.communicate(input=msg)
        exitcode = proc.returncode
        if exitcode != 0:
            raise IOError(err)
        return out
    else:
        DETACHED_PROCESS = 0x00000008
        proc = Popen(args, creationflags=DETACHED_PROCESS)