Loader factory that combines a series of loaders.
497386
def load_each(*loaders):
    
    def _load_each(metadata):
        return merge(
            loader(metadata)
            for loader in loaders
        )
    return _load_each
857050
def combine(specs):
        
        new_specs = {}
        for spec in specs:
            if new_specs.get(spec, None) is None:
                new_specs[spec] = spec
            else:
                new_specs[spec].add(spec)
        return list(new_specs.values())
758721
def _combine_ngrams(ngrams, joiner) -> str:
        """"""
        if isinstance(ngrams, str):
            return ngrams
        else:
            combined = joiner.join(ngrams)
            return combined
246695
function assembleOtherSeries(series) {
    return zrUtil.map(series, function (series) {
        var data = series.getRawData();
        var lines = [series.name];
        var vals = [];
        data.each(data.dimensions, function () {
            var argLen = arguments.length;
            var dataIndex = arguments[argLen - 1];
            var name = data.getName(dataIndex);
            for (var i = 0; i < argLen - 1; i++) {
                vals[i] = arguments[i];
            }
            lines.push((name ? (name + ITEM_SPLITER) : '') + vals.join(ITEM_SPLITER));
        });
        return lines.join('\n');
    }).join('\n\n' + BLOCK_SPLITER + '\n\n');
}
1222142
function normalize(loader, mods) {
	var modNames = (mods && !Array.isArray(mods)) ? [mods] : mods;

	return (modNames || []).map(function(moduleName) {
		return !_.isString(moduleName) ?
			Promise.resolve(moduleName) :
			loader.normalize(moduleName);
	});
}
998113
function combineDepends( depends ) {
   var deps, items;

    deps = [];

    _.each(depends, function(ex) {
        items = [];
        switch (ex.type) {
            case 'Literal':
                items = _.map(ex.value.split(','), function(v) {
                    return v.trim();
                });
                break;
            case 'ArrayExpression':
                items = _.map(ex.elements, function(v) {
                    return v.value.trim();
                });
                break;
        }

        deps = _.union(deps, items)
    });

    return deps;
}
1251291
private void startWorkers() {
        m_logger.info("Starting {} workers", m_config.workers);
        for (int workerNo = 1; workerNo <= m_config.workers; workerNo++) {
            LoadWorker loadWorker = new LoadWorker(workerNo);
            loadWorker.start();
            m_workerList.add(loadWorker);
        }
    }
437867
def loader(self):
        """"""
        loader = super().loader
        if self._lazy and (sys.version_info.major, sys.version_info.minor) != (3, 4):
            loader = LazyLoader.factory(loader)
        # Strip the leading underscore from slots
        return partial(
            loader, **{object.lstrip("_"): getattr(self, object) for object in self.__slots__}
        )
1131330
function factory(options) {
  options = _.extend({}, options, defaultOptions);

  if (!_.isString(options.warpAndWeftSeparator)) {
    options.warpAndWeftSeparator = '';
  }
  if (options.warpAndWeftSeparator == '') {
    options.warpAndWeftSeparator = index.warpAndWeftSeparator;
  }

  options.transformSyntaxTree = tartan.transform([
    options.transformSyntaxTree,
    tartan.transform.fold({
      allowRootReorder: false,
      allowNestedBlocks: false,
      maxFoldLevels: 2,
      minBlockSize: 3,
      greedy: false,
      allowSplitStripe: false,
      processExistingBlocks: false
    })
  ]);

  options.join = function(components) {
    var parts = [];
    if (components.colors.length > 0) {
      parts.push(components.colors.join(' '));
    }
    if (components.warp != components.weft) {
      parts.push(components.warp + ' ' + options.warpAndWeftSeparator +
        ' ' + components.weft);
    } else {
      parts.push(components.warp);
    }
    return parts.join('\n');
  };

  return tartan.render.format(options);
}
94917
def ordered_load(stream, Loader=yaml.Loader, object_pairs_hook=OrderedDict):
    

    # noinspection PyClassHasNoInit
    class OrderedLoader(Loader):
        """
        A helper class to define an Ordered Loader
        """
        pass

    def construct_mapping(loader, node):
        """
        construct a flattened node mapping
        :param loader: the loader
        :param node: the node dict
        :return: 
        """
        loader.flatten_mapping(node)
        return object_pairs_hook(loader.construct_pairs(node))

    OrderedLoader.add_constructor(
        yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG,
        construct_mapping)
    return yaml.load(stream, OrderedLoader)
