'Creates and returns a block structure from the modulestore
starting at the given root_block_usage_key.
Arguments:
root_block_usage_key (UsageKey) - The usage_key for the root
of the block structure that is to be created.
modulestore (ModuleStoreRead) - The modulestore that
contains the data for the xBlocks within the block
structure starting at root_block_usage_key.
Returns:
BlockStructureModulestoreData - The created block structure
with instantiated xBlocks from the given modulestore
starting at root_block_usage_key.
Raises:
xmodule.modulestore.exceptions.ItemNotFoundError if a block for
root_block_usage_key is not found in the modulestore.'

@classmethod
def create_from_modulestore(cls, root_block_usage_key, modulestore):

    block_structure = BlockStructureModulestoreData(root_block_usage_key)
    blocks_visited = set()
    def build_block_structure(xblock):
        '\n                                                Recursively    update    the    block    structure    with    the    given    xBlock\n                                                and    its    descendants.\n                                                '
        if (xblock.location in blocks_visited):
            return
        blocks_visited.add(xblock.location)
        block_structure._add_xblock(xblock.location, xblock)
        for child in xblock.get_children():
            block_structure._add_relation(xblock.location, child.location)
            build_block_structure(child)
    root_xblock = modulestore.get_item(root_block_usage_key, depth=None, lazy=False)
    build_block_structure(root_xblock)
    return block_structure
