def pwordfreq(view, fnames):
    assert len(fnames) == len(view.targets)
    view.scatter('fname', fnames, flatten=True)
    ar = view.apply(wordfreq, Reference('fname'))
    freqs_list = ar.get()
    word_set = set()
    for f in freqs_list:
        word_set.update(list(f.keys()))
    freqs = dict(list(zip(word_set, repeat(0))))
    for f in freqs_list:
        for word, count in f.items():
            freqs[word] += count
    return freqs
Parallel word frequency counter.
dataset/ETHPy150Open ipython/ipython-py3k/docs/examples/newparallel/davinci/pwordfreq.py/pwordfreq