<commit_before>from celery.task import tasks, Task, PeriodicTask
from celery.timer import TimeoutError
from djangofeeds.importers import FeedImporter
from djangofeeds.messaging import refresh_all_feeds_delayed
from django.conf import settings
import threading

DEFAULT_REFRESH_EVERY = 15 * 60 # 15 minutes
DEFAULT_FEED_TIMEOUT = 10
DEFAULT_ROUTING_KEY_PREFIX = "feed"
REFRESH_EVERY = getattr(settings, "DJANGOFEEDS_REFRESH_EVERY",
                        DEFAULT_REFRESH_EVERY)
ROUTING_KEY_PREFIX = getattr(settings, "DJANGOFEEDS_ROUTING_KEY_PREFIX",
                             DEFAULT_ROUTING_KEY_PREFIX)
FEED_TIMEOUT = getattr(settings, "DJANGOFEEDS_FEED_TIMEOUT",
                       DEFAULT_FEED_TIMEOUT)


class RefreshFeedTask(Task):
    """Refresh a djangofeed feed, supports multiprocessing."""
    name = "djangofeeds.refresh_feed"
    routing_key = ".".join([DJANGOFEEDS_ROUTING_KEY_PREFIX, "feedimporter"])

    def run(self, **kwargs):
        feed_url = kwargs["feed_url"]

        def on_timeout():<commit_msg>Fix typo DJANGOFEEDS_ROUTING_KEY_PREFIX -> ROUTING_KEY_PREFIX<commit_after>from celery.task import tasks, Task, PeriodicTask
from celery.timer import TimeoutError
from djangofeeds.importers import FeedImporter
from djangofeeds.messaging import refresh_all_feeds_delayed
from django.conf import settings
import threading

DEFAULT_REFRESH_EVERY = 15 * 60 # 15 minutes
DEFAULT_FEED_TIMEOUT = 10
DEFAULT_ROUTING_KEY_PREFIX = "feed"
REFRESH_EVERY = getattr(settings, "DJANGOFEEDS_REFRESH_EVERY",
                        DEFAULT_REFRESH_EVERY)
ROUTING_KEY_PREFIX = getattr(settings, "DJANGOFEEDS_ROUTING_KEY_PREFIX",
                             DEFAULT_ROUTING_KEY_PREFIX)
FEED_TIMEOUT = getattr(settings, "DJANGOFEEDS_FEED_TIMEOUT",
                       DEFAULT_FEED_TIMEOUT)


class RefreshFeedTask(Task):
    """Refresh a djangofeed feed, supports multiprocessing."""
    name = "djangofeeds.refresh_feed"
    routing_key = ".".join([ROUTING_KEY_PREFIX, "feedimporter"])

    def run(self, **kwargs):
        feed_url = kwargs["feed_url"]

        def on_timeout():
{'fraction_non_alphanumeric': 0.07640878701050621, 'fraction_numerical': 0.007640878701050621, 'mean_word_length': 4.2375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1507523', 'n_tokens_mistral': 733, 'n_tokens_neox': 673, 'n_words': 132}