#NEWLINE# def dereference( self ) : #NEWLINE# #INDENT# '\n        Instruct all children to perform dereferencing.\n        ' #NEWLINE# all = [ ] #NEWLINE# indexes = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for child in self . children : #NEWLINE# #INDENT# child . content ( all ) #NEWLINE# #UNINDENT# deplist = DepList ( ) #NEWLINE# for x in all : #NEWLINE# #INDENT# x . qualify ( ) #NEWLINE# ( midx , deps ) = x . dependencies ( ) #NEWLINE# item = ( x , tuple ( deps ) ) #NEWLINE# deplist . add ( item ) #NEWLINE# indexes [ x ] = midx #NEWLINE# #UNINDENT# for ( x , deps ) in deplist . sort ( ) : #NEWLINE# #INDENT# midx = indexes . get ( x ) #NEWLINE# if ( midx is None ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# d = deps [ midx ] #NEWLINE# x . merge ( d )