/*
Helper to create properties and assign values in an object.
Properties with `undefined` values are ignored. *mutative*

@param {object} obj Object to assign properties to
505531
function assignVal(obj, prop, userVal, defaultVal) {
  const val = userVal !== undefined ? userVal : defaultVal;
  if (val !== undefined) {
    obj[prop] = val;
  }
}
955722
function forIn(obj, fn, thisObj){
        var key, i = 0;
        // no need to check if argument is a real object that way we can use
        // it for arrays, functions, date, etc.

        //post-pone check till needed
        if (_hasDontEnumBug == null) { checkDontEnum(); }

        for (key in obj) {
            if (exec(fn, obj, key, thisObj) === false) {
                break;
            }
        }

        if (_hasDontEnumBug) {
            while (key = _dontEnums[i++]) {
                // since we aren't using hasOwn check we need to make sure the
                // property was overwritten
                if (obj[key] !== Object.prototype[key]) {
                    if (exec(fn, obj, key, thisObj) === false) {
                        break;
                    }
                }
            }
        }
    }
923273
function extend(obj) {
  Array.prototype.slice.call(arguments, 1).forEach(function(source) {
    if (source) {
      for (var prop in source) {
        if (source[prop].constructor === Object) {
          if (!obj[prop] || obj[prop].constructor === Object) {
            obj[prop] = obj[prop] || {};
            extend(obj[prop], source[prop]);
          } else {
            obj[prop] = source[prop];
          }
        } else {
          obj[prop] = source[prop];
        }
      }
    }
  });
  return obj;
}
330645
function(objA, objB) {
		// first see if we can union a single property
		// {age: 21, color: ["R"]} U {age: 21, color: ["B"]} -> {age: 21, color: ["R","B"]}

		var diff = keyDiff(objA.values, objB.values);


		// find the different keys
		var aAndBKeysThatAreNotEqual = [],
			sameKeys = {};

		diff.aAndBKeys.forEach(function(key) {
			if (!set.isEqual(objA.values[key], objB.values[key])) {
				aAndBKeysThatAreNotEqual.push(key)
			} else {
				sameKeys[key] = objA.values[key];
			}
		});
		var aUnequal = {}, bUnequal = {};
		aAndBKeysThatAreNotEqual.forEach(function(key){
			aUnequal[key] = objA.values[key];
			bUnequal[key] = objB.values[key];
		});

		// if all keys are shared
		if (!diff.aOnlyKeys.length && !diff.bOnlyKeys.length) {

			if (aAndBKeysThatAreNotEqual.length === 1) {
				var keyValue = aAndBKeysThatAreNotEqual[0];

				var result = sameKeys[keyValue] = set.union(objA.values[keyValue], objB.values[keyValue]);

				// if there is only one property, we can just return the universal set
				return canReflect.size(sameKeys) === 1 && set.isEqual(result, set.UNIVERSAL) ?
					set.UNIVERSAL : new KeysAnd(sameKeys);
			} else if (aAndBKeysThatAreNotEqual.length === 0) {
				// these things are equal
				return objA;
			}
		}
		// If everything shared is the same
		if (aAndBKeysThatAreNotEqual.length === 0) {
			// the set with the extra keys is a subset
			if (diff.aOnlyKeys.length > 0 && diff.bOnlyKeys.length === 0) {
				return checkIfUniversalAndReturnUniversal(objB);
			} else if (diff.aOnlyKeys.length === 0 && diff.bOnlyKeys.length > 0) {
				return checkIfUniversalAndReturnUniversal(objA);
			}
		}
		// (count > 5 && age > 25 ) || (count > 7 && age > 35 && name > "Justin" )
		//
		// ( age > 25 ) || ( name > "Justin" && age > 35)  A U (B & C) => (A U B) & (A U C)
		// ( age > 25 || name > "Justin" ) && (age > 25)
		// lets see if one side is different
		if (diff.aOnlyKeys.length > 0 && diff.bOnlyKeys.length === 0) {
			// collect shared value
			if( set.isSubset(new KeysAnd(aUnequal), new KeysAnd(bUnequal) )) {
				return objB;
			}
		}
		if (diff.bOnlyKeys.length > 0 && diff.aOnlyKeys.length === 0) {
			// collect shared value
			if( set.isSubset(new KeysAnd(bUnequal),  new KeysAnd(aUnequal) )) {
				return objA;
			}
		}

		return new keysLogic.ValuesOr([objA, objB]);
	}
19098
function setaVal(obj, k, v) {
  if (obj.hasOwnProperty(k)) {
    var val = obj[k];
    if (!_.isArray(val)) { obj[k] = [val]; }
    obj[k].push(v);
  }
  else { obj[k] = v; }
}
134743
function each (obj, fn) {
      var key;
      for (key in obj) {
        if (Object.hasOwnProperty.call(obj, key)) {
          fn(key);
        }
      }
    }
248838
function (obj) {
            // Must be an Object.
            // Because of IE, we also have to check the presence of the constructor property.
            // Make sure that Dom nodes and window objects don't pass through, as well
            if (!obj || util.type(obj) !== 'object' || obj.nodeType || /*jshint eqeqeq:false*/
                // must == for ie8
                obj.window == obj) {
                return FALSE;
            }
            var key, objConstructor;
            try {
                // Not own constructor property must be Object
                if ((objConstructor = obj.constructor) && !hasOwnProperty(obj, 'constructor') && !hasOwnProperty(objConstructor.prototype, 'isPrototypeOf')) {
                    return FALSE;
                }
            } catch (e) {
                // IE8,9 Will throw exceptions on certain host objects
                return FALSE;
            }    // Own properties are enumerated firstly, so to speed up,
                 // if last one is own, then all properties are own.
                 /*jshint noempty:false*/
            // Own properties are enumerated firstly, so to speed up,
            // if last one is own, then all properties are own.
            /*jshint noempty:false*/
            for (key in obj) {
            }
            return key === undef || hasOwnProperty(obj, key);
        }
