def merge_mappings(target, other, function=(lambda x, y: (x + y))):
 assert (set(target) == set(other)), 'keys must match'
 return {k: function(v, other[k]) for (k, v) in target.items()}

def merge_mappings ( target , other , function = ( lambda x , y : ( x + y ) ) ) : assert ( set ( target ) == set ( other ) ) , 'keys must match' return { k : function ( v , other [ k ] ) for ( k , v ) in target . items ( ) }
merge two mappings into a single mapping .