Try to find out system path with ca certificates. This path is cached and
    returned. If no path is found out, None is returned.
511038
def get_default_ca_certs():
    
    # pylint: disable=protected-access
    if not hasattr(get_default_ca_certs, '_path'):
        for path in get_default_ca_cert_paths():
            if os.path.exists(path):
                get_default_ca_certs._path = path
                break
        else:
            get_default_ca_certs._path = None
    return get_default_ca_certs._path
993942
def get_compiler_path():
    
    # If the user provides a specific solc binary let's use that
    given_binary = os.environ.get('SOLC_BINARY')
    if given_binary:
        return given_binary

    for path in os.getenv('PATH', '').split(os.pathsep):
        path = path.strip('"')
        executable_path = os.path.join(path, BINARY)

        if os.path.isfile(executable_path) and os.access(
                executable_path, os.X_OK):
            return executable_path

    return None
686435
Path getCache(Path hdfsPath) {
    CacheEntry c = cacheMap.get(hdfsPath);
    localMetrics.numGetAttempts++;
    if (c != null) {
      // update the accessTime before returning to caller
      c.setGenstamp(globalStamp.incrementAndGet());
      localMetrics.numGetHits++;
      return c.localPath;
    }
    return null; // not in cache
  }
1265172
def find_ca_bundle():
    """"""
    extant_cert_paths = filter(os.path.isfile, cert_paths)
    return (
        get_win_certfile()
        or next(extant_cert_paths, None)
        or _certifi_where()
    )
609179
def is_cached(self, version=None):
        '''
        
        '''
        version = _process_version(self, version)

        if self.api.cache and self.api.cache.fs.isfile(
                self.get_version_path(version)):
            return True

        return False
197308
def cache_path(self, name):
        
        return os.path.join(self._path, self.CACHE_DIR, name)
620599
def in_system_path(filename):
    
    fn = sdk_normalize(os.path.realpath(filename))
    if fn.startswith('/usr/local/'):
        return False
    elif fn.startswith('/System/') or fn.startswith('/usr/'):
        return True
    else:
        return False
291815
def path_in_cache(self, filename, metahash):
        
        cpath = self._genpath(filename, metahash)
        if os.path.exists(cpath):
            return cpath
        else:
            raise CacheMiss
214907
def _get_systemd_services(root):
    '''
    
    '''
    ret = set()
    for path in SYSTEM_CONFIG_PATHS + (LOCAL_CONFIG_PATH,):
        # Make sure user has access to the path, and if the path is a
        # link it's likely that another entry in SYSTEM_CONFIG_PATHS
        # or LOCAL_CONFIG_PATH points to it, so we can ignore it.
        path = _root(path, root)
        if os.access(path, os.R_OK) and not os.path.islink(path):
            for fullname in os.listdir(path):
                try:
                    unit_name, unit_type = fullname.rsplit('.', 1)
                except ValueError:
                    continue
                if unit_type in VALID_UNIT_TYPES:
                    ret.add(unit_name if unit_type == 'service' else fullname)
    return ret
224795
def cache_location():
    ''''''
    plat = platform.platform()
    log.debug('Platform read as: {0}'.format(plat))
    if plat.startswith('Windows'):
        log.debug('Windows platform detected')
        return os.path.join(os.environ['APPDATA'], 'OpenAccess_EPUB')
    elif plat.startswith('Darwin'):
        log.debug('Mac platform detected')
    elif plat.startswith('Linux'):
        log.debug('Linux platform detected')
    else:
        log.warning('Unhandled platform for cache_location')

    #This code is written for Linux and Mac, don't expect success for others
    path = os.path.expanduser('~')
    if path == '~':
        path = os.path.expanduser('~user')
        if path == '~user':
            log.critical('Could not resolve the correct cache location')
            sys.exit('Could not resolve the correct cache location')
    cache_loc = os.path.join(path, '.OpenAccess_EPUB')
    log.debug('Cache located: {0}'.format(cache_loc))
    return cache_loc
801979
def getCaCerts(self):
        '''
        
        '''
        retn = []

        path = s_common.genpath(self.certdir, 'cas')

        for name in os.listdir(path):
            if not name.endswith('.crt'):
                continue

            full = s_common.genpath(self.certdir, 'cas', name)
            retn.append(self._loadCertPath(full))

        return retn
457205
def cache_local_file(path):
    '''
    
    '''
    if not os.path.exists(path):
        return ''

    path_cached = is_cached(path)

    # If the file has already been cached, return the path
    if path_cached:
        path_hash = hash_file(path)
        path_cached_hash = hash_file(path_cached)

        if path_hash['hsum'] == path_cached_hash['hsum']:
            return path_cached

    # The file hasn't been cached or has changed; cache it
    return _client().cache_local_file(path)
736830
def _get_cibpath():
    '''
    
    '''
    cibpath = os.path.join(__opts__['cachedir'], 'pcs', __env__)
    log.trace('cibpath: %s', cibpath)
    return cibpath
883911
def tryload_cache(dpath, fname, cfgstr, verbose=None):
    
    try:
        return load_cache(dpath, fname, cfgstr, verbose=verbose)
    except IOError:
        return None
792918
def is_cached(self, path, saltenv='base', cachedir=None):
        '''
        
        '''
        if path.startswith('salt://'):
            path, senv = salt.utils.url.parse(path)
            if senv:
                saltenv = senv

        escaped = True if salt.utils.url.is_escaped(path) else False

        # also strip escape character '|'
        localsfilesdest = os.path.join(
            self.opts['cachedir'], 'localfiles', path.lstrip('|/'))
        filesdest = os.path.join(
            self.opts['cachedir'], 'files', saltenv, path.lstrip('|/'))
        extrndest = self._extrn_path(path, saltenv, cachedir=cachedir)

        if os.path.exists(filesdest):
            return salt.utils.url.escape(filesdest) if escaped else filesdest
        elif os.path.exists(localsfilesdest):
            return salt.utils.url.escape(localsfilesdest) \
                if escaped \
                else localsfilesdest
        elif os.path.exists(extrndest):
            return extrndest

        return ''
715618
def _path_importer_cache(cls, path):  # from importlib.PathFinder
        
        if path == '':
            try:
                path = os.getcwd()
            except FileNotFoundError:
                # Don't cache the failure as the cwd can easily change to
                # a valid directory later on.
                return None
        try:
            finder = sys.path_importer_cache[path]
        except KeyError:
            finder = cls._path_hooks(path)
            sys.path_importer_cache[path] = finder

        return finder
1159908
def check_case_sensitivity (self):
        
        if os.name != 'nt':
            return
        path = self.get_os_filename()
        realpath = get_nt_filename(path)
        if path != realpath:
            self.add_warning(_("The URL path %(path)r is not the same as the "
                            "system path %(realpath)r. You should always use "
                            "the system path in URLs.") % \
                            {"path": path, "realpath": realpath},
                               tag=WARN_FILE_SYSTEM_PATH)