(string, reload=False, invalidate_cache=True)
| 254 | |
| 255 | |
| 256 | def get_obj_from_str(string, reload=False, invalidate_cache=True): |
| 257 | module, cls = string.rsplit(".", 1) |
| 258 | if invalidate_cache: |
| 259 | importlib.invalidate_caches() |
| 260 | if reload: |
| 261 | module_imp = importlib.import_module(module) |
| 262 | importlib.reload(module_imp) |
| 263 | return getattr(importlib.import_module(module, package=None), cls) |
| 264 | |
| 265 | |
| 266 | def append_zero(x): |
no outgoing calls
no test coverage detected