

def _stream_files(logger, fn, mesos_files, line_prefixes):
    'Apply `fn` in parallel to each file in `mesos_files`.  `fn` must\n    return a list of strings, and these strings are then printed\n    serially as separate lines.\n    '
    reachable_files = list(mesos_files)
    for (job, mesos_file) in util.stream(fn, mesos_files):
        try:
            lines = job.result()
        except DCOSException:
            reachable_files.remove(mesos_file)
            continue
        if lines:
            _output(logger, str(mesos_file), lines, line_prefixes)
    return reachable_files

dataset/ETHPy150Open shopkeep/shpkpr/shpkpr/files.py _stream_files/original