Returns the merged config of all matching category names for the given input, using the defaults if no categories match.
975381
final LoggerConfig get(String name) {
		final LoggerConfig config = new LoggerConfig();

		if (categories.isEmpty()) {
			config.merge(LoggerConfig.DEFAULT);
			return config;
		}

		if (name == null) {
			name = "";
		}

		while (true) {
			final int index = name.lastIndexOf('.');

			if (config.merge(categories.get(name)))
				return config;

			if (index != -1) {
				name = name.substring(0, index);
			} else {
				if (!config.merge(categories.get(""))) {
					config.merge(LoggerConfig.DEFAULT);
				}
				return config;
			}
		}
	}
601454
@SuppressWarnings({"unchecked", "rawtypes"})
    @Override
    public C merge(final C other) {
        return (C) ConfigurationUtils.defaultMerge((ConfigurationComponent) this, (ConfigurationComponent) other);
    }
121321
def plugin_categories_to_choices(categories):
    
    choices = []
    for category, items in categories.items():
        if items:
            plugin_tuples = tuple((plugin.type_name, plugin.verbose_name) for plugin in items)
            if category:
                choices.append((category, plugin_tuples))
            else:
                choices += plugin_tuples

    choices.sort(key=lambda item: item[0])
    return choices
867225
def merge_default(defaults)
      if defaults && !defaults.empty?
        defaults.each do |key, value|
          self[key] = value unless self.key?(key)
        end
      end
      self
    end
114568
def _merge_defaults(self, data: dict) -> dict:
        
        log.debug("merging defaults %s into data %s", self.defaults, data)
        return merge_dicts(data, self.defaults)
17707
def merge_config(d1, d2):
    '''
    '''
    result = deepcopy(d1)
    elements = deque()
    elements.append((result, d2))

    while elements:
        old, new = elements.popleft()

        new = OrderedDict([(k.lower(), (k, v)) for k, v in new.items()])
        visited_keys = []

        for k, old_value in old.items():
            klow = k.lower()
            if klow in new:
                new_key, new_value = new[klow]
                visited_keys.append(new_key)
                if all(isinstance(e, MutableMapping) for e in (old_value, new_value)):
                    elements.append((old_value, new_value))
                else:
                    old[k] = deepcopy(new_value)

        for k, v in new.values():
            if k not in visited_keys:
                old[k] = deepcopy(v)

    return result
374633
def _GetParsersFromPresetCategory(cls, category):
    
    preset_definition = cls._presets.GetPresetByName(category)
    if preset_definition is None:
      return []

    preset_names = cls._presets.GetNames()
    parser_names = set()

    for element_name in preset_definition.parsers:
      if element_name in preset_names:
        category_parser_names = cls._GetParsersFromPresetCategory(element_name)
        parser_names.update(category_parser_names)
      else:
        parser_names.add(element_name)

    return sorted(parser_names)
481907
protected function mergeConfiguration(array $default, $apply): array
    {
        foreach ($apply as $key => $item) {
            if (isset($default[$key]) && $this->isAssocArray($default[$key])) {
                $default[$key] = $this->mergeConfiguration($default[$key], $item);
            } else {
                $default[$key] = $item;
            }
        }

        return $default;
    }
1345045
def default_classification_value_maps(classification):
    
    value_maps = {}
    for hazard_class in classification['classes']:
        value_maps[hazard_class['key']] = hazard_class.get(
            'string_defaults', [])

    return value_maps
492593
def defaults(self):
        
        defaults = ConfigParser.defaults(self).copy()
        for key, val in iteritems(defaults):
            defaults[key] = self.get('DEFAULT', key) or val
        return defaults
995405
def gatherInput(**Config):
  
  """
  _type = Config.get('type')

  while True:
    try:
      got = raw_input('%s: ' % getLabel(Config))

    except EOFError:
      got = None

    if not got and 'default' in Config:
      return Config['default']

    try:
      return _type(got) if _type else got

    except ValueError as e:
      err(str(e) or '<invalid value>')

    except TypeError:
      err(str(e) or '<invalid value>')
750841
def merge_all_config_sections_into_a_single_dict(desired_type: Type[T], config: ConfigParser, logger: Logger,
                                                 conversion_finder: ConversionFinder, **kwargs) -> Dict[str, Any]:
    

    # convert the whole config to a dictionary by flattening all sections. If a key is found twice in two different
    # sections an error is raised
    results = dict()
    for section, props in config.items():
        for key, value in props.items():
            if key in results.keys():
                # find all sections where it appears
                sections_where_it_appears = [s for s, p in config.items() if key in p.keys()]
                raise MultipleKeyOccurenceInConfigurationError.create(key, sections_where_it_appears)
            else:
                results[key] = value

    return ConversionFinder.convert_collection_values_according_to_pep(results, desired_type, conversion_finder,
                                                                       logger, **kwargs)
788071
function mergeDefaultOptions(opts) {
    const copy = {};
    copyKeys(copy, _defaultOptions);
    copyKeys(copy, opts);
    Object.keys(_defaultOptions).forEach((key) => {
        const obj = _defaultOptions[key];
        if (typeof obj === 'object') {
            const objCopy = {};
            copyKeys(objCopy, obj);
            copyKeys(objCopy, copy[key]);
            copy[key] = objCopy;
        }
    });
    return copy;
}
177408
def merge_extras(items, config):
    
    final = {}
    for extra_name in items[0]["disambiguate"].keys():
        in_files = []
        for data in items:
            in_files.append(data["disambiguate"][extra_name])
        out_file = "%s-allmerged%s" % os.path.splitext(in_files[0])
        if in_files[0].endswith(".bam"):
            merged_file = merge.merge_bam_files(in_files, os.path.dirname(out_file), items[0],
                                                out_file=out_file)
        else:
            assert extra_name == "summary", extra_name
            merged_file = _merge_summary(in_files, out_file, items[0])
        final[extra_name] = merged_file
    out = []
    for data in items:
        data["disambiguate"] = final
        out.append([data])
    return out
709357
function( config ) {
		
		for( var key in lm.config.itemDefaultConfig ) {
			if( config[ key ] === undefined ) {
				config[ key ] = lm.config.itemDefaultConfig[ key ];
			}
		}
		
		return config;
	}
563004
public UnifiedPushConfig setCategories(String... categories) {
        validateCategories(categories);        
        this.categories = Arrays.asList(categories);
        return this;
    }
1068255
public void mergeWithDefaults(GlobalMetadata defaults) {
    List<String> defaultTransferEncoding = defaults.getTransferEncoding();
    List<String> myEncoding = getTransferEncoding();

    if (defaultTransferEncoding != null) {
      if (myEncoding == null) {
        setDatasetMetadata(TRANSFER_ENCODING_KEY, defaultTransferEncoding);
      } else {
        List<String> combinedEncoding = new ArrayList<>();
        combinedEncoding.addAll(myEncoding);
        combinedEncoding.addAll(defaultTransferEncoding);

        setDatasetMetadata(TRANSFER_ENCODING_KEY, combinedEncoding);
      }
    }

    for (Map.Entry<String, Object> entry : defaults.datasetLevel.entrySet()) {
      if (!datasetLevel.containsKey(entry.getKey())) {
        setDatasetMetadata(entry.getKey(), entry.getValue());
      }
    }
  }