def delete(self, get_parent=False, from_tree=True): # Internal Last Flag
        "Delete this node (optionally, return parent)."
        if self.__tree.exists(self.__node):
            parent = self.parent if get_parent else None
            # PATCH: Remove extra data about node.
            if TrimDir.SIZE:
                for child in self.children:
                    child.delete(from_tree=False)
                del self.__tree.nodes[self.__node]
            if from_tree:
                self.__tree.delete(self.__node)
            #=====================================
            return parent
        if get_parent:
            raise ValueError('Cannot return parent!')
Delete this node (optionally, return parent).
recipes/Python/577635_Directory_Pruner_3/recipe-577635.py