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

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