Merge /etc/portage/package.keywords and
    /etc/portage/package.accept_keywords.
427159
def _unify_keywords():
    '''
    
    '''
    old_path = BASE_PATH.format('keywords')
    if os.path.exists(old_path):
        if os.path.isdir(old_path):
            for triplet in salt.utils.path.os_walk(old_path):
                for file_name in triplet[2]:
                    file_path = '{0}/{1}'.format(triplet[0], file_name)
                    with salt.utils.files.fopen(file_path) as fh_:
                        for line in fh_:
                            line = salt.utils.stringutils.to_unicode(line).strip()
                            if line and not line.startswith('#'):
                                append_to_package_conf(
                                    'accept_keywords', string=line)
            shutil.rmtree(old_path)
        else:
            with salt.utils.files.fopen(old_path) as fh_:
                for line in fh_:
                    line = salt.utils.stringutils.to_unicode(line).strip()
                    if line and not line.startswith('#'):
                        append_to_package_conf('accept_keywords', string=line)
            os.remove(old_path)
583797
function mergeForVersions(versions, opts) {
    opts = _.defaults(opts || {}, {
        includeTag: true
    });

    return _.chain(versions)
        .reduce(function(prev, version) {
            if (!version.notes) return prev;

            // Include tag as title
            if (opts.includeTag) {
                prev = prev + '## ' + version.tag + '\n';
            }

            // Include notes
            prev = prev + version.notes + '\n';

            // New lines
            if (opts.includeTag) {
                prev = prev + '\n';
            }

            return prev;
        }, '')
        .value();
}
552160
def _check_accept_keywords(approved, flag):
    ''''''
    if flag in approved:
        return False
    elif (flag.startswith('~') and flag[1:] in approved) \
            or ('~'+flag in approved):
        return False
    else:
        return True
1277232
private Map<String,List<JavaFileObject>> searchSubPackages(
            List<String> subPackages,
            ListBuffer<String> packages,
            List<String> excludedPackages)
            throws IOException {
        Map<String,List<JavaFileObject>> packageFiles =
                new HashMap<String,List<JavaFileObject>>();

        Map<String,Boolean> includedPackages = new HashMap<String,Boolean>();
        includedPackages.put("", true);
        for (String p: excludedPackages)
            includedPackages.put(p, false);

        StandardLocation path = docenv.fileManager.hasLocation(StandardLocation.SOURCE_PATH)
                ? StandardLocation.SOURCE_PATH : StandardLocation.CLASS_PATH;

        searchSubPackages(subPackages,
                includedPackages,
                packages, packageFiles,
                path,
                EnumSet.of(JavaFileObject.Kind.SOURCE));

        return packageFiles;
    }
167393
def mergewords(self, newword, *originalwords, **kwargs):
        """"""
        return self.correctwords(originalwords, [newword], **kwargs)
1163623
def redirect_to_terms_accept(current_path='/', slug='default'):
    """"""
    redirect_url_parts = list(urlparse(ACCEPT_TERMS_PATH))
    if slug != 'default':
        redirect_url_parts[2] += slug
    querystring = QueryDict(redirect_url_parts[4], mutable=True)
    querystring[TERMS_RETURNTO_PARAM] = current_path
    redirect_url_parts[4] = querystring.urlencode(safe='/')
    return HttpResponseRedirect(urlunparse(redirect_url_parts))
1097793
public void addExtraCapabilities(DesiredCapabilities extraCapabilities) {
        if (extraCapabilities != null && browser.getName() != BrowserName.NONE) {
            desiredCapabilities = desiredCapabilities.merge(extraCapabilities);
        }
    }
434206
def merge(self, other):
        ''''''
        assert self.refnames == other.refnames
        assert self.dirs == other.dirs
        assert self.lengths == other.lengths

        for i in range(2):
            if self.pos[i] is None:
                if other.pos[i] is None:
                   raise Error('Error merging these two links:\n' + str(self) + '\n' + str(other))
                self.pos[i] = other.pos[i]
            else:
                if other.pos[i] is not None:
                   raise Error('Error merging these two links:\n' + str(self) + '\n' + str(other))
179825
def add_keyword(self, keyword, schema=None, source=None):
        
        keyword_dict = self._sourced_dict(source, value=keyword)

        if schema is not None:
            keyword_dict['schema'] = schema

        self._append_to('keywords', keyword_dict)
1151020
def merge(directory=None, revisions='', message=None, branch_label=None,
          rev_id=None):
    """"""
    if alembic_version >= (0, 7, 0):
        config = current_app.extensions['migrate'].migrate.get_config(
            directory)
        command.merge(config, revisions, message=message,
                      branch_label=branch_label, rev_id=rev_id)
    else:
        raise RuntimeError('Alembic 0.7.0 or greater is required')
