'Returns the transformed Block Structure for the root_block_usage_key,
starting at starting_block_usage_key, getting block data from the cache
and modulestore, as needed.
Details: Similar to the get_collected method, except the transformers\'
transform methods are also called.
Arguments:
transformers (BlockStructureTransformers) - Collection of
transformers to apply.
starting_block_usage_key (UsageKey) - Specifies the starting block
in the block structure that is to be transformed.
If None, root_block_usage_key is used.
collected_block_structure (BlockStructureBlockData) - A
block structure retrieved from a prior call to
get_collected.  Can be optionally provided if already available,
for optimization.
Returns:
BlockStructureBlockData - A transformed block structure,
starting at starting_block_usage_key.'

def get_transformed(self, transformers, starting_block_usage_key=None, collected_block_structure=None):

    block_structure = (collected_block_structure.copy() if collected_block_structure else self.get_collected())
    if starting_block_usage_key:
        if (starting_block_usage_key not in block_structure):
            raise UsageKeyNotInBlockStructure("The    requested    usage_key    '{0}'    is    not    found    in    the    block_structure    with    root    '{1}'", unicode(starting_block_usage_key), unicode(self.root_block_usage_key))
        block_structure.set_root_block(starting_block_usage_key)
    transformers.transform(block_structure)
    return block_structure
