Returns the popcount or cardinality of the union of the two sets.
Neither set is modified.
168219
public static long unionCount(OpenBitSet a, OpenBitSet b) {
        long tot = BitUtil.pop_union( a.bits, b.bits, 0, Math.min( a.wlen, b.wlen ) );
        if (a.wlen < b.wlen) {
            tot += BitUtil.pop_array( b.bits, a.wlen, b.wlen - a.wlen );
        } else if (a.wlen > b.wlen) {
            tot += BitUtil.pop_array( a.bits, b.wlen, a.wlen - b.wlen );
        }
        return tot;
    }
1200866
public static final <T> Set<T> intersection(Collection<Set<T>> sets)
    {
        Set<T> set = union(sets);
        for (Set<T> s : sets)
        {
            set.retainAll(s);
        }
        return set;
    }
11255
public static <T> Set<T> union(Set<T> setA, Set<T> setB) {
        Set<T> union = new HashSet<T>(setA);
        union.addAll(setB);
        return union;
    }
1194943
def pop(self):
        
        if not self.items:
            raise KeyError("Set is empty")

        elem = self.items[-1]
        del self.items[-1]
        del self.map[elem]
        return elem
889596
def cardinality(self):
		'''
			
		'''
		num_strings = {}
		def get_num_strings(state):
			# Many FSMs have at least one oblivion state
			if self.islive(state):
				if state in num_strings:
					if num_strings[state] is None: # "computing..."
						# Recursion! There are infinitely many strings recognised
						raise OverflowError(state)
					return num_strings[state]
				num_strings[state] = None # i.e. "computing..."

				n = 0
				if state in self.finals:
					n += 1
				if state in self.map:
					for symbol in self.map[state]:
						n += get_num_strings(self.map[state][symbol])
				num_strings[state] = n

			else:
				# Dead state
				num_strings[state] = 0

			return num_strings[state]

		return get_num_strings(self.initial)
1362009
public static int cardinality(SkippableIterator i) {
		int card = 0;
		while (i.hasValue()) {
			card += Integer.bitCount(i.getCurrentWord());
			i.advance();
		}
		return card;
	}
192159
private String getSourceMultiplicity(final Cardinality cardinality) {

		switch (cardinality) {

			case OneToOne:
			case OneToMany:
				return "1";

			case ManyToOne:
			case ManyToMany:
				return "*";
		}

		return null;
	}
390359
def union(*sets, **kwargs):
    
    sets = _set_preprocess(sets, **kwargs)
    return as_index( _set_concatenate(sets), axis=0, base=True).unique
1010490
def sdiff(self, *other_sets):
        
        return self.db.sdiff([self.key] + [s.key for s in other_sets])
36003
public static <E> Set<E> union(Set<E> s1, Set<E> s2) {
    Set<E> s = new HashSet<E>();
    s.addAll(s1);
    s.addAll(s2);
    return s;
  }
493048
public static IntSet or (IntSet... sets)
    {
        checkNotNull(sets);
        IntSet result = create();
        for (IntSet set : sets) {
            result.addAll(set);
        }
        return result;
    }
626413
def k_subsets(set_, k):
    
    ensure_countable(set_)

    if not isinstance(k, Integral):
        raise TypeError("subset cardinality must be a number")
    if not (k >= 0):
        raise ValueError("subset cardinality must be positive")
    if not (k <= len(set_)):
        raise ValueError("subset cardinality must not exceed set cardinality")

    result = combinations(set_, k)
    return _harmonize_subset_types(set_, result)
723787
public static Cardinality createCardinality(AtlasCardinality cardinality) {
        switch(cardinality) {

        case SINGLE:
            return Cardinality.SINGLE;
        case LIST:
            return Cardinality.LIST;
        case SET:
            return Cardinality.SET;
        default:
            throw new IllegalStateException("Unrecognized cardinality: " + cardinality);
        }
    }
1121500
public static int getBondCount(IRingSet set) {
        int count = 0;
        for (IAtomContainer atomContainer : set.atomContainers()) {
            count += atomContainer.getBondCount();
        }
        return count;
    }
352177
public Cardinalities getCardinalities(Class<? extends ElementBase> sourceClass) {
        Class<?> clazz = sourceClass;
        Cardinalities cardinalities = null;
        
        while (cardinalities == null && clazz != null) {
            cardinalities = map.get(clazz);
            clazz = clazz == ElementBase.class ? null : clazz.getSuperclass();
        }
        
        return cardinalities;
    }
1364257
def union(self,other):
        
        if self.everything:
            return self
        elif other.everything:
            return other
        else:
            return DiscreteSet(self.elements.union(other.elements))
922488
def single(self):
        
        nodes = super(OneOrMore, self).all()
        if nodes:
            return nodes[0]
        raise CardinalityViolation(self, 'none')