Deep copies the properties of the source object into the destination
object.
979682
function deepCopy(destination, source) {
    Object.keys(source).forEach(function (property) {
        if (destination[property] && isObject(destination[property])) {
            deepCopy(destination[property], source[property]);
        } else {
            destination[property] = source[property];
        }
    });
}
482813
def copy(self, deep=True):
        
        return self.__constructor__(query_compiler=self._query_compiler.copy())
1114166
function deepCopy(obj) {
			var ret = {}, key, val;
			for (key in obj) {
				if (obj.hasOwnProperty(key)) {
					val = obj[key];
					if (typeof val === 'object' && val !== null) {
						ret[key] = deepCopy(val);
					} else {
						ret[key] = val;
					}
				}
			}
			return ret;
		}
1030578
def deep_copy
      copy = self.dup
      copy.create_command
      copy.serializer    = self.serializer.deep_copy
      copy.deserializer  = self.deserializer.deep_copy
      copy.commands      = self.commands.dup
      copy.libraries     = self.libraries.dup
      copy.bound_objects = self.bound_objects.dup
      copy
    end
513667
function copy(source) {
    var destination;
    if (Type.isDate(source)) {
        return new Date(source.getTime());
    } else if (Type.isRegExp(source)) {
        return new RegExp(source.source);
    } else if (isConstructor(source)) {
        try {
            destination = new source.constructor;
            Object.keys(source).forEach(function (key) {
                destination[key] = copy(source[key]);
            });
            return destination;
        } catch (e) {
            throw new Error('Core.copy: To many recursions on copy', e);
        }
    }
    return source;
}
1098128
function deepCopy(obj)
{
	var ret, key;
	var marker = '__deepCopy';

	if (obj && obj[marker])
		throw (new Error('attempted deep copy of cyclic object'));

	if (obj && obj.constructor == Object) {
		ret = {};
		obj[marker] = true;

		for (key in obj) {
			if (key == marker)
				continue;

			ret[key] = deepCopy(obj[key]);
		}

		delete (obj[marker]);
		return (ret);
	}

	if (obj && obj.constructor == Array) {
		ret = [];
		obj[marker] = true;

		for (key = 0; key < obj.length; key++)
			ret.push(deepCopy(obj[key]));

		delete (obj[marker]);
		return (ret);
	}

	/*
	 * It must be a primitive type -- just return it.
	 */
	return (obj);
}
122105
def copy
    copy = self.clone #Currently, we overwrite everything anyway, but we may add some clonable attributes later.
    #Make a deep copy of all objects.
    copy.instance_eval {@objects = {}}
    self.objects.each {|object| copy.add_object(object.copy)}
    #Make a deep copy of all environmental_factors.
    copy.clear_environmental_factors
    self.environmental_factors.each {|environmental_factor| copy.add_environmental_factor(environmental_factor)}
    copy
  end
44422
function deepCopy(o) {
    var copy = Object.create(null);
    for (var i in o) {
      if (typeof o[i] === "object" && o[i] !== null) {
        copy[i] = deepCopy(o[i]);
      }
      else if (typeof o[i] === "function" && o[i] !== null) {
        // clone function:
        eval(" copy[i] = " +  o[i].toString());
        //copy[i] = o[i].bind(_g);
      }

      else
        copy[i] = o[i];
    }
    return copy;
  }
1099416
public static final Object deepCopy(Object source, final KunderaMetadata kunderaMetadata)
    {
        Map<Object, Object> copiedObjectMap = new HashMap<Object, Object>();

        Object target = deepCopyUsingMetadata(source, copiedObjectMap, kunderaMetadata);

        copiedObjectMap.clear();
        copiedObjectMap = null;

        return target;
    }
1048754
def copy(self):
        
        properties = {}
        for key, value in self.raw_values.items():
            if key in self.UnhashableOptions:
                properties[key] = value
            else:
                properties[key] = copy.copy(value)

        return Context(**properties)
825285
function extend(destination, source) {
  for (var prop in source)
    if (source.hasOwnProperty(prop))
      destination[prop] = source[prop];
}
315523
function deepCopy(obj) {
  var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];

  // just return if obj is immutable value
  if (obj === null || (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object') {
    return obj;
  }

  // if obj is hit, it is in circular structure
  var hit = find(cache, function (c) {
    return c.original === obj;
  });
  if (hit) {
    return hit.copy;
  }

  var copy = Array.isArray(obj) ? [] : {};
  // put the copy into cache at first
  // because we want to refer it in recursive deepCopy
  cache.push({
    original: obj,
    copy: copy
  });

  Object.keys(obj).forEach(function (key) {
    if (avalon.msie < 9 && /^\$\w+$/.test(key)) return;
    copy[key] = deepCopy(obj[key], cache);
  });

  return copy;
}
953964
function extend(destination, source, deepCopy) {
    if (Type.isUndefined(source)) {
        return extend({}, destination, false);
    }
    if (Type.isObject(destination) && Type.isObject(source) && !Type.isArray(source) && !Type.isArray(destination)) {
        Object.keys(source).forEach(function (key) {
            destination[key] = Type.assert(Type.BOOLEAN, deepCopy) && !!deepCopy ? copy(source[key]) : source[key];
        });
    } else {
        throw new Error('Core.extend:  invalid source or destination type:');
    }
    return destination;
}
769833
function deepAssign (target, source) {
  var keys = Object.keys(source);

  for (var i = 0; i < keys.length; i++) {
    var key = keys[i];
    var oldValue = target[key];
    var newValue = source[key];

    target[key] = deepClone(newValue, oldValue);
  }

  return target;
}
965517
public static void copyProperties(Object source, Object target, CopyOptions copyOptions) {
		if (null == copyOptions) {
			copyOptions = new CopyOptions();
		}
		BeanCopier.create(source, target, copyOptions).copy();
	}
1296439
def copy(self):
        
        _conns = self._conns
        self._conns = {}
        c = copy.deepcopy(self)
        self._conns = _conns
        return c
1090075
function copyMetaProperties(dest, source) {
    if (!dest || !source) {
        return dest;
    }

    let fields = ['_id', '_updated'];

    for (let field of fields) {
        dest[field] = source[field];
    }

    return dest;
}