def normDict(d, normalizeTo=1):
  ''' Normalize the values of d by setting the largest value in d.values
      to normalizeTo. The return dict will have it's values spreading
      between 0~normalizeTo'''
  ks = d.keys()
  vs = d.values()
  vMax = max(vs)
  vs= [ x/(vMax*1.0)*normalizeTo for x in vs]
  return dict(zip(ks, vs))
 Normalize the values of d by setting the largest value in d.values
      to normalizeTo. The return dict will have it's values spreading
      between 0~normalizeTo
recipes/Python/278259_Dictionary_Tools/recipe-278259.py