def composedict(d, srcfld):
    def g(rec):
        k = rec[srcfld]
        if k in d:
            return d[k]
        else:
            return k
    return g
dataset/ETHPy150Open alimanfoo/petl/petl/transform/maps.py/composedict/original