Takes list linked to common name and maps common name to accepted predicate
            and their respected suffixes to decrease sensitivity.
544528
def create_pred2common(self):
        ''' 
        '''
        self.pred2common = {}
        for common_name, ext_preds in self.common2preds.items():
            for pred in ext_preds:
                pred = pred.lower().strip()
                self.pred2common[pred] = common_name
97948
private static void mergeList(final List<String> _names)
    {
        Collections.sort(_names);
        final Set<String> compare = new HashSet<>();
        for (int i = _names.size() - 1; i > -1; i--) {
            if (compare.contains(_names.get(i))) {
                _names.remove(i);
            } else {
                compare.add(_names.get(i));
            }
        }
    }
493763
def filter_paired(list):
	
	pairs = {}
	filtered = []
	for id in list:
		read = id.rsplit('/')[0]
		if read not in pairs:
			pairs[read] = []
		pairs[read].append(id)
	for read in pairs:
		ids = pairs[read]
		if len(ids) == 2:
			filtered.extend(ids)
	return set(filtered)
756081
private void rechecksqlistpl()
    {
    	if(data != null)
    	{
    		Node[] childrens = ((SimpleNode)data).getChildren();
    		if(childrens != null && childrens.length > 0)
    		{
    			boolean switchcase = true;
    			for(Node node:childrens)
    			{
    				if(!(node instanceof ASTText))
    				{
    					switchcase = false;
    					break;
    				}
    			}
    			if(switchcase)
    			{
    				this.esInfo.setTpl(false);
    				 
    			}
    			else
    			{
    				this.esInfo.setTpl(true);
    			}
    		}
    		
    	}
    }
347868
def fix_reference_name(name, blacklist=None):
    """"""
    name = "".join(re.split(r'[^0-9a-zA-Z_]', name))
    while name and not re.match(r'([a-zA-Z]+[0-9a-zA-Z_]*)$', name):
        if not re.match(r'[a-zA-Z]', name[0]):
            name = name[1:]
            continue
    name = str(name)
    if not name:
        name = "data"
    if blacklist is not None and name in blacklist:
        get_new_name = lambda index: name+('%03d' % index)
        index = 0
        while get_new_name(index) in blacklist:
            index += 1
        name = get_new_name(index)
    return name
745035
public LinkedList<Entry<String, V>> commonPrefixSearchWithValue(char[] key, int begin)
    {
        LinkedList<Entry<String, Integer>> valueIndex = mdag.commonPrefixSearchWithValueIndex(key, begin);
        LinkedList<Entry<String, V>> entryList = new LinkedList<Entry<String, V>>();
        for (Entry<String, Integer> entry : valueIndex)
        {
            entryList.add(new SimpleEntry<String, V>(entry.getKey(), valueList.get(entry.getValue())));
        }

        return entryList;
    }
825476
private void minimize() {

        // Algorithm: compare each entry n to all subsequent entries in
        // the list: if any subsequent entry matches or widens entry n,
        // remove entry n. If any subsequent entries narrow entry n, remove
        // the subsequent entries.
        for (int i = 0; i < size(); i++) {
            GeneralNameInterface current = getGeneralNameInterface(i);
            boolean remove1 = false;

            /* compare current to subsequent elements */
            for (int j = i + 1; j < size(); j++) {
                GeneralNameInterface subsequent = getGeneralNameInterface(j);
                switch (current.constrains(subsequent)) {
                    case GeneralNameInterface.NAME_DIFF_TYPE:
                        /* not comparable; different name types; keep checking */
                        continue;
                    case GeneralNameInterface.NAME_MATCH:
                        /* delete one of the duplicates */
                        remove1 = true;
                        break;
                    case GeneralNameInterface.NAME_NARROWS:
                        /* subsequent narrows current */
                        /* remove narrower name (subsequent) */
                        remove(j);
                        j--; /* continue check with new subsequent */
                        continue;
                    case GeneralNameInterface.NAME_WIDENS:
                        /* subsequent widens current */
                        /* remove narrower name current */
                        remove1 = true;
                        break;
                    case GeneralNameInterface.NAME_SAME_TYPE:
                        /* keep both for now; keep checking */
                        continue;
                }
                break;
            } /* end of this pass of subsequent elements */

            if (remove1) {
                remove(i);
                i--; /* check the new i value */
            }

        }
    }
387560
private void keepLowestMatches(final List<Match> matches)
    {
        Set<Match> to_remove = new HashSet<>();
        for (Match match : matches)
        {
            for (Match to_compare : matches)
            {
                if (match.getStartIndex() == to_compare.getStartIndex() && match.getEndIndex() == to_compare.getEndIndex())
                {
                    if (match.calculateEntropy() / match.getLength() > to_compare.calculateEntropy() / to_compare.getLength())
                    {
                        to_remove.add(match);
                        break;
                    }
                }
            }
        }
        matches.removeAll(to_remove);
    }
