for all the binaries in the path, setup a proxy function with the binary's name that will execute it.
495465
function addBinaries(binaries) {
	var SLICE = Array.prototype.slice;
	//iterate backwards to mimic normal resolution order
	for (var i = binaries.length-1; i >= 0; i--) {
		var parts = binaries[i].split('/');
		(function() {var name = parts[parts.length-1];
		exports[name] = function() {

			//grab the last argument, which might be a callback

			var cbs = SLICE.call(arguments, 3);
			//assume none of the args we got were handlers
			var args = SLICE.call(arguments);
			var argLength = args.length;
		
			var cb, stdoutHandler, stderrHandler, options;
			if (args[argLength-3] instanceof Function) {
				//we have all 3
				stderrHandler = args.pop();
				stdoutHandler = args.pop();
				cb = args.pop();
			} else if (arguments[argLength-2] instanceof Function) {
				//we have cb and stdout 
				stdoutHandler = args.pop();
				cb = args.pop();
			} else if (arguments[argLength-1] instanceof Function) {
				//we have cb only
				cb = args.pop();
			}

			//if the last arg is an object, it's the options object
			var lastArg = args[args.length-1];
			if (typeof lastArg == 'object' && !lastArg.length) {
				options = args.pop();
			}
			//if the first argument was an array, the args were passed as
			//an array
			if (args[0] instanceof Array) {
				args = args[0];
			}
			
			return runCommand(name, args, options, cb, stdoutHandler, stderrHandler);

		};})();
	}
}
950816
def _set_relative_pythonpath(self, value):
        """"""
        self.pythonpath = [osp.abspath(osp.join(self.root_path, path))
                           for path in value]
1325067
def register_from_dir(cls, dir_path, prefix=''):
        

        for filename in os.listdir(dir_path):
            name, file_ext = os.path.splitext(filename)
            if file_ext in cls._formats:
                fkey = '{0}{1}'.format(prefix, name)
                cls.register(fkey, os.path.join(dir_path, filename))
909953
function createProxies(config, map, parentPath) {
  parentPath = parentPath || [];

  var isBase = parentPath.length === 0;
  var proxies = {};
  var path;

  for (var key in map) {
    if (map.hasOwnProperty(key)) {
      if (isObject(map[key])) {
        proxies[key] = createProxies(config, map[key], parentPath.concat([key]));
      }
      else if (isBoolean(map[key])) {
        path = parentPath.join('/') + (isBase ? '' : '/') + key;
        proxies[key] = createProxiedMethod(config, path);
      }
    }
  }

  return proxies;
}
466186
private void addBinaryResourcePath(BinaryResourcesHandler binRsHandler, String resourcePath) {

		try {
			String resultPath = CheckSumUtils.getCacheBustedUrl(resourcePath, rsReaderHandler, jawrConfig);
			binRsHandler.addMapping(resourcePath, resultPath);
			bundleMapping.put(resourcePath, resultPath);
		} catch (IOException e) {
			LOGGER.error("An exception occurs while defining the mapping for the file : " + resourcePath, e);
		} catch (ResourceNotFoundException e) {
			LOGGER.error("Impossible to define the checksum for the resource '" + resourcePath
					+ "'. Unable to retrieve the content of the file.");
		}
	}
5311
def apply_fixes(args, tmpdir):
  """"""
  invocation = [args.clang_apply_replacements_binary]
  if args.format:
    invocation.append('-format')
  if args.style:
    invocation.append('-style=' + args.style)
  invocation.append(tmpdir)
  subprocess.call(invocation)
235710
function mkdirIfNotExists(relativePath) {
    const dir = path.join(__dirname, relativePath);
    let stat;
    try {
        stat = fs.statSync(dir);
    } catch (e) {
        fs.mkdirSync(dir);
    }
}
1027458
function binary($path) {
        if (function_exists('exec')) {
            exec($path.' -v 2>&1',$out,$ret);
            if ($ret==0 && preg_match('/cli/',@$out[0],$out))
                $this->binary=$path;
        }
        return $this->binary;
    }
