Shallow copies all public attributes from source_obj to dest_obj.

    Overwrites them if they already exist.
340161
def copy_public_attrs(source_obj, dest_obj):
    
    for name, value in inspect.getmembers(source_obj):
        if not any(name.startswith(x) for x in ["_", "func", "im"]):
            setattr(dest_obj, name, value)
237174
public static void shallowCopyFieldState(final Object src, final Object dest) {
		if (src == null) {
			throw new IllegalArgumentException("Source for field copy cannot be null");
		}
		if (dest == null) {
			throw new IllegalArgumentException("Destination for field copy cannot be null");
		}
		if (!src.getClass().isAssignableFrom(dest.getClass())) {
			throw new IllegalArgumentException("Destination class [" + dest.getClass().getName() +
					"] must be same or subclass as source class [" + src.getClass().getName() + "]");
		}
		doWithFields(src.getClass(), new FieldCallback() {
			@Override
			public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException {
				makeAccessible(field);
				Object srcValue = field.get(src);
				field.set(dest, srcValue);
			}
		}, COPYABLE_FIELDS);
	}
294782
def copy(source, dest):
    
    logger.info("copying {} -> {}".format(source, dest))

    return client.copy(source, dest)
176621
function shallowEqual(objA, objB) {
  if (isSameRef(objA, objB)) {
    return true
  }

  if (
    typeof objA !== 'object' ||
    objA === null ||
    typeof objB !== 'object' ||
    objB === null
  ) {
    return false
  }

  const keysA = Object.keys(objA)
  const keysB = Object.keys(objB)

  if (keysA.length !== keysB.length) {
    return false
  }

  for (let k of keysA) {
    if (!objB.hasOwnProperty(k)) {
      return false
    } else if (!isSameRef(objA[k], objB[k])) {
      return false
    }
  }

  return true
}
798529
function copyBase(src, dest, options, callback) {
  if (typeof options !== 'object') {
    callback = options;
    options = {};
  }

  if (arguments.length < 3) {
    return invalid.apply(null, arguments);
  }

  var fs = utils.fs; // graceful-fs (lazyily required)
  var opts = utils.extend({overwrite: true}, options);
  var cb = once(callback);
  var listener = once(ws);
  src = path.resolve(src);

  var rs = fs.createReadStream(src)
    .on('error', handleError('read', src, opts, cb))
    .once('readable', listener)
    .on('end', listener);

  function ws() {
    mkdir(dest, function(err) {
      if (err) return cb(err);
      rs.pipe(fs.createWriteStream(dest, writeOpts(opts))
        .on('error', handleError('write', dest, opts, cb))
        .on('close', handleClose(src, dest, cb)));
    });
  }
}
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];
        }
    });
}
925444
function copy(obj) {
  var filters = copy.filterFactory(obj.filter);
  var source = copy.sourceFactory(obj.source, filters);
  var dest = copy.destFactory(obj.dest, filters);
  dest.processSource(source);
}
285706
def make_copy
      obj = self.dup
      obj.local_options = Marshal.load(Marshal.dump(local_options))
      obj.hooks         = @hooks

      obj
    end
373554
def public_copy(self):
        """"""
        d = dict(chain_code=self._chain_code, depth=self._depth,
                 parent_fingerprint=self._parent_fingerprint,
                 child_index=self._child_index, public_pair=self.public_pair())
        return self.__class__(**d)
458333
def CopyFromDict(self, attributes):
    
    for attribute_name, attribute_value in attributes.items():
      # Not using startswith to improve performance.
      if attribute_name[0] == '_':
        continue
      setattr(self, attribute_name, attribute_value)
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;
}
481799
def copy_object(self, obj, new_container, new_obj_name=None,
            content_type=None):
        
        return self.manager.copy_object(self, obj, new_container,
                new_obj_name=new_obj_name, content_type=content_type)
562966
function shallowClone(obj) {
    let result = {};
    for (let p in obj) {
        if (obj.hasOwnProperty(p)) {
            result[p] = obj[p];
        }
    }
    return result;
}
321911
function(destObject, sourceObject) {
    if (sourceObject)
        for (var property in sourceObject)
            if (sourceObject.hasOwnProperty(property))
                destObject[property] = sourceObject[property];

    return destObject;
}
850728
function( obj1, obj2 ) {
            var newObj = {};
            if ( obj1 ) {
                this.inheritAttrs( newObj, this.cloneObj( obj1 ) );
            }
            if ( obj2 ) {
                this.inheritAttrs( newObj, obj2 );
            }
            return newObj;
        }
428233
function(source, obj, override) {
      var out;

      // Create extensible object.
      if(override) {
        out = source;
      } else {
        // Create shallow copy of source.
        out = {};
        for(var i in source){
          if(source.hasOwnProperty(i)) {
            out[i] = source[i];
          }
        }
      }

      // Copy properties.
      for(var j in obj) {
        if(obj.hasOwnProperty(j)) {
          out[j] = obj[j];
        }
      }

      return out;
    }
1328779
def copy_attrs(obj1, obj2, attrs):
    
    for attr in attrs:
        value = getattr(obj2, attr) if hasattr(obj2, attr) else None
        if value is None and isinstance(obj2, dict) and attr in obj2:
            value = obj2[attr]
        setattr(obj1, attr, value)