finds overlapping solutions, deletes multiples and deletes non-solutions and if it is not a solution, deleted as well
777010
def findOverlap(x_mins, y_mins, min_distance):
    
    n = len(x_mins)
    idex = []
    for i in range(n):
        if i == 0:
            pass
        else:
            for j in range(0, i):
                if (abs(x_mins[i] - x_mins[j]) < min_distance and abs(y_mins[i] - y_mins[j]) < min_distance):
                    idex.append(i)
                    break
    x_mins = np.delete(x_mins, idex, axis=0)
    y_mins = np.delete(y_mins, idex, axis=0)
    return x_mins, y_mins
417264
private void solution(BitSet traversed) {
        boolean included = false;
        BitSet projG1 = projectG1(traversed);
        BitSet projG2 = projectG2(traversed);

        // the solution must follows the search constrains
        // (must contain the mandatory elements in G1 an G2)
        if (isContainedIn(c1, projG1) && isContainedIn(c2, projG2)) {
            // the solution should not be included in a previous solution
            // at the RGraph level. So we check against all previous solution
            // On the other hand if a previous solution is included in the
            // new one, the previous solution is removed.
            for (Iterator<BitSet> i = solutionList.listIterator(); i.hasNext() && !included;) {
                BitSet sol = i.next();

                if (!sol.equals(traversed)) {
                    // if we asked to save all 'mappings' then keep this mapping
                    if (findAllMap && (projG1.equals(projectG1(sol)) || projG2.equals(projectG2(sol)))) {
                        // do nothing
                    }
                    // if the new solution is included mark it as included
                    else if (isContainedIn(projG1, projectG1(sol)) || isContainedIn(projG2, projectG2(sol))) {
                        included = true;
                    }
                    // if the previous solution is contained in the new one, remove the previous solution
                    else if (isContainedIn(projectG1(sol), projG1) || isContainedIn(projectG2(sol), projG2)) {
                        i.remove();
                    }
                } else {
                    // solution already exists
                    included = true;
                }
            }

            if (included == false) {
                // if it is really a new solution add it to the
                // list of current solution
                solutionList.add(traversed);
            }

            if (!findAllStructure) {
                // if we need only one solution
                // stop the search process
                // (e.g. substructure search)
                stop = true;
            }
        }
    }
892407
def remove_duplicates(errors):
    
    passed = defaultdict(list)
    for error in errors:
        key = error.linter, error.number
        if key in DUPLICATES:
            if key in passed[error.lnum]:
                continue
            passed[error.lnum] = DUPLICATES[key]
        yield error
1067266
static boolean overlapQuantBounds(int amin[], int amax[], int bmin[], int bmax[]) {
        boolean overlap = true;
        overlap = (amin[0] > bmax[0] || amax[0] < bmin[0]) ? false : overlap;
        overlap = (amin[1] > bmax[1] || amax[1] < bmin[1]) ? false : overlap;
        overlap = (amin[2] > bmax[2] || amax[2] < bmin[2]) ? false : overlap;
        return overlap;
    }
165784
def overlap(listA, listB):
    
    if (listA is None) or (listB is None):
        return []
    else:
        return list(set(listA) & set(listB))
1263771
def cleanup(first_I, first_Z):
    
    cont = 0
    Nmin = len(first_I)
    if len(first_Z) < Nmin:
        Nmin = len(first_Z)
    for kk in range(Nmin):
        if first_I[kk][0] != first_Z[kk][0]:
            print("\n WARNING: ")
            if first_I[kk] < first_Z[kk]:
                del first_I[kk]
            else:
                del first_Z[kk]
            print("Unmatched step number: ", kk + 1, '  ignored')
            cont = 1
        if cont == 1:
            return first_I, first_Z, cont
    return first_I, first_Z, cont
922486
def _remove_duplicates(self):
        
        contained = set()
        for m1, m2 in itertools.combinations(self._max_rects, 2):
            if m1.contains(m2):
                contained.add(m2)
            elif m2.contains(m1):
                contained.add(m1)
        
        # Remove from max_rects
        self._max_rects = [m for m in self._max_rects if m not in contained]
