

def iterrowmapmany(source, rowgenerator, header, failonerror):
    it = iter(source)
    hdr = next(it)
    flds = list(map(text_type, hdr))
    (yield tuple(header))
    it = (Record(row, flds) for row in it)
    for row in it:
        try:
            for outrow in rowgenerator(row):
                (yield tuple(outrow))
        except Exception as e:
            if failonerror:
                raise e
            else:
                pass

dataset/ETHPy150Open alimanfoo/petl/petl/transform/maps.py iterrowmapmany/original