#NEWLINE# @ property #NEWLINE# def flattened_layers( self ) : #NEWLINE# #INDENT# layers = [ ] #NEWLINE# if ( self . layers [ 0 ] . __class__ . __name__ == 'Merge' ) : #NEWLINE# #INDENT# merge = self . layers [ 0 ] #NEWLINE# for layer in merge . layers : #NEWLINE# #INDENT# if hasattr ( layer , 'flattened_layers' ) : #NEWLINE# #INDENT# for sublayer in layer . flattened_layers : #NEWLINE# #INDENT# if ( sublayer not in layers ) : #NEWLINE# #INDENT# layers . append ( sublayer ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if hasattr ( layer , 'layers' ) : #NEWLINE# #INDENT# for sublayer in layer . layers : #NEWLINE# #INDENT# if ( sublayer not in layers ) : #NEWLINE# #INDENT# layers . append ( sublayer ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( layer not in layers ) : #NEWLINE# #INDENT# layers . append ( layer ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . layers [ 0 ] not in layers ) : #NEWLINE# #INDENT# layers . append ( self . layers [ 0 ] ) #NEWLINE# #UNINDENT# #UNINDENT# for layer in self . layers [ 1 : ] : #NEWLINE# #INDENT# if ( layer not in layers ) : #NEWLINE# #INDENT# layers . append ( layer ) #NEWLINE# #UNINDENT# #UNINDENT# return layers