contextlib

contextmanager(func)

@contextmanager decorator.

closing(thing)

Context to automatically close something at the end of a block.