code: def validate_config_has_one_of(config, one_of_keys):
    
    intersection = set(config).intersection(one_of_keys)
    if len(intersection) > 1:
      raise Exception('Only one of the values in "%s" is needed' % ', '.join(intersection))
    if len(intersection) == 0:
      raise Exception('One of the values in "%s" is needed' % ', '.join(one_of_keys))
docs: Validate a config dictionary to make sure it has one and only one
        key in one_of_keys.
  
    Args:
      config: the config to validate.
      one_of_keys: the list of possible keys that config can have one and only one.
  
    Raises:
      Exception if the config does not have any of them, or multiple of them.