def _extend_blocks(extend_node, blocks):
    # we don't support variable extensions
    if is_variable_extend_node(extend_node):
        return
    parent = extend_node.get_parent(get_context())
    # Search for new blocks
    for node in _get_nodelist(parent).get_nodes_by_type(BlockNode):
        if node.name not in blocks:
            blocks[node.name] = node
        else:
            # set this node as the super node (for {{ block.super }})
            block = blocks[node.name]
            seen_supers = []
            while (hasattr(block.super, 'nodelist') and
                   block.super not in seen_supers):
                seen_supers.append(block.super)
                block = block.super
            block.super = node
    # search for further ExtendsNodes
    for node in _get_nodelist(parent).get_nodes_by_type(ExtendsNode):
        _extend_blocks(node, blocks)
        break
Extends the dictionary `blocks` with *new* blocks in the parent node
dataset/ETHPy150Open ojii/django-sekizai/sekizai/helpers.py/_extend_blocks