'Mutates block_structure based on the given usage_info.'

def transform(self, usage_info, block_structure):

    if (not self.block_types_to_count):
        return
    for block_key in block_structure.post_order_traversal():
        for block_type in self.block_types_to_count:
            descendants_type_count = sum([block_structure.get_transformer_block_field(child_key, self, block_type, 0) for child_key in block_structure.get_children(block_key)])
            block_structure.set_transformer_block_field(block_key, self, block_type, (descendants_type_count + (1 if (block_structure.get_xblock_field(block_key, 'category') == block_type) else 0)))
