def load_yaml(s):
    """Load a Yaml document.

    This is a helper function which tries to use the fast ``CLoader``
    implementation and falls back to the native Python version on failure.
    """
    import yaml
    try:
        from yaml import CLoader as Loader
    except ImportError:
        from yaml import Loader
    return yaml.load(s, Loader=Loader)
