Defensive deep-copy
559376
private Catalogo copy(Catalogo catalogo) throws Exception {
	    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
	    dbf.setNamespaceAware(true);
	    DocumentBuilder db = dbf.newDocumentBuilder(); 
	    Document doc = db.newDocument();
	    Marshaller m = context.createMarshaller();
	    m.marshal(catalogo, doc);
	    Unmarshaller u = context.createUnmarshaller();
	    return (Catalogo) u.unmarshal(doc);
	  }
1152652
def _copy(self):
        """"""

        items = self.items()
        subs = {}
        for f in (self.getall("CHAP") + self.getall("CTOC")):
            subs[f.HashKey] = f.sub_frames._copy()
        return (items, subs)
886873
def deep_copy(item_original):
    """"""
    item = copy.copy(item_original)
    item._id = uuid.uuid4().hex
    if hasattr(item, '_children') and len(item._children) > 0:
        children_new = collections.OrderedDict()
        for subitem_original in item._children.values():
            subitem = deep_copy(subitem_original)
            subitem._parent = item
            children_new[subitem.get_name()] = subitem
        item._children = children_new
    return item
1297498
def copy(self):
        """"""
        attrs = {k: self.__dict__[k].copy() for k in self.containers}
        attrs.update({k: cp.deepcopy(self.__dict__[k]) for k in self.shared})
        return self.__class__(**attrs)
1246607
def assert_deepcopy_idempotent(obj):
    '''
    '''
    from copy import deepcopy
    obj1 = deepcopy(obj)
    obj2 = deepcopy(obj1)
    obj3 = deepcopy(obj2)
    assert_equivalent(obj, obj1)
    assert_equivalent(obj, obj2)
    assert_equivalent(obj, obj3)
    assert type(obj) is type(obj3)
1104505
def copy(self, deep=True):
        
        values = self.values
        if deep:
            values = values.copy()
        return self.make_block_same_class(values, ndim=self.ndim)
1115010
def deep_copy(numpy_dict):
  
  out = {}
  for key in numpy_dict:
    out[key] = numpy_dict[key].copy()
  return out
903362
def deep_update(d,d_update):
	
	for k,v in list(d_update.items()):
		if isinstance(v,dict):
			if k in d:
				deep_update(d[k],v)
			else:
				d[k]=v
		elif isinstance(d,list):
			d.append({k:v})
		else:
			d[k]=v
	return d
423003
function deepCopy(obj, strictKeys) {
  var res;

  if (
    typeof obj === 'boolean' ||
    typeof obj === 'number' ||
    typeof obj === 'string' ||
    obj === null ||
    util.isDate(obj)
  ) {
    return obj;
  }

  if (util.isArray(obj)) {
    res = [];
    obj.forEach(function(o) {
      res.push(deepCopy(o, strictKeys));
    });
    return res;
  }

  if (typeof obj === 'object') {
    res = {};
    Object.keys(obj).forEach(function(k) {
      if (!strictKeys || (k[0] !== '$' && k.indexOf('.') === -1)) {
        res[k] = deepCopy(obj[k], strictKeys);
      }
    });
    return res;
  }

  return undefined; // For now everything else is undefined. We should probably throw an error instead
}
193443
function clone(object, deep) {
		if (!object) { return object; }
		var clone = object.prototype
						? Object.create(object.prototype.constructor) : {};

		for(var key in object) {
			if (!object.hasOwnProperty(key)) { continue; }
			clone[key] = deep ? clone(object[key], deep) : object[key];
		}
		return clone;
	}
862146
def deep_copy(self):
        
        return ContinuousColumn(self.arr, metadata=self.metadata, missing_id=self._missing_id, weights=self.weights)
653929
def discretize(value, factor=100):
    """"""
    if not isinstance(value, Iterable):
        return int(value * factor)
    int_value = list(deepcopy(value))
    for i in range(len(int_value)):
        int_value[i] = int(int_value[i] * factor)
    return int_value
1114998
private Node deepCopy(final Node copyTarget){

        // Precondition checks
        assert copyTarget != null : "Node to copy information into must be specified";

        // Set attributes
        final Map<String, String> attributes = this.getAttributes();
        final Set<String> attributeKeys = attributes.keySet();
        for (final String key : attributeKeys) {
            final String value = attributes.get(key);
            copyTarget.attribute(key, value);
        }

        // Set text
        copyTarget.text(this.getText());

        // Set children
        final List<Node> children = this.getChildren();
        for (final Node child : children) {
            final Node newChild = copyTarget.createChild(child.getName());
            // Recurse in
            child.deepCopy(newChild);
        }

        // Return
        return this;
    }
536185
function deepCopy(srcObj) {
      var tmpObj;
      if (isArr(srcObj)) {
        tmpObj = [];
        for (var i = 0; i < srcObj.length; i++) {
          tmpObj.push(deepCopy(srcObj[i]));
        }
      } else if (isObj(srcObj)) {
        tmpObj = {};
        for (var key in srcObj) {
          if (has(srcObj, key)) tmpObj[key] = deepCopy(srcObj[key]);
        }
      } else {
        tmpObj = srcObj;
      }
      return tmpObj;
    }
459488
function deepCopy(value) {
  let result;
  if (value instanceof Buffer) {
    // isPlainObject(buffer) returns true.
    return new Buffer(value);
  }

  if (isPlainObject(value) === true) {
    result = {};
    loopKeys(value, function(_value, key) {
      if (_value.hasOwnProperty(key)) {
        result[key] = deepCopy(_value[key]);
      }
    });
    return result;
  }

  if (Array.isArray(value)) {
    result = [];
    for (let i = 0, ii = value.length; i < ii; ++i) {
      result.push(deepCopy(value[i]));
    }
    return result;
  }

  return value;
}
188287
private void deepCopy(Element origElement, Element copyElement) {
        List<Node> children = origElement.getChildElements();
        for(Node node : children) {
            try {
                if(node instanceof Content) {
                    Content content = (Content) ((Content) node).clone();
                    copyElement.addChildElement(content);
                } else {
                    Element element = (Element) ((Element) node).clone();
                    copyElement.addChildElement(element);
                    deepCopy((Element)node, element);
                }
            } catch (CloneNotSupportedException e) {
                throw new XmlModelException("Unable to clone object", e);
            }
        }
    }
1225037
def deepcopy(value):
    

    if not isinstance(value, (dict, list, tuple)):
        return value

    if isinstance(value, dict):
        copy = {}
        for k, v in value.items():
            copy[k] = deepcopy(v)

    if isinstance(value, tuple):
        copy = list(range(len(value)))

        for k in get_keys(list(value)):
            copy[k] = deepcopy(value[k])

        copy = tuple(copy)

    if isinstance(value, list):
        copy = list(range(len(value)))

        for k in get_keys(value):
            copy[k] = deepcopy(value[k])

    return copy