Update the collection with items from *other*. Accepts other
        :class:`SortedSetBase` instances, dictionaries mapping members to
        numeric scores, or sequences of ``(member, score)`` tuples.
188708
def update(self, other):
        
        def update_trans(pipe):
            other_items = method(pipe=pipe) if use_redis else method()

            pipe.multi()
            for member, score in other_items:
                pipe.zadd(self.key, {self._pickle(member): float(score)})

        watches = []
        if self._same_redis(other, RedisCollection):
            use_redis = True
            watches.append(other.key)
        else:
            use_redis = False

        if hasattr(other, 'items'):
            method = other.items
        elif hasattr(other, '__iter__'):
            method = other.__iter__

        self._transaction(update_trans, *watches)
84945
def update(self, other_context):
        
        # convert a context instance into a dictionary
        if isinstance(other_context, orb.Context):
            other_context = copy.copy(other_context.raw_values)

        ignore = ('where', 'columns', 'scope')
        inherit_kwds = {}
        inherit_scope = {}
        inherit_columns = []
        inherit_where = orb.Query()

        # update from the base context
        base_context = other_context.pop('context', None)
        if base_context is not None:
            inherit_kwds = base_context.raw_values

        # use the default contexts
        else:
            for default in self.defaultContexts():
                if default is not None:
                    # extract expandable information
                    for k, v in default.raw_values.items():
                        if k not in ignore:
                            inherit_kwds[k] = copy.copy(v)

                    # merge where queries
                    where = default.where
                    if where is not None:
                        inherit_where &= where

                    # merge column queries
                    columns = default.columns
                    if columns is not None:
                        inherit_columns += list(columns)

                    # merge scope
                    scope = default.scope
                    if scope:
                        inherit_scope.update(scope)

        # update the inherited kwds
        for k, v in inherit_kwds.items():
            other_context.setdefault(k, v)

        # update the inherited query
        if inherit_where:
            other_context.setdefault('where', orb.Query())
            other_context['where'] &= inherit_where

        # update the inherited columns
        if inherit_columns:
            other_context['columns'] = inherit_columns + (other_context.get('columns') or [])

        # update the inherited scope
        if inherit_scope:
            new_scope = {}
            new_scope.update(inherit_scope)
            new_scope.update(other_context.get('scope') or {})
            other_context['scope'] = new_scope

        # convert the columns to a list
        if 'columns' in other_context and isinstance(other_context['columns'], (str, unicode)):
            other_context['columns'] = other_context['columns'].split(',')

        # convert where to query
        where = other_context.get('where')
        if isinstance(where, dict):
            other_context['where'] = orb.Query.fromJSON(where)

        if isinstance(where, (orb.Query, orb.QueryCompound)):
            other_context['where'] &= self.where

        # validate values
        if other_context.get('start') is not None and (type(other_context['start']) != int or other_context['start'] < 0):
            msg = 'Start needs to be a positive number, got {0} instead'
            raise orb.errors.ContextError(msg.format(other_context.get('start)')))
        if other_context.get('page') is not None and (type(other_context['page']) != int or other_context['page'] < 1):
            msg = 'Page needs to be a number equal to or greater than 1, got {0} instead'
            raise orb.errors.ContextError(msg.format(other_context.get('page')))
        if other_context.get('limit') is not None and (type(other_context['limit']) != int or other_context['limit'] < 1):
            msg = 'Limit needs to be a number equal to or greater than 1, got {0} instead'
            raise orb.errors.ContextError(msg.format(other_context.get('limit')))
        if other_context.get('pageSize') is not None and (type(other_context['pageSize']) != int or other_context['pageSize'] < 1):
            msg = 'Page size needs to be a number equal to or greater than 1, got {0} instead'
            raise orb.errors.ContextError(msg.format(other_context.get('pageSize')))

        # update the raw values
        self.raw_values.update({k: v for k, v in other_context.items() if k in self.Defaults})
1316363
def update_selected(self, other, selected):
        

        self.update({k: other[k] for k in selected})
