# Path: loom/util.py
# @contextlib.contextmanager
# def csv_reader(filename):
#     with open_compressed(filename, 'rb') as f:
#         yield csv.reader(f)


import os
import functools
import loom.datasets
import loom.store
from nose.tools import assert_true
from distributions.io.stream import protobuf_stream_load
from loom.util import csv_reader
from loom.schema_pb2 import Row
        kwargs.update(paths['ingest'])
        kwargs.update(paths)
        fun(**kwargs)

    @functools.wraps(fun)
    def test_all():
        for dataset in loom.datasets.TEST_CONFIGS:
            yield test_one, dataset

    return test_all


def load_rows(filename):
    rows = []
    for string in protobuf_stream_load(filename):
        row = Row()
        row.ParseFromString(string)
        rows.append(row)
    return rows


def load_rows_raw(filename):
    return list(protobuf_stream_load(filename))


def load_rows_csv(dirname):
    filenames = os.listdir(dirname)
    rows = [None]
    for filename in filenames:
        filename = os.path.join(dirname, filename)

# Path: loom/util.py
# @contextlib.contextmanager
# def csv_reader(filename):
#     with open_compressed(filename, 'rb') as f:
#         yield csv.reader(f)


# Path: loom/test/util.py
import os
import functools
import loom.datasets
import loom.store
from nose.tools import assert_true
from distributions.io.stream import protobuf_stream_load
from loom.util import csv_reader
from loom.schema_pb2 import Row

        kwargs.update(paths['ingest'])
        kwargs.update(paths)
        fun(**kwargs)

    @functools.wraps(fun)
    def test_all():
        for dataset in loom.datasets.TEST_CONFIGS:
            yield test_one, dataset

    return test_all


def load_rows(filename):
    rows = []
    for string in protobuf_stream_load(filename):
        row = Row()
        row.ParseFromString(string)
        rows.append(row)
    return rows


def load_rows_raw(filename):
    return list(protobuf_stream_load(filename))


def load_rows_csv(dirname):
    filenames = os.listdir(dirname)
    rows = [None]
    for filename in filenames:
        filename = os.path.join(dirname, filename)

        with csv_reader(filename) as reader: