code: def validate_config_value(value, possible_values):
    
    if value not in possible_values:
      raise Exception('Invalid config value "%s". Possible values are '
                      '%s' % (value, ', '.join(e for e in possible_values)))
docs: Validate a config value to make sure it is one of the possible values.
  
    Args:
      value: the config value to validate.
      possible_values: the possible values the value can be
  
    Raises:
      Exception if the value is not one of possible values.