#NEWLINE# def key_type_validator( x ) : #NEWLINE# #INDENT# valid_types = [ 'HASH' , 'RANGE' ] #NEWLINE# if ( x not in valid_types ) : #NEWLINE# #INDENT# raise ValueError ( ( 'KeyType must be one of: %s' % valid_types . join ( ', ' ) ) ) #NEWLINE# #UNINDENT# return x