Merge user's configurations.

@param {string=} opt_level .
@param {string=} opt_dir .
@return {Object} .
330255
function getLogConfig(opt_level, opt_dir) {
  var config = _.clone(defaultConfig);
  if (opt_level) {
    config.level = opt_level;
  }
  if (opt_dir) {
    config.file.dir = opt_dir;
  }
  return config;
}
82669
function normalizeSlaveConfig(opt) {
    // exec path
    if (typeof opt === 'string') {
      opt = { exec: opt };
    }
    if (!opt.exec) {
      return null;
    } else {
      return opt;
    }
  }
138027
def merge_config(yaml, params)
      if params['post'].has_key? 'yaml'
        params['post']['yaml'].each do |key, value|
          if value == 'true'
            yaml[key] = true
          elsif value == 'false'
            yaml[key] = false
          else
            yaml[key] = value
          end
        end
      end

      yaml
    end
1265384
def merge(settings_list):
    
    if not isinstance(settings_list, list):
        return settings_list
    settings = OrderedDict()
    for item in settings_list:
        for k, v in item.items():
            if settings.get(k) and isinstance(v, OrderedDict):
                settings[k].update(v)
            else:
                settings[k] = v
    return settings
741834
def deeper_merge(source, options = {})
      default_opts = {:preserve_unmergeables => true}
      DeepMerge::deep_merge!(source, self, default_opts.merge(options))
    end
1024394
function mergeIntoMasterAndAddBundle(opts) {
	var mains = opts.mains;
	var loader = opts.loader;
	var newGraph = opts.newGraph;
	var bundleName = opts.bundleName;
	var masterGraph = opts.masterGraph;

	for(var name in newGraph) {
		var oldNode = masterGraph[name];
		var newNode = newGraph[name];

		if(!oldNode || hasNewDeps(oldNode, newNode)) {
			masterGraph[name] = newGraph[name];
		}
		// If it's a plugin we'll use the new node but need to copy any previous
		// bundles onto the new node
		else if(masterGraph[name] && masterGraph[name].isPlugin) {
			var oldBundle = masterGraph[name].bundles || [];
			masterGraph[name] = newGraph[name];
			oldBundle.forEach(function(bundle){
				addBundle(masterGraph[name], bundle);
			});
		}
		// If this is the configMain like package.json!npm we need to override
		// the source every time because it continuously changes.
		else if(masterGraph[name] && name === loader.configMain) {
			var node = masterGraph[name];
			node.load.source = newGraph[name].load.source;
		}

		// do not track bundles of entry point modules (a.k.a mains) unless
		// it is its own bundle.
		if (name === bundleName || !includes(mains, name)) {
			addBundle(masterGraph[name], bundleName);
		}
	}
}
825451
def ko_deeper_merge!(source, options = {})
      default_opts = {:knockout_prefix => "--", :preserve_unmergeables => false}
      DeepMerge::deep_merge!(source, self, default_opts.merge(options))
    end
280000
function loadDefaultOpts(startDir, configFile) {
  try {
    return require(path.join(startDir, configFile)).options || {};
  } catch (e) {
    var dir = path.dirname(startDir);
    if (dir === startDir) {
      return {};
    }
    return loadDefaultOpts(dir, configFile);
  }
}
65633
function getOptions(opts) {
  const mergedOptions = getMergedOptions(opts || {});

  // For saving JSON from mochawesome reporter
  if (mergedOptions.saveJson) {
    mergedOptions.jsonFile = `${getFilename(mergedOptions)}.json`;
  }

  mergedOptions.htmlFile = `${getFilename(mergedOptions)}.html`;
  return mergedOptions;
}
1107816
function init(opt_config) {
  if (modalInstance) {
    return;
  }
  var config = objects.clone(defaultConfig);
  if (opt_config) {
    objects.merge(config, opt_config);
  }

  modalInstance = new Modal(config);
}
571122
function loadFromOptions(opts) {
  var defCfg = loadDefault()
  var cfg = opts.config ? loadFromFile(opts.config) : loadDefault()

  // Command line config override file loaded config
  for (var k in opts) {
    defCfg.hasOwnProperty(k) && (defCfg[k] !== opts[k] && (cfg[k] = opts[k]))
  }

  return cfg
}
230950
function merge_config(top_config, base_config)
{
    for (var option in top_config)
    {
        if (Array.isArray(top_config[option])) // handle array elements in the same order
        {
            if (!Array.isArray(base_config[option]))
                base_config[option] = top_config[option];
            else
            {
                for(var i=0;i<top_config[option].length;i++)
                {
                    if (base_config[option].length <= i)
                        base_config[option].push(top_config[option][i]);
                    else
                        merge_config(top_config[option][i],base_config[option][i]);
                }
            } 
        }
        else if (typeof top_config[option] === "Object") // recurseively handle complex configurations
        {
            if (base_config[option] === undefined)
                base_config[option] = top_config[option];
            else
                merge_config(top_config[option], base_config[option]);
        }
        else
            base_config[option] = top_config[option];
    }

}
1097040
def options
      opts = {}
      VALID_CONFIG_KEYS.each_key do |k|
        opts.merge!(k => send(k))
      end
      opts
    end
1292052
def make_vol_opt(hostdir, contdir, options=None):
    ''''''
    vol = '--volume={}:{}'.format(hostdir, contdir)
    if options != None:
        if isinstance(options, str):
            options = (options,)
        vol += ':' + ','.join(options)
    return vol
160266
function copyOptions (options) {
  return Object.assign(
    function (context) {
      return function (prevConfig) {
        context.copyPlugin = context.copyPlugin || {}

        // Merge the provided copy plugin config into the context
        context.copyPlugin = _extends({}, context.copyPlugin, {
          options: options,
        })

        // Don't alter the config yet
        return prevConfig
      }
    },
    {post: postConfig}
  )
}
259678
function config(opts) {
  if (!opts) return;
  if (opts.baseUrl) _baseUrl = parse(opts.baseUrl).bareId + '/';

  if (opts.paths) {
    Object.keys(opts.paths).forEach(path => {
      let alias = opts.paths[path];
      _paths[cleanPath(path)] = cleanPath(alias);
    });
  }

  if (opts.bundles) {
    Object.keys(opts.bundles).forEach(bundleName => {
      const spaces = opts.bundles[bundleName];
      if (Array.isArray(spaces)) {
        _bundles[bundleName] = {
          user: arrayToHash(spaces),
          package: arrayToHash([])
        };
      } else {
        _bundles[bundleName] = {
          nameSpace: spaces.nameSpace || null,
          user: arrayToHash(spaces.user || []),
          package: arrayToHash(spaces.package || [])
        };
      }
    });
  }
}
1293195
function init(opt_config) {
  if (singleton) {
    return;
  }
  var config = objects.clone(defaultConfig);
  if (opt_config) {
    objects.merge(config, opt_config);
  }

  singleton = new YouTubeModal(config);
}