docs: def weight_list_to_tuple(data, attr_name):
      '''
      Converts a list of values and corresponding weights to a tuple of values
      '''
  
      if len(data['Value']) != len(data['Weight']):
          raise ValueError('Number of weights do not correspond to number of '
                           'attributes in %s' % attr_name)
      weight = np.array(data['Weight'])
      if fabs(np.sum(weight) - 1.) > 1E-7:
          raise ValueError('Weights do not sum to 1.0 in %s' % attr_name)
  
      data_tuple = []
      for iloc, value in enumerate(data['Value']):
          data_tuple.append((value, weight[iloc]))
      return data_tuple