def map_reader(fd, size, url, params): from disco.worker import task_io assert isinstance(fd, file) return task_io.chain_reader(fd, size, url, params)
def reader(fd, size, url, params): for e in chain_reader(fd, size, url): L = e.split() yield L[0], [float(s) for s in L[1:]]
def reader(fd, size, fname, extra): from disco.worker.task_io import chain_reader for k, v in chain_reader(fd, size, fname): yield k + extra, v
def reader(fd, size, url): from disco.worker.task_io import chain_reader for e in chain_reader(fd, size, url): L = e.split() yield L[0], [float(s) for s in L[1:]]
def open_chain(url, task=None): from disco.worker.task_io import chain_reader return chain_reader(open(url, task=task), None, url)