def files(fn, fltr, flist, active_only=False, fail=True):
    global dne

    tlist = MASTER.tasks(fltr, active_only=active_only)
    dne = True

    def process((task, fname)):
        global dne

        try:
            fobj = task.file(fname)
        except exceptions.SlaveDoesNotExist:
            if missing_slave not in task["id"]:
                cli.header("{0}:{1}".format(
                    task["id"], fname))
                print("Slave no longer exists.")

            missing_slave.add(task["id"])
            raise exceptions.SkipResult

        if fobj.exists():

            dne = False
            return fn(fobj)

    elements = itertools.chain(
        *[[(task, fname) for fname in flist] for task in tlist])

    for result in parallel.stream(process, elements):
        if not result:
            continue
        yield result

    if dne and fail:
        log.fatal("No such task has the requested file or directory")
dataset/ETHPy150Open mesosphere/mesos-cli/mesos/cli/cluster.py/files/swapped operands of `not in`