<commit_before># -*- coding: utf-8 -*-

"""
Autojit meta class.
"""

from __future__ import print_function, division, absolute_import

class _AutojitMeta(type):
    """
    Metaclass base for autojit classes.
    """

def create_unspecialized_cls(py_class, class_specializer):
    """
    Create an unspecialized class.

    class_specializer:
        NumbaSpecializingWrapper (args -> specialized object instance)
    """

    class AutojitMeta(_AutojitMeta, type(py_class)):
        """
        Metaclass base for autojit classes.

            AutojitMeta -> UnspecializedClass -> SpecializedInstance
        """

        def __call__(cls, *args, **kwargs):
            return class_specializer(*args, **kwargs)

        def __getitem__(cls, key):
            assert isinstance(key, dict)

            for specialized_cls in cls.specializations:
                attrdict = specialized_cls.exttype.attribute_table.attributedict
                if attrdict == key:
                    return specialized_cls

            raise KeyError(key)

        @property<commit_msg>Fix autojit metaclass mro conflict<commit_after># -*- coding: utf-8 -*-

"""
Autojit meta class.
"""

from __future__ import print_function, division, absolute_import

class _AutojitMeta(type):
    """
    Metaclass base for autojit classes.
    """

def create_unspecialized_cls(py_class, class_specializer):
    """
    Create an unspecialized class.

    class_specializer:
        NumbaSpecializingWrapper (args -> specialized object instance)
    """

    class AutojitMeta(type(py_class)):
        """
        Metaclass base for autojit classes.

            AutojitMeta -> UnspecializedClass -> SpecializedInstance
        """

        def __call__(cls, *args, **kwargs):
            return class_specializer(*args, **kwargs)

        def __getitem__(cls, key):
            assert isinstance(key, dict)

            for specialized_cls in cls.specializations:
                attrdict = specialized_cls.exttype.attribute_table.attributedict
                if attrdict == key:
                    return specialized_cls

            raise KeyError(key)

        @property
{'fraction_non_alphanumeric': 0.08980921358771522, 'fraction_numerical': 0.0009306654257794323, 'mean_word_length': 2.4235668789808917, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '7562864', 'n_tokens_mistral': 601, 'n_tokens_neox': 580, 'n_words': 142}