def add_parameter_group_to_list_of_dicts( Dlist, names, values ):
    """
    Copies and returns the given list of dictionaries but with
    names[0]=values[0] and names[1]=values[1] etc added to each.
    """
    assert len(names) == len(values)
    N = len(names)

    new_Dlist = []

    for D in Dlist:
        newD = D.copy()
        for i in range(N):
            newD[ names[i] ] = values[i]
        new_Dlist.append( newD )

    return new_Dlist