Utility method for cloning the instance as a new object.

:parameter data: additional which override field data.
:rtype: a new instance of this class.
438147
def clone(self, **data):
        '''
'''
        meta = self._meta
        session = self.session
        pkname = meta.pkname()
        pkvalue = data.pop(pkname, None)
        fields = self.todict(exclude_cache=True)
        fields.update(data)
        fields.pop('__dbdata__', None)
        obj = self._meta.make_object((pkvalue, None, fields))
        obj.session = session
        return obj
342144
def data(self, *args):
        ''''''
        data = self._data
        if not args:
            return data or {}
        result, adding = self._attrdata('data', *args)
        if adding:
            if data is None:
                self._extra['data'] = {}
            add = self._visitor.add_data
            for key, value in result.items():
                add(self, key, value)
            return self
        else:
            return result
16658
def make_object(cls, data):
    
    if issubclass(cls, Object):
        self = object.__new__(cls)
        self._data = data
    else:
        self = data
    return self
518948
def clone(self, klass=None, memo=None, **kwargs):
        
        obj = Empty()
        obj.__class__ = klass or self.__class__

        obj.resource = self.resource

        obj.filters = self.filters.copy()
        obj.order_by = self.order_by

        obj.low_mark = self.low_mark
        obj.high_mark = self.high_mark

        obj.__dict__.update(kwargs)

        return obj
805508
def copy(self):
        
        return self.__class__(self.tag, self.data.copy(), self.context.copy())
219372
def data(self, data: numpy.ndarray) -> None:
        
        self.__data_item.set_data(numpy.copy(data))
42299
function clone (data) {
  if (Array.isArray(data)) {
    return data.map(clone)
  } else if (data && typeof data === 'object') {
    let obj = Object.assign({}, data)
    for (let key in obj) {
      if (!obj.hasOwnProperty(key)) continue
      if (typeof obj[key] === 'object') {
        obj[key] = clone(obj[key])
      }
    }
    return obj
  } else {
    return data
  }
}
601302
def copy(self, inheritance=False):
        # type: (bool) -> FactoryContext
        
        # Create a new factory context and duplicate its values
        new_context = FactoryContext()
        for field in self.__slots__:
            if not field.startswith("_"):
                setattr(
                    new_context, field, self._deepcopy(getattr(self, field))
                )

        if inheritance:
            # Store configuration as inherited one
            new_context.__inherited_configuration = self.__handlers.copy()
            new_context.__handlers = {}

        # Remove instances in any case
        new_context.__instances.clear()
        new_context.is_singleton_active = False
        return new_context
1333131
def repr_new_instance(self, class_data):
        
        classname = self.formatted_classname(class_data["classname"])
        instancename = self.formatted_instancename(class_data["classname"])
        arguments = list()
        for key, value in self.sorted_dict(class_data.get("metadata", dict())):
            arguments.append("%s=%r" % (key, value))
        return "%s = %s(%s)" % (
            instancename, classname, ", ".join(arguments))
470310
def new(self, data):
        """"""
        data = self.__model__._get_non_empty_dict(data)
        return self.__class__(
            self.__five9__,
            self.__model__,
            records=[self.__model__.deserialize(data)],
        )
125628
def _new_instance(self):
        

        new_obj = self.__class__()
        new_obj.class_ = self.class_
        new_obj.tag = self.tag
        new_obj.implicit = self.implicit
        new_obj.explicit = self.explicit
        return new_obj
1187904
def clone(self):
    """"""
    return type(self)(name = self.name, dataFormat = self._dataFormat)
69967
def clone(self, *args, **kwargs):
        
        return self._client.clone_scope(*args, source_scope=self, **kwargs)
952289
function(new_data, original_data) {
        var key;
        for (key in new_data) {
            if (new_data[key].constructor === Object) {
                original_data[key] = this._recursive_extend(
                    new_data[key],
                    original_data[key]
                );
            } else {
                original_data[key] = new_data[key];
            }
        }
        return original_data;
    }
892187
def data(self):
        
        clone = copy.deepcopy(self)
        clone._cfg['rtype'] = ReturnType.Object
        return clone
459034
def copy(self, new_container, new_obj_name=None, extra_info=None):
        
        return self.container.copy_object(self, new_container,
                new_obj_name=new_obj_name)
819176
def extra(self, **params):
        
        q = self._clone()
        for key, value in params.items():
            q._extra[key].append(value)
        return q