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

from axes.utils import reset


class Command(BaseCommand):
    help = ("resets any lockouts or failed login records. If called with an "
            "IP, resets only for that IP")

    def add_arguments(self, parser):
        parser.add_argument('ip', nargs='*')

    def handle(self, *args, **kwargs):
        count = 0
        if kwargs and kwargs.get('ip'):
            for ip in kwargs['ip']:
                count += reset(ip=ip)
        else:
            count = reset()

        if count:
            print('{0} attempts removed.'.format(count))
        else:
            print('No attempts found.')<commit_msg>Fix bug when using the optional IP parameter<commit_after>from django.core.management.base import BaseCommand

from axes.utils import reset


class Command(BaseCommand):
    help = ("resets any lockouts or failed login records. If called with an "
            "IP, resets only for that IP")

    def add_arguments(self, parser):
        parser.add_argument('ip', nargs='*')

    def handle(self, *args, **kwargs):
        count = 0
        if kwargs and kwargs.get('ip'):
            for ip in kwargs['ip'][1:]:
                count += reset(ip=ip)
        else:
            count = reset()

        if count:
            print('{0} attempts removed.'.format(count))
        else:
            print('No attempts found.')
{'fraction_non_alphanumeric': 0.11442786069651742, 'fraction_numerical': 0.0035536602700781805, 'mean_word_length': 2.18552036199095, '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': '7542653', 'n_tokens_mistral': 394, 'n_tokens_neox': 385, 'n_words': 128}