#NEWLINE# def pop_context( self , name ) : #NEWLINE# #INDENT# returned = self . _all . pop ( name ) #NEWLINE# def transfer( source , destination ) : #NEWLINE# #INDENT# for ( key , value ) in source . iteritems ( ) : #NEWLINE# #INDENT# if ( key not in destination ) : #NEWLINE# #INDENT# destination [ key ] = value #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( source [ key ] , dict ) : #NEWLINE# #INDENT# transfer ( source [ key ] , destination [ key ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( source [ key ] , list ) : #NEWLINE# #INDENT# destination . setdefault ( key , [ ] ) . extend ( value ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . throw ( 'can not recursively copy this type of data' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# for inherit in returned . get ( 'inherit' , [ ] ) : #NEWLINE# #INDENT# if ( inherit not in self . _all [ 'template' ] ) : #NEWLINE# #INDENT# self . throw ( 'invalid template name referenced' ) #NEWLINE# #UNINDENT# transfer ( self . _all [ 'template' ] [ inherit ] , returned ) #NEWLINE# #UNINDENT# return returned