Extended standard set function.
320972
def set(self, key, value, extend=False, **kwargs):
        """"""
        self.__setitem__(key, value, extend, **kwargs)
160016
def visit_Set(self, node: ast.Set) -> Set[Any]:
        """"""
        result = set(self.visit(node=elt) for elt in node.elts)

        self.recomputed_values[node] = result
        return result
1277174
def _extended_gcd(self, a, b):
        
        s, old_s = 0, 1
        t, old_t = 1, 0
        r, old_r = b, a
        while r:
            quotient = old_r // r
            old_r, r = r, old_r - quotient * r
            old_s, s = s, old_s - quotient * s
            old_t, t = t, old_t - quotient * t
        return old_r, old_s, old_t
1172017
function(set) {
            var l = set.length;
            for(var i=0; i<l; i++) if(!__.isLinear(set[i])) return false;
            return true;
        }
1187331
function(s) {
                //TODO: validate array length
		//TODO: return unwanted subset as new Px object

                var counts = this.valCounts(),
                multipliers = [];

                _.each(s, function(d, i) {
                    if (d[0] === '*') {
                        s[i] = _.range(0, counts[i] - 1);
                    }
                });

                for (var i = 0, l = counts.length; i < l - 1; i++) {
                    multipliers[i] = _.reduce(counts.slice(i+1), function(a, b) { return a * b; });
                }
                multipliers.push(1);

                for (var j = 0, k = s.length; j < k; j++) {
                    
                    // drop the values
                    this.metadata.VALUES[this.variables()[j]] = 
                        _.filter(this.metadata.VALUES[this.variables()[j]], function(e, m) {
                            return _.indexOf(s[j], m) !== -1;
                        });
                }

                var keepIdxs = [];
                var pattern = function pattern(c,m,w,p) {
                    if (c.length > 1) {
                        p = typeof p !== 'undefined' ? p : 1;
                        var count = c.pop(),
                            multiple = m.pop(),
                            want = w.pop();

                        var patt = _.flatten(_.map(_.range(0, count), function(d) { 
                            return _.include(want, d) ? p : _arrayOfZeroes(multiple);
                        }));

                        pattern(c, m, w, patt);
                    }
                    keepIdxs.push(_.flatten(p));
                };
                pattern(counts,multipliers,s);
                keepIdxs = keepIdxs[0];

                var indices = [];
                _.each(s[0], function(d) {
                    var start = d * multipliers[0];
                    var end = start + multipliers[0];
                    indices.push(_.filter(_.range(start, end), function(d, i) {return keepIdxs[i] === 1;}));
                });
                indices = _.flatten(indices);
                this.data = _.filter(this.data, function(d, i) {return _.indexOf(indices, i) !== -1;});
            }
896325
function routine (fn, sets, context) {
  const master = []

  if (typeof context === 'undefined') {
    context = fn
  }

  for (const args of sets) {
    master.push(fn.apply(context, Array.isArray(args) ? args : [args]))
  }

  return Promise.all(master)
}
698883
function makeSet( length ) {
    var res = new Array( length );
    var i = -1;

    while( ++i < length ) {
        res[i] = i;
    }

    return new _set2.default( res );
}
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)
581846
function standardizeLets(declars) {
  var _arr = declars;

  for (var _i = 0; _i < _arr.length; _i++) {
    var declar = _arr[_i];
    delete declar._let;
  }
}
185534
def set_of(cls):
    
    return lambda l: isinstance(l, set) and all(isinstance(x, cls) for x in l)
1250773
def inc(self, *args, **kwargs):
        '''  '''
        pairs = []
        if len(args) == 1:
            pairs.append((args[0], 1))
        elif len(args) == 2:
            pairs.append(args)
        elif len(kwargs) != 0:
            pairs.extend([(k, v) for k, v in kwargs.items()])
        else:
            raise UpdateException('Invalid arguments for set.  Requires either two positional arguments or at least one keyword argument')

        ret = self
        for qfield, value in pairs:
            ret = self._atomic_op('$inc', qfield, value)
        return ret
691954
public static final <S, E> Functional<S> functionalSet(Set<E> set) {
		return new FunctionalSet<S, E>(set);
	}
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;
      });
    });
  }
703662
function(and1, and2) {
			var union1 = set.union(and1, and2.values[0]);
			var union2 = set.union(and1, and2.values[1]);

			if (isAndOrOr(union1) || isAndOrOr(union2)) {
				// try the other direction
				union1 = set.union(and2, and1.values[0]);
				union2 = set.union(and2, and1.values[1]);
			}
			if (isAndOrOr(union1) || isAndOrOr(union2)) {
				return new is.Or([and1, and2]);
			} else {
				return set.intersection(union1, union2);
			}

			/*
			var combo1 = [
					set.union(and1.values[0], and2.values[0]),
					set.union(and1.values[1], and2.values[1])
				],
				combo2 = [
					set.union(and1.values[0], and2.values[1]),
					set.union(and1.values[1], and2.values[0])
				];
			if(combo1.every(isUniversal)) {
				return set.intersection.apply(set, combo2);
			}
			if(combo2.every(isUniversal)) {
				return set.intersection.apply(set, combo1);
			}
			return new is.Or([and1, and2]);*/
		}
466367
def p_common_scalar_magic_func(p):
    ''
    p[0] = ast.MagicConstant(p[1].upper(), None, lineno=p.lineno(1))
108860
function lset(key, index, value, req) {
  var val = this.getKey(key, req);
  if(val === undefined) return null;
  val = val.lset(index, value);
  return val !== null ? OK : null;
}
835568
function(or1, or2) {
			var union1 = set.union(or1.values[0], or2.values[0]);
			var union2 = set.union(or1.values[1], or2.values[1]);

			if (!isAndOrOr(union1) || !isAndOrOr(union2)) {
				return set.union(union1, union2);
			}
			union1 = set.union(or1.values[0], or2.values[1]);
			union2 = set.union(or1.values[1], or2.values[0]);

			if (!isAndOrOr(union1) || !isAndOrOr(union2)) {
				return set.union(union1, union2);
			} else {
				return new is.Or([or1, or2]);
			}
		}