#NEWLINE# def check_char_set( string , allowed ) : #NEWLINE# #INDENT# for c in string : #NEWLINE# #INDENT# if ( c not in allowed ) : #NEWLINE# #INDENT# raise NotAllowedValue ( ( "'%c' not in the allowed character set" % c ) )