Return executable and any options to be executed by bootstrap
962449
def _WorkerCommand_executable(self):
        """"""
        worker = self.workersArguments

        c = []
        if worker.executable:
            c.append(worker.executable)
        # This trick is used to parse correctly quotes
        # (ie. myScript.py 'arg1 "arg2" arg3')
        # Because it is parsed by a shell, every quote gets re-interpreted.
        # It replaces simple quotation marks with \\\" which gets evaluated to
        # \" by the second shell which prints it out as a double quote.
        if worker.args:
            if self.isLocal():
                # If local, no shell is used so no escaping needed
                c.extend([
                    '{0}'.format(a) for a in worker.args
                ])
            else:
                c.extend([
                    '"{0}"'.format(a.replace('"', '\\\"')) for a in worker.args
                ])
        return c
1176070
def __find_executables(path):
    

    success = False
    progs = {
        "dot": "",
        "twopi": "",
        "neato": "",
        "circo": "",
        "fdp": "",
        "sfdp": "",
    }

    was_quoted = False
    path = path.strip()
    if path.startswith('"') and path.endswith('"'):
        path = path[1:-1]
        was_quoted = True

    if not os.path.isdir(path):
        return None

    for prg in progs:
        if progs[prg]:
            continue

        prg_path = os.path.join(path, prg)
        prg_exe_path = prg_path + ".exe"

        if os.path.exists(prg_path):
            if was_quoted:
                prg_path = "\"{}\"".format(prg_path)
            progs[prg] = prg_path
            success = True

        elif os.path.exists(prg_exe_path):
            if was_quoted:
                prg_exe_path = "\"{}\"".format(prg_exe_path)
            progs[prg] = prg_exe_path
            success = True

    if success:
        return progs

    return None
221821
function executable(value) {
      var result;
      try {
        result = resolve(task.apply(this, arguments));
      } catch (e) {
        result = reject(e);
      }
      return result;
    }
868053
protected function bootstrap()
    {
        if ($this->extensions === null) {
            $file = Zilf::getAlias('@vendor/Zilfsoft/extensions.php');
            $this->extensions = is_file($file) ? include $file : [];
        }
        foreach ($this->extensions as $extension) {
            if (!empty($extension['alias'])) {
                foreach ($extension['alias'] as $name => $path) {
                    Zilf::setAlias($name, $path);
                }
            }
            if (isset($extension['bootstrap'])) {
                $component = Zilf::createObject($extension['bootstrap']);
                if ($component instanceof BootstrapInterface) {
                    Zilf::debug('Bootstrap with ' . get_class($component) . '::bootstrap()', __METHOD__);
                    $component->bootstrap($this);
                } else {
                    Zilf::debug('Bootstrap with ' . get_class($component), __METHOD__);
                }
            }
        }

        foreach ($this->bootstrap as $mixed) {
            $component = null;
            if ($mixed instanceof \Closure) {
                Zilf::debug('Bootstrap with Closure', __METHOD__);
                if (!$component = call_user_func($mixed, $this)) {
                    continue;
                }
            } elseif (is_string($mixed)) {
                if ($this->has($mixed)) {
                    $component = $this->get($mixed);
                } elseif ($this->hasModule($mixed)) {
                    $component = $this->getModule($mixed);
                } elseif (strpos($mixed, '\\') === false) {
                    throw new InvalidConfigException("Unknown bootstrapping component ID: $mixed");
                }
            }

            if (!isset($component)) {
                $component = Zilf::createObject($mixed);
            }

            if ($component instanceof BootstrapInterface) {
                Zilf::debug('Bootstrap with ' . get_class($component) . '::bootstrap()', __METHOD__);
                $component->bootstrap($this);
            } else {
                Zilf::debug('Bootstrap with ' . get_class($component), __METHOD__);
            }
        }
    }
502972
async function bootTymly (options, messages) {
  const loadedComponents = loadComponents(
    options,
    messages
  )

  preBootTymlyRefResolution(
    loadedComponents,
    messages
  )

  const parsedServices = parseServices(
    loadedComponents,
    messages
  )

  const bootedServices = await bootServices(
    parsedServices,
    loadedComponents,
    options,
    messages
  )

  await postBootTymlyRefResolution(
    loadedComponents,
    bootedServices,
    messages
  )

  return bootedServices
}
1255758
function loadBootstrap(appPath, modules, type = 'worker') {
  let bootstrapPath = '';
  if (modules.length) {
    bootstrapPath = path.join(appPath, 'common/bootstrap');
  } else {
    bootstrapPath = path.join(appPath, 'bootstrap');
  }
  const filepath = path.join(bootstrapPath, `${type}.js`);
  if (helper.isFile(filepath)) {
    debug(`load file: ${filepath}`);
    return require(filepath);
  }
}
1013073
def main():
    
    # vars
    tar_file = TMPDIR + '/' + BINARY_URL.split('/')[-1]
    chksum = TMPDIR + '/' + MD5_URL.split('/')[-1]
    # pre-run validation + execution
    if precheck() and os_packages(distro.linux_distribution()):
        stdout_message('begin download')
        download()
        stdout_message('begin valid_checksum')
        valid_checksum(tar_file, chksum)
        return compile_binary(tar_file)
    logger.warning('%s: Pre-run dependency check fail - Exit' % inspect.stack()[0][3])
    return False
328883
def bootstrap():
    ""
    # Link files shared by subprojects
    debian = path("debian")
    debian.exists() or debian.makedirs()

    for shared in ("debian/changelog", "LICENSE"):
        path(shared).exists() or (path("..") / shared).link(shared)

    build()