772321
private MaterializedListModification<Paragraph<PS, SEG, S>> trim(MaterializedListModification<Paragraph<PS, SEG, S>> mod) {
        return commonPrefixSuffixLengths(mod.getRemoved(), mod.getAdded()).map((pref, suff) -> {
            if(pref == 0 && suff == 0) {
                return mod;
            } else {
                return MaterializedListModification.create(
                        mod.getFrom() + pref,
                        mod.getRemoved().subList(pref, mod.getRemovedSize() - suff),
                        mod.getAdded().subList(pref, mod.getAddedSize() - suff));
            }
        });
    }
562631
private Set<String> checkPreResolvedExistAndSetFullName(Set<String> preResolved, SelectionContext selectionContext) {
        Set<String> preResolvedSymbolicNames = new LinkedHashSet<String>(preResolved.size());
        for (String preResolvedFeatureName : preResolved) {
            ProvisioningFeatureDefinition preResolvedDef = selectionContext.getRepository().getFeature(preResolvedFeatureName);
            if (preResolvedDef == null) {
                return Collections.emptySet();
            } else {
                preResolvedSymbolicNames.add(preResolvedDef.getSymbolicName());
            }
        }
        return preResolvedSymbolicNames;
    }
11692
public static Map<String,String> getNamesWithAliases(String nameList) {
        String[] names = nameList.split(",");
        Map<String,String> results = new LinkedHashMap<>();  //retain ordering / determinism
        for ( String p : names) {
            String configName = p.trim();

            if ( configName.length() > 0) {
                Matcher matcher = nameWithAlias.matcher(configName);
                if (matcher.matches()) {
                    results.put(matcher.group(2), matcher.group(1));
                } else {
                    results.put(configName, configName);
                }
            }
        }
        return results;
    }
584020
def clean_names(lines, ensure_unique_names=False, strip_prefix=False,
                make_database_safe=False):
    
    names = {}

    for row in lines:
        if strip_prefix:
            row['name'] = row['name'][row['name'].find('-') + 1:]

            if row['indexed_by'] is not None:
                row['indexed_by'] = row['indexed_by'][row['indexed_by'].find(
                    '-') + 1:]

        if ensure_unique_names:
            i = 1
            while (row['name'] if i == 1 else
                   row['name'] + "-" + str(i)) in names:
                i += 1

            names[row['name'] if i == 1 else row['name'] + "-" + str(i)] = 1

            if i > 1:
                row['name'] = row['name'] + "-" + str(i)

        if make_database_safe:
            row['name'] = row['name'].replace("-", "_")
    return lines
1049366
def set_default_names(data):
    """"""
    if all(name is not None for name in data.index.names):
        return data

    data = data.copy()
    if data.index.nlevels > 1:
        names = [name if name is not None else 'level_{}'.format(i)
                 for i, name in enumerate(data.index.names)]
        data.index.names = names
    else:
        data.index.name = data.index.name or 'index'
    return data
1334100
def trim(self, prefixes):
        ""
        _prefixes, prefixes = set(map(lambda k:self._prepare_key(k), prefixes)), list()
        for t in lookahead(sorted(_prefixes)):
            if t[1] is not None:
                if t[0] == commonprefix(t):
                    continue
            prefixes.append(t[0])
        length = 0
        for prefix in prefixes:
            length += self._trim(prefix)
        return length
458778
public void updateNames(
      List<String> escapeMapNames, List<String> matcherNames, List<String> filterNames) {
    // Store the names for this directive for use in building the helper function.
    escapesName = escapeMapVar >= 0 ? escapeMapNames.get(escapeMapVar) : null;
    matcherName = matcherVar >= 0 ? matcherNames.get(matcherVar) : null;
    filterName = filterVar >= 0 ? filterNames.get(filterVar) : null;
  }
869947
private void applyPredicatesForRegisteredItems(final List<PredicateHandler> predicates) {
        ImmutableList.builder()
                .addAll(getEnabledModules())
                .addAll(getEnabledBundles())
                .addAll(getEnabledExtensions())
                .addAll(getEnabledInstallers())
                .build()
                .stream()
                .<ItemInfo>map(this::getInfo)
                .forEach(item -> applyDisablePredicates(predicates, item));
    }
1010291
def private_names_for(cls, names):
    """"""
    if not isinstance(names, Iterable):
        raise TypeError('names must be an interable')
    return (private_name_for(item, cls) for item in names)