brainstorm/structure/view_references.py
def append_to_all_leaves(structure, content, default, fallback):
    """
    Traverse the given structure and append or extend all the leaves (have to
    be Nodes) with the given value.
    """
    if isinstance(structure, dict):
        for k, v in structure.items():
            append_to_all_leaves(v, content, default, fallback)
    else:
        assert isinstance(structure, Node)
        add_or_update(structure.content, content)
        if default is not None:
            add_or_update(structure.defaults, default)
        if fallback is not None:
            add_or_update(structure.fallback, fallback)

    Traverse the given structure and append or extend all the leaves (have to
    be Nodes) with the given value.
    
Traverse the given structure and append or extend all the leaves (have to
be Nodes) with the given value.
Traverse the given structure and append or extend all the leaves ( have to be Nodes ) with the given value .
def append_to_all_leaves(structure, content, default, fallback):
    if isinstance(structure, dict):
        for k, v in structure.items():
            append_to_all_leaves(v, content, default, fallback)
    else:
        assert isinstance(structure, Node)
        add_or_update(structure.content, content)
        if default is not None:
            add_or_update(structure.defaults, default)
        if fallback is not None:
            add_or_update(structure.fallback, fallback)
def append_to_all_leaves ( structure , content , default , fallback ) : if isinstance ( structure , dict ) : for k , v in structure . items ( ) : append_to_all_leaves ( v , content , default , fallback ) else : assert isinstance ( structure , Node ) add_or_update ( structure . content , content ) if default is not None : add_or_update ( structure . defaults , default ) if fallback is not None : add_or_update ( structure . fallback , fallback )
Traverse the given structure and append or extend all the leaves (have to
be Nodes) with the given value.
Traverse the given structure and append or extend all the leaves ( have to be Nodes ) with the given value .
"""
    Traverse the given structure and append or extend all the leaves (have to
    be Nodes) with the given value.
    """
structure
content
default
fallback