375873
def set_object(self, obj, properties):
        """"""
        self._objects.add(obj)
        properties = set(properties)
        self._properties |= properties
        pairs = self._pairs
        for p in self._properties:
            if p in properties:
                pairs.add((obj, p))
            else:
                pairs.discard((obj, p))
46378
function(obj, prop, op) {
        var writable;

        if (!canWriteProtect() || !obj.hasOwnProperty(prop)) {
          op.call(obj);
          return;
        }

        writable = Object.getOwnPropertyDescriptor(obj, prop).writable;

        Object.defineProperty(obj, prop, { writable: true });
        op.call(obj);
        Object.defineProperty(obj, prop, { writable: writable });

      }
1364026
function setDeepProperty (obj, propName, propValue) {
  propName = propName.split(".");
  for (let i = 0; i < propName.length - 1; i++) {
    obj = obj[propName[i]] = obj[propName[i]] || {};
  }
  obj[propName[propName.length - 1]] = propValue;
}
908127
function set(obj, key, val) {
  var v = obj[key];
  if (undefined === v) {
    obj[key] = val;
  } else if (isArray(v)) {
    v.push(val);
  } else {
    obj[key] = [v, val];
  }
}
4277
function defineProperty(obj, prop, getter) {
  Object.defineProperty(obj, prop, {
    configurable: true,
    enumerable: true,
    get: getter
  });
}
233881
function extend(object, subject, ignoredKeys) {
    if (arrayOrNil(subject)) {
      for (var len = subject.length; --len >= 0;) { extend(object, subject[len], ignoredKeys); }
    } else {
      ignoredKeys = ignoredKeys || { constructor: 1, $super: 1, prototype: 1, $superp: 1 };

      var iClass     = classOrNil(object),
          isSubClass = classOrNil(subject),
          oPrototype = object.prototype, key, proto;

      // copy static properties and prototype.* to object
      if (mapOrNil(subject) || iClass) {
        for (key in subject) {
          copier(key, subject[key], ignoredKeys, object, iClass, oPrototype);
        }
      }

      if (isSubClass) {
        proto = subject.prototype;
        for (key in proto) {
          copier(key, proto[key], ignoredKeys, object, iClass, oPrototype);
        }
      }

      // prototype properties
      if (iClass && isSubClass) { extend(oPrototype, subject.prototype, ignoredKeys); }
    }
  }
884524
function assign() {
  var result = {};
  var args = Array.prototype.slice.call(arguments);
  for(var i = 0; i < args.length; i++) {
    var obj = args[i];
    if(typeof obj !== 'object') {
      continue;
    }
    for(var key in obj) {
      if(obj.hasOwnProperty(key)) {
        result[key] = obj[key];
      }
    }
    obj = void 0;
  }
  return result;
}
534672
function(obj) {
		var prop;

		if (!obj || typeOf(obj) !== 'object') {
			return true;
		}

		for (prop in obj) {
			return false;
		}

		return true;
	}
974892
function randomize( obj ) {
	var j = 0,
		i = Math.floor(Math.random() * (Object.keys(obj).length)),
		result;

	for(var property in obj) {
		if(j === i) {
			result = property;
			break;
		}

		j++;
	}

	return result;
}
1182955
function( obj ) {
  // Not plain objects:
  // - Any object or value whose internal [[Class]] property is not "[object Object]"
  // - DOM nodes
  // - window
  if (typeof obj !== "object" || obj.nodeType || (obj !== null && obj === obj.window)) {
    return false;
  }

  if (obj.constructor && !Object.prototype.hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf")) {
    return false;
  }

  // If the function hasn't returned already, we're confident that
  // |obj| is a plain object, created by {} or constructed with new Object
  return true;
}