#NEWLINE# @ classmethod #NEWLINE# def apply_customizations( cls , spec , options ) : #NEWLINE# #INDENT# '\n        Apply the given option specs to the supplied options tree.\n        ' #NEWLINE# for key in sorted ( spec . keys ( ) ) : #NEWLINE# #INDENT# if isinstance ( spec [ key ] , ( list , tuple ) ) : #NEWLINE# #INDENT# customization = { v . key : v for v in spec [ key ] } #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# customization = { k : ( Options ( ** v ) if isinstance ( v , dict ) else v ) for ( k , v ) in spec [ key ] . items ( ) } #NEWLINE# #UNINDENT# options [ str ( key ) ] = customization #NEWLINE# #UNINDENT# return options