def unneeded_files():
    putative = (lambda f: (f.is_remote and (not f.protected) and (not f.should_keep_local)))
    generated_input = set()
    for (job_, files) in self.dependencies[job].items():
        generated_input |= files
        for f in filter(putative, files):
            if (not needed(job_, f)):
                (yield f)
    for (f, f_) in zip(job.output, job.rule.output):
        if (putative(f) and (not needed(job, f)) and (not (f in self.targetfiles))):
            if (f in job.dynamic_output):
                for f_ in job.expand_dynamic(f_):
                    (yield f_)
            else:
                (yield f)
    for f in filter(putative, job.input):
        if (f not in generated_input):
            (yield f)
def unneeded_files():
    putative = (lambda f: (f.is_remote and (not f.protected) and (not f.should_keep_local)))
    generated_input = set()
    for (job_, files) in self.dependencies[job].items():
        generated_input |= files
        for f in filter(putative, files):
            if (not needed(job_, f)):
                (yield f)
    for (f, f_) in zip(job.output, job.rule.output):
        if (putative(f) and (not needed(job, f)) and (not (f in self.targetfiles))):
            if (f in job.dynamic_output):
                for f_ in job.expand_dynamic(f_):
                    (yield f_)
            else:
                (yield f)
    for f in filter(putative, job.input):
        if (f not in generated_input):
            (yield f)