def _adopt_orphans(self, negligent_parent_id):
for child_id in self._hts.get_children(negligent_parent_id):<EOL><INDENT>self.remove_child(negligent_parent_id, child_id)<EOL>if not self._hts.has_parents(child_id):<EOL><INDENT>self._assign_as_root(child_id)<EOL><DEDENT><DEDENT>
Clean up orphaned children