(self)
| 40 | self._current_context = None |
| 41 | |
| 42 | def get_state(self): |
| 43 | if self._current_context is None: |
| 44 | raise ValueError("No context is set. Please set a context before retrieving the state.") |
| 45 | if self._current_context not in self._state_cache.keys(): |
| 46 | self._state_cache[self._current_context] = self._state_cls(*self._init_args, **self._init_kwargs) |
| 47 | return self._state_cache[self._current_context] |
| 48 | |
| 49 | def set_context(self, name: str) -> None: |
| 50 | self._current_context = name |
no outgoing calls