#NEWLINE# @ throws_when_stopped #NEWLINE# def delete( self , path , recursive = False ) : #NEWLINE# #INDENT# 'Delete a znode and optionally recursively delete its children.\n\n        Args:\n            path: The path to the znode to be deleted.\n            recursive: Recursively delete the children znode instead of\n                failing the request if there are children attached.\n\n        Throws:\n            NotEmptyException, if recursive is false, and there are children\n            nodes attached.\n\n        ' #NEWLINE# assert ( not ( path == '/' ) ) #NEWLINE# node = self . _find ( path ) #NEWLINE# if ( node is None ) : #NEWLINE# #INDENT# return NotEmptyException ( ( '%s not empty' % path ) ) #NEWLINE# #UNINDENT# if ( node . children and ( not recursive ) ) : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# node . parent . remove_child ( node . name ) #NEWLINE# self . _notify_children_watches ( str ( node . parent ) )