#NEWLINE# def _nested( self , obj , seen , format_callback ) : #NEWLINE# #INDENT# if ( obj in seen ) : #NEWLINE# #INDENT# return [ ] #NEWLINE# #UNINDENT# seen . add ( obj ) #NEWLINE# children = [ ] #NEWLINE# for child in self . edges . get ( children , ( ) ) : #NEWLINE# #INDENT# children . extend ( self . _nested ( child , seen , format_callback ) ) #NEWLINE# #UNINDENT# if format_callback : #NEWLINE# #INDENT# ret = [ format_callback ( obj ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ret = [ obj ] #NEWLINE# #UNINDENT# if children : #NEWLINE# #INDENT# ret . append ( children ) #NEWLINE# #UNINDENT# return ret