this is called in project urls.py
    for registering desired modules (eg.: admin.py)
187962
def call_modules(auto_discover=()):
    
    for app in settings.INSTALLED_APPS:
        modules = set(auto_discover)
        if app in INSTALLED_APPS_REGISTER:
            modules.update(INSTALLED_APPS_REGISTER[app])
        for module in modules:
            mod = import_module(app)
            try:
                import_module('%s.%s' % (app, module))
                inst = getattr(mod, '__install__', lambda: None)
                inst()
            except:
                if module_has_submodule(mod, module):
                    raise
    app_modules_loaded.send(sender=None)
295968
def registration_backend(backend=None, namespace=None):
    # type: (Optional[Text], Optional[Text]) -> BaseBackend
    
    backend = backend or ORGS_REGISTRATION_BACKEND
    class_module, class_name = backend.rsplit(".", 1)
    mod = import_module(class_module)
    return getattr(mod, class_name)(namespace=namespace)
619988
def register_bootstrap_functions():
    '''

    '''

    # This can be called twice if '.pth' file bootstrapping works and
    # the 'autowrapt' wrapper script is still also used. We therefore
    # protect ourselves just in case it is called a second time as we
    # only want to force registration once.

    global _registered

    if _registered:
        return 

    _registered = True

    # It should be safe to import wrapt at this point as this code will
    # be executed after all Python module search directories have been
    # added to the module search path.

    from wrapt import discover_post_import_hooks

    for name in os.environ.get('AUTOWRAPT_BOOTSTRAP', '').split(','):
        discover_post_import_hooks(name)
633096
def register_all_in_module(module_instance, exclude_name_list=[], admin_class_list=None):
    
    class_list = []
    for name, obj in inspect.getmembers(module_instance):
        if inspect.isclass(obj):
            if obj.__name__ in exclude_name_list:
                continue
            class_list.append(obj)
    #print class_list, admin_class_list
    register_all(class_list, admin_class_list)
374131
def get_admin_urls_for_registration(self):
        
        urls = []
        for instance in self.modeladmin_instances:
            urls.extend(instance.get_admin_urls_for_registration())
        return urls
1343203
def register_module(module=None):
    

    global REGISTERED_MODULES

    if module is None:
        # Note: inspect.getmodule() can return the wrong module if it has been imported with different relatives paths.
        module = sys.modules.get(inspect.currentframe().f_back.f_globals["__name__"])

    REGISTERED_MODULES.add(module)
    return True
1291750
def register(conf, conf_admin, **options):
    
    assert issubclass(conf_admin, ConfigAdmin), (
        'conf_admin is not a ConfigAdmin subclass')
    assert issubclass(
        getattr(conf_admin, 'change_list_form', None),
        ConfigForm), 'No change_list_form set'
    assert issubclass(conf, Config), (
        'conf is not a Config subclass')
    assert conf.app_label, 'No app_label set'
    assert conf.verbose_name_plural, 'No verbose_name_plural set'
    assert not conf.name or re.match(r"^[a-zA-Z_]+$", conf.name), (
        'Not a valid name. Valid chars are [a-zA-Z_]')
    config_class = type("Config", (), {})
    config_class._meta = type("Meta", (_ConfigMeta,), {
        'app_label': conf.app_label,
        'verbose_name_plural': conf.verbose_name_plural,
        'object_name': 'Config',
        'model_name': conf.name,
        'module_name': conf.name})
    admin.site.register([config_class], conf_admin, **options)
1217336
def _manage(target, extra='', proj_settings=PROJ_SETTINGS):
    """"""
    local("export PYTHONPATH='' && "
          "export DJANGO_SETTINGS_MODULE='%s' && "
          "django-admin.py %s %s" %
          (proj_settings, target, extra),
          capture=False)
1362856
def get_symlinks(self, project_path, vars, mods):
        
        # Some additional symlinks
        if 'cms' in mods:
            # Mirroring Ckeditor JS overrides for the CKEditor cmsplugin that 
            # use a different namespace than 'django-ckeditor'
            self.symlink_list.append(('ckeditor', join(project_path, 'mods_available/ckeditor/static/djangocms_text_ckeditor')))

        # Enable all selected mods (it resumes to make a list of symlinks to 
        # do in mods_enabled)
        for name in mods:
            self.symlink_list.append((
                join('..', 'mods_available', name),
                join(project_path, 'mods_enabled', name)
            ))
        
        return self.symlink_list
