weightedRand and weightedChoice

In PythonUtil.py there are two interesting helper functions: weightedRand and weightedChoice.

I don’t understand the difference between these functions in terms of their outcome. Could somebody please explain it? I only see differences in their signature.

It seems weightedRand returns a random key from the dict you passed (depending on its weight, which is the corresponding value in the dict) and weightedChoice returns the second element of the chosen pair from the list you passed (randomly depending on the first element, which represent the weight).