def __new__(cls, name, bases, attrs):

        from .fields import CacheDescriptor, DefaultLanguageDescriptor
        from .mixins import ModelMixin
        from .models import Translation

        meta = None
        default_language = utils.get_fallback_language()

        if 'Meta' not in attrs or not hasattr(attrs['Meta'], 'linguist'):
            return super(ModelMeta, cls).__new__(cls, name, bases, attrs)

        validate_meta(attrs['Meta'].linguist)
        meta = attrs['Meta'].linguist
        delattr(attrs['Meta'], 'linguist')

        all_fields = dict(
            (attr_name, attr)
            for attr_name, attr in six.iteritems(attrs)
            if isinstance(attr, models.fields.Field))

        abstract_model_bases = [
            base
            for base in bases
            if hasattr(base, '_meta') and base._meta.abstract
        ]

        for base in abstract_model_bases:
            all_fields.update(dict((field.name, field) for field in base._meta.fields))

        #
        # Save original fields, then delete them.
        #

        original_fields = {}

        for field in meta['fields']:

            if field not in all_fields:
                raise ImproperlyConfigured(
                    "There is no field %(field)s in model %(name)s, "
                    "as specified in Meta's translate attribute" %
                    dict(field=field, name=name))

            original_fields[field] = all_fields[field]

            if attrs in field:
                del attrs[field]

        #
        # Auto-add Mixins
        #

        bases = (ModelMixin, ) + bases

        #
        # Let's create class
        #

        new_class = super(ModelMeta, cls).__new__(cls, name, bases, attrs)

        #
        # instance._linguist / instance.default_language descriptors
        #

        setattr(new_class, '_linguist', CacheDescriptor(meta=meta))
        setattr(new_class, 'default_language', DefaultLanguageDescriptor())

        #
        # Decider
        #

        decider = meta.get('decider', Translation)

        if not hasattr(decider, 'linguist_models'):
            decider.linguist_models = []

        decider.linguist_models.append(new_class)

        #
        # Language fields
        #

        for field_name, field in six.iteritems(original_fields):

            field.name = field_name
            field.model = new_class

            if not field.verbose_name:
                field.verbose_name = pretty_name(field_name)

            for lang in settings.SUPPORTED_LANGUAGES:

                lang_code = lang[LANGUAGE_CODE]
                lang_attr = create_translation_field(field, lang_code)
                lang_attr_name = utils.get_real_field_name(field_name, lang_code)

                if lang_code != default_language:
                    if not lang_attr.null and lang_attr.default is NOT_PROVIDED:
                        lang_attr.null = True
                    if not lang_attr.blank:
                        lang_attr.blank = True

                lang_attr.contribute_to_class(new_class, lang_attr_name)

            setattr(new_class,
                    field_name,
                    property(default_value_getter(field_name), default_value_setter(field_name)))

        #
        # Linguist Meta
        #

        new_class._meta.linguist = meta

        return new_class
dataset/ETHPy150Open ulule/django-linguist/linguist/metaclasses.py/ModelMeta.__new__/swapped operands of `in`