def ScaleData(data, old_min, old_max, new_min, new_max):
  def ScalePoint(x):
    if x is None:
      return None
    return scale * x + translate

  if old_min == old_max:
    scale = 1
  else:
    scale = (new_max - new_min) / float(old_max - old_min)
  translate = new_min - scale * old_min
  return map(ScalePoint, data)
All values of X must be probabilities of independent events occuring according
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/_internal/graphy/backends/google_chart_api/util.py/ScaleData--crossover with--dataset/ETHPy150Open theusual/kaggle-seeclickfix-ensemble/Miroslaw/sparserbm.py/sample_bernoulli