def nested_update_with_layers(dict_1, dict_2, layers, **kwargs):
    """Update dict_1 with dict_2, filtering away some layers.

    Example:
        >>> nested_update_with_layers(
        ...     dict_1 = {},
        ...     dict_2 = {"a": {"ii": {"1": 121, "2": 122},
        ...                     "iii": {"3": 133, "4": 134}}},
        ...     layers = ("abc", "roman", "arabic"),
        ...     roman="ii"
        ... )
        OUT: {"a": {"1": 121, "2": 122}}

    Args:
        dict_1 (dict): The dictionary to update. Can be an empty dictionary.
        dict_2 (dict): The dictionary to update it with. This will in general be a
            homogeneous multi-layered string-keyed dictionary.
        layers (iter of str): The names of the layers of dict_2. Needs to have the
            same length as the number of times you would index dict_2.
        kwargs: The filters to apply to dict_2 while updating dict_1. Each key-word
            has to be the name of a layer. Those layers will not be recreated from
            dict_1 to dict_2. Instead, the key-word argument will be used as an index,
            selecting only one branch of the lower layers of dict_2 to update into
            dict_1.
    """
    for layer_name in kwargs:
        if layer_name not in layers:
            key = kwargs.pop(layer_name)
            print(
                f"Can't filter based in {layer_name}={key} "
                f"because {key} is not in layers={layers}. This will be ignored."
            )
    if layers[0] in kwargs:
        new_kwargs = kwargs.copy()
        key = new_kwargs.pop(layers[0])
        nested_update_with_layers(dict_1, dict_2[key], layers[1:], **new_kwargs)
    else:
        for key, value in dict_2:
            if isinstance(dict_2, dict):
                if key not in dict_1:
                    dict_1[key] = {}
                nested_update_with_layers(
                    dict_1[key], dict_2[key], layers[1:], **kwargs
                )
            else:
                dict_1[key] = value
    return dict_1