Returns the plugins for the given class.
        
        :param      enabled | <bool> || None
        
        :return     [<Plugin>, ..]
519905
def plugins(cls, enabled=True):
        
        cls.loadPlugins()
        plugs = getattr(cls, '_%s__plugins' % cls.__name__, {}).values()
        if enabled is None:
            return plugs

        return filter(lambda x: x.isEnabled() == enabled, plugs)
49474
def get_module_plugins(module, classobj):
    
    try:
        names = module.__all__
    except AttributeError:
        names = [x for x in vars(module) if not x.startswith('_')]
    for name in names:
        try:
            obj = getattr(module, name)
        except AttributeError:
            continue
        try:
            if issubclass(obj, classobj):
                yield obj
        except TypeError:
            continue
493651
def GetDisabledOutputClasses(cls):
    
    for _, output_class in iter(cls._disabled_output_classes.items()):
      yield output_class.NAME, output_class
879225
def get_plugin(self, method):
        
        all_plugins = []
        for entry_point in pkg_resources.iter_entry_points('yolk.plugins'):
            plugin_obj = entry_point.load()
            plugin = plugin_obj()
            plugin.configure(self.options, None)
            if plugin.enabled:
                if not hasattr(plugin, method):
                    self.logger.warn("Error: plugin has no method: %s" % method)
                    plugin = None
                else:
                    all_plugins.append(plugin)
        return all_plugins
770766
public static function get_enabled_plugins() {
        global $DB;

        $enabled = array();
        $rs = $DB->get_recordset('portfolio_instance', array('visible'=>1), 'plugin ASC', 'plugin');
        foreach ($rs as $repository) {
            $enabled[$repository->plugin] = $repository->plugin;
        }
        $rs->close();

        return $enabled;
    }
134514
def enabled(self):
        
        # Cache into ._enabled
        if self._enabled is None:
            if self.parent is not None and self.parent.enabled():
                self._enabled = True
            else:
                # Default to Enabled if not otherwise disabled
                self._enabled = getattr(self.options, self.dest, True)
        return self._enabled
878030
public static function get_enabled_plugins() {
        global $CFG;

        if (empty($CFG->enablewebservices) or empty($CFG->webserviceprotocols)) {
            return array();
        }

        $enabled = array();
        foreach (explode(',', $CFG->webserviceprotocols) as $protocol) {
            $enabled[$protocol] = $protocol;
        }

        return $enabled;
    }
1112451
def get_modules(self):
        
        plugins = []
        for path in self.package.__path__:
            if os.path.isdir(path):
                plugins.extend(self._find_plugins_in_dir(path))

        return plugins
374849
def get_plugin_class(self, plugin_type, plugin_name):
        """"""
        plugin = self._get_plugin_type(plugin_type)
        return plugin.get_plugin_class(plugin_name)
1113905
public static function get_enabled_plugins() {
        global $CFG;

        // These two are always enabled and can't be disabled.
        $enabled = array('nologin'=>'nologin', 'manual'=>'manual');
        foreach (explode(',', $CFG->auth) as $auth) {
            $enabled[$auth] = $auth;
        }

        return $enabled;
    }
446971
public List<PluginWrapper> getPlugins(Class<? extends Plugin> pluginSuperclass) {
        List<PluginWrapper> result = new ArrayList<>();
        for (PluginWrapper p : getPlugins()) {
            if(pluginSuperclass.isInstance(p.getPlugin()))
                result.add(p);
        }
        return Collections.unmodifiableList(result);
    }
885582
public PluginWrapper whichPlugin(Class c) {
        PluginWrapper oneAndOnly = null;
        ClassLoader cl = c.getClassLoader();
        for (PluginWrapper p : activePlugins) {
            if (p.classLoader==cl) {
                if (oneAndOnly!=null)
                    return null;    // ambiguous
                oneAndOnly = p;
            }
        }
        return oneAndOnly;
    }
566146
def get_enabled(name, app):
    '''
    
    '''
    plugins = app.config['PLUGINS']
    return dict(_ep_to_kv(e) for e in iter_all(name) if e.name in plugins)
1350964
def get_plugins_from_dir(dir_path, classbase):
    """"""

    if dir_path == "sys":
        dir_path = os.path.abspath(
            os.path.join(os.path.dirname(__file__), 'plugins'))
        dir_plugins = get_plugins(dir_path)
        return {"dir": dir_path, "plugins": dir_plugins, "class": classbase}

    if dir_path == ".":
        dir_path = os.path.expanduser(
            os.path.expandvars(os.path.join(os.getcwd(), 'plugins')))
        dir_plugins = get_plugins(dir_path)
        return {"dir": dir_path, "plugins": dir_plugins, "class": classbase}
    else:

        dir_path = os.path.expanduser(os.path.expandvars(dir_path))
        prefix = "{0}/{1}".format(dir_path, classbase)

        user_path = "{0}/plugins".format(prefix)

        create_dir(user_path)
        create_file("{0}/__init__.py".format(prefix))
        create_file("{0}/plugins/__init__.py".format(prefix))
        sys.path.append(os.path.expanduser(dir_path))
        dir_plugins = get_plugins(user_path)
        # pprint({"dir": dir_path, "plugins": dir_plugins, "class": classbase})
        return {"dir": dir_path, "plugins": dir_plugins, "class": classbase}
834938
def detected_releasers(cls, config):
        

        def get_config(releaser):
            if config:
                return config.get(releaser.config_name(), {})

            return {}

        releasers = []

        for releaser_cls in cls.releasers():
            releaser_config = get_config(releaser_cls)

            if releaser_config.get('disabled', False):
                continue

            if releaser_cls.detect():
                logger.info('Enabled Releaser: {}'.format(releaser_cls.name))
                releasers.append(releaser_cls(releaser_config))

        return releasers
1093894
public function get_enrolment_plugins($onlyenabled = true) {
        if ($this->_plugins === null) {
            $this->_plugins = enrol_get_plugins(true);
        }

        if ($onlyenabled) {
            return $this->_plugins;
        }

        if ($this->_allplugins === null) {
            // Make sure we have the same objects in _allplugins and _plugins.
            $this->_allplugins = $this->_plugins;
            foreach (enrol_get_plugins(false) as $name=>$plugin) {
                if (!isset($this->_allplugins[$name])) {
                    $this->_allplugins[$name] = $plugin;
                }
            }
        }

        return $this->_allplugins;
    }
1108541
def _get_enabled():
    """"""
    providers = Provider.objects.all()
    return [p for p in providers if p.enabled()]