Given a Traversable object, return that object as a path on the local file system in a context manager.
(path)
| 130 | |
| 131 | @functools.singledispatch |
| 132 | def as_file(path): |
| 133 | """ |
| 134 | Given a Traversable object, return that object as a |
| 135 | path on the local file system in a context manager. |
| 136 | """ |
| 137 | return _temp_dir(path) if _is_present_dir(path) else _temp_file(path) |
| 138 | |
| 139 | |
| 140 | @as_file.register(pathlib.Path) |
no test coverage detected
searching dependent graphs…