<commit_before># Standard Libary
import datetime

# Django
from django.core.management.base import BaseCommand

from api.models import (
    Person,
)


class Command(BaseCommand):
    help = "Command to sync active status."

    def handle(self, *args, **options):
        # sync persons
        self.stdout.write("Updating active status...")
        today = datetime.date.today()
        ps = Person.objects.filter(
            status=10,
            valid_through__lt=today,
        )
        for p in ps:
            p.deactivate()
            p.save()
        self.stdout.write("Complete")<commit_msg>Add feedback to sync_active command<commit_after># Standard Libary
import datetime

# Django
from django.core.management.base import BaseCommand

from api.models import (
    Person,
)


class Command(BaseCommand):
    help = "Command to sync active status."

    def handle(self, *args, **options):
        # sync persons
        self.stdout.write("Updating active status...")
        today = datetime.date.today()
        ps = Person.objects.filter(
            status=10,
            valid_through__lt=today,
        )
        total = ps.count()
        i = 0
        for p in ps:
            i += 1
            p.deactivate()
            p.save()
            self.stdout.write("{0}/{1}".format(i, total), ending='\r')
            self.stdout.flush()
        self.stdout.write("Updated {0} persons.".format(total))
        self.stdout.write("Complete")
{'fraction_non_alphanumeric': 0.11704312114989733, 'fraction_numerical': 0.006160164271047228, 'mean_word_length': 2.090909090909091, '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': '4618382', 'n_tokens_mistral': 422, 'n_tokens_neox': 407, 'n_words': 104}