Return the path to the activate binary
428908
def _get_env_activate(bin_env):
    '''
    
    '''
    if not bin_env:
        raise CommandNotFoundError('Could not find a `activate` binary')

    if os.path.isdir(bin_env):
        if salt.utils.platform.is_windows():
            activate_bin = os.path.join(bin_env, 'Scripts', 'activate.bat')
        else:
            activate_bin = os.path.join(bin_env, 'bin', 'activate')
        if os.path.isfile(activate_bin):
            return activate_bin
    raise CommandNotFoundError('Could not find a `activate` binary')
565952
def get_gopath(self, target):
    """"""
    return os.path.join(self.workdir, target.id)
798604
def abspath(self, path):
        """"""
        return os.path.abspath(os.path.join(os.path.dirname(self.path), path))
542510
def select(self, binary_request):
    """"""

    logger.debug("binary_request: {!r}".format(binary_request))

    try:
      download_path = self._get_download_path(binary_request)
    except self.MissingMachineInfo as e:
      raise self.BinaryResolutionError(binary_request, e)

    try:
      url_generator = self._get_url_generator(binary_request)
    except self.NoBaseUrlsError as e:
      raise self.BinaryResolutionError(binary_request, e)

    urls = self._get_urls(url_generator, binary_request)
    if not isinstance(urls, list):
      # TODO: add test for this error!
      raise self.BinaryResolutionError(
        binary_request,
        TypeError("urls must be a list: was '{}'.".format(urls)))
    fetch_request = BinaryFetchRequest(
      download_path=download_path,
      urls=urls)

    logger.debug("fetch_request: {!r}".format(fetch_request))

    try:
      downloaded_file = self._binary_tool_fetcher.fetch_binary(fetch_request)
    except BinaryToolFetcher.BinaryNotFound as e:
      raise self.BinaryResolutionError(binary_request, e)

    # NB: we mark the downloaded file executable if it is not an archive.
    archiver = binary_request.archiver
    if archiver is None:
      chmod_plus_x(downloaded_file)
      return downloaded_file

    download_dir = os.path.dirname(downloaded_file)
    # Use the 'name' given in the request as the directory name to extract to.
    unpacked_dirname = os.path.join(download_dir, binary_request.name)
    if not os.path.isdir(unpacked_dirname):
      logger.info("Extracting {} to {} .".format(downloaded_file, unpacked_dirname))
      archiver.extract(downloaded_file, unpacked_dirname, concurrency_safe=True)
    return unpacked_dirname
1012420
function () {
      return _.map([].concat(this.pkgs, this.devPkgs), function (pkg) {
        return path.join(pkg.path, "node_modules/.bin");
      });
    }
1032949
def path_to(self, p):
        """"""
        if os.path.isabs(p):
            return p

        return os.sep.join([self._original_dir, p])
1291422
def coderelpath(coderoot, relpath):
    """"""
    from os import chdir, getcwd, path
    cd = getcwd()
    chdir(coderoot)
    result = path.abspath(relpath)
    chdir(cd)
    return result
495488
def executable(self):
        
        return util.find_executable(self.BINS[0], os.path.join("bin", self.BINS[0]) )
611247
def abspath(self):
        ""
        return Path(os.path.abspath(os.path.expanduser(str(self.path))))
161841
function getBinPath(cmd, fn) {
  which(cmd, function(err, bin) {
    if (err) {
      return fn(err);
    }

    fs.exists(bin, function(exists) {
      if (!exists) {
        return fn(new Error(format(
          'Expected file for `%s` does not exist at `%s`',
          cmd, bin)));
      }
      fn(null, bin);
    });
  });
}
683173
def abspath(self, path):
        """"""
        if self.is_ssh(path):
            return path
        else:
            return os.path.abspath(path)
1018254
def get_bin_and_lib(self, x64=False, native=False):
        
        if x64:
            msvc = self.bin64
            paths = self.lib64
        else:
            msvc = self.bin32
            paths = self.lib
        if native:
            arch = 'x64' if x64 else 'x86'
            paths += self.sdk.get_lib(arch, native=True)
        else:
            attr = 'lib64' if x64 else 'lib'
            paths += getattr(self.sdk, attr)
        return msvc, paths
586183
def get_exe_path(cls):
        
        return os.path.abspath(os.path.join(ROOT, cls.bmds_version_dir, cls.exe + ".exe"))
91029
def scan_path(executable="mongod"):
    
    for path in os.environ.get("PATH", "").split(":"):
        path = os.path.abspath(path)
        executable_path = os.path.join(path, executable)
        if os.path.exists(executable_path):
            return executable_path
844474
def abspath(*path):
    """"""
    setup_dir = os.path.dirname(os.path.abspath(__file__))
    return os.path.join(setup_dir, *path)
869473
def abspath(path, **kwargs):
    """"""
    import os.path
    return os.path.abspath(path, **kwargs)
474759
def find_binary_of_command(candidates):
    
    from distutils.spawn import find_executable
    for c in candidates:
        binary_path = find_executable(c)
        if c and binary_path:
            return c, binary_path
    raise RuntimeError('No binary located for candidates: {}'.format(
        candidates))