| Conditions | 2 |
| Total Lines | 8 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | from importlib import import_module |
||
| 6 | def _check_package(*, package: str, extra: str) -> None: |
||
| 7 | if find_spec(package) is None: |
||
| 8 | message = ( |
||
| 9 | f'The `{package}` package is required for this.' |
||
| 10 | f' Install TorchIO with the `{extra}` extra:' |
||
| 11 | f' `pip install torchio[{extra}]`.' |
||
| 12 | ) |
||
| 13 | raise ImportError(message) |
||
| 14 | |||
| 27 |