def register(self, class_):
        """
        Accepts ``class_``, a class object that must extend ``base``. The
        class is added to the registry. the register method can be used as a
        regular method::

            registry.register(MyClass)

        Or as a class decorator::

            @registry.register
            class MyClass:
                pass

        The exception ``appregister.base.AlreadyRegistered`` is raised if the
        class has already been registered, as defined by the ``is_registered``
        method.

        The exception ``appregister.base.InvalidOperation`` is raised if the
        class is not a valid addition to this register, as defined by the
        ``is_valid`` method.
        """

        if not self.is_valid(class_):
            msg = "Object '%s' is not a subclass of '%s'" % (class_.__name__,
                self.base.__name__)
            raise InvalidOperation(msg)

        if self.is_registered(class_):
            msg = class_.__name__ % "Object '%s' has already been registered"
            raise AlreadyRegistered(msg)

        self.add_class(class_)

        # Return the original class to allow this method to be used as a
        # class based decorator.
        return class_
dataset/ETHPy150Open d0ugal-archive/django-appregister/appregister/base.py/Registry.register/swapped operands of `%`