Load the plugins classes installed.
Register the observers for every plugin.
327221
private function reloadActivatedPlugins()
    {
        $pluginsToPostPendingEventsTo = array();
        foreach ($this->pluginsToLoad as $pluginName) {
            $pluginsToPostPendingEventsTo = $this->reloadActivatedPlugin($pluginName, $pluginsToPostPendingEventsTo);
        }

        // post pending events after all plugins are successfully loaded
        foreach ($pluginsToPostPendingEventsTo as $plugin) {
            EventDispatcher::getInstance()->postPendingEventsTo($plugin);
        }
    }
1238516
def load_plugins(self):
        ''' 
        '''
        self._dbg("Loading plugins")
        if not self.active_plugins:
            self._dbg("No plugins specified in conf file")
            return  # nothing to load

        for plugin_path in self.active_plugins:
            self._dbg("Importing {}".format(plugin_path))

            if self.debug is True:
                # this makes the plugin fail with stack trace in debug mode
                cls = import_string(plugin_path)
            else:
                # otherwise we log the exception and carry on
                try:
                    cls = import_string(plugin_path)
                except ImportError as error:
                    logging.exception("Problem importing {} - {}".format(
                        plugin_path, error)
                    )

            plugin_config = self.config.get(cls.__name__, {})
            plugin = cls(slack_client=self.slack_client, plugin_config=plugin_config)  # instatiate!
            self.bot_plugins.append(plugin)
            self._dbg("Plugin registered: {}".format(plugin))
853195
def load_plugins():
    
    loader = _PluginLoader()

    for pkg in PLUGIN_PACKAGES:
        loader.load_plugins(pkg)

    return loader.plugins
662019
public function loadPlugins()
    {
        $activePlugins = $this->getActivePlugins();
        foreach ($activePlugins as $plugin) {
            if ($class = $this->load($plugin)) {
                $class->run();
            }
        }
    }
180255
private function plugins_loaded() {
		if ( $this->_plugins_loaded ) {
			return;
		}
		$this->_plugins_loaded = true;

		spl_autoload_register( function ( $class ) {
			return $this->get_main()->load_class( $class );
		} );

		$this->load_functions();
	}
40669
def register_plugin(cls, model, plugin):
        '''
        
        '''
        logger.info("Plugin registered for %s: %s", model, plugin)
        cls.plugins[model] = plugin
454739
function load() {
			$all_plugins_data = $this->get_all_data();
			$this->_data      = isset( $all_plugins_data[ $this->_secondary_id ] ) ?
				$all_plugins_data[ $this->_secondary_id ] :
				array();
		}
1019950
def setup(self):
    
    return self._load_plugins(
      self._working_set,
      self._bootstrap_options.pythonpath,
      self._bootstrap_options.plugins,
      self._bootstrap_options.backend_packages
    )
914825
def register_plugin(self):
        """"""
        self.main.restore_scrollbar_position.connect(
                                               self.restore_scrollbar_position)
        self.main.add_dockwidget(self)
445137
protected function setPluginAutoloading()
    {
        foreach ($this->config('plugin.autoloading', []) as $ns => $path) {
            $path = $this->dirPath.'/'.trim($path, '\/');
            $this->loader->addPsr4($ns, $path);
        }

        $this->loader->register();
    }
468918
private static void loadRegistry() {
		// Load audit filters to runtime configurations.
		for (AuditEventFilter filter : PreConfigurationContext.getPrefilters()) {
			configContext.addFilter(filter);
		}
		// Load audit annotation filters to runtime configurations.
		for (AuditAnnotationFilter annotationFilter : PreConfigurationContext.getPreannotationfilters()) {
			configContext.addAnnotationFilter(annotationFilter);
		}
	}
785653
private void registerExternalLoaders() throws MojoExecutionException {
        if (archiveLoaders != null) {
            for (String entry : archiveLoaders) {
                try {
                    SourceLoader loader = (SourceLoader) Class.forName(entry).newInstance();
                    registerLoader(loader);
                } catch (Exception e) {
                    throw new MojoExecutionException("Error registering archive loader for class: " + entry, e);
                }
            }
        }
    }
598522
private void loadDelayedPlugins() {
        while (!delayedLoadPlugins.isEmpty()) {
            GrailsPlugin plugin = delayedLoadPlugins.remove(0);
            if (areDependenciesResolved(plugin)) {
                if (!hasValidPluginsToLoadBefore(plugin)) {
                    registerPlugin(plugin);
                }
                else {
                    delayedLoadPlugins.add(plugin);
                }
            }
            else {
                // ok, it still hasn't resolved the dependency after the initial
                // load of all plugins. All hope is not lost, however, so lets first
                // look inside the remaining delayed loads before giving up
                boolean foundInDelayed = false;
                for (GrailsPlugin remainingPlugin : delayedLoadPlugins) {
                    if (isDependentOn(plugin, remainingPlugin)) {
                        foundInDelayed = true;
                        break;
                    }
                }
                if (foundInDelayed) {
                    delayedLoadPlugins.add(plugin);
                }
                else {
                    failedPlugins.put(plugin.getName(), plugin);
                    LOG.error("ERROR: Plugin [" + plugin.getName() + "] cannot be loaded because its dependencies [" +
                            DefaultGroovyMethods.inspect(plugin.getDependencyNames()) + "] cannot be resolved");
                }
            }
        }
    }
614888
public function activatePlugins(): void
    {
        foreach (array_keys($this->getPlugins()) as $plugin) {
            if (!$this->isPluginActive($plugin)) {
                $this->activatePlugin($plugin);
            }
        }
    }
501260
def load_services(self, services=settings.TH_SERVICES):
        
        kwargs = {}
        for class_path in services:
            module_name, class_name = class_path.rsplit('.', 1)
            klass = import_from_path(class_path)
            service = klass(None, **kwargs)
            self.register(class_name, service)
501218
def register_plugin_dir(path):
    """"""
    import glob
    for f in glob.glob(path + '/*.py'):
        for k, v in load_plugins_from_module(f).items():
            if k:
                global_registry[k] = v
1153780
def RegisterPlugin(cls, plugin_class):
    
    plugin_name = plugin_class.NAME.lower()
    if plugin_name in cls._plugin_classes:
      raise KeyError((
          'Plugin class already set for name: {0:s}.').format(
              plugin_class.NAME))

    cls._plugin_classes[plugin_name] = plugin_class