def load_yaml(filename):
    """Read a YAML document from a file. If the file cannot be read or
    parsed, a ConfigReadError is raised.
    """
    try:
        with open(filename, 'r') as f:
            return yaml.load(f, Loader=Loader)
    except (__HOLE__, yaml.error.YAMLError) as exc:
        raise ConfigReadError(filename, exc)


# YAML dumping.
dataset/ETHPy150Open beetbox/beets/beets/util/confit.py/load_yaml