Asynchronously load all of the configuration objects from the various sources.
517826
async function loadSources (sources, options) {
  const mergedConfig = {};

  function handleSourceLoad (sourceConfig) {
    if (sourceConfig) merge(sourceConfig, mergedConfig);
  }

  for (const source of sources) {
    let sourceConfig;

    if (source == null) {
            // No-op... skip this source
      continue;
    } else if (typeof source === 'string') {
            // Load a source from a JSON file
      sourceConfig = await loadFileSource(source, options);
    } else if (Array.isArray(source)) {
      sourceConfig = await loadSources(source, options); // Load and merge all of the sources
    } else if (typeof source === 'function') {
      sourceConfig = await source(); // Invoke the function to asynchronously load the config object for this source
    } else if (typeof source === 'object') {
      sourceConfig = source; // Just merge the object
    } else {
      throw new Error('Invalid configuration source: ' + source);
    }

    handleSourceLoad(sourceConfig);
  }

  return mergedConfig;
}
478132
private void load() {
    Iterator iterator = loaders.iterator();
    while (iterator.hasNext()) {
      MacroLoader loader = (MacroLoader) iterator.next();
      loader.setRepository(this);
      log.debug("Loading from: " + loader.getClass());
      loader.loadPlugins(this);
    }
  }
586647
def load(self):
        
        data = self.dict_class()
        
        for path in self.paths:
            if path in self.paths_loaded: continue
            
            try:
                with open(path, 'r') as file:
                    path_data = yaml.load(file.read())
                    data = dict_merge(data, path_data)
                self.paths_loaded.add(path)
            except IOError:
                # TODO: Log this correctly once logging is implemented
                if not path.endswith('.local.yml'):
                    print 'CONFIG NOT FOUND: %s' % (path)

        self.data = data
672567
private function loadDynamicServices(): void
    {
        $this->startMeasure(__METHOD__);

        /** @var array $objects */
        $objects = App::$Properties->getAll('object');
        if (!Any::isArray($objects)) {
            throw new NativeException('Object configurations is not loaded: /Private/Config/Object.php');
        }

        // each all objects as service_name => service_instance()
        foreach ($objects as $name => $instance) {
            // check if definition of object is exist and services list contains it or is null to auto build
            if (property_exists(get_called_class(), $name) && $instance instanceof \Closure && (isset($this->_services[$name]) || $this->_services === null)) {
                if ($this->_services[$name] === true || $this->_services === null) { // initialize from configs
                    self::${$name} = $instance();
                } elseif (is_callable($this->_services[$name])) { // raw initialization from App::run()
                    self::${$name} = $this->_services[$name]();
                }
            } elseif (Str::startsWith('_', $name)) { // just anonymous callback without entry-point
                @call_user_func($instance);
            }
        }

        $this->stopMeasure(__METHOD__);
    }
1130580
private function loadAll(): void
  {
    $this->findSourceFiles();
    $this->detectNameConflicts();
    $this->getColumnTypes();
    $this->readStoredRoutineMetadata();
    $this->getConstants();
    $this->getOldStoredRoutinesInfo();
    $this->getCorrectSqlMode();

    $this->loadStoredRoutines();

    // Drop obsolete stored routines.
    $this->dropObsoleteRoutines();

    // Remove metadata of stored routines that have been removed.
    $this->removeObsoleteMetadata();

    $this->io->writeln('');

    // Write the metadata to file.
    $this->writeStoredRoutineMetadata();
  }
475648
def _loadConfiguration(self):
        
        configPath = os.path.join(self.path, "config")
        if not os.path.isdir(configPath):
            return

        config = Config(configPath)

        Config.mergeDictionaries(config.getData(), self.application.config)
573072
private ProviderClassLoader loadClasses(ClassSource soruce) throws Exception 
	{
		ProviderClassLoader loader=new ProviderClassLoader(parentClassLoader);
		Set<Class<?>> allClass = loader.getAllClass();
		List<ClassSourceInfo> sources=soruce.getClassSources();
		if(sources.isEmpty())
		{
			return loader;
		}
		for(ClassSourceInfo cs:sources)
		{
			loader.addURL(cs.getUrl());
			for(String className:cs.getClassNames())
			{
				Class<?> clazz=loader.loadClass(className);
				if(clazz!=null)
				{
					allClass.add(clazz);
				}
			}
		}
		_log.debug("classloader init complete,find Class:"+allClass.size());
		return loader;
	}
955459
def config_loader(app, **kwargs):
    """"""
    app.config.from_object(Config)
    app.config.update(**kwargs)
