'A contextmanager that returns a mixed modulestore built on top of modulestores
generated by other builder classes.
Args:
contentstore: The contentstore that this modulestore should use to store
all of its assets.'

@contextmanager
def build_with_contentstore(self, contentstore, **kwargs):

    (names, generators) = zip(*self.store_builders)
    with nested(*(gen.build_with_contentstore(contentstore, **kwargs) for gen in generators)) as modulestores:
        store_iterator = iter(modulestores)
        next_modulestore = (lambda *args, **kwargs: store_iterator.next())
        stores = [{'NAME': name, 'ENGINE': 'This    space    deliberately    left    blank'} for name in names]
        self.mixed_modulestore = MixedModuleStore(contentstore, self.mappings, stores, create_modulestore_instance=next_modulestore, xblock_mixins=XBLOCK_MIXINS)
        (yield self.mixed_modulestore)
