def _calculate_word_prob_all():
    links = Link.objects.all().order_by('-created_on')[:max_links_in_corpus]
    try:
        corpus = file(sample_corpus_location, 'r')
        corpus_created = os.path.getmtime(sample_corpus_location)
        diff = datetime.now() - datetime.fromtimestamp(corpus_created)
        if diff.days > calculate_corpus_after:
            raise IOError
        all_corpus = pickle.load(corpus)
        corpus.close()
    except __HOLE__:
        all_corpus = _calculate_word_prob(links)
        corpus = file(sample_corpus_location, 'w')
        pickle.dump(all_corpus, corpus)
        corpus.close()
    return all_corpus
dataset/ETHPy150Open agiliq/django-socialnews/socialnews/news/cron.py/_calculate_word_prob_all