def drop_titles(tree, titles_to_drop):
    """
    Walk the tree and drop any nodes whose titles are in `titles_to_drop`.
    """

    def _drop_titles(subtree):
        new_children = []
        for child in subtree["children"]:
            if child["title"] in titles_to_drop:
                continue
            else:
                new_child = _drop_titles(child)
                new_children.append(child)
        subtree["children"] = new_children
        return subtree

    return _drop_titles(tree)