def asdict(hdr, row, missing=None):
    flds = [text_type(f) for f in hdr]
    try:
        # list comprehension should be faster
        items = [(flds[i], row[i]) for i in range(len(flds))]
    except IndexError:
        # short row, fall back to slower for loop
        items = list()
        for i, f in enumerate(flds):
            try:
                v = row[i]
            except __HOLE__:
                v = missing
            items.append((f, v))
    return dict(items)
dataset/ETHPy150Open alimanfoo/petl/petl/util/base.py/asdict