import yaml


def load_yaml(filename: str) -> dict:
    """Load a YAML file;

    .. code-block:: python

        >>> from gadalang_lang import test_utils
        >>>
        >>> test_utils.load_yaml(test_utils.data_yml_path())
        {'a': 1, 'b': 2}
        >>>

    :param filename: file to load
    :return: JSON object
    """
    with open(filename, "r") as f:
        return yaml.safe_load(f.read())