<commit_before><commit_msg>adapter<commit_after>from courses.models import Department
from ccxp.fetch import Browser


def update_departments():
    count = 0
    for department in Browser().get_departments():
        obj, created = Department.objects.get_or_create(**department)
        count += created
    print(count, 'departments created.')
{'fraction_non_alphanumeric': 0.09855072463768116, 'fraction_numerical': 0.002898550724637681, 'mean_word_length': 4.492063492063492, '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': '3696642', 'n_tokens_mistral': 101, 'n_tokens_neox': 90, 'n_words': 24}