<commit_before>from django.contrib.admin.sites import AdminSite as DjangoAdminSite
from django.contrib.admin.sites import site as django_site


class HatbandAndDjangoRegistry(object):
    def __init__(self, site):
        super(HatbandAndDjangoRegistry, self).__init__()
        self._site = site
        self._registry = {}
        self.dicts = [self._registry, django_site._registry]

    def items(self):
        for d in self.dicts:
            for item in d.items():
                yield item

    def iteritems(self):
        return iter(self.items())

    def __contains__(self, k):
        return k in self._registry or k in django_site._registry


class AdminSite(DjangoAdminSite):
    def __init__(self, *args, **kwargs):
        super(AdminSite, self).__init__(*args, **kwargs)
        self._registry = HatbandAndDjangoRegistry(self)<commit_msg>fix this so it uses self.dicts and can check multiples<commit_after>from django.contrib.admin.sites import AdminSite as DjangoAdminSite
from django.contrib.admin.sites import site as django_site


class HatbandAndDjangoRegistry(object):
    def __init__(self, site):
        super(HatbandAndDjangoRegistry, self).__init__()
        self._site = site
        self._registry = {}
        self.dicts = [self._registry, django_site._registry]

    def items(self):
        for d in self.dicts:
            for item in d.items():
                yield item

    def iteritems(self):
        return iter(self.items())

    def __contains__(self, k):
        for d in self.dicts:
            if k in d:
                return True
        return False


class AdminSite(DjangoAdminSite):
    def __init__(self, *args, **kwargs):
        super(AdminSite, self).__init__(*args, **kwargs)
        self._registry = HatbandAndDjangoRegistry(self)
{'fraction_non_alphanumeric': 0.09380234505862646, 'fraction_numerical': 0.0, 'mean_word_length': 2.764705882352941, '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': '89387', 'n_tokens_mistral': 524, 'n_tokens_neox': 503, 'n_words': 138}