<commit_before>from django.conf import settings
import re
import sys


class DisposableEmailChecker():
    """
    Check if an email is from a disposable
    email service
    """
    
    def __init__(self):
        self.emails = [line.strip() for line in open(settings.DISPOSABLE_EMAIL_DOMAINS)]
    
    def chunk(l,n):
        return (l[i:i+n] for i in xrange(0, len(l), n))
    
    def is_disposable(self, email):
        for email_group in self.chunk(self.emails, 20):
            regex = "(.*" + ")|(.*".join(email_group) + ")"
            if re.match(regex, email):
                return True
    
        return False<commit_msg>Fix bug in chunk arguments<commit_after>from django.conf import settings
import re
import sys


class DisposableEmailChecker():
    """
    Check if an email is from a disposable
    email service
    """
    
    def __init__(self):
        self.emails = [line.strip() for line in open(settings.DISPOSABLE_EMAIL_DOMAINS)]
    
    def chunk(self,l,n):
        return (l[i:i+n] for i in xrange(0, len(l), n))
    
    def is_disposable(self, email):
        for email_group in self.chunk(self.emails, 20):
            regex = "(.*" + ")|(.*".join(email_group) + ")"
            if re.match(regex, email):
                return True
    
        return False
{'fraction_non_alphanumeric': 0.12095531587057011, 'fraction_numerical': 0.004622496147919877, 'mean_word_length': 2.3053435114503817, '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': '231549', 'n_tokens_mistral': 421, 'n_tokens_neox': 408, 'n_words': 113}