Ensures any internal object-type fields related to `MessageTrait` are cloned from their origins.
In case actual trait owner implementing method [[__clone()]], it must invoke this method within it.
556202
private function cloneHttpMessageInternals()
    {
        if (\is_object($this->_headerCollection)) {
            $this->_headerCollection = clone $this->_headerCollection;
        }
        if (\is_object($this->_body)) {
            $this->_body = clone $this->_body;
        }
    }
996294
@Override
    public RuleBasedCollator cloneAsThawed() {
        try {
            RuleBasedCollator result = (RuleBasedCollator) super.clone();
            // since all collation data in the RuleBasedCollator do not change
            // we can safely assign the result.fields to this collator 
            // except in cases where we can't
            result.settings = settings.clone();
            result.collationBuffer = null;
            result.frozenLock = null;
            return result;
        } catch (CloneNotSupportedException e) {
            // Clone is implemented
            return null;
        }
    }
150438
def _copy_ancestor_docstring(mro_list, func):  # pylint: disable=W0613
    """"""
    if func.__doc__ is not None:
        raise RuntimeError('Function already has docstring')
    # Search for docstring in superclass
    for cls in mro_list:
        super_fn = getattr(cls, func.__name__, None)
        if super_fn is None:
            continue
        func.__doc__ = super_fn.__doc__
        break
    else:
        raise RuntimeError("Can't inherit docstring for %s: method does not "
                           "exist in superclass" % func.__name__)
    return func
1125624
function ensurePrototypeTraversal(prototype) {
    if (!Object.__proto__) {
      var ancestor = Object.getPrototypeOf(prototype);
      prototype.__proto__ = ancestor;
      if (isBase(ancestor)) {
        ancestor.__proto__ = Object.getPrototypeOf(ancestor);
      }
    }
  }
1146798
def restore_original_method(self):
        """"""

        if self._target.is_class_or_module():
            setattr(self._target.obj, self._method_name, self._original_method)
            if self._method_name == '__new__' and sys.version_info >= (3, 0):
                _restore__new__(self._target.obj, self._original_method)
            else:
                setattr(self._target.obj, self._method_name, self._original_method)
        elif self._attr.kind == 'property':
            setattr(self._target.obj.__class__, self._method_name, self._original_method)
            del self._target.obj.__dict__[double_name(self._method_name)]
        elif self._attr.kind == 'attribute':
            self._target.obj.__dict__[self._method_name] = self._original_method
        else:
            # TODO: Could there ever have been a value here that needs to be restored?
            del self._target.obj.__dict__[self._method_name]

        if self._method_name in ['__call__', '__enter__', '__exit__']:
            self._target.restore_attr(self._method_name)
336632
private static void checkExtraFields(JSTuple tuple, int startCol, int count) throws JMFSchemaViolationException {
    for (int i = startCol; i < count; i++) {
      JMFType field = tuple.getField(i);
      if (field instanceof JSVariant) {
        JMFType firstCase = ((JSVariant)field).getCase(0);
        if (firstCase instanceof JSTuple)
          if (((JSTuple)firstCase).getFieldCount() == 0)
            continue;
      }
      throw new JMFSchemaViolationException(field.getFeatureName() + " not defaulting variant");
    }
  }
311956
def project_clone(object_id, input_params={}, always_retry=False, **kwargs):
    
    return DXHTTPRequest('/%s/clone' % object_id, input_params, always_retry=always_retry, **kwargs)
645680
function clone(source) {
            if (!source || typeof source !== 'object') {
                return source;
            }

            var cloned = source;

            if (isArray(source)) {
                cloned = source.slice().map(clone);
            }
            else if (isObject(source) && 'isPrototypeOf' in source) {
                cloned = {};
                for (var key in source) {
                    if (hasOwnProperty.call(source, key)) {
                        cloned[key] = clone(source[key]);
                    }
                }
            }

            return cloned;
        }
389300
@Override
	public AbstractMessage copy()
    {
        ObjectMessageImpl clone = new ObjectMessageImpl();
        copyCommonFields(clone);
        clone.body = this.body;
        
        return clone;
    }
685697
private static Object safeDuplicate(Object message) {
        if (message instanceof ByteBuf) {
            return ((ByteBuf) message).retainedDuplicate();
        } else if (message instanceof ByteBufHolder) {
            return ((ByteBufHolder) message).retainedDuplicate();
        } else {
            return ReferenceCountUtil.retain(message);
        }
    }
788533
@Override
    void copyTransients(JsMessageImpl copy) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "copyTransients");
        super.copyTransients(copy);

        JsJmsObjectMessageImpl other = (JsJmsObjectMessageImpl) copy;
        // Copy the real object reference, soft reference & booleans across
        other.realObject = realObject;
        other.hasRealObject = hasRealObject;
        other.hasSerializedRealObject = hasSerializedRealObject;
        other.softRefToRealObject = softRefToRealObject;

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "copyTransients");
    }
196806
private List<LightweightTypeReference> cloneTypeReferences(List<JvmTypeReference> types,
			Map<String, JvmTypeReference> typeParameterMap) {
		final List<LightweightTypeReference> newList = new ArrayList<>(types.size());
		for (final JvmTypeReference type : types) {
			newList.add(cloneTypeReference(type, typeParameterMap));
		}
		return newList;
	}
33109
def _makes_clone(_func, *args, **kw):
    
    self = args[0]._clone()
    _func(self, *args[1:], **kw)
    return self
343420
def _set_field_on_message(msg, key, value):
    """"""
    # Attempt to set the value on the types of objects we know how to deal
    # with.
    if isinstance(value, (collections_abc.MutableSequence, tuple)):
        # Clear the existing repeated protobuf message of any elements
        # currently inside it.
        while getattr(msg, key):
            getattr(msg, key).pop()

        # Write our new elements to the repeated field.
        for item in value:
            if isinstance(item, collections_abc.Mapping):
                getattr(msg, key).add(**item)
            else:
                # protobuf's RepeatedCompositeContainer doesn't support
                # append.
                getattr(msg, key).extend([item])
    elif isinstance(value, collections_abc.Mapping):
        # Assign the dictionary values to the protobuf message.
        for item_key, item_value in value.items():
            set(getattr(msg, key), item_key, item_value)
    elif isinstance(value, message.Message):
        getattr(msg, key).CopyFrom(value)
    else:
        setattr(msg, key, value)
1187904
def clone(self):
    """"""
    return type(self)(name = self.name, dataFormat = self._dataFormat)
758557
private static FieldInfo cloneDeprecated(FieldInfo fieldInfo) {
	return new FieldInfo(fieldInfo.getAccess() | Opcodes.ACC_DEPRECATED,
		fieldInfo.getName(), fieldInfo.getDesc(),
		fieldInfo.getSignature(), fieldInfo.getValue());
    }
677929
def clonetopath(self, dest):
        
        raise Exception(
            "%s.%s needs to implement @classmethod .clonetopath(dest)" % (
                self.__class__.__module__, self.__class__.__name__))