'Context manager for a set of environments.'

@classmethod
@contextmanager
def manage(cls):

    if hasattr(cls._local, 'environments'):
        (yield)
    else:
        try:
            cls._local.environments = Environments()
            (yield)
        finally:
            release_local(cls._local)
