#NEWLINE# def _remove_all_ephemeral_nodes( self ) : #NEWLINE# #INDENT# 'Traverse the tree to remove all ephemeral nodes.' #NEWLINE# nodes = deque ( [ MockKazooClient . ZK_ROOT_NODE ] ) #NEWLINE# while nodes : #NEWLINE# #INDENT# curr_node = nodes . popleft ( ) #NEWLINE# if curr_node . ephemeral : #NEWLINE# #INDENT# curr_node . parent . remove_child ( curr_node . name ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# for child in curr_node . children : #NEWLINE# #INDENT# nodes . append ( child )