The contextmanager decorator creates a `with` handler using a context manager.

This ensures also that setup and cleanup actions are properly handled,
even if an exception occurs within the managed code block.