1168506
def _sync_download(self, url, destination_path):
    """"""
    proxies = {
        'http': os.environ.get('TFDS_HTTP_PROXY', None),
        'https': os.environ.get('TFDS_HTTPS_PROXY', None),
        'ftp': os.environ.get('TFDS_FTP_PROXY', None)
    }
    if kaggle.KaggleFile.is_kaggle_url(url):
      if proxies['http']:
        os.environ['KAGGLE_PROXY'] = proxies['http']
      return self._sync_kaggle_download(url, destination_path)

    try:
      # If url is on a filesystem that gfile understands, use copy. Otherwise,
      # use requests.
      if not url.startswith('http'):
        return self._sync_file_copy(url, destination_path)
    except tf.errors.UnimplementedError:
      pass

    session = requests.Session()
    session.proxies = proxies
    if _DRIVE_URL.match(url):
      url = self._get_drive_url(url, session)
    use_urllib = url.startswith('ftp')
    if use_urllib:
      if proxies['ftp']:
        proxy = urllib.request.ProxyHandler({'ftp': proxies['ftp']})
        opener = urllib.request.build_opener(proxy)
        urllib.request.install_opener(opener)   # pylint: disable=too-many-function-args
      request = urllib.request.Request(url)
      response = urllib.request.urlopen(request)
    else:
      response = session.get(url, stream=True)
      if response.status_code != 200:
        raise DownloadError('Failed to get url %s. HTTP code: %d.' %
                            (url, response.status_code))
    fname = _get_filename(response)
    path = os.path.join(destination_path, fname)
    size = 0

    size_mb = 0
    unit_mb = units.MiB
    self._pbar_dl_size.update_total(
        int(response.headers.get('Content-length', 0)) // unit_mb)
    with tf.io.gfile.GFile(path, 'wb') as file_:
      checksum = self._checksumer()
      if use_urllib:
        iterator = iter(lambda: response.read(io.DEFAULT_BUFFER_SIZE), b'')
      else:
        iterator = response.iter_content(chunk_size=io.DEFAULT_BUFFER_SIZE)

      for block in iterator:
        size += len(block)

        # Update the progress bar
        size_mb += len(block)
        if size_mb > unit_mb:
          self._pbar_dl_size.update(size_mb // unit_mb)
          size_mb %= unit_mb

        checksum.update(block)
        file_.write(block)
    self._pbar_url.update(1)
    return checksum.hexdigest(), size
1006683
function EmbarkBin(binpath, kind) {
  this.binpath = binpath;
  this.binrealpath = undefined;
  this.kind = kind || 'invoked';
  this.pkgDir = undefined;
  this.pkgJson = undefined;
}
535872
def setup_path():
    """"""
    import os.path; import sys

    if sys.argv[0]:
        top_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
        sys.path = [os.path.join(top_dir, "src")] + sys.path
        pass
    return
49867
def merge(self, paths):
        

        # Use local topojson binary
        topojson_binary = 'node_modules/bin/topojson'

        if not os.path.exists(topojson_binary):
            # try with global topojson binary
            topojson_binary = 'topojson'

        merge_cmd = '%(binary)s -o %(output_path)s --bbox -p -- %(paths)s' % {
            'output_path': self.args.output_path,
            'paths': ' '.join(paths),
            'binary': topojson_binary
        }

        sys.stdout.write('Merging layers\n')

        if self.args.verbose:
            sys.stdout.write('  %s\n' % merge_cmd)

        r = envoy.run(merge_cmd)

        if r.status_code != 0:
            sys.stderr.write(r.std_err)
1212318
def _setup_paths(self, paths, filters=()):
    """"""
    for interpreter in self._matching(PythonInterpreter.all(paths), filters=filters):
      identity_str = str(interpreter.identity)
      pi = self._interpreter_from_relpath(identity_str, filters=filters)
      if pi is None:
        self._setup_interpreter(interpreter, identity_str)
        pi = self._interpreter_from_relpath(identity_str, filters=filters)
      if pi:
        yield pi
172964
async function resolveBinary(binaryName) {
  let nodeModulesPath = `./node_modules/.bin/${binaryName}`;
  if (await exists(nodeModulesPath)) {
    return nodeModulesPath;
  } else {
    try {
      await exec(`which ${binaryName}`);
      return binaryName;
    } catch (e) {
      console.log(`${binaryName} binary not found on the PATH or in node_modules.`);
      let rl = readline.createInterface(process.stdin, process.stdout);
      let answer = await rl.question(`Run "npm install -g ${binaryName}"? [Y/n] `);
      rl.close();
      if (answer.toLowerCase().startsWith('n')) {
        throw new CLIError(`${binaryName} must be installed.`);
      }
      console.log(`Installing ${binaryName} globally...`);
      await execLive(`npm install -g ${binaryName}`);
      console.log(`Successfully installed ${binaryName}\n`);
      return binaryName;
    }
  }
}
313621
def server_prepare_root_bin_dir():
    ''''''
    commands = ['run_backup']
    for command in commands:
        install_file_legacy(flo('/root/bin/{command}'), sudo=True)
        sudo(flo('chmod 755 /root/bin/{command}'))
        if command == 'run_backup':
            sudo('ln -snf /root/bin/run_backup /etc/cron.daily/run_backup')
227613
def extend_path():
    
    if ROOT not in sys.path:
        sys.path.insert(0, ROOT)

    if LIB not in sys.path:
        sys.path.insert(0, LIB)
51667
def _store_binary(self, local_path, remote):
        """"""
        # Destination directory
        dst_dir = os.path.dirname(remote)

        # Destination file name
        dst_file = os.path.basename(remote)

        # File upload command
        dst_cmd = 'STOR {0}'.format(dst_file)

        with open(local_path, 'rb') as local_file:
            # Change directory if needed
            if dst_dir != dst_file:
                self.chdir(dst_dir, make=True)

            # Upload file & return response
            return self.session.storbinary(dst_cmd, local_file)