Clone each element in a collection
@private
@param {Jamon} collection
@param {boolean} [deep=true] - deep clone?
@return {Jamon} the cloned collection
15714
function clone(collection, deep = true) {
		const clones = new Jamon();

		collection.forEach(element => clones.push(element.cloneNode(deep)));

		return clones;
	}
1223174
function (obj) {
        return _.cloneDeepWith(obj, function (value) {
            // falls back to default deepclone if object does not have explicit toJSON().
            if (value && _.isFunction(value.toJSON)) {
                return value.toJSON();
            }
        });
    }
1356621
function (name, items) {
    var List = this.get('List');
    var list = this.lists[name];
    if (typeof list === 'undefined') {
      var opts = lazy.clone(this.options);
      opts.items = items || this.items;
      opts.collection = this;
      this.lists[name] = list = new List(opts);
    }
    return list;
  }
1228567
function cloneWithRaws(node) {
      if (node.nodes) {
        const oldNodes = node.nodes;
        node.nodes = [];
        const clone = node.clone({ raws: node.raws });
        node.nodes = oldNodes;
        for (const clonedChild of oldNodes.map(cloneWithRaws)) {
          clone.append(clonedChild);
        }
        return clone;
      } else {
        return node.clone({ raws: node.raws });
      }
    }
645680
function clone(source) {
            if (!source || typeof source !== 'object') {
                return source;
            }

            var cloned = source;

            if (isArray(source)) {
                cloned = source.slice().map(clone);
            }
            else if (isObject(source) && 'isPrototypeOf' in source) {
                cloned = {};
                for (var key in source) {
                    if (hasOwnProperty.call(source, key)) {
                        cloned[key] = clone(source[key]);
                    }
                }
            }

            return cloned;
        }
258804
function from(collection) {
  const result = [];
  const length = collection.length;
  let idx = -1;
  while (++idx < length) {
    result[idx] = collection[idx];
  }
  return result;
}
82800
function clone(obj1, obj2, index) {
  index = index || 0;
  for (var i in obj2) {
    if ('object' == typeof i) obj1[i] = recursiveMerge(obj1[i], obj2[i], index++);
    else obj1[i] = obj2[i];
  }
  return obj1;
}
664369
function _setCollectionFrom(COLLECTION) {
	  _export(_export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {
	      var mapFn = arguments[1];
	      var mapping, A, n, cb;
	      _aFunction(this);
	      mapping = mapFn !== undefined;
	      if (mapping) _aFunction(mapFn);
	      if (source == undefined) return new this();
	      A = [];
	      if (mapping) {
	        n = 0;
	        cb = _ctx(mapFn, arguments[2], 2);
	        _forOf(source, false, function (nextItem) {
	          A.push(cb(nextItem, n++));
	        });
	      } else {
	        _forOf(source, false, A.push, A);
	      }
	      return new this(A);
	    } });
	}
910313
function(options) {
      options = options ? _.clone(options) : {};
      if (options.parse === void 0) options.parse = true;
      var collection = this;
      var success = options.success;
      options.success = function(resp, status, xhr) {
        var method = options.update ? 'update' : 'reset';
        collection[method](resp, options);
        if (success) success(collection, resp, options);
      };
      return this.sync('read', this, options);
    }
192489
def inverse_all(collection)
      newcollection = collection.dup.clear
      collection.each do |point|
        newcollection << inverse(point)
      end
      newcollection
    end
516933
def cloneNode(self, deep: bool=False) -> AbstractNode:
        
        if deep:
            return self._clone_node_deep()
        return self._clone_node()
42299
function clone (data) {
  if (Array.isArray(data)) {
    return data.map(clone)
  } else if (data && typeof data === 'object') {
    let obj = Object.assign({}, data)
    for (let key in obj) {
      if (!obj.hasOwnProperty(key)) continue
      if (typeof obj[key] === 'object') {
        obj[key] = clone(obj[key])
      }
    }
    return obj
  } else {
    return data
  }
}
855461
def recursive_update(a, b, **kwargs):
    
    copy = kwargs.get('copy', False)
    merge_lists = kwargs.get('merge_lists', True)

    for k, v in b.items():
        if isinstance(v, collections.Mapping):
            if isinstance(a.get(k, None), collections.Mapping):
                recursive_update(a[k], v, **kwargs)
                continue

        elif merge_lists and type(v) is list:
            if type(a.get(k, None)) is list:
                if copy:
                    a[k].extend(deepcopy(v))
                else:
                    a[k].extend(v)
                continue

        # warning, clobbering
        if copy:
            a[k] = deepcopy(v)
        else:
            a[k] = v

    return a
791911
function deepClone(obj) {
  if (obj && typeof obj === 'object') {
    if (Array.isArray(obj)) {
      var newObj = [];

      for (var i = 0, j = obj.length; i < j; i++) {
        newObj[i] = deepClone(obj[i]);
      }

      return newObj;
    } else if (isPlainObj(obj)) {
      var _newObj = {};

      for (var _i in obj) {
        _newObj[_i] = deepClone(obj[_i]);
      }

      return _newObj;
    }
  }

  return obj;
}
557859
private CollectionDescriptorDef cloneCollection(CollectionDescriptorDef collDef, String prefix)
    {
        CollectionDescriptorDef copyCollDef = new CollectionDescriptorDef(collDef, prefix);

        copyCollDef.setOwner(this);
        // we remove properties that are only relevant to the class the features are declared in
        copyCollDef.setProperty(PropertyHelper.OJB_PROPERTY_IGNORE, null);

        Properties mod = getModification(copyCollDef.getName());

        if (mod != null)
        {
            if (!PropertyHelper.toBoolean(mod.getProperty(PropertyHelper.OJB_PROPERTY_IGNORE), false) &&
                hasFeature(copyCollDef.getName()))
            {
                LogHelper.warn(true,
                               ClassDescriptorDef.class,
                               "process",
                               "Class "+getName()+" has a feature that has the same name as its included collection "+
                               copyCollDef.getName()+" from class "+collDef.getOwner().getName()); 
            }
            copyCollDef.applyModifications(mod);
        }
        return copyCollDef;
    }
1003750
function(options) {
          options = options ? _.clone(options) : {};
          if (options.parse === void 0) { options.parse = true; }
          var success = options.success;
          var collection = this;
          options.success = function(resp) {
            var arr = [];
            var keys = _.keys(resp);
            _.each(keys, function(key) {
              arr.push(resp[key]);
            });
            var method = options.reset ? 'reset' : 'set';
            collection[method](arr, options);
            if (success) { success(collection, arr, options); }
            options.autoSync = false;
            options.url = this.url;
            collection.trigger('sync', collection, arr, options);
          };
          return this.sync('read', this, options);
        }
1092792
function deepClone (value, oldValue) {
  var type = typeOf(value);
  var clone;

  if (type.isPOJO) {
    var oldType = typeOf(oldValue);
    if (oldType.isPOJO) {
      // Return a merged clone of the old POJO and the new POJO
      clone = deepAssign({}, oldValue);
      return deepAssign(clone, value);
    }
    else {
      return deepAssign({}, value);
    }
  }
  else if (type.isArray) {
    clone = [];
    for (var i = 0; i < value.length; i++) {
      clone.push(deepClone(value[i]));
    }
  }
  else if (type.hasValue) {
    // string, boolean, number, function, Date, RegExp, etc.
    // Just return it as-is
    return value;
  }
}