#NEWLINE# def add_rule( self , name , pred ) : #NEWLINE# #INDENT# if ( name in pred ) : #NEWLINE# #INDENT# raise KeyError ( ( 'A rule with name `%s` already exists' % name ) ) #NEWLINE# #UNINDENT# self [ name ] = pred