import yaml


def load_yaml(path):
    """
    Function to load a yaml file and
    return the collected dict(s)

    Parameters
    ----------
    path : str
        The path to the yaml config file

    Returns
    -------
    result : dict
        The dictionary from the config file
    """

    assert isinstance(path, str), "Provided path is not a string"
    try:
        f = open(path, "r")
        result = yaml.load(f, Loader=yaml.Loader)
    except FileNotFoundError as e:
        # Adding this for future functionality
        raise e
    return result