def clear_obj(self, obj):
obj_nodes = self.get_nodes_with(obj)<EOL>removed = set()<EOL>for node in obj_nodes:<EOL><INDENT>if self.has_node(node):<EOL><INDENT>removed.update(self.clear_descendants(node))<EOL><DEDENT><DEDENT>return removed<EOL>
Remove all nodes with `obj` and their descendants.