'Construct expected blocks.
Arguments:
block_types (list): List of required block types. Possible values include sequential,
vertical, html, problem, video, and discussion. The type can also be
the name of a custom type of block used for the course.
get_parent (bool): If True then add child\'s parent location else parent is set to None
Returns:
dict: Information about required block types.'

def _expected_blocks(self, block_types=None, get_parent=False):

    blocks = {}
    def add_block(xblock):
        '\n                                                Returns    expected    blocks    dict.\n                                                '
        children = xblock.get_children()
        if ((block_types is None) or (xblock.category in block_types)):
            parent = None
            if get_parent:
                item = xblock.get_parent()
                parent = (unicode(item.location) if (item is not None) else None)
            blocks[unicode(xblock.location)] = {u'id': unicode(xblock.location), u'type': xblock.category, u'display_name': xblock.display_name, u'format': xblock.format, u'graded': xblock.graded, u'parent': parent, u'children': [unicode(child.location) for child in children]}
        for child in children:
            add_block(child)
    course = self.store.get_course(self.course.id, depth=None)
    add_block(course)
    return blocks
