Merge all active chains from the given keychain group into this keychain group.
196254
public final void mergeActiveKeyChains(KeyChainGroup from, long keyRotationTimeSecs) {
        checkArgument(isEncrypted() == from.isEncrypted(), "encrypted and non-encrypted keychains cannot be mixed");
        for (DeterministicKeyChain chain : from.getActiveKeyChains(keyRotationTimeSecs))
            addAndActivateHDChain(chain);
    }
635890
def _merge_groups(self, backends_list):
        
        ret = {}
        for backends in backends_list:
            for b in backends:
                if b not in ret:
                    ret[b] = set([])
                for group in backends[b]:
                    ret[b].add(group)
        for b in ret:
            ret[b] = list(ret[b])
            ret[b].sort()
        return ret
1131932
protected function buildChain($merge = [])
    {
        $newChain = $merge ? $this->parseChain($merge) : [];

        $merged = [];

        foreach ($this->chain as $name => $infos) {
            if (!isset($newChain[$name])) {
                $merged[$name] = $infos;
                continue;
            }

            if ($newChain[$name]['operator'] == '-') {
                continue;
            }

            $merged[$name] = $newChain[$name];
        }

        foreach ($newChain as $name => $infos) {
            if ($infos['operator'] == '-') {
                continue;
            }

            if (!isset($merged[$name])) {
                $merged[$name] = $infos;
            }
        }

        return $merged;
    }
996470
def merge(directory, message, branch_label, rev_id, revisions):
    """"""
    _merge(directory, revisions, message, branch_label, rev_id)
625198
@Override
    public synchronized ChainGroupData addChainGroup(String groupName, String[] chainNames) throws InvalidChainNameException, ChainGroupException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "addChainGroup: " + groupName);
        }
        if (null == groupName) {
            throw new ChainGroupException("Null group name");
        }
        if ((null == chainNames) || (0 == chainNames.length)) {
            throw new InvalidChainNameException("Null or empty chain name list");
        }

        // Create a new group
        ChainData chainDataArray[] = new ChainData[chainNames.length];
        // Verify the chain configurations already exist.
        ChainData chainData = null;
        for (int i = 0; i < chainNames.length; i++) {
            chainData = chainDataMap.get(chainNames[i]);
            if (null != chainData) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "Found chain for group, " + chainNames[i]);
                }
                // Note, now supporting inbound and outbound chains.
                chainDataArray[i] = chainData;
            } else {
                InvalidChainNameException e = new InvalidChainNameException("Missing chain config during add: " + chainNames[i]);
                FFDCFilter.processException(e, getClass().getName() + ".addChainGroup", "3071", this, new Object[] { chainNames[i] });
                throw e;
            }
        }
        // At this point we have verified that all the chain configs exist.
        ChainGroupData groupData = createChainGroupData(groupName, chainDataArray);
        this.chainGroups.put(groupName, groupData);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "addChainGroup");
        }
        return groupData;
    }
731261
@Override
    public synchronized ChainGroupData updateChainGroup(String groupName, String[] chainNames) throws ChainGroupException, InvalidChainNameException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Updating chain group, " + groupName);
        }

        // Input parameters validated internally
        return addChainGroup(groupName, chainNames);
    }
919758
def merge(self, dct=None, **kwargs):
        
        if dct is None:
            dct = {}
        if kwargs:
            dct.update(**kwargs)

        for key, value in dct.items():
            if all((
                    isinstance(value, dict),
                    isinstance(self.get(key), Configuration),
                    getattr(self.get(key), "__merge__", True),
            )):
                # recursively merge
                self[key].merge(value)
            elif isinstance(value, list) and isinstance(self.get(key), list):
                # append
                self[key] += value
            else:
                # set the new value
                self[key] = value
97589
function merge (target, source) {
  source = source || {};
  return Object.keys(source).reduce((targetKey, key) => {
    targetKey[key] = source[key];
    return target;
  }, target);
}
532794
public List<List<String>> toGroups ()
    {
        List<String> list = Lists.newArrayList(_imports);
        Collections.sort(list, new Comparator<String>() {
            public int compare (String class1, String class2) {
                return ComparisonChain.start()
                    .compare(findImportGroup(class1), findImportGroup(class2))
                    .compare(class1, class2)
                    .result();
            }
        });
        List<List<String>> result = Lists.newArrayList();
        List<String> current = null;
        int lastGroup = -2;
        for (String imp : list) {
            int group = findImportGroup(imp);
            if (group != lastGroup) {
                if (current == null || !current.isEmpty()) {
                    result.add(current = Lists.<String>newArrayList());
                }
                lastGroup = group;
            }
            current.add(imp);
        }
        return result;
    }
955534
def merge_into_group(self, group):
        
        super(VerboseMixin, self).merge_into_group(group)
        group.verbose_name = self.verbose_name
        group.help_text = self.help_text
937436
def _consolidate(blocks):
    

    # sort by _can_consolidate, dtype
    gkey = lambda x: x._consolidate_key
    grouper = itertools.groupby(sorted(blocks, key=gkey), gkey)

    new_blocks = []
    for (_can_consolidate, dtype), group_blocks in grouper:
        merged_blocks = _merge_blocks(list(group_blocks), dtype=dtype,
                                      _can_consolidate=_can_consolidate)
        new_blocks = _extend_blocks(merged_blocks, new_blocks)
    return new_blocks
31182
def chain(self, **kwargs):
        
        chain = self.build_chain(**kwargs)
        self._patterns.append(chain)
        return chain
715802
private void compactGroups() {
    for (int i = 0; i < groups.size(); i++) {
      List<Segment> group = groups.get(i);
      List<OffsetPredicate> groupPredicates = predicates.get(i);
      Segment segment = compactGroup(group, groupPredicates);
      mergeReleased(group, groupPredicates, segment);
      deleteGroup(group);
    }
  }
645374
private final void add(ThreadGroup g){
        synchronized (this) {
            if (destroyed) {
                throw new IllegalThreadStateException();
            }
            if (groups == null) {
                groups = new ThreadGroup[4];
            } else if (ngroups == groups.length) {
                groups = Arrays.copyOf(groups, ngroups * 2);
            }
            groups[ngroups] = g;

            // This is done last so it doesn't matter in case the
            // thread is killed
            ngroups++;
        }
    }
1206526
def merge_all(dcts):
    
    return reduce(
        lambda accum, dct: merge(accum, dct),
        dict(),
        dcts
    )
1351234
@Override
    public synchronized ChainGroupData removeChainGroup(String groupName) throws ChainGroupException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Removing chain group, " + groupName);
        }
        if (null == groupName) {
            throw new ChainGroupException("Input group name is null");
        }

        ChainGroupData groupData = this.chainGroups.remove(groupName);
        if (null == groupData) {
            throw new ChainGroupException("Null group name");
        }
        return groupData;
    }
654346
def group(merge_func, tokens):
	
	output = []

	if tokens:
		output.append(tokens[0])

		for token in tokens[1:]:
			prev_token = output[-1]

			if merge_func(prev_token, token):
				output[-1] += token
			else:
				output.append(token)

	return output