

def addmul_number_dicts(series):
    'Multiply dictionaries by a numeric values and add them together.\n\n:parameter series: a tuple of two elements tuples. Each serie is of the form::\n\n        (weight,dictionary)\n\n    where ``weight`` is a number and ``dictionary`` is a dictionary with\n    numeric values.\n:parameter skip: optional list of field names to skip.\n\nOnly common fields are aggregated. If a field has a non-numeric value it is\nnot included either.'
    if (not series):
        return
    vtype = value_type((s[1] for s in series))
    if (vtype == 1):
        return sum(((weight * float(d)) for (weight, d) in series))
    elif (vtype == 3):
        keys = set(series[0][1])
        for serie in series[1:]:
            keys.intersection_update(serie[1])
        results = {
            
        }
        for key in keys:
            key_series = tuple(((weight, d[key]) for (weight, d) in series))
            result = addmul_number_dicts(key_series)
            if (result is not None):
                results[key] = result
        return results

dataset/ETHPy150Open lsbardel/python-stdnet/stdnet/utils/jsontools.py addmul_number_dicts/original