269660
def register_app(app_name, app_setting, web_application_setting, mainfile, package_space):
    
    from turbo import log
    app_config.app_name = app_name
    app_config.app_setting = app_setting
    app_config.project_name = os.path.basename(get_base_dir(mainfile, 2))
    app_config.web_application_setting.update(web_application_setting)
    if app_setting.get('session_config'):
        app_config.session_config.update(app_setting['session_config'])
    log.getLogger(**app_setting.log)
    _install_app(package_space)
471296
def register_app(app):
    "  "

    from .views import urls
    app.register_blueprint(urls)

    from .ext import admin
    admin.init_app(app)

    from flask_bootstrap import Bootstrap
    bootstrap = Bootstrap()
    bootstrap.init_app(app)

    from flask import render_template
    app.errorhandler(404)(lambda e: (render_template('core/404.html'), 404))
70827
def autodiscover(self, module_name=None, verbose=False):
        
        module_name = module_name or "notifications"
        verbose = True if verbose is None else verbose
        sys.stdout.write(f" * checking for {module_name} ...\n")
        for app in django_apps.app_configs:
            try:
                mod = import_module(app)
                try:
                    before_import_registry = copy.copy(site_notifications._registry)
                    import_module(f"{app}.{module_name}")
                    if verbose:
                        sys.stdout.write(
                            f" * registered notifications from application '{app}'\n"
                        )
                except Exception as e:
                    if f"No module named '{app}.{module_name}'" not in str(e):
                        site_notifications._registry = before_import_registry
                        if module_has_submodule(mod, module_name):
                            raise
            except ModuleNotFoundError:
                pass
645255
def add_default_module_dir(self):
        
        default_module_dir = os.path.join(
            os.path.abspath(os.path.curdir),
            'plugins'
        )
        module_dir_params = {
            'module_dir': [default_module_dir]
        }

        if 'module_dir' in self.config['global']:
            module_dir_params['module_dir'].append(
                self.config['global']['module_dir']
            )
        self.config['global'].update(
            module_dir_params
        )
314539
def modify_classes():
    
    import copy
    from django.conf import settings
    from django.contrib.admin.sites import site
    from django.utils.importlib import import_module
    from django.utils.module_loading import module_has_submodule

    for app in settings.INSTALLED_APPS:
        mod = import_module(app)
        # Attempt to import the app's class_modifier module.
        try:
            before_import_registry = copy.copy(site._registry)
            import_module('%s.class_modifiers' % app)
        except:
            site._registry = before_import_registry
            # Decide whether to bubble up this error. If the app just
            # doesn't have an class_modifier module, we can ignore the error
            # attempting to import it, otherwise we want it to bubble up.
            if module_has_submodule(mod, 'class_modifiers'):
                raise
31885
def register(self, *handlers, **params):
        
        for handler in handlers:

            if issubclass(handler, PWModel):
                handler = type(
                    handler._meta.db_table.title() + 'Admin',
                    (PWAdminHandler,), dict(model=handler, **params))
                self.app.register(handler)
                continue

            name = handler.name.lower()
            self.handlers[name] = handler
822854
private function prepareModulesForActivation()
    {
        $moduleDirectory = \OxidEsales\Eshop\Core\Registry::getConfig()->getModulesDir();
        $moduleList = new ModuleList();
        $moduleList->getModulesFromDir($moduleDirectory);
    }
396591
def register():
    """"""
    if not plim:
        logger.warning('`slim` failed to load dependency `plim`. '
                       '`slim` plugin not loaded.')
        return
    if not mako:
        logger.warning('`slim` failed to load dependency `mako`. '
                       '`slim` plugin not loaded.')
        return
    if not bs:
        logger.warning('`slim` failed to load dependency `BeautifulSoup4`. '
                       '`slim` plugin not loaded.')
        return
    if not minify:
        logger.warning('`slim` failed to load dependency `htmlmin`. '
                       '`slim` plugin not loaded.')
        return

    signals.get_writer.connect(get_writer)