1162202
function loadResources() {
        var resources = {};
        var resourcesDir = path.join(this.injector.rootDir, this.injector.servicesDir + '/resources');


        if (!fs.existsSync(resourcesDir)) {
            return resources;
        }

        var me = this;
        var resourceNames = fs.readdirSync(resourcesDir);

        _.each(resourceNames, function (resourceName) {
            if (resourceName.substring(resourceName.length - 3) !== '.js') {  // only dirs, not js files
                resources[resourceName] = me.injector.loadModule(utils.getCamelCase(resourceName + '.resource'));
            }
        });

        return resources;
    }
449116
private static void createAll()
    {
        if (_configs!=null)
        {
            synchronized(_configs)
            {
                _servers=new Vector();
                for(int i=0;i<_configs.size();i++)
                {
                    try
                    {
                        Server server = new Server((String)_configs.get(i));
                        _servers.add(server);
                    }
                    catch(Exception e)
                    {
                        log.warn(_configs.get(i)+" configuration problem: ",e);
                    }
                }
            }
        }
    }
427898
private int loadAll() {
        if (allLoaded) {
            return configs.length;
        }
        if (debug != null) {
            debug.println("Loading all providers");
            new Exception("Call trace").printStackTrace();
        }
        int n = 0;
        for (int i = 0; i < configs.length; i++) {
            Provider p = configs[i].getProvider();
            if (p != null) {
                n++;
            }
        }
        if (n == configs.length) {
            allLoaded = true;
        }
        return n;
    }
408327
protected static void loadConfigSource(ConfigArgP config, String source) {
    Properties p = loadConfig(source);
    Config c = config.getConfig();
    for(String key: p.stringPropertyNames()) {
      String value = p.getProperty(key);
      ConfigurationItem ci = config.getConfigurationItem(key);      
      if(ci!=null) { // if we recognize the key, validate it
        ci.setValue(processConfigValue(value));
      }
      c.overrideConfig(key, processConfigValue(value));     
    }
  }
472716
def load_all_plugins(self):
        """"""

        # Go through the existing python files in the plugin directory
        self.plugin_path = os.path.realpath(self.plugin_dir)
        sys.path.append(self.plugin_dir)
        print '<<< Plugin Manager >>>'
        for f in [os.path.join(self.plugin_dir, child) for child in os.listdir(self.plugin_dir)]:

            # Skip certain files
            if '.DS_Store' in f or '__init__.py' in f: 
                continue

            # Add the plugin
            self.add_plugin(f)
34077
def _lazy_load(self):
        
        obj = self._connection.documents.get(id=self.id)
        self.__dict__['contributor'] = obj.contributor
        self.__dict__['contributor_organization'] = \
            obj.contributor_organization
        self.__dict__['data'] = obj.data
        self.__dict__['annotations'] = obj.__dict__['annotations']
        self.__dict__['sections'] = obj.__dict__['sections']
1264012
def load(self):
        """"""
        self._list = self._source.load()
        self._list_iter = itertools.cycle(self._list)
815534
protected void loadInternal(Set<K> keys, Iterable<Data> dataKeys, boolean replaceExistingValues) {
        if (dataKeys == null) {
            dataKeys = convertToData(keys);
        }
        Map<Integer, List<Data>> partitionIdToKeys = getPartitionIdToKeysMap(dataKeys);
        Iterable<Entry<Integer, List<Data>>> entries = partitionIdToKeys.entrySet();
        for (Entry<Integer, List<Data>> entry : entries) {
            Integer partitionId = entry.getKey();
            List<Data> correspondingKeys = entry.getValue();
            Operation operation = createLoadAllOperation(correspondingKeys, replaceExistingValues);
            operationService.invokeOnPartition(SERVICE_NAME, operation, partitionId);
        }
        waitUntilLoaded();
    }
689767
def load_configuration():
    """"""

    (belbio_conf_fp, belbio_secrets_fp) = get_belbio_conf_files()
    log.info(f"Using conf: {belbio_conf_fp} and secrets files: {belbio_secrets_fp} ")

    config = {}
    if belbio_conf_fp:
        with open(belbio_conf_fp, "r") as f:
            config = yaml.load(f, Loader=yaml.SafeLoader)
            config["source_files"] = {}
            config["source_files"]["conf"] = belbio_conf_fp

    if belbio_secrets_fp:
        with open(belbio_secrets_fp, "r") as f:
            secrets = yaml.load(f, Loader=yaml.SafeLoader)
            config["secrets"] = copy.deepcopy(secrets)
            if "source_files" in config:
                config["source_files"]["secrets"] = belbio_secrets_fp

    get_versions(config)

    # TODO - needs to be completed
    # add_environment_vars(config)

    return config