Creates a copy of the current instance. The 'kwargs' parameter can be
        used by clients to update attributes after copying has taken place.
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
952610
def copy(self, *args, **kwargs):
        
        cls = self.__class__    # Note that type conversion does not perform copy
        return cls(pd.Series(self).copy(*args, **kwargs))
1315808
def copy(self, selection, smart_selection_adaption=True):
        
        assert isinstance(selection, Selection)
        self.__create_core_and_model_object_copies(selection, smart_selection_adaption)
8477
def create(self, **kwargs):
        
        obj = self.model(**kwargs)
        meta = obj.get_meta()
        meta.connection = get_es_connection(self.es_url, self.es_kwargs)
        meta.index=self.index
        meta.type=self.type
        obj.save(force=True)
        return obj
27281
def clone(self, **kwargs):
        '''
        
        '''
        child = ChildContextDict(parent=self, threadsafe=self._threadsafe, overrides=kwargs)
        return child
400054
def copy_from_local(self, localsrc, dest, **kwargs):
        
        with io.open(localsrc, 'rb') as f:
            self.create(dest, f, **kwargs)
835112
def create(cls, **kw):
        
        for k, v in kw.items():
            attr = getattr(cls, k, None)
            if isinstance(attr, RecordAttribute):
                kw.pop(k)
                kw.update(attr._decompose(v))
        return cls(**kw)
39171
def clone(self):
        

        p = type(self)(self.id)
        p.hooks = list(self.hooks)
        p.instance = self.instance
        return p
80454
def copy(self):
        
        new = self.__class__()
        new.__dict__ = dict(self.__dict__)
        return new
1227983
def copy(self, klass=None):
        
        chain = (
            klass if klass else self.__class__
        )(*self._args, **self._kwargs)
        chain._tokens = self._tokens.copy()
        return chain
1326794
def copy
    copy = self.clone #Currently, we overwrite everything anyway, but we may add some clonable attributes later.
    #Make a deep copy of all actions.
    copy.instance_eval {@actions = []}
    self.actions.each {|action| copy.add_action(action.copy)}
    #Make a deep copy of all conditions.
    copy.instance_eval {@conditions = []}
    self.conditions.each {|condition| copy.add_condition(condition.copy)}
    copy
  end
1176376
def make_copy(self, copy_to):
        

        for attr, value in self.__dict__.items():
            if attr.startswith('__') and attr.endswith('__'):
                continue
            setattr(copy_to, attr, value)
80969
def copy(self):
        
        return self.__class__(self, key=self._keyfn, precedes=self._precedes)
1252886
def create(self, **kwargs):
        
        if self.created:
            raise RuntimeError(
                '{} already created.'.format(self.__model_type__.__name__))

        kwargs = self.merge_kwargs(self._create_kwargs, kwargs)

        self._inner = self.helper.create(
            self.name, *self._create_args, **kwargs)
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
1134094
def update(cls, **kwargs):
        '''
        
        '''
        q = cls._get_instance(**{'id': kwargs['id']})
        if q:
            for k, v in kwargs.items():
                setattr(q, k, v)
            _action_and_commit(q, session.add)
        else:
            cls.get_or_create(**kwargs)
1006444
def create(self, _attributes=None, **attributes):
        
        if _attributes is not None:
            attributes.update(_attributes)

        instance = self._related.new_instance(attributes)

        self._set_foreign_attributes_for_create(instance)

        instance.save()

        return instance