code: def weights(value):
      
      probs = probabilities(value)
      if abs(sum(probs) - 1.) > PRECISION:
          raise ValueError('The weights do not sum up to 1: %s' % probs)
      return probs
docs: Space-separated list of weights:
  
      >>> weights('0.1 0.2 0.7')
      [0.1, 0.2, 0.7]
  
      >>> weights('0.1 0.2 0.8')
      Traceback (most recent call last):
        ...
      ValueError: The weights do not sum up to 1: [0.1, 0.2, 0.8]