Files @ f974a462133f
Branch filter:

Location: light9/light8/util.py

drewp
added light8 from the posted light8-1.0.tgz

def maxes(dicts):
    '''
    ({'a' : 5, 'b' : 9}, {'a' : 10, 'b' : 943})
    '''
    newdict = {}
    for d in dicts:
        for k,v in d.items():
            newdict[k] = max(v, newdict.get(k, 0))
    return newdict

def scaledict(d,scl):
    # scales all values in dict and returns a new dict
    return dict([(k,v*scl) for k,v in d.items()])
    
# class Setting that scales, maxes