def accumDict(d, normalizeTo=None):
    ''' if d.values=[1,2,3,4,5]: 
        accumDict(d).values ==>   [1, 3, 6, 10, 15]
        if d.values=[0.25, 0.25, 0.25, 0.25]
        accumDict(d).values ==>   [0.25, 0.50, 0.75, 1.00]

        Required: odict()
        Ordered Dictionary Class
        Dave Benjamin 
        http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/161403
    '''
    ks = d.keys()
    vs = d.values()
    if normalizeTo: vs = normListSumTo(vs, sumTo=normalizeTo)

    r = range(1, len(vs))
    newList=[vs[0]]
    for i in r:
        newList.append( newList[-1]+ vs[i] )
    
    odic = odict()
    for i in range(len(newList)):
        odic[ks[i]] =newList[i]
    return odic
 if d.values=[1,2,3,4,5]: 
        accumDict(d).values ==>   [1, 3, 6, 10, 15]
        if d.values=[0.25, 0.25, 0.25, 0.25]
        accumDict(d).values ==>   [0.25, 0.50, 0.75, 1.00]

        Required: odict()
        Ordered Dictionary Class
        Dave Benjamin 
        http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/161403
    
recipes/Python/278259_Dictionary_Tools/recipe-278259.py