

def import_set(dset, in_stream, headers=True, **kwargs):
    'Returns dataset from CSV stream.'
    dset.wipe()
    kwargs.setdefault('delimiter', DEFAULT_DELIMITER)
    if (not is_py3):
        kwargs.setdefault('encoding', DEFAULT_ENCODING)
    rows = csv.reader(StringIO(in_stream), **kwargs)
    for (i, row) in enumerate(rows):
        if ((i == 0) and headers):
            dset.headers = row
        else:
            dset.append(row)

dataset/ETHPy150Open kennethreitz/tablib/tablib/formats/_csv.py import_set/original