code: def Read(f):
    
    try:
      yaml_data = yaml.load(f)
    except yaml.YAMLError as e:
      raise ParseError('%s' % e)
    except IOError as e:
      raise YAMLLoadError('%s' % e)
  
    _CheckData(yaml_data)
  
    try:
      return Config(
          yaml_data.get('blacklist', ()),
          yaml_data.get('whitelist', ('*')))
    except UnicodeDecodeError as e:
      raise YAMLLoadError('%s' % e)
docs: Reads and returns Config data from a yaml file.
  
    Args:
      f: Yaml file to parse.
  
    Returns:
      Config object as defined in this file.
  
    Raises:
      Error (some subclass): If there is a problem loading or parsing the file.