def _check_list_weights(parameter, name):
    '''
    Checks that the weights in a list of tuples sums to 1.0
    '''
    if not isinstance(parameter, list):
        raise ValueError('%s must be formatted with a list of tuples' % name)
    weight = np.sum([val[1] for val in parameter])
    if fabs(weight - 1.) > 1E-8:
        raise ValueError('%s weights do not sum to 1.0!' % name)
    return parameter
Checks that the weights in a list of tuples sums to 1.0