Returns the complement of subset.
169578
private static int[] getComplement(int[] subset, int[] fullset) {
        int size = fullset.length - subset.length;

        // Returns null if no complement
        if (size < 1) {
            return null;
        }

        // Otherwsise define combination array and determine complement
        int[] complement = new int[size];
        int index = 0;
        for (int i = 0; i < fullset.length; i++) {
            int item = fullset[i];
            boolean member = false;
            for (int j = 0; j < subset.length; j++) {
                if (item == subset[j]) {
                    member = true;
                    break;
                }
            }

            if (!member) {
                complement[index++] = item;
            }

        }

        return complement;
    }
395280
def power(set_):
    
    ensure_countable(set_)

    result = chain.from_iterable(combinations(set_, r)
                                 for r in xrange(len(set_) + 1))
    return _harmonize_subset_types(set_, result)
1093197
public function complement(Value $set)
    {
        $complement = $this->value;

        /** @var Value $arg */
        foreach (func_get_args() as $arg) {
            /** @var array $convertedArg */
            $convertedArg = $arg->getSet()->getValue();
            //array_values is needed to make sure the indexes are ordered from 0
            $complement = array_values(array_diff($complement, $convertedArg));
        }

        return new self($complement);
    }
1099701
def assert_subset(self, subset, superset, failure_message='Expected collection "{}" to be a subset of "{}'):
        
        assertion = lambda: set(subset).issubset(set(superset))
        failure_message = unicode(failure_message).format(superset, subset)
        self.webdriver_assert(assertion, failure_message)
1293988
def regular_subset(spikes, n_spikes_max=None, offset=0):
    """"""
    assert spikes is not None
    # Nothing to do if the selection already satisfies n_spikes_max.
    if n_spikes_max is None or len(spikes) <= n_spikes_max:  # pragma: no cover
        return spikes
    step = math.ceil(np.clip(1. / n_spikes_max * len(spikes),
                             1, len(spikes)))
    step = int(step)
    # Note: randomly-changing selections are confusing...
    my_spikes = spikes[offset::step][:n_spikes_max]
    assert len(my_spikes) <= len(spikes)
    assert len(my_spikes) <= n_spikes_max
    return my_spikes
96324
def issuperset(self, other):
        """"""
        self._binary_sanity_check(other)
        return set.issuperset(self, other)
275922
public static <T> Set<T> subset(Set<T> set, Criteria<T> criteria) {
        Set<T> subset = new HashSet<T>();
        for(T item : set) {
            if(criteria.meetsCriteria(item)) {
                subset.add(item);
            }
        }
        return subset;
    }
1273353
private final java.util.Set getSubSet(final Object key)
    {
        // Make sure the hashcode is positive.
        return subSets[(int) ((key.hashCode() & 0x7FFFFFFF) % subSets.length)];
    }
987101
def trivial_partition(set_):
    
    ensure_countable(set_)

    result = ((x,) for x in set_)
    return _harmonize_subset_types(set_, result)
426487
def subset_sum(x, R):
    
    k = len(x) // 2             # divide input
    Y = [v for v in part_sum(x[:k])]
    Z = [R - v for v in part_sum(x[k:])]
    Y.sort()                    # test of intersection between Y and Z
    Z.sort()
    i = 0
    j = 0
    while i < len(Y) and j < len(Z):
        if Y[i] == Z[j]:
            return True
        elif Y[i] < Z[j]:       # increment index of smallest element
            i += 1
        else:
            j += 1
    return False
1055330
def index_complement(index_list, len_=None):
    
    mask1 = index_to_boolmask(index_list, len_)
    mask2 = not_list(mask1)
    index_list_bar = list_where(mask2)
    return index_list_bar
530560
def get(self, subset=None):
        
        if subset is None:
            return dict((name, attr.get(copy=True)) for name, attr in self._fields.items())
        else:
            return dict((name, attr.get(copy=True)) for name, attr in self._fields.items() if name in subset)
340877
public UnicodeSet complement() {
        checkFrozen();
        if (list[0] == LOW) {
            System.arraycopy(list, 1, list, 0, len-1);
            --len;
        } else {
            ensureCapacity(len+1);
            System.arraycopy(list, 0, list, 1, len);
            list[0] = LOW;
            ++len;
        }
        pat = null;
        return this;
    }
1362830
def subset_sum(x, R):
    
    b = [False] * (R + 1)
    b[0] = True
    for xi in x:
        for s in range(R, xi - 1, -1):
            b[s] |= b[s - xi]
    return b[R]
274824
def complement(self):
        """"""

        # add meta-parameters, given options have priority
        self.check()
        for key in CMAOptions.defaults():
            if key not in self:
                self[key] = CMAOptions.defaults()[key]
        return self
934709
function isSubsetOf(subset, superset, cmp, contains, ordered) {
    if (!contains) {
      if (subset.length !== superset.length) return false;
      superset = superset.slice();
    }

    return subset.every(function(elem, idx) {
      if (ordered) return cmp ? cmp(elem, superset[idx]) : elem === superset[idx];

      if (!cmp) {
        var matchIdx = superset.indexOf(elem);
        if (matchIdx === -1) return false;

        // Remove match from superset so not counted twice if duplicate in subset.
        if (!contains) superset.splice(matchIdx, 1);
        return true;
      }

      return superset.some(function(elem2, matchIdx) {
        if (!cmp(elem, elem2)) return false;

        // Remove match from superset so not counted twice if duplicate in subset.
        if (!contains) superset.splice(matchIdx, 1);
        return true;
      });
    });
  }
596164
public final UnicodeSet complement(CharSequence s) {
        checkFrozen();
        int cp = getSingleCP(s);
        if (cp < 0) {
            String s2 = s.toString();
            if (strings.contains(s2)) {
                strings.remove(s2);
            } else {
                strings.add(s2);
            }
            pat = null;
        } else {
            complement(cp, cp);
        }
        return this;
    }