def dict_union_combine(dict1, dict2, combine_op=op.add,
                       default=util_const.NoParam,
                       default2=util_const.NoParam):
    """
    Combine of dict keys and uses dfault value when key does not exist

    CAREFUL WHEN USING THIS WITH REDUCE. Use dict_stack2 instead
    """
    keys3 = set(dict1.keys()).union(set(dict2.keys()))
    if default is util_const.NoParam:
        dict3 = {key: combine_op(dict1[key], dict2[key]) for key in keys3}
    else:
        if default2 is util_const.NoParam:
            default2 = default
        dict3 = {key: combine_op(dict1.get(key, default), dict2.get(key, default2))
                 for key in keys3}
    return dict3
def dict_union_combine ( dict1 , dict2 , combine_op = op . add , default = util_const . NoParam , default2 = util_const . NoParam ) : keys3 = set ( dict1 . keys ( ) ) . union ( set ( dict2 . keys ( ) ) ) if default is util_const . NoParam : dict3 = { key : combine_op ( dict1 [ key ] , dict2 [ key ] ) for key in keys3 } else : if default2 is util_const . NoParam : default2 = default dict3 = { key : combine_op ( dict1 . get ( key , default ) , dict2 . get ( key , default2 ) ) for key in keys3 } return dict3
Combine of dict keys and uses dfault value when key does not exist

    CAREFUL WHEN USING THIS WITH REDUCE. Use dict_stack2 instead