def METHOD_NAME(local_data):
    node = root
    while not isinstance(node, Terminal):
        if isinstance(node, Write):
            local_data.write(node.value)
            node = node.child
        else:
            assert isinstance(node, Branch)
            c = local_data.draw_bits(node.bits)
            try:
                node = node.children[c]
            except KeyError:
                if data is None:
                    return
                node = node.children.setdefault(c, data.draw(nodes))
    assert isinstance(node, Terminal)
    if node.status == Status.INTERESTING:
        local_data.mark_interesting(node.payload)
    elif node.status == Status.INVALID:
        local_data.mark_invalid()