Return merged set of main addons and mode's addons
492519
def upgrade_addons_operation(self, addons_state, mode=None):
        
        installed = set(a.name for a in addons_state
                        if a.state in ('installed', 'to upgrade'))

        base_mode = self._get_version_mode()
        addons_list = base_mode.upgrade_addons.copy()
        if mode:
            add_mode = self._get_version_mode(mode=mode)
            addons_list |= add_mode.upgrade_addons

        to_install = addons_list - installed
        to_upgrade = installed & addons_list

        return UpgradeAddonsOperation(self.options, to_install, to_upgrade)
62343
public static function &getComponents(): array
    {
        if (empty(self::$runtimeComponents)) {
            foreach (self::getAddons() as $addon) {
                self::$runtimeComponents = array_merge(self::$runtimeComponents, $addon->getComponents());
            }
        }
        
        return self::$runtimeComponents;
    }
401777
def merge_components(
        *components: typing.List[typing.Union[list, tuple, COMPONENT]]
) -> COMPONENT:
    

    flat_components = functools.reduce(flatten_reducer, components, [])
    return COMPONENT(
        includes=functools.reduce(
            functools.partial(combine_lists_reducer, 'includes'),
            flat_components,
            []
        ),
        files=functools.reduce(
            functools.partial(combine_lists_reducer, 'files'),
            flat_components,
            []
        )
    )
284322
def get_submodules(mod):
    """"""
    def catch_exceptions(module):
        pass
    try:
        m = __import__(mod)
        submodules = [mod]
        submods = pkgutil.walk_packages(m.__path__, m.__name__ + '.',
                                        catch_exceptions)
        for sm in submods:
            sm_name = sm[1]
            submodules.append(sm_name)
    except ImportError:
        return []
    except:
        return [mod]
    
    return submodules
363155
def load_addon_strings(addon, filename):
    ''''''
    def get_strings(fn):
        xml = parse(fn)
        strings = dict((tag.getAttribute('id'), tag.firstChild.data) for tag in xml.getElementsByTagName('string'))
        #strings = {}
        #for tag in xml.getElementsByTagName('string'):
            #strings[tag.getAttribute('id')] = tag.firstChild.data
        return strings
    addon._strings = get_strings(filename)
505165
function mergeConf(env, conf, key, ENV, fn) {
  fetch(conf, key, function(err, layout) {
    if (err) return fn(err);

    fetch(layout, 'default', function(err, defaults) {
      if (err) return fn(err);

      debug('  default', defaults);
      merge(ENV, defaults);
      debug('    ', ENV);

      fetch(layout, env, function(err, envs) {
        if (err) return fn(err);

        debug('  ' + env, envs);
        merge(ENV, envs);
        debug('    ', ENV);

        fn();
      });
    });
  });
}
597856
function getModules(argv,modules){
    if(argv.module){
        var which = getModuleConfig(argv.module,modules);
        if(which){
            return [which];
        }else{
            return [];
        }
    }
    return modules;
}
649604
def listModules(self):
        """"""
        modules = list(self.modules.items())
        modules.sort()
        return [module for name, module in modules]
216154
def plugins(self):
        
        from fluent_contents import extensions   # Avoid circular reference because __init__.py imports subfolders too
        if self._plugins is None:
            return extensions.plugin_pool.get_plugins()
        else:
            return extensions.plugin_pool.get_plugins_by_name(*self._plugins)
907992
def get_plugin_actions(self):
        """"""
        return [self.rich_text_action, self.plain_text_action,
                self.show_source_action, MENU_SEPARATOR,
                self.auto_import_action]
630058
def get_backends():
    
    IGNORE_DIRS = ["core", "tools", "utils"]

    global backends
    if backends is None:
        backends = {}
        i3pystatus_dir = os.path.dirname(i3pystatus.__file__)
        subdirs = [
            x
            for x in next(os.walk(i3pystatus_dir))[1]
            if not x.startswith("_") and x not in IGNORE_DIRS
        ]
        for subdir in subdirs:
            dirs = next(os.walk(os.path.join(i3pystatus_dir, subdir)))[2]
            backends.update(
                {
                    x[:-3]: "i3pystatus.%s.%s" % (subdir, x[:-3])
                    for x in dirs
                    if not x.startswith("_") and x.endswith(".py")
                }
            )
    return backends
280517
def _merge_cdicts(self, clut, exdict, separator):
    """"""
    if not self._full_cname:
        return
    # Find all callables that are not in self exceptions dictionary
    # and create new tokens for them
    repl_dict = {}
    for key, value in _sorted_keys_items(clut):
        otoken = self._clut.get(key, None)
        if not otoken:
            otoken = str(len(self._clut))
            self._clut[key] = otoken
        repl_dict[value] = otoken
    # Update other dictionaries to the mapping to self
    # exceptions dictionary
    for fdict in exdict.values():
        for entry in fdict.values():
            olist = []
            for item in entry["function"]:
                if item is None:
                    # Callable name is None when callable is
                    # part of exclude list
                    olist.append(None)
                else:
                    itokens = item.split(separator)
                    itokens = [repl_dict.get(itoken) for itoken in itokens]
                    olist.append(separator.join(itokens))
            entry["function"] = olist
1137416
def _get_loaded_modules():
        """"""
        output = subprocess.check_output(['apache2ctl', '-M'])
        if six.PY3:
            output = output.decode('utf-8')
        modules = []
        for line in output.splitlines():
            # Each line of the enabled module output looks like:
            #  module_name (static|shared)
            # Plus a header line at the top of the output which is stripped
            # out by the regex.
            matcher = re.search(r'^ (\S*)_module (\S*)', line)
            if matcher:
                modules.append(matcher.group(1))
        return modules
273922
def option(self, opt):
        '''
        
        '''
        if 'config.merge' in self.functions:
            return self.functions['config.merge'](opt, {}, omit_master=True)
        return self.opts.get(opt, {})
1308573
function merge(src1, src2) {
    var merged = {};
    extend(merged, src1);
    extend(merged, src2);
    return merged;
}
563316
def get_plugin_modules(folders, package='plugins',
                       parentpackage='linkcheck.dummy'):
    """"""
    for folder in folders:
        for module in loader.get_folder_modules(folder, parentpackage):
            yield module
    for module in loader.get_package_modules(package):
        yield module
1088258
function getIncludes(ext, exclude) {
    var globs = [];

    modules.forEach(function (module) {

      if (!settings.release) {

        // Not in release mode:
        // Ensure the main module file is included first

        globs.push(module.folder + '/' + module.folder + ext);
        globs.push(module.folder + '/**/*' + ext);
      } else {

        // In release mode:
        // Include the minified version.

        globs.push(module.folder + '/' + module.folder + '.min' + ext);
      }

    });

    var res = gulp.src(globs, {
      read: false,
      cwd: path.resolve(settings.folders.dest)
    });

    if (exclude) {
      res = res.pipe(gfilter('!**/*' + exclude));
//      res = res.pipe(utils.dumpFilePaths());
    }

    return res;
  }