157151
def unified_load(namespace, subclasses=None, recurse=False):
    

    if subclasses is not None:
        return ClassLoader(recurse=recurse).load(namespace, subclasses=subclasses)
    else:
        return ModuleLoader(recurse=recurse).load(namespace)
318320
function createModuleConfig(loader) {
	var tmp = require("tmp");
	var config = {};
	var virtualModules = loader.virtualModules || {};
	for(var moduleName in virtualModules) {
		var filename = tmp.fileSync().name;
		var source = virtualModules[moduleName];
		fs.writeFileSync(filename, source, "utf8");

		var paths = config.paths = config.paths || {};
		paths[moduleName] = "file:"+filename;
	}
	return config;
}
225756
function createLoader(handlers) {
  var handlerMap = new Map(Object.keys(handlers).map(function (key) {
    return [key, handlers[key]];
  }));
  handlers = undefined;

  return function (state, data) {
    var keys = Object.keys(data);
    return Promise.all(keys.map(function (key) {
      var handler = handlerMap.get(key);

      return handler(state, data[key]);
    })).then(function (results) {
      var data = Object.create(null);
      results.forEach(function (result, index) {
        data[keys[index]] = result;
      });
      return data;
    });
  };
}
991305
private void recomputeLoadSums() {
        loadsHaveChanged.set(false);
        for (int d = 0; d < nbDims; d++) {
            int sli = 0;
            int sls = 0;
            for (int b = 0; b < nbBins; b++) {
                sli += loads[d][b].getLB();
                sls += loads[d][b].getUB();
            }
            this.sumLoadInf[d].set(sli);
            this.sumLoadSup[d].set(sls);
        }
    }
466781
def gen_modules(self, initial_load=False):
        '''
        
        '''
        self.utils = salt.loader.utils(self.opts)
        self.functions = salt.loader.minion_mods(
            self.opts,
            utils=self.utils,
            whitelist=self.whitelist,
            initial_load=initial_load)
        self.serializers = salt.loader.serializers(self.opts)
        if self.mk_returners:
            self.returners = salt.loader.returners(self.opts, self.functions)
        if self.mk_states:
            self.states = salt.loader.states(self.opts,
                                             self.functions,
                                             self.utils,
                                             self.serializers)
        if self.mk_rend:
            self.rend = salt.loader.render(self.opts, self.functions)
        if self.mk_matcher:
            self.matchers = salt.loader.matchers(self.opts)
        self.functions['sys.reload_modules'] = self.gen_modules
661513
def compose_all(stream, Loader=Loader):
    
    loader = Loader(stream)
    try:
        while loader.check_node():
            yield loader.get_node()
    finally:
        loader.dispose()
1245859
def _create_data_loader(self, data, **kwargs):
        """"""
        if data is None:
            return None

        # Set DataLoader config
        # NOTE: Not applicable if data is already a DataLoader
        config = {
            **self.config["train_config"]["data_loader_config"],
            **kwargs,
            "pin_memory": self.config["device"] != "cpu",
        }
        # Return data as DataLoader
        if isinstance(data, DataLoader):
            return data
        elif isinstance(data, Dataset):
            return DataLoader(data, **config)
        elif isinstance(data, (tuple, list)):
            return DataLoader(self._create_dataset(*data), **config)
        else:
            raise ValueError("Input data type not recognized.")