code: def _CheckData(yaml_data):
    
    legal_keys = set(('blacklist', 'whitelist'))
    unknown_keys = set(yaml_data) - legal_keys
    if unknown_keys:
      raise UnknownConfigKeyError(
          'Unknown keys in configuration: %s' % unknown_keys)
  
    for key, data in six.iteritems(yaml_data):
      _AssertDataIsList(key, data)
docs: Checks data for illegal keys and formatting.