def merge_dict_of_lists(d1: dict, d2: dict) -> dict:
    """Merge two dicts of lists.

    Parameters
    ----------
    d1 : dict
        The first dict to merge.
    d2 : dict
        The second dict to merge.

    Returns
    -------
    dict
        The merged dict.
    """
    ret = {k: list(v) for k, v in d1.items()}
    for k, _ in d1.items():
        if k in d2.keys():
            ret[k] += d2[k]
        else:
            ret[k] = d2[k]
    return ret