def register(self, app=None, discovering_apps=False):
        # allow use as a decorator
        if app is None:
            return lambda app: self.register(app, discovering_apps)

        if app.__module__.split('.')[-1] == 'cms_app':
            warnings.warn('cms_app.py filename is deprecated, '
                          'and it will be removed in version 3.4; '
                          'please rename it to cms_apps.py', DeprecationWarning)

        if self.apphooks and not discovering_apps:
            return app

        if app.__name__ in self.apps:
            raise AppAlreadyRegistered(
                app.__name__ % 'A CMS application %r is already registered')

        if not issubclass(app, CMSApp):
            raise ImproperlyConfigured(
                'CMS application must inherit from cms.app_base.CMSApp, '
                'but %r does not' % app.__name__)

        if not hasattr(app, 'menus') and hasattr(app, 'menu'):
            warnings.warn("You define a 'menu' attribute on CMS application "
                "%r, but the 'menus' attribute is empty, "
                "did you make a typo?" % app.__name__)

        self.apps[app.__name__] = app()
        return app
dataset/ETHPy150Open divio/django-cms/cms/apphook_pool.py/ApphookPool.register/swapped operands of `%`