#NEWLINE# def replace_include( self , view_elements ) : #NEWLINE# #INDENT# ' Replaces any items that have an **id** attribute with an Include\n        object with the same ID value, and puts the object with the ID\n        into the specified ViewElements object.\n\n        Parameters\n        ----------\n        view_elements : ViewElements object\n            A set of Group, Item, and Include objects\n        ' #NEWLINE# for ( i , item ) in enumerate ( self . content ) : #NEWLINE# #INDENT# if item . is_includable ( ) : #NEWLINE# #INDENT# id = item . id #NEWLINE# if ( id in view_elements . content ) : #NEWLINE# #INDENT# raise TraitError ( ( "Duplicate definition for view element '%s'" % id ) ) #NEWLINE# #UNINDENT# self . content [ i ] = Include ( id ) #NEWLINE# view_elements . content [ id ] = item #NEWLINE# #UNINDENT# item . replace_include ( view_elements )