605208
def _other_to_dict(self, other):
    
    if isinstance(other, ModelBase):
      return other.to_dict()
    elif isinstance(other, list):
      # TODO: what if it's not a list?
      return [self._other_to_dict(i) for i in other]
    else:
      return other
1006567
def merge(self, other):
        
        for key, value in other.items():
            if not key in self:
                self[key] = value
            elif isinstance(value, (list, tuple)):
                self[key] += value
            elif isinstance(value, OrderedSet):
                if isinstance(self[key], str):
                    self[key] = OrderedSet([self[key]])
                elif not isinstance(self[key], OrderedSet):
                    self[key] = OrderedSet(self[key])
                self[key] |= value
            else:
                self[key] = value
        return self
1112324
def difference_update(self, *iterables):
        
        _set = self._set
        values = set(chain(*iterables))
        if (4 * len(values)) > len(_set):
            _list = self._list
            _set.difference_update(values)
            _list.clear()
            _list.update(_set)
        else:
            _discard = self.discard
            for value in values:
                _discard(value)
        return self
200191
def _put_many(self, items):
        ''' 
        '''
        for item in items:
            if not isinstance(item, self._item_class):
                raise RuntimeError('Items mismatch for %s and %s' % (self._item_class, type(item)))
            self._put_one(item)
285762
def difference_update(self, other):
		""""""
		other = set(other)
		indices_to_delete = set()
		for i, elem in enumerate(self):
			if elem in other:
				indices_to_delete.add(i)
		if indices_to_delete:
			self._delete_values_by_index(indices_to_delete)
249877
def merge(self, dest, *others):
        
        items = [self.key]
        items.extend([other.key for other in others])
        self.database.pfmerge(dest, *items)
        return HyperLogLog(self.database, dest)
866597
def _bin_update_items(self, items, replace_at_most_one,
                          replacements, leftovers):
        
        for key, value in items:
            # If there are existing items with key <key> that have yet to be
            # marked for replacement, mark that item's value to be replaced by
            # <value> by appending it to <replacements>.
            if key in self and key not in replacements:
                replacements[key] = [value]
            elif (key in self and not replace_at_most_one and
                  len(replacements[key]) < len(self.values(key))):
                replacements[key].append(value)
            else:
                if replace_at_most_one:
                    replacements[key] = [value]
                else:
                    leftovers.append((key, value))
76625
def update(self, dict_):
        
        for key, value in dict_.items():
            index = self.column_index.get(key, None)
            if index is not None:
                list.__setitem__(self, index, value)
531681
def symmetric_difference_update(self, other):
        # type: (Iterable[Any]) -> _BaseSet
        
        intersect = self.intersection(other)
        self.remove(*intersect)
        for elem in set(other).difference(intersect):
            self.add(elem)
        return self
1268453
public void swap(UnorderedCollection<E> other) {
        int sizeTmp = size;
        size = other.size;
        other.size = sizeTmp;
        storage.swap(other.storage);
    }
4063
def merge(self, items):
        
        if isinstance(items, BaseCollection):
            items = items.all()

        if not isinstance(items, list):
            raise ValueError('Unable to merge uncompatible types')

        self._items += items

        return self
515915
def subtract(self, other=None, **kwargs):
        
        if other is not None:
            if self._same_redis(other, RedisCollection):
                self._update_helper(other, operator.sub, use_redis=True)
            elif hasattr(other, 'keys'):
                self._update_helper(other, operator.sub)
            else:
                self._update_helper(collections.Counter(other), operator.sub)

        if kwargs:
            self._update_helper(kwargs, operator.sub)
793880
def _sort_by_sortedset_after(self):
        
        return self._sort_by_sortedset and not self._sort_limits and (not self._lazy_collection['pks']
                                                                or self._want_score_value)
668091
def intersection_update(self, *others):
        
        return self._op_update_helper(
            tuple(others), operator.and_, 'sinterstore', update=True
        )