265183
def find_executable(executable, path=None):
  
  if path is None:
    path = os.environ['PATH']
  paths = path.split(os.pathsep)
  base, ext = os.path.splitext(executable)

  if (sys.platform == 'win32' or os.name == 'os2') and (ext != '.exe'):
    executable = executable + '.exe'

  if not os.path.isfile(executable):
    for p in paths:
      f = os.path.join(p, executable)
      if os.path.isfile(f):
        # the file exists, we have a shot at spawn working
        return f
    return None
  else:
    return executable
182081
def main(self):
        '''
        
        '''
        self.status = self.parent.status
        self.modules = self.parent.executed_modules

        # A special exception for the extractor module, which should be allowed to
        # override the verbose setting, e.g., if --matryoshka has been
        # specified
        if hasattr(self, "extractor") and self.extractor.config.verbose:
            self.config.verbose = self.config.display.verbose = True

        if not self.config.files:
            binwalk.core.common.debug("No target files specified, module %s terminated" % self.name)
            return False

        self.reset_dependencies()

        try:
            self.init()
        except KeyboardInterrupt as e:
            raise e
        except Exception as e:
            self.error(exception=e)
            return False

        try:
            self.config.display.format_strings(self.HEADER_FORMAT, self.RESULT_FORMAT)
        except KeyboardInterrupt as e:
            raise e
        except Exception as e:
            self.error(exception=e)
            return False

        self._plugins_pre_scan()

        try:
            retval = self.run()
        except KeyboardInterrupt as e:
            raise e
        except Exception as e:
            self.error(exception=e)
            return False

        self._plugins_post_scan()

        return retval
1106973
def python_executable(self):
        """"""
        return self.get(property_name='python_executable',
                        default=sys.executable or os.path.join(self.install_prefix, 'bin', 'python'))
809221
def run_executable(exec, options)
      script_href = "right_script_href="+exec.href
      # Construct the parameters to pass for the inputs
      params=options.collect { |k, v|
        "&inputs[][name]=#{k}&inputs[][value]=#{v}" unless k == :ignore_lock
        }.join('&')

      if options[:ignore_lock]
        params+="&ignore_lock=true"
      end
      # self is the actual Server object
      Log.debug "[#{Chimp.get_job_uuid}] Running executable"
      task = self.object.run_executable(script_href + params)
      return task
    end
355919
def main(name, output, font):
    

    # The path of the directory where the final files will end up in
    bootstrapped_directory = os.getcwd() + os.sep + name.lower().replace(' ', '-') +  os.sep

    # Copy the template files to the target directory
    copy_tree(get_real_path(os.sep + 'my-cool-os-template'), bootstrapped_directory)

    # Create the necessary assembly mov instructions for printing out the output on boot
    start_byte = int('0xb8000', 16)
    instructions_list = []

    for c in output:
        char_as_hex = '0x02'+ c.encode('hex')
        instructions_list.append('\tmov word [{0}], {1} ; {2}'.format(hex(start_byte), char_as_hex, c))
        start_byte += 2

    # Render the ASCII banner to be displayed in the README (A must for any serious hobby OS project!)
    banner = Figlet(font=font).renderText(name)

    render_template_file(bootstrapped_directory  + 'README.md', {'name' : name, 'banner' : banner})
    render_template_file(bootstrapped_directory  + 'grub.cfg' , {'name' : name})
    render_template_file(bootstrapped_directory  + 'boot.asm' , {'instructions_list' : instructions_list})

    print('finished bootstrapping project into directory ' + bootstrapped_directory)
668867
def bootstrap_app():
    '''
    
    '''
    from salt.netapi.rest_cherrypy import app
    import salt.config

    __opts__ = salt.config.client_config(
            os.environ.get('SALT_MASTER_CONFIG', '/etc/salt/master'))
    return app.get_app(__opts__)
1141158
function bootstrap(next) {
      if (!options.commands || !options.commands.length) {
        return next();
      }

      var hasErr;

      self.ssh({
        keys: options.keys,
        server: options.server,
        commands: options.commands,
        remoteUser: options.remoteUser,
        tunnel: options.tunnel
      }).on('error', function (err) {
        if (!hasErr) {
          hasErr = true;
          next(err);
        }
      }).on('complete', function (server, stdout) {
        if (!hasErr) {
          next(null, stdout);
        }
      });
    }
1304995
def get_bootstrap(cls, name, ctx):
        '''
        '''
        if name is None:
            return None
        if not hasattr(cls, 'bootstraps'):
            cls.bootstraps = {}
        if name in cls.bootstraps:
            return cls.bootstraps[name]
        mod = importlib.import_module('pythonforandroid.bootstraps.{}'
                                      .format(name))
        if len(logger.handlers) > 1:
            logger.removeHandler(logger.handlers[1])
        bootstrap = mod.bootstrap
        bootstrap.bootstrap_dir = join(ctx.root_dir, 'bootstraps', name)
        bootstrap.ctx = ctx
        return bootstrap
605104
def create(cls, bootstrap_options):
    
    binary_tool_fetcher = BinaryToolFetcher(
      bootstrap_dir=bootstrap_options.pants_bootstrapdir,
      timeout_secs=bootstrap_options.binaries_fetch_timeout_secs)
    binary_util = BinaryUtil(
      baseurls=bootstrap_options.binaries_baseurls,
      binary_tool_fetcher=binary_tool_fetcher,
      path_by_id=bootstrap_options.binaries_path_by_id,
      allow_external_binary_tool_downloads=bootstrap_options.allow_external_binary_tool_downloads)

    return WatchmanLauncher(
      binary_util,
      bootstrap_options.level,
      bootstrap_options.watchman_version,
      bootstrap_options.watchman_supportdir,
      bootstrap_options.watchman_startup_timeout,
      bootstrap_options.watchman_socket_timeout,
      bootstrap_options.watchman_socket_path,
      bootstrap_options.pants_subprocessdir
    )