import yaml


def load_template(filename):
    """Load a Json object from a file. The file may either be in Yaml or in Json
    format.

    Parameters
    ----------
    filename: string
        Path to file on disk

    Returns
    -------
    dict
    """
    with open(filename, 'r') as f:
        return yaml.load(f.read(), Loader=yaml.FullLoader)