def nested_dict_path_set(
    data: dict[str, Any], path: Sequence[str], value: Any
) -> dict[str, Any]:
    """Sets a value inside a nested dict based on the list of dict keys as a path,
    and will create sub-dicts as needed to set the value."""
    sub_data = data
    for element in path[:-1]:
        if element not in sub_data:
            sub_data[element] = {}
        sub_data = sub_data[element]
    sub_data[path[len(path) - 1]] = value
    return data
Sets a value inside a nested dict based on the list of dict keys as a path,
    and will create sub-dicts as needed to set the value.
src/datachain/utils.py