def METHOD_NAME(cls, nodes: Iterable["Node"]) -> "Node":
    children_by_name = defaultdict(list)
    for node in nodes:
        for name, child in node.items():
            children_by_name[name].append(child)
    return Node(
        {name: cls.METHOD_NAME(children) for name, children in children_by_name.items()}
    )