405654
def overlap(self, query, subject):
        """"""
        if (self.pt_within(query[0], subject) or self.pt_within(query[1], subject) or 
            self.pt_within(subject[0], query) or self.pt_within(subject[1], query)):
            return True

        return False
889777
function( pattern, ignoreCase ) {
					var overlap = [ -1 ];
					if ( ignoreCase )
						pattern = pattern.toLowerCase();
					for ( var i = 0; i < pattern.length; i++ ) {
						overlap.push( overlap[ i ] + 1 );
						while ( overlap[ i + 1 ] > 0 && pattern.charAt( i ) != pattern.charAt( overlap[ i + 1 ] - 1 ) )
							overlap[ i + 1 ] = overlap[ overlap[ i + 1 ] - 1 ] + 1;
					}

					this._ = {
						overlap: overlap,
						state: 0,
						ignoreCase: !!ignoreCase,
						pattern: pattern
					};
				}
450061
def clear(self, clear_indices=False):
        ''
        super(MIMapping, self).clear()
        if clear_indices:
            self.indices.clear()
        else:
            for index_d in self.indices[1:]:
                index_d.clear()
1244931
def __remove_duplicates(self, _other):
        """"""
        if not isinstance(_other, type(self)) \
           and not isinstance(_other, type(list)) \
           and not isinstance(_other, type([])):
            other = [_other]
        else:
            other = list(_other)

        # remove items already in self
        newother = []
        for i in range(0, len(other)):
            item = other.pop(0)
            if not list.__contains__(self, item):
                newother.append(item)

        # remove duplicate items in other
        other = []
        if newother != []:
            other.append(newother[0])
            for i in range(1, len(newother)):
                item = newother.pop()
                if not other.__contains__(item):
                    other.append(item)
        return other
234044
def _weave_conflicting_selectors(prefixes, a, b, suffix=()):
    
    # OK, what this actually does: given a list of selector chains, two
    # "conflicting" selector chains, and an optional suffix, return a new list
    # of chains like this:
    #   prefix[0] + a + b + suffix,
    #   prefix[0] + b + a + suffix,
    #   prefix[1] + a + b + suffix,
    #   ...
    # In other words, this just appends a new chain to each of a list of given
    # chains, except that the new chain might be the superposition of two
    # other incompatible chains.
    both = a and b
    for prefix in prefixes:
        yield prefix + a + b + suffix
        if both:
            # Only use both orderings if there's an actual conflict!
            yield prefix + b + a + suffix
1099590
public static <S> boolean solutionListsAreEquals(List<S> solutionList,
                                                   List<S> newSolutionList) {
    boolean found;
    for (int i = 0; i < solutionList.size(); i++) {

      int j = 0;
      found = false;
      while (j < newSolutionList.size()) {
        if (solutionList.get(i).equals(newSolutionList.get(j))) {
          found = true;
        }
        j++;
      }
      if (!found) {
        return false;
      }
    }
    return true;
  }
559936
def cleanup(self):
        
        remove = []
        for handle, assoc in self.assocs.items():
            if assoc.expiresIn == 0:
                remove.append(handle)
        for handle in remove:
            del self.assocs[handle]
        return len(remove), len(self.assocs)
1137343
def detuning_combinations(lists):
    
    """
    Nl = len(lists)
    comb = [[i] for i in range(lists[0])]
    for l in range(1, Nl):
        combn = []
        for c0 in comb:
            for cl in range(lists[l]):
                combn += [c0[:]+[cl]]
        comb = combn[:]
    return comb
454437
def overlap(self, x, ctrs, kdtree=None):
        """"""

        q = len(self.within(x, ctrs, kdtree=kdtree))

        return q
788195
public void cleanUp() {
	int nI;
	for (nI = 0; nI < PBOX_ENTRIES; nI++)
	    m_pbox[nI] = 0;
	for (nI = 0; nI < SBOX_ENTRIES; nI++)
	    m_sbox1[nI] = m_sbox2[nI] = m_sbox3[nI] = m_sbox4[nI] = 0;
    }