MCPcopy Index your code
hub / github.com/python/cpython / _temp_dir

Function _temp_dir

Lib/importlib/resources/_common.py:159–166  ·  view source on GitHub ↗

Given a traversable dir, recursively replicate the whole tree to the file system in a context manager.

(path)

Source from the content-addressed store, hash-verified

157
158@contextlib.contextmanager
159def _temp_dir(path):
160 """
161 Given a traversable dir, recursively replicate the whole tree
162 to the file system in a context manager.
163 """
164 assert path.is_dir()
165 with _temp_path(tempfile.TemporaryDirectory()) as temp_dir:
166 yield _write_contents(temp_dir, path)
167
168
169def _write_contents(target, source):

Callers 1

as_fileFunction · 0.85

Calls 3

_temp_pathFunction · 0.85
_write_contentsFunction · 0.85
is_dirMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…