def load(s):
    try:
        yml_dict = yaml.load(s, yaml_loader)
    except yaml.YAMLError as exc:
        msg = 'An error occurred during YAML parsing.'
        if hasattr(exc, 'problem_mark'):
            msg += ' Error position: (%s:%s)' % (exc.problem_mark.line + 1,
                                                 exc.problem_mark.column + 1)
        raise ValueError(msg)
    if not isinstance(yml_dict, dict) and not isinstance(yml_dict, list):
        raise ValueError('The source is not a YAML mapping or list.')
    if isinstance(yml_dict, dict) and len(yml_dict) < 1:
        raise ValueError('Could not find any element in your YAML mapping.')
    return yml_dict
dataset/ETHPy150Open openstack/python-solumclient/solumclient/common/yamlutils.py/load/original