Returns the difference of the union of all values and the union of the values in *args.
333387
def complement(self, *args):
        '''
        '''
        universe = self.union()
        to_diff = self.union(*args)
        return universe.difference(to_diff)
1014000
def record_diff(lhs, rhs):
    ""
    delta = {}
    for k in set(lhs).union(rhs):
        from_ = lhs[k]
        to_ = rhs[k]
        if from_ != to_:
            delta[k] = {'from': from_, 'to': to_}

    return delta
30595
def merge_with(self, other):
        """"""
        result = ValuesAggregation()
        result.total = self.total + other.total
        result.count = self.count + other.count
        result.min = min(self.min, other.min)
        result.max = max(self.max, other.max)
        return result
1323933
public Multiset<O> difference(Multiset<O> multiset) throws ParameterException {
		Validate.notNull(multiset);
		Multiset<O> result = new Multiset<>();
		for (O o : support()) {
			if (multiset.multiplicity(o) > 0) {
				result.setMultiplicity(o, Math.max(0, multiplicity(o) - multiset.multiplicity(o)));
			} else {
				result.setMultiplicity(o, multiplicity(o));
			}
		}
		return result;
	}
1234584
def equal(self, value_a, value_b):                                         #pylint: disable=no-self-use
        
        equal = value_a == value_b
        if hasattr(equal, '__iter__'):
            return all(equal)
        return equal
1252446
function(and, or) {
			var aDiff = set.difference(and, or.values[0]);
			var bDiff = set.difference(and, or.values[1]);
			return set.intersection(aDiff, bDiff);
		}
1102333
def union(self, *others, **kwargs):
        
        return self._combine_variant_collections(
            combine_fn=set.union,
            variant_collections=(self,) + others,
            kwargs=kwargs)
79907
def _diff(d1,d2):
    '''
        
    '''
    d = {}
    ds = _diff_internal(d1,d2)
    for key in ds['vdiff']:
        d[key] = d1[key]
    for key in ds['kdiff']:
        d[key] = d1[key]
    return(d)
103133
function diffClamp(value, min, max) {
  if (value > max) {
    return { value: max, diff: value - max };
  } else if (value < min) {
    return { value: min, diff: value - min };
  }
  return { value, diff: 0 };
}
2801
def pt_between_pts(a=(0.0, 0.0), b=(0.0, 0.0), t=0.5):
    '''
    '''
    assert isinstance(a, tuple)
    assert isinstance(b, tuple)
    l_pt = len(a)
    assert l_pt > 1
    assert l_pt == len(b)
    for i in a:
        assert isinstance(i, float)
    for i in b:
        assert isinstance(i, float)
    assert isinstance(t, float)
    assert 0 <= t <= 1

    return tuple([ ((b[i] - a[i]) * t) + a[i] for i in range(l_pt) ])
1076871
function union(arr1, arr2) {
  if (_.isEqual(arr1, arr2)) {
    return arr1;
  }

  const arr = arr1.slice();
  for (const v of arr2) {
    if (!arrayIncludes(arr, v)) {
      arr.push(v);
    }
  }

  return arr;
}
689728
def mean(values: Sequence[Union[int, float, None]]) -> Optional[float]:
    
    total = 0.0  # starting with "0.0" causes automatic conversion to float
    n = 0
    for x in values:
        if x is not None:
            total += x
            n += 1
    return total / n if n > 0 else None
725198
def symmetric_difference(self, that):
        
        diff = self._set.symmetric_difference(that)
        return self._fromset(diff, key=self._key)
1152774
def intersection(self, *args):
        '''
        '''
        values = self.values()
        if args:
            values = [val for key,val in self.items() if key in args]
        return set(reduce(set.intersection, values))
42617
def combine_numeric_values(self, other):
        
        if self.values is None:
            ret = IdValues()
        else:
            ret = sum([IdValues(
                {k: int(v) * int(other.values[key]) for k, v in value.items()})
                for key, value in self.values.items()])
        return ret
1131479
def difference (b, a):
    
    a = set(a)
    result = []
    for item in b:
        if item not in a:
            result.append(item)
    return result
1374704
def union(self):
        
        usegs = reduce(operator.or_, self.values())
        usegs.name = ' | '.join(self.keys())
        return usegs