docs: def rescale(inlist, newrange=(0, 1)):
      """
      rescale the values in a list between the values in newrange (a tuple with the new minimum and maximum)
      """
      OldMax = max(inlist)
      OldMin = min(inlist)
      
      if OldMin == OldMax:
          raise RuntimeError('list contains of only one unique value')
      
      OldRange = OldMax - OldMin
      NewRange = newrange[1] - newrange[0]
      result = [(((float(x) - OldMin) * NewRange) / OldRange) + newrange[0] for x in inlist]
      return result