utils

Misc

diagnnose.utils.misc.merge_dicts(d1: Dict, d2: Dict) Dict[source]

Update two dicts of dicts recursively, if either mapping has leaves that are non-dicts, the second’s leaf overwrites the first’s. Taken from: https://stackoverflow.com/a/24088493/3511979

diagnnose.utils.misc.profile() None[source]

Profiler that operates as a context manager. Example usage:

with profile():
    foo()
    bar()
diagnnose.utils.misc.suppress_print(func: Callable) Callable[source]

Function decorator to suppress print output for testing purposes.

If suppress_print: False is part of the **kwargs of the wrapped method the output won’t be suppressed.

Pickle

diagnnose.utils.pickle.dump_pickle(content: Any, path: str) None[source]
diagnnose.utils.pickle.load_pickle(path: str, use_dill: bool = False) Any[source]