def compose_maps(m1,m2):
    res = m2.copy()
    res.update((x,m2.get(y,y)) for x,y in m1.iteritems())
    return res
compose two maps as functions. a map is assumed to be the identity for keys not present
dataset/ETHPy150Open Microsoft/ivy/src/ivy/ivy_utils.py/compose_maps