make a directory to store all caches

        Returns:
        ---------
            cache path
481296
def cache_path(self):
        
        cache_path = os.path.join(os.path.dirname(__file__), '..', 'cache')
        if not os.path.exists(cache_path):
            os.mkdir(cache_path)
        return cache_path
408226
def cachedir
      if Gem.win_platform?
        File.join(ENV['LOCALAPPDATA'], 'PDK', 'cache')
      else
        File.join(Dir.home, '.pdk', 'cache')
      end
    end
118004
def _get_cache_dir(self, commit_hash):
        
        path = os.path.join(self._path, commit_hash)
        stamp = path + ".timestamp"
        return path, stamp
755634
def disk_cache(cls, basename, function, *args, method=True, **kwargs):
        
        @utility.disk_cache(basename, cls.directory(), method=method)
        def wrapper(*args, **kwargs):
            return function(*args, **kwargs)

        return wrapper(*args, **kwargs)
419612
def mkdir(self, path):
        
        if not os.path.exists(path):
            os.makedirs(path)
1038157
def set_cache(config_fpath, cache_dir):
    
    cache_dir = os.path.abspath(cache_dir)
    return write_config_value_to_file(
        CACHE_DIRECTORY_KEY,
        cache_dir,
        config_fpath
    )
228476
def cache_set(cache_dir, cache_key, content):
    
    filename = os.path.join(cache_dir, cache_key)

    with open(filename, 'w') as f:
        f.write(content)
726206
def make_directory(self, directory_name, *args, **kwargs):
		
		previous_path = self.session_path()
		try:
			self.session_path(directory_name)
			os.mkdir(self.full_path())
		finally:
			self.session_path(previous_path)
807674
def store(bank, key, data, cachedir):
    '''
    
    '''
    base = os.path.join(cachedir, os.path.normpath(bank))
    try:
        os.makedirs(base)
    except OSError as exc:
        if exc.errno != errno.EEXIST:
            raise SaltCacheError(
                'The cache directory, {0}, could not be created: {1}'.format(
                    base, exc
                )
            )

    outfile = os.path.join(base, '{0}.p'.format(key))
    tmpfh, tmpfname = tempfile.mkstemp(dir=base)
    os.close(tmpfh)
    try:
        with salt.utils.files.fopen(tmpfname, 'w+b') as fh_:
            fh_.write(__context__['serial'].dumps(data))
        # On Windows, os.rename will fail if the destination file exists.
        salt.utils.atomicfile.atomic_rename(tmpfname, outfile)
    except IOError as exc:
        raise SaltCacheError(
            'There was an error writing the cache file, {0}: {1}'.format(
                base, exc
            )
        )
339551
def _make_temp_directory(prefix):
    '''
    
    '''
    temp_dir = _make_temp_filename(prefix=str(prefix))
    _os.makedirs(temp_dir)
    return temp_dir
227569
def in_cache_dir(*paths)
      paths.reduce(cache_dir) do |base, path|
        Jekyll.sanitized_path(base, path)
      end
    end
418208
def cache_master(self, saltenv='base', cachedir=None):
        '''
        
        '''
        ret = []
        for path in self.file_list(saltenv):
            ret.append(
                self.cache_file(
                    salt.utils.url.create(path), saltenv, cachedir=cachedir)
            )
        return ret
219248
def init_cachedir(base=None):
    '''
    
    '''
    if base is None:
        base = __opts__['cachedir']
    needed_dirs = (base,
                   os.path.join(base, 'requested'),
                   os.path.join(base, 'active'))
    for dir_ in needed_dirs:
        if not os.path.exists(dir_):
            os.makedirs(dir_)
        os.chmod(base, 0o755)

    return base
1290003
def create_cache_directories(self):
        """"""
        if not os.path.isdir(self.package_cache_dir):
            if not os.path.isdir(self.stacker_cache_dir):
                os.mkdir(self.stacker_cache_dir)
            os.mkdir(self.package_cache_dir)
905778
def get_beam_cache_directory():
    
    home = os.path.expanduser("~")
    cache_dir = os.path.join(home, '.hwrt-beam-cache')
    if not os.path.exists(cache_dir):
        os.makedirs(cache_dir)
    return cache_dir
713529
def generate_cache_path(path):
    
    logger.debug(f"Generating cache for {path}")
    sha = hashlib.sha1(str(path).encode()).hexdigest()[:9]
    HOME = pathlib.Path.home()
    cache_path = str(HOME / ".wily" / sha)
    logger.debug(f"Cache path is {cache_path}")
    return cache_path
661075
def setup_dirs():
    
    try:
        top_dir = os.path.abspath(os.path.expanduser(os.environ["XDG_CACHE_HOME"]))
    except KeyError:
        top_dir = os.path.abspath(os.path.expanduser("~/.cache"))
    our_cache_dir = os.path.join(top_dir, PROJECT_NAME)
    os.makedirs(our_cache_dir, mode=0o775, exist_ok=True)
    return our_cache_dir