Don't need the full-out "clone" mechanism here, since if you're trying to set things other than empty arrays/objects on your sub-classed `Error` object, you're probably doing it wrong.
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;
}
153151
function deepClone(val, instanceClone) {
        switch ( kindOf(val) ) {
            case 'Object':
                return cloneObject(val, instanceClone);
            case 'Array':
                return cloneArray(val, instanceClone);
            default:
                return clone(val);
        }
    }
977239
function cloneSet(set, isDeep, cloneFunc) {
    var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);
    return arrayReduce(array, addSetEntry, new set.constructor());
  }
172492
function ref_copy_self(self, obj) {
	//console.log( 'at ref_copy_self(): self = ' + JSON.stringify(self) + ', obj = ' + JSON.stringify(obj) );
	ARRAY(Object.keys(obj)).forEach(function(key) {
		self[key] = ref_copy(obj[key]);
	});
}
1156372
function clone(a) {
  return a === undefined ? undefined : JSON.parse(JSON.stringify(a))
}
470511
function extend( target, src ) {
		var name, copy, copyIsArray, clone,
			options = src,
			i = 1,
			deep = true;
		// Handle a deep copy situation
		if( typeof target === 'boolean' ) {
			deep = target;
			// skip the boolean and the target
			i = 2;
		}
		// Handle case when target is a string or something( possible in deep copy )
		if( typeof target !== 'object' && typeof target !== 'function' ){
			target = {};
		}
		// Only deal with non-null/undefined values
		if (! options) return target;

			// Extend the base object
		for( name in options ) {
			src = target[name];
			copy = options[name];
			// Prevent never-ending loop
			if( target === copy ) continue;
			// Recurse if we're merging plain objects or arrays
			copyIsArray = Array.isArray(copy);
			if( deep && (typeof copy === 'object' || copyIsArray)) {
				if( copyIsArray ) {
					clone = src && Array.isArray(src) ? src : [];
				} else clone = src && typeof src === 'object' ? src : {};
				// Never move original objects, clone them
				target[name] = extend(clone, copy);
				// Don't bring in undefined values
			} else if( typeof copy !== 'undefined' ) target[name] = copy;
		}

		return target;
	}
386429
function (args) {
				var k;
				// error catching
				if (typeof args !== "object" && args instanceof Array) throw new Error("args must be an object");
				// set parameters
				for (k in args) {
					if (args.hasOwnProperty(k)) {
						this[k] = args[k];
					}
				}
			}
83929
def create_object(self, cls: Type[T], additional_kwargs=None) -> T:
        """"""
        additional_kwargs = additional_kwargs or {}
        log.debug('%sCreating %r object with %r', self._log_prefix, cls, additional_kwargs)

        try:
            instance = cls.__new__(cls)
        except TypeError as e:
            reraise(
                e,
                CallError(cls, getattr(cls.__new__, '__func__', cls.__new__), (), {}, e, self._stack),
                maximum_frames=2,
            )
        try:
            init = cls.__init__
            self.call_with_injection(init, self_=instance, kwargs=additional_kwargs)
        except TypeError as e:
            # The reason why getattr() fallback is used here is that
            # __init__.__func__ apparently doesn't exist for Key-type objects
            reraise(
                e,
                CallError(
                    instance,
                    getattr(instance.__init__, '__func__', instance.__init__),
                    (),
                    additional_kwargs,
                    e,
                    self._stack,
                ),
            )
        return instance
378595
function deepCloneArray(arr) {
  const clone = [];
  forEach(arr, (item, index) => {
    if (typeof item === "object" && item !== null) {
      if (isArray(item)) {
        clone[index] = deepCloneArray(item);
      } else if (isSpecificValue(item)) {
        clone[index] = cloneSpecificValue(item);
      } else {
        clone[index] = deepExtend({}, item);
      }
    } else {
      clone[index] = item;
    }
  });
  return clone;
}
1051015
def _simple_new(cls, values, name=None, dtype=None, **kwargs):
        
        if not hasattr(values, 'dtype'):
            if (values is None or not len(values)) and dtype is not None:
                values = np.empty(0, dtype=dtype)
            else:
                values = np.array(values, copy=False)
                if is_object_dtype(values):
                    values = cls(values, name=name, dtype=dtype,
                                 **kwargs)._ndarray_values

        if isinstance(values, (ABCSeries, ABCIndexClass)):
            # Index._data must always be an ndarray.
            # This is no-copy for when _values is an ndarray,
            # which should be always at this point.
            values = np.asarray(values._values)

        result = object.__new__(cls)
        result._data = values
        # _index_data is a (temporary?) fix to ensure that the direct data
        # manipulation we do in `_libs/reduction.pyx` continues to work.
        # We need access to the actual ndarray, since we're messing with
        # data buffers and strides. We don't re-use `_ndarray_values`, since
        # we actually set this value too.
        result._index_data = values
        result.name = name
        for k, v in kwargs.items():
            setattr(result, k, v)
        return result._reset_identity()
192534
function clone (obj){
	if(obj == null || typeof(obj) != 'object')
		return obj;

	var temp = obj.constructor();

	for(var key in obj)
		temp[key] = clone(obj[key]);
	return temp;
}
1025950
function clone(arr) {
              	var newArr = [];
              	for (var i=0; i<arr.length; i++) {
              		newArr.push(arr[i]);
              	}
              	return newArr;
              }
95034
function () {
    var pattern = /\{(\d+)\}/g;
    //safer way to convert a pseudo array to an object array
    var args = Array.prototype.slice.call(arguments);
    var s = args.shift();
    return s.replace(pattern, function(c, d) {
      var replacement = args[d] ;
      if (lib.isNull(replacement)) {
        replacement = "";
      }
      return replacement;
    });
  }
963467
function cloneObject(source)
{
	var clone,key,value;
	
	if (Array.isArray(source) === true)
	{
		clone = [];
	}
	else
	{
		// Only clone the prototype -- more efficient as it will not convert keys to prototype keys
		clone = Object.create( Object.getPrototypeOf(source) );
	}
	
	// Clone keys/indexes
	// TODO :: use Object.keys() for more speed
	for (key in source)
	{
		if (hasOwnProperty.call(source, key) === true)
		{
			value = source[key];
			
			if (value!==null && typeof value==="object")
			{
				clone[key] = cloneObject(value);
			}
			else
			{
				clone[key] = value;
			}
		}
	}
	
	return clone;
}
649704
function FilerError({name, code, message, peerID, fileID}){
  // name should be the constructor function name(FilerError in this case), but I don't want to create one constructor for one error.
  this.name = name || 'UnknownError';
  this.code = code || 'ERR_UNKNOWN_ERROR';
  this.message = message || 'unknown error';
  this.peerID = peerID;
  this.fileID = fileID;
}
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);
                }
            });
        }
991874
function setupError(obj, name, message) {
  if (obj) {
    Error.call(obj);
    Object.defineProperty(obj, 'name', {
      value: name,
      enumerable: false
    });
    Object.defineProperty(obj, 'message', {
      value: message,
      enumerable: false
    });
  } else {
    logger.ffdc('setupError', 'ffdc001', null, 'Client object not provided');
  }
}