(
pth: Union[Path, str],
absolute: bool=False,
to_str: bool=True
)
| 205 | |
| 206 | @lru_cache() |
| 207 | def normalize_path( |
| 208 | pth: Union[Path, str], |
| 209 | absolute: bool=False, |
| 210 | to_str: bool=True |
| 211 | ) -> Union[str, Path]: |
| 212 | if type(pth) == str: |
| 213 | pth = Path(pth) |
| 214 | |
| 215 | pth = cast(Path, pth) |
| 216 | |
| 217 | if absolute: |
| 218 | pth = pth.absolute() |
| 219 | |
| 220 | if to_str: |
| 221 | return os.fspath(pth) |
| 222 | else: |
| 223 | return Path(pth) |
| 224 | |
| 225 | |
| 226 | def slotted_dataclass(dataclass_arguments=None, **kwargs): |
no outgoing calls
no test coverage detected