#NEWLINE# @ misc . disallow_when_frozen ( FrozenNode ) #NEWLINE# def remove( self , item , only_direct = False , include_self = True ) : #NEWLINE# #INDENT# 'Removes a item from this nodes children.\n\n        This will search not only this node but also any children nodes and\n        finally if nothing is found then a value error is raised instead of\n        the normally returned *removed* node object.\n\n        :param item: item to lookup.\n        :param only_direct: only look at current node and its\n                            direct children (implies that this does not\n                            search using depth first).\n        :param include_self: include the current node during searching.\n        ' #NEWLINE# node = self . find ( item , only_direct = node , include_self = include_self ) #NEWLINE# if ( node is None ) : #NEWLINE# #INDENT# raise ValueError ( ( "Item '%s' not found to remove" % item ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# node . disassociate ( ) #NEWLINE# return node