merges muliple configs without loosing keys
323981
protected function mergeConfigs(array $configs)
    {
        $mergedConfig = array();
        
        foreach($configs as $config)
        {
            $mergedConfig = array_merge_recursive($mergedConfig, $config);
        }
        
        return  array($mergedConfig);
    }
275832
def merge_files(configuration, locale, fail_if_missing=True):
    
    for target, sources in configuration.generate_merge.items():
        merge(configuration, locale, target, sources, fail_if_missing)
386758
def merge_config(configs):
    
    new_config = {}

    for name, config in configs.items():
        new_config = dictmerge(new_config, config, name)

    return new_config
868611
def concatenating_merge(options, options2, *args)
      options = call_each_hash_value_with_params(options, *args) || {}
      options2 = call_each_hash_value_with_params(options2, *args) || {}


      options.symbolize_keys.merge(options2.symbolize_keys) do |key, v1, v2|
        if v1.is_a?(String) && v2.is_a?(String)
          "#{v1} #{v2}"
        else
          v2
        end
      end
    end
426263
function mergeScaleConfig(/* config objects ... */) {
	return helpers.merge({}, [].slice.call(arguments), {
		merger: function(key, target, source, options) {
			if (key === 'xAxes' || key === 'yAxes') {
				var slen = source[key].length;
				var i, type, scale;

				if (!target[key]) {
					target[key] = [];
				}

				for (i = 0; i < slen; ++i) {
					scale = source[key][i];
					type = valueOrDefault(scale.type, key === 'xAxes' ? 'category' : 'linear');

					if (i >= target[key].length) {
						target[key].push({});
					}

					if (!target[key][i].type || (scale.type && scale.type !== target[key][i].type)) {
						// new/untyped scale or type changed: let's apply the new defaults
						// then merge source scale to correctly overwrite the defaults.
						helpers.merge(target[key][i], [scaleService.getScaleDefaults(type), scale]);
					} else {
						// scales type are the same
						helpers.merge(target[key][i], scale);
					}
				}
			} else {
				helpers._merger(key, target, source, options);
			}
		}
	});
}
297814
def merge_base(all_envs)
      base = all_envs["base"] || {}
      all_envs.each do |env, settings|
        all_envs[env] = base.merge(settings) unless env == "base"
      end
      all_envs
    end
1272648
def _merge_configuration(self, parent_config, child_options):
        
        # Copy the parent error codes so we won't override them
        error_codes = copy.deepcopy(parent_config.checked_codes)
        if self._has_exclusive_option(child_options):
            error_codes = self._get_exclusive_error_codes(child_options)

        self._set_add_options(error_codes, child_options)

        kwargs = dict(checked_codes=error_codes)
        for key in ('match', 'match_dir', 'ignore_decorators'):
            kwargs[key] = \
                getattr(child_options, key) or getattr(parent_config, key)
        return CheckConfiguration(**kwargs)
470822
function merge(defaultConfig, additionalConfig) {	
	for( var p in additionalConfig ) {
		if( defaultConfig.hasOwnProperty(p)) {
			if (typeof additionalConfig[p] === 'object' && !(util.isArray(additionalConfig[p]))) {
				//this is an object, recurse
				defaultConfig[p] = merge(defaultConfig[p], additionalConfig[p]);
			} else {
				//this is an array or otherwise simple property
				defaultConfig[p] = additionalConfig[p];
			}
		}
	};

	return defaultConfig;
}
34636
def normalize_defaults
      new_options = {}
      options.each do |key,value|
        unless value.nil?
          new_options[key.to_s] = value
          new_options[key.to_sym] = value
        end
      end
      options.merge!(new_options)
    end
219257
def conf_merger(user_dict, variable):
    
    if variable not in globals().keys():
        raise NameError("Unknown variable '%s'." % variable)

    if variable not in user_dict:
        return globals()[variable]

    return globals()[variable] and user_dict[variable]
1338724
def merge!(*args)
      val = args.pop
      keys = args.flatten
      StorageFile.merge!(path, [*@parents, *keys], val)
    end
829564
public function merge_config()
    {
        $current      = $this->config;
        $this->config = array();

        foreach ($this->replaced_config as $prop => $replacement) {
            if (isset($current[$prop])) {
                if ($prop == 'skin_path') {
                    $this->config[$replacement] = preg_replace('#skins/(\w+)/?$#', '\\1', $current[$prop]);
                }
                else if ($prop == 'multiple_identities') {
                    $this->config[$replacement] = $current[$prop] ? 2 : 0;
                }
                else {
                    $this->config[$replacement] = $current[$prop];
                }
            }

            unset($current[$prop]);
        }

        foreach ($this->obsolete_config as $prop) {
            unset($current[$prop]);
        }

        // add all ldap_public sources having global_search enabled to autocomplete_addressbooks
        if (is_array($current['ldap_public'])) {
            foreach ($current['ldap_public'] as $key => $ldap_public) {
                if ($ldap_public['global_search']) {
                    $this->config['autocomplete_addressbooks'][] = $key;
                    unset($current['ldap_public'][$key]['global_search']);
                }
            }
        }

        $this->config = array_merge($this->config, $current);

        foreach (array_keys((array) $current['ldap_public']) as $key) {
            $this->config['ldap_public'][$key] = $current['ldap_public'][$key];
        }
    }
1067895
function merge(self $config): void {
    foreach ($config as $key => $value) $this[$key] = $value;
  }
232962
def copy_config(config, mutable_config_keys=MUTABLE_CONFIG_KEYS):
    

    cloned_config = copy(config)
    # Apply ``copy`` function to mutable config values
    for key in mutable_config_keys:
        cloned_config[key] = copy(config[key])
    return cloned_config
1195461
def _merge_configs(configs):
    
    result = {
        u"contexts": [],
        u"users": [],
        u"clusters": [],
        u"current-context": None,
    }
    for config in configs:
        for k in {u"contexts", u"users", u"clusters"}:
            try:
                values = config.doc[k]
            except KeyError:
                pass
            else:
                result[k].extend(values)

        if result[u"current-context"] is None:
            try:
                result[u"current-context"] = config.doc[u"current-context"]
            except KeyError:
                pass

    return KubeConfig(result)
1014384
private DynamoDBMapperConfig mergeConfig(DynamoDBMapperConfig config) {
        if ( config != this.config )
            config = new DynamoDBMapperConfig(this.config, config);
        return config;
    }
640396
def merge(self, dict_=None):
        """"""
        if dict_ is None and hasattr(self, '__dict__'):
            dict_ = self.__dict__  
            # doesn't work anymore as we have _lock attribute
        if dict_ is None:
            return self
        self.update(dict_)
        return self