<commit_before>from django.core.management.base import BaseCommand
from django.conf import settings

from django_cron import CronJobManager


def get_class( kls ):
    """TODO: move to django-common app.
    Converts a string to a class. Courtesy: http://stackoverflow.com/questions/452969/does-python-have-an-equivalent-to-java-class-forname/452981#452981"""
    parts = kls.split('.')
    module = ".".join(parts[:-1])
    m = __import__( module )
    for comp in parts[1:]:
        m = getattr(m, comp)            
    return m

CRONS_TO_RUN = map(lambda x: get_class(x), settings.CRONS_CLASSES)

class Command(BaseCommand):
    def handle(self, *args, **options):
        for cron_class in CRONS_TO_RUN:
            instance = cron_class()
            CronJobManager.run(instance)<commit_msg>Looking for CRONS_CLASSES, think it's just a simple miss-type or the read me is a miss type<commit_after>from django.core.management.base import BaseCommand
from django.conf import settings

from django_cron import CronJobManager


def get_class( kls ):
    """TODO: move to django-common app.
    Converts a string to a class. Courtesy: http://stackoverflow.com/questions/452969/does-python-have-an-equivalent-to-java-class-forname/452981#452981"""
    parts = kls.split('.')
    module = ".".join(parts[:-1])
    m = __import__( module )
    for comp in parts[1:]:
        m = getattr(m, comp)            
    return m

CRONS_TO_RUN = map(lambda x: get_class(x), settings.CRON_CLASSES)

class Command(BaseCommand):
    def handle(self, *args, **options):
        for cron_class in CRONS_TO_RUN:
            instance = cron_class()
            CronJobManager.run(instance)
{'fraction_non_alphanumeric': 0.11324146195326543, 'fraction_numerical': 0.02396644697423607, 'mean_word_length': 3.260204081632653, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '122395', 'n_tokens_mistral': 577, 'n_tokens_neox': 531, 'n_words': 139}