def _from_yaml(stream):
    """Load data form a YAML file or string."""
    from yaml import load
    try:
        from yaml import CLoader as Loader
    except ImportError:
        from yaml import Loader
    data = load(stream, Loader=Loader)
    return data
