A set of objects of the same type
762798
function ArrayType(typeSpec) {
  if (!typeSpec.subtype) {
    console.error('Array.typeSpec is missing subtype. Assuming string.' +
        JSON.stringify(typeSpec));
    typeSpec.subtype = 'string';
  }

  Object.keys(typeSpec).forEach(function(key) {
    this[key] = typeSpec[key];
  }, this);
  this.subtype = types.getType(this.subtype);
}
111149
def _structure_set(self, obj, cl):
        """"""
        if is_bare(cl) or cl.__args__[0] is Any:
            return set(obj)
        else:
            elem_type = cl.__args__[0]
            return {
                self._structure_func.dispatch(elem_type)(e, elem_type)
                for e in obj
            }
613750
function(a, b) {
        var self = this;

        function equalArrays(a, b) {
            if (a.length !== b.length) {
                return false;
            }

            var length = a.length;
            var i;
            for (i = 0; i < length; i++) {
                if (!self.equal(a[i], b[i])) {
                    return false;
                }
            }

            return true;
        }

        function equalObjects(a, b) {
            var keysA = Object.keys(a);
            var keysB = Object.keys(b);

            keysA.sort();
            keysB.sort();

            if (keysA.length !== keysB.length) {
                return false;
            }

            var length = keysA.length;
            var i;
            var key;
            for (i = 0; i < length; i++) {
                if (keysA[i] !== keysB[i]) {
                    return false;
                }

                key = keysA[i];
                if (!self.equal(a[key], b[key])) {
                    return false;
                }
            }

            return true;
        }

        var typeA = this.typeOf(a);
        var typeB = this.typeOf(b);

        if (typeA !== typeB) {
            return false;
        }

        switch (typeA) {
            case 'Null':
            case 'Boolean':
            case 'Number':
            case 'String':
            case 'Filter':
                return a === b;

            case 'RegExp':
                return a.source === b.source
                    && a.global === b.global
                    && a.multiline === b.multiline
                    && a.ignoreCase === b.ignoreCase;

            case 'Date':
            case 'Duration':
                return JuttleMoment.eq(a, b);

            case 'Array':
                return equalArrays(a, b);

            case 'Object':
                return equalObjects(a, b);
        }
    }
1332690
function object(pairs) {
  let obj = {};
  for (let i = 0;i<pairs.length;++i) {
    obj[pairs[i][0]] = pairs[i][1];
  }
  return obj;
}
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;
    }
96896
def intersection(self, *iterables):
        
        comb = self._set.intersection(*iterables)
        new_set = self.__class__(key=self._key, load=self._load, _set=comb)
        return new_set
947493
function(objects) {
		var ret = {};
		
		for(var i=0; i<arguments.length; i++) {
			var o = arguments[i];
			
			for(var j in o) {
				ret[j] = o[j];
			}
		}
		
		return ret;
	}
67433
private IndexedSet<T> createFromIndices(IntSet indx) {
		return new IndexedSet<T>(itemToIndex, indexToItem, indx);
	}
638302
function(item1, item2, query) {
            if (typeof item1 === 'object' && typeof item2 === 'object') {
                query = query || {};
                for (var prop in query) {
                    if (item1[prop] !== item2[prop])
                        return false;
                }
                return true;
            }
            return item1 === item2;
        }
297152
def is_one_of(obj, types):
    """"""
    for type_ in types:
        if isinstance(obj, type_):
            return True
    return False
408776
def identical(self, a, b):
        
        return self._identical(self.convert(a), self.convert(b))
1261426
def of_type(cls, iterable, types):
    

    return cls(x for x in iterable if isinstance(x, types))
245177
function Set() {
            var set = this;
            set = emulateES6construct(set);
            if (!set._es6set) {
              throw new TypeError('bad set');
            }

            defineProperties(set, {
              '[[SetData]]': null,
              '_storage': emptyObject()
            });

            // Optionally initialize map from iterable
            var iterable = arguments[0];
            if (iterable !== undefined && iterable !== null) {
              var it = ES.GetIterator(iterable);
              var adder = set.add;
              if (!ES.IsCallable(adder)) { throw new TypeError('bad set'); }
              while (true) {
                var next = ES.IteratorNext(it);
                if (next.done) { break; }
                var nextItem = next.value;
                adder.call(set, nextItem);
              }
            }
            return set;
          }
211670
static boolean equalsImpl(Set<?> s, @Nullable Object object) {
    if (s == object) {
      return true;
    }
    if (object instanceof Set) {
      Set<?> o = (Set<?>) object;

      try {
        return s.size() == o.size() && s.containsAll(o);
      } catch (NullPointerException ignored) {
        return false;
      } catch (ClassCastException ignored) {
        return false;
      }
    }
    return false;
  }
788759
def subclasses(cls):
        """"""
        seen = set()
        queue = set([cls])

        while queue:
            c = queue.pop()
            seen.add(c)

            sc = c.__subclasses__()
            for c in sc:
                if c not in seen:
                    queue.add(c)

        seen.remove(cls)
        return seen
253403
function _compareTypes(typeA, typeB, sameTypes, propertyA, propertyB) {
  sameTypes = sameTypes || {}
  if (typeA === typeB) {
    if (typeA === types.class && propertyA && propertyB) {
      return propertyA.constructor.name === propertyB.constructor.name;
    }
    return true;
  }

  if (Object.keys(sameTypes).length === 0) {
    return false;
  }
  let typeKeyA;
  let typeKeyB;
  let foundMatch = false
  Object.keys(sameTypes).forEach((key) => {
    if (foundMatch) { return }
    const similar = sameTypes[key];
    if (similar.indexOf(typeA) > -1) {
      typeKeyA = key;
    }
    if (similar.indexOf(typeB) > -1) {
      typeKeyB = key;
    }
    if (typeKeyA && typeKeyB) { foundMatch = true }
  });
  return foundMatch && typeKeyA === typeKeyB;
}
1327706
function(and, or) {
			var aIntersection = set.intersection(and, or.values[0]);
			var bIntersection = set.intersection(and, or.values[1]);
			if (!isOr(aIntersection) && !isOr(bIntersection)) {
				return set.union(aIntersection, bIntersection);
			}
			return new is.And([and, or]);
		}