def set_with_path(d, path, value):
    """In a nested dict/list data structure, set the entry at path.

    In a data structure composed of dicts, lists and tuples, apply each
    key in sequence, then set the resulting entry of the tree to value.
    This is done in-place!

    Args:
        d: Dict/list/tuple data structure
        path: List of keys
        value: Value to set

    """
    my_d = d
    for key in path[:-1]:
        my_d = my_d[key]
    my_d[path[-1]] = value
