Learning to handle 'with' and @contextlib.contextmanager