clone really means, "make a new object with these modifications". all "setters" really use this to create a new object while only changing some of the properties
329711
function clone(inst, alts) {
  const current = {
    ts: inst.ts,
    zone: inst.zone,
    c: inst.c,
    o: inst.o,
    loc: inst.loc,
    invalid: inst.invalid
  };
  return new DateTime(Object.assign({}, current, alts, { old: current }));
}
1156372
function clone(a) {
  return a === undefined ? undefined : JSON.parse(JSON.stringify(a))
}
589391
function () {
			var newObj = {};
			for (var i = 0; i < arguments.length; i++) {
				var obj = arguments[i];
				for (var key in obj) {
					if (obj.hasOwnProperty(key)) {
						newObj[key] = obj[key];
					}
				}
			}
			return newObj;
		}
110582
def _clone_properties(self):
    """"""
    cls = self.__class__
    if self._properties is cls._properties:
      self._properties = dict(cls._properties)
1182170
function clone(obj) {
    if (typeof obj !== 'object') {
        return obj;
    }
    var ret;
    if (util.isArray(obj)) {
        ret = [];
        obj.forEach(function (val) {
            ret.push(clone(val));
        });
        return ret;
    }
    ret = {};
    Object.keys(obj).forEach(function (key) {
        ret[key] = clone(obj[key]);
    });
    return ret;
}
1062162
function copyFunction(original)
{
  // clone original function
  var target = fulcon(original);

  // copy it's "static" methods
  copy(target, original);
  // duplicate prototype methods
  copy(target.prototype, original.prototype);

  // add instance reference to the it's own constructor
  Object.defineProperty(target.prototype, 'constructor', {
    value       : target,
    writable    : true,
    enumerable  : false,
    configurable: true
  });

  return target;
}
113641
function clone(that, propName, value) {
    // immutable queries mean that we don't need to clone if no change in value.
    if (propName) {
      if (that[propName] === value) return that;
    }
    // copying QueryOptions is safe because they are are immutable;
    var copy = __extend(new EntityQuery(), that, [
      "resourceName",
      "fromEntityType",
      "wherePredicate",
      "orderByClause",
      "selectClause",
      "skipCount",
      "takeCount",
      "expandClause",
      "inlineCountEnabled",
      "noTrackingEnabled",
      "usesNameOnServer",
      "queryOptions",
      "entityManager",
      "dataService",
      "resultEntityType"
    ]);
    copy.parameters = __extend({}, that.parameters);
    if (propName) {
      copy[propName] = value;
    }
    return copy;
  }
42454
function overwrite(input, clone) {
  // Overwrite input.getReader, input.locked, etc to point to clone
  Object.entries(Object.getOwnPropertyDescriptors(ReadableStream.prototype)).forEach(([name, descriptor]) => {
    if (name === 'constructor') {
      return;
    }
    if (descriptor.value) {
      descriptor.value = descriptor.value.bind(clone);
    } else {
      descriptor.get = descriptor.get.bind(clone);
    }
    Object.defineProperty(input, name, descriptor);
  });
}
80097
function clone(obj) {
  if (null == obj || "object" != typeof obj)
    return obj;

  if (obj instanceof Object) {
    var copy = {};
    for (var attr in obj) {
      if (obj.hasOwnProperty(attr)) copy[attr] = clone(obj[attr]);
    }
    return copy;
  }

  throw new Error("Unable to copy obj! Its type isn't supported.");
}
850728
function( obj1, obj2 ) {
            var newObj = {};
            if ( obj1 ) {
                this.inheritAttrs( newObj, this.cloneObj( obj1 ) );
            }
            if ( obj2 ) {
                this.inheritAttrs( newObj, obj2 );
            }
            return newObj;
        }
1130994
function simple_instance_setters (setters) {
        var stateKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'instances';
        var instanceKey = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'id';

        // loop over the setter keys and make a mutation for each
        return Object.keys(setters).reduce(function (mutations, name) {

            // attach our new mutation to result
            return Object.assign({}, mutations, defineProperty({}, name, function (state, payload) {
                // find the instance that we're mutating
                var instance = findInstance(state, stateKey, instanceKey, payload);

                if (instance) {
                    var value = findValue(payload, instanceKey);

                    // if the setter name has a dot, then resolve the
                    // state path before feeding our value into it.
                    if (setters[name].indexOf('.') > -1) {
                        var obj = setters[name].split('.');
                        var key = obj.pop();

                        resolveObjectPath(instance, obj)[key] = value;
                    } else {
                        // otherwise, just set the instance state to our value
                        instance[setters[name]] = value;
                    }
                } else {
                    // if the instance wasn't found, let the dev know with a warning
                    console.warn('An instance with an identifier of ' + instanceKey + ' was not found.');
                }
            }));
        }, {});
    }
312496
function clone() {
    var cloned = new this.constructor(this.client);
    cloned._method = this._method;
    cloned._single = assign({}, this._single);
    cloned._options = assign({}, this._options);
    cloned._statements = this._statements.slice();
    return cloned;
  }
420302
function _clone(src) {
  if (!src) {
    return src;
  }

  if (typeof src.clone === 'function') {
    return src.clone();
  } else if (_isPlainObject(src) || _isArray(src)) {
    let ret = new (src.constructor);

    Object.getOwnPropertyNames(src).forEach(function(key) {
      if (typeof src[key] !== 'function') {
        ret[key] = _clone(src[key]);
      }
    });

    return ret;
  } else {
    return JSON.parse(JSON.stringify(src));
  }
}
58343
function cloneAndInvoke(obj){
  var clone = Array.isArray(obj) ? [] : {};
  for (var key in obj) {
    if (obj[key] !== null && typeof(obj[key])=="object") {
      clone[key] = cloneAndInvoke(obj[key]);
    }else if(typeof(obj[key])=="function"){
      clone[key] = obj[key]();
    }else{
      clone[key] = obj[key];
    }
  }
  return clone
}
235326
function(obj, fromObj) {
		var orig = _.clone(obj);
		_.deleteAll(obj);
		_.extend(obj, fromObj);
		_.extend(obj, orig);
		return obj;
	}
967905
function clone() {
      return new this.constructor(this.models, {
        url: 'function' === typeof this.url ? this.url() : this.url,
        model: this.model,
        database: this.database,
        comparator: this.comparator
      });
    }
1108133
function() {

            var that = this;
            var propertiesParams = that.__getPropertiesParam();

            _.each(propertiesParams, function(params, property) {

                var value = that.__getPropertyValue(property);

                if (_.isUndefined(value) && 'default' in params) {

                    var defaultValue = params.default;

                    if (_.isFunction(defaultValue)) {
                        defaultValue = defaultValue.call(that);
                    }

                    if (defaultValue) {
                        if ((_.isSimpleObject(defaultValue)) || _.isArray(defaultValue)) {
                            defaultValue = _.clone(defaultValue)
                        }
                    }

                    that.__setPropertyValue(property, defaultValue, false);
                }
            });
        }