import json
import yaml


def load_dict(file_name):
    """
    Reads JSON or YAML file into a dictionary
    """
    if file_name.lower().endswith(".json"):
        with open(file_name) as _f:
            return json.load(_f)

    with open(file_name) as _f:
        return yaml.full_load(_f)