def multiple_choice_validator(optdict, name, value):
 choices = optdict['choices']
 values = optik_ext.check_csv(None, name, value)
 for value in values:
  if (not (value in choices)):
   msg = 'option %s: invalid value: %r, should be in %s'
   raise optik_ext.OptionValueError((msg % (name, value, choices)))
 return values

def multiple_choice_validator ( optdict , name , value ) : choices = optdict [ 'choices' ] values = optik_ext . check_csv ( None , name , value ) for value in values : if ( not ( value in choices ) ) : msg = 'option %s: invalid value: %r, should be in %s' raise optik_ext . OptionValueError ( ( msg % ( name , value , choices ) ) ) return values
validate and return a converted value for option of type choice .