#NEWLINE# def register_category( self , category , default_builder ) : #NEWLINE# #INDENT# if ( default_builder in self . _callbacks ) : #NEWLINE# #INDENT# raise ValueError ( ( 'Category %r already registered' % category ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _callbacks [ category ] = defaultdict ( ( lambda : default_builder ) ) #NEWLINE# setattr ( self . categories , category , _Dummy ( ) )