human
Complete this python program:
def _calculate_course_xblocks_data(course_key):
assistant
#Here is the Python program you requested.

    """Fetch data for all the blocks in the course.
    This data consists of the display_name and path of the block.
    """
    with modulestore().bulk_operations(course_key):
        course = modulestore().get_course(course_key, depth=None)
        blocks_info_dict = {}
        blocks_stack = [course]
        while blocks_stack:
            current_block = blocks_stack.pop()
            children = (current_block.get_children() if current_block.has_children else [])
            usage_id = unicode(current_block.scope_ids.usage_id)
            block_info = {'usage_key': current_block.scope_ids.usage_id, 'display_name': current_block.display_name_with_default, 'children_ids': [unicode(child.scope_ids.usage_id) for child in children]}
            blocks_info_dict[usage_id] = block_info
            blocks_stack.extend(children)
    for block in blocks_info_dict.values():
        block.setdefault('children', [])
        for child_id in block['children_ids']:
            block['children'].append(blocks_info_dict[child_id])
        block.pop('children_ids', None)
    def add_path_info(block_info, current_path):
        'Do    a    DFS    and    add    paths    info    to    each    block_info.'
        block_info.setdefault('paths', [])
        block_info['paths'].append(current_path)
        for child_block_info in block_info['children']:
            add_path_info(child_block_info, (current_path + [block_info]))
    add_path_info(blocks_info_dict[unicode(course.scope_ids.usage_id)], [])
    return blocks_info_dict