'Adds a distance penalty. `key` must correspond with a
configured weight setting. `dist` must be a float between 0.0
and 1.0, and will be added to any existing distance penalties
for the same key.'

def add(self, key, dist):

    if (not (0.0 <= dist <= 1.0)):
        raise ValueError(u'`dist`    must    be    between    0.0    and    1.0,    not    {0}'.format(dist))
    self._penalties.setdefault(key, []).append(dist)
