#NEWLINE# def _traverse( node ) : #NEWLINE# #INDENT# " Generator to traverse a tree accessing the nodes' children\n        attribute.\n\n        **Example**\n\n        Here is a simple example printing the names of all the objects in\n        the pipeline::\n\n            for obj in mlab.pipeline.traverse(mlab.gcf()):\n                print obj.name\n\n    " #NEWLINE# try : #NEWLINE# #INDENT# for leaf in leaf . children : #NEWLINE# #INDENT# for leaflet in _traverse ( leaf ) : #NEWLINE# #INDENT# ( yield leaflet ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# ( yield node )