Create a clone of the object specified.  If `deep` is truthy, clone any referenced properties too.
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;
	}
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;
  }
394397
def clone(self, date=None, data=None, name=None):
        ''''''
        name = name or self.name
        data = data if data is not None else self.values()
        ts = self.__class__(name)
        ts._dtype = self._dtype
        if date is None:
            # dates not provided
            ts.make(self.keys(), data, raw=True)
        else:
            ts.make(date, data)
        return ts
1358597
def copy(self, name=None):
        
        return Struct.copy(self, deep=True, name=name)
850277
def copy(self, deep=True):
        
        from copy import copy, deepcopy
        if deep:
            return deepcopy(self)
        else:
            return copy(self)
1202352
def _shallow_copy(self, obj=None, obj_type=None, **kwargs):
        
        if obj is None:
            obj = self._selected_obj.copy()
        if obj_type is None:
            obj_type = self._constructor
        if isinstance(obj, obj_type):
            obj = obj.obj
        for attr in self._attributes:
            if attr not in kwargs:
                kwargs[attr] = getattr(self, attr)
        return obj_type(obj, **kwargs)
888609
function clone(object) {
  if (object === null || typeof object != "object") {
    return object;
  }
  const copy = object.constructor();
  for (const attr in object) {
    if (Object.prototype.hasOwnProperty.call(object, attr)) {
      copy[attr] = object[attr];
    }
  }

  return copy;
}
558856
function clone(target) {
  if (target == null || typeof target !== "object") return target;
  var cloned = target.constructor ? target.constructor() : Object.create(null);
  for (var attr in target) {
    if (target.hasOwnProperty(attr)) {
      cloned[attr] = target[attr];
    }
  }
  return cloned;
}
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
790712
function extend(dest, source) {
    dest = dest || {};
    source = source || {};

    var result = clone(dest);
    for (var key in source) {
        if (source.hasOwnProperty(key)) {
            result[key] = source[key];
        }
    }
    return result;
}
294398
def clone(self, transformed=True):
        
        poly = self.polydata(transformed=transformed)
        polyCopy = vtk.vtkPolyData()
        polyCopy.DeepCopy(poly)

        cloned = Actor()
        cloned.poly = polyCopy
        cloned.mapper.SetInputData(polyCopy)
        cloned.mapper.SetScalarVisibility(self.mapper.GetScalarVisibility())
        pr = vtk.vtkProperty()
        pr.DeepCopy(self.GetProperty())
        cloned.SetProperty(pr)
        return cloned
412372
public static Object duplicate(Object object, boolean deepCopy) {
	if (object == null) return null;
	if (object instanceof Number) return object;
	if (object instanceof String) return object;
	if (object instanceof Date) return ((Date) object).clone();
	if (object instanceof Boolean) return object;

	RefBoolean before = new RefBooleanImpl();
	try {
	    Object copy = ThreadLocalDuplication.get(object, before);
	    if (copy != null) {
		return copy;
	    }

	    if (object instanceof Collection) return ((Collection) object).duplicate(deepCopy);
	    if (object instanceof Duplicable) return ((Duplicable) object).duplicate(deepCopy);
	    if (object instanceof UDF) return ((UDF) object).duplicate();
	    if (object instanceof List) return duplicateList((List) object, deepCopy);
	    if (object instanceof Map) return duplicateMap((Map) object, deepCopy);
	    if (object instanceof Serializable) {
		try {
		    String ser = JavaConverter.serialize((Serializable) object);
		    return JavaConverter.deserialize(ser);

		}
		catch (Throwable t) {
		    ExceptionUtil.rethrowIfNecessary(t);
		}
	    }
	}
	finally {
	    if (!before.toBooleanValue()) ThreadLocalDuplication.reset();
	}

	return object;
    }
885172
function clone(source, deep) {
    if (deep) {
        return lodash.cloneDeep(source);
    } else {
        return lodash.clone(source);
    }
}
788812
def clone(self, opts):
        '''
        
        '''
        topt = self.opts.copy()
        topt.update(opts)
        return self.__class__(self.modl, self.name, self.info, topt)
368518
function clone(value, deep) {
    if (Array.isArray(value)) {
      if (deep) {
        return value.map(function(value) {
          return clone(value, deep);
        });
      } else {
        return value.slice();
      }
    } else if (value && typeof value === 'object') {
      if (value.valueOf() !== value) {
        return new value.constructor(value.valueOf());
      } else {
        var copy = {};
        for (var key in value) {
          var objValue = value[key];
          if (deep) {
            objValue = clone(objValue, deep);
          }
          copy[key] = objValue;
        }
        return copy;
      }
    } else {
      return value;
    }
  }
794142
def _clone(self, deepcopy=True, base=None):
        """"""
        if not base:
            if self.__explicit_session:
                base = self._clone_base(self.__session)
            else:
                base = self._clone_base(None)

        values_to_clone = ("spec", "projection", "skip", "limit",
                           "max_time_ms", "max_await_time_ms", "comment",
                           "max", "min", "ordering", "explain", "hint",
                           "batch_size", "max_scan", "manipulate",
                           "query_flags", "modifiers", "collation")
        data = dict((k, v) for k, v in iteritems(self.__dict__)
                    if k.startswith('_Cursor__') and k[9:] in values_to_clone)
        if deepcopy:
            data = self._deepcopy(data)
        base.__dict__.update(data)
        return base
377074
function _shallowCopy(component) {
        var clone = {},
            property;

        for (property in component) {
            if (component.hasOwnProperty(property)) {
                clone[property] = component[property];
            }
        }

        return clone;
    }