def handle(self, **options):
        print("Starting clean up of django-defender table")
        now = timezone.now()
        cleanup_delta = timedelta(hours=config.ACCESS_ATTEMPT_EXPIRATION)
        min_attempt_time = now - cleanup_delta

        attempts_to_clean = AccessAttempt.objects.filter(
            attempt_time__lt=min_attempt_time,
        )
        attempts_to_clean_count = attempts_to_clean.count()

        attempts_to_clean.delete()

        print(
            "Finished. Removed {0} AccessAttempt entries.".format(
                attempts_to_clean_count)
        )
A simple process that wrap the output with header and footer.
dataset/ETHPy150Open kencochrane/django-defender/defender/management/commands/cleanup_django_defender.py/Command.handle--crossover with--dataset/ETHPy150Open bloomreach/briefly/examples/shell_pipeline/shell_pipeline.py/pretty_print