| 407 | msg += f" ({exception_str})" |
| 408 | |
| 409 | class _LazyRaise: |
| 410 | |
| 411 | def __init__(self, *_args, **_kwargs): |
| 412 | _default_msg = ( |
| 413 | f"{msg}." |
| 414 | + "\n\nFor details about installing the optional dependencies, please visit:" |
| 415 | + "\n https://monai.readthedocs.io/en/latest/installation.html#installing-the-recommended-dependencies" |
| 416 | ) |
| 417 | if tb_str: |
| 418 | _default_msg += f"\n\nOriginal traceback:\n{tb_str}" |
| 419 | self._exception = OptionalImportError(_default_msg) |
| 420 | |
| 421 | def __getattr__(self, name): |
| 422 | """ |
| 423 | Raises: |
| 424 | OptionalImportError: When you call this method. |
| 425 | """ |
| 426 | raise self._exception |
| 427 | |
| 428 | def __call__(self, *_args, **_kwargs): |
| 429 | """ |
| 430 | Raises: |
| 431 | OptionalImportError: When you call this method. |
| 432 | """ |
| 433 | raise self._exception |
| 434 | |
| 435 | def __getitem__(self, item): |
| 436 | raise self._exception |
| 437 | |
| 438 | def __iter__(self): |
| 439 | raise self._exception |
| 440 | |
| 441 | if as_type == "default": |
| 442 | return _LazyRaise(), False |
no outgoing calls
no test coverage detected
searching dependent graphs…