165042
public void addExportedPackages(Set<String> packages) {
		String s = (String) getMainAttributes().get(EXPORT_PACKAGE);
		Wrapper<Boolean> modified = Wrapper.wrap(this.modified);
		String result = mergeIntoCommaSeparatedList(s, packages, modified, lineDelimiter);
		this.modified = modified.get();
		getMainAttributes().put(EXPORT_PACKAGE, result);
	}
874209
public void addKeywords(String[] keywords) {
        for (String keyword : keywords) {
            if (taxonomy.concepts.containsKey(keyword)) {
                throw new IllegalArgumentException(String.format("Concept %s already exists.", keyword));
            }
        }

        for (String keyword : keywords) {
            taxonomy.concepts.put(keyword, this);
        }

        if (synset == null) {
            synset = new TreeSet<>();
        }

        for (String keyword : keywords) {
            synset.add(keyword);
        }
    }
1169201
private void mergeModComps(List<ModifiedCompound> modComps) {
		TreeSet<Integer> remove = new TreeSet<Integer>();
		int n = modComps.size();
		for (int icurr=1; icurr<n; icurr++) {
			ModifiedCompound curr = modComps.get(icurr);

			String id = curr.getModification().getId();
			if (ProteinModificationRegistry.getById(id).getCategory()
					!=ModificationCategory.UNDEFINED)
				continue;

			// find linked compounds that before curr
			//List<Integer> merging = new ArrayList<Integer>();
			int ipre = 0;
			for (; ipre<icurr; ipre++) {
				if (remove.contains(ipre))	continue;
				ModifiedCompound pre = modComps.get(ipre);
				if (!Collections.disjoint(pre.getGroups(false),
						curr.getGroups(false))) {
					break;
				}
			}

			if (ipre<icurr) {
				ModifiedCompound mcKeep = modComps.get(ipre);

				// merge modifications of the same type
				if (mcKeep.getModification().getId().equals(id)) {
					// merging the current one to the previous one
					mcKeep.addAtomLinkages(curr.getAtomLinkages());
					remove.add(icurr);
				}
			}
		}

		Iterator<Integer> it = remove.descendingIterator();
		while (it.hasNext()) {
			modComps.remove(it.next().intValue());
		}
	}
91724
public static <T> void mergeFrom(MessageUnpacker unpacker, T message, Schema<T> schema, boolean numeric)
            throws IOException
    {
        MsgpackParser parser = new MsgpackParser(unpacker, numeric);
        schema.mergeFrom(new MsgpackInput(parser), message);
    }
1177968
@Override
    public void addPackages( Collection<? extends KiePackage> newPkgs ) {
        final List<InternalKnowledgePackage> clonedPkgs = new ArrayList<>();
        for (KiePackage newPkg : newPkgs) {
            clonedPkgs.add(((InternalKnowledgePackage)newPkg).deepCloneIfAlreadyInUse(rootClassLoader));
        }

        clonedPkgs.sort(Comparator.comparing( (InternalKnowledgePackage p) -> p.getRules().size() ).reversed().thenComparing( InternalKnowledgePackage::getName ));
        enqueueModification( () -> internalAddPackages( clonedPkgs ) );
    }
37700
protected function mergePackageLinks($type, RootPackageInterface $root)
    {
        $linkType = BasePackage::$supportedLinkTypes[$type];
        $getter   = 'get' . ucfirst($linkType['method']);
        $setter   = 'set' . ucfirst($linkType['method']);
        $links    = $this->getPackage()->{$getter}();

        if ( ! empty($links)) {
            $unwrapped = static::unwrapIfNeeded($root, $setter);

            // @codeCoverageIgnoreStart
            if ($root !== $unwrapped) {
                $this->getLogger()->warning(
                    'This Composer version does not support ' .
                    "'{$type}' merging for aliased packages."
                );
            }
            // @codeCoverageIgnoreEnd

            $unwrapped->{$setter}(array_merge(
                $root->{$getter}(),
                $this->replaceSelfVersionDependencies($type, $links, $root)
            ));
        }
    }
831578
def add_code_mapping(self, from_pdb_code, to_pdb_code):
        ''''''

        # Consistency check - make sure that we always map the same code e.g. 'LIG' to the same code e.g. 'GTP'
        if from_pdb_code in self.code_map:
            assert(self.code_map[from_pdb_code] == to_pdb_code)
        else:
            self.code_map[from_pdb_code] = to_pdb_code