import json


def load_dict_from_json(file_: str, key_type: type = int):
    """
    Read in json file. Convert keys to `key_type'.
    Inverse to `save_dict_to_json`.

    Parameters
    ----------
    file_:
        Name of the file to read in.
    key_type:
        Type to convert the keys into.

    Returns
    -------
    dct: The json file contents.
    """
    with open(file_, 'r') as f:
        _dct = json.load(f)
    dct = {}
    for key, val in _dct.items():
        dct[key_type(key)] = val
    return dct