MCPcopy
hub / github.com/Vchitect/Latte / make_cache_dir_path

Function make_cache_dir_path

tools/dnnlib/util.py:127–136  ·  view source on GitHub ↗
(*paths: str)

Source from the content-addressed store, hash-verified

125 _dnnlib_cache_dir = path
126
127def make_cache_dir_path(*paths: str) -> str:
128 if _dnnlib_cache_dir is not None:
129 return os.path.join(_dnnlib_cache_dir, *paths)
130 if 'DNNLIB_CACHE_DIR' in os.environ:
131 return os.path.join(os.environ['DNNLIB_CACHE_DIR'], *paths)
132 if 'HOME' in os.environ:
133 return os.path.join(os.environ['HOME'], '.cache', 'dnnlib', *paths)
134 if 'USERPROFILE' in os.environ:
135 return os.path.join(os.environ['USERPROFILE'], '.cache', 'dnnlib', *paths)
136 return os.path.join(tempfile.gettempdir(), '.cache', 'dnnlib', *paths)
137
138# Small util functions
139# ------------------------------------------------------------------------------------------

Callers 1

open_urlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected