def nested_update(
    d: Dict[AnyKey, Any], *updating_d: Dict[AnyKey, Any]
) -> Dict[AnyKey, Any]:
    """
    Update a nested dictionary `d` with the content of an other dictionary `updating_d`.
    """
    # from https://github.com/pydantic/pydantic/blob/9d631a3429a66f30742c1a52c94ac18ec6ba848d/pydantic/utils.py#L198
    updated_mapping = d.copy()
    for updating_mapping in updating_d:
        for k, v in updating_mapping.items():
            if (
                k in updated_mapping
                and isinstance(updated_mapping[k], dict)
                and isinstance(v, dict)
            ):
                updated_mapping[k] = nested_update(updated_mapping[k], v)
            else:
                updated_mapping[k] = v
    return updated_mapping

    Update a nested dictionary `d` with the content of an other dictionary `updating_d`.
    
fortuna/utils/nested_dicts.py