Utility method to raise an error if the given `attribute` is not set.
(self, attribute, for_method)
| 567 | return False |
| 568 | |
| 569 | def _require(self, attribute, for_method): |
| 570 | """Utility method to raise an error if the given `attribute` is not set.""" |
| 571 | if getattr(self, attribute, None) is None: |
| 572 | raise ValueError( |
| 573 | f"`{attribute}` is not set. Pass `{attribute}` to " |
| 574 | f"`Controller.__init__` before calling `{for_method}()`.") |
| 575 | |
| 576 | def _sync_on_async_checkpointing(self): |
| 577 | """Force to wait for the async checkpoint saving (if any) to finish.""" |
no outgoing calls
no test coverage detected