update a set-valued dictionary
    when key exists, union sets
486860
def dict_update_union(d1, d2):
    
    for k in d2:
        if k in d1:
            d1[k].update(d2[k])
        else:
            d1[k] = d2[k]
964761
def update(self, **kwargs):
    """"""
    for key, value in kwargs.items():
      setattr(self, key, value)
1077225
def update(self, data):
        
        for key, value in data.items():
            setattr(self, key, value)
1353318
def _update(self, data):
        """"""
        for k, v in six.iteritems(data):
            new_value = v
            if isinstance(v, dict):
                new_value = type(self)(v)
            elif isinstance(v, list):
                new_value = [(type(self)(e) if isinstance(e, dict) else e)
                             for e in v]
            setattr(self, k, new_value)
489727
def dict_update_overwrite_check(base, fresh):
    

    result = [
        (key, base[key], fresh[key])
        for key in set(base.keys()) & set(fresh.keys())
        if base[key] != fresh[key]
    ]
    base.update(fresh)
    return result
499800
def _mappingGetValueSet(mapping, keys):
    
    setUnion = set()
    for k in keys:
        setUnion = setUnion.union(mapping[k])
    return setUnion
500756
def update(self, field_dict, where_clause=None):
        '''
        
        '''
        query = '''
        UPDATE %s SET %s
        ''' % (
            self._name,
            ','.join('%s=:%s' % (k, k) for k in field_dict)
        )
        if where_clause:
            query += ' WHERE %s' % (where_clause)
        self._cursor.execute(query, field_dict)
        self._connection.commit()
1364145
def update_options(composite_key, value, options)
      nesting = options
      keys = composite_key.sub(/\A--/, "").split(":")
      keys.each_with_index do |key, i|
        key = key.to_sym
        if i < keys.length - 1
          nesting[key] ||= {}
          nesting = nesting[key]
        else
          nesting[key] = parse_possible_boolean(value)
        end
      end
      options
    end
474370
def update_with_slice(self,flag):
        '''
         
        '''
        
        N=flag.sum()
        
        #Get object attributes to update
        varSize = np.array([np.size(self.__dict__[k]) for k in self.__dict__.keys()])
        par_list=np.array(self.__dict__.keys())[varSize == self._dimensions['time']].tolist()
        
        self._dimensions['time']=N
        self.count=N
        
        for par in par_list :
#             self.__setattr__(par,self.__dict__[par][flag])
#             inVar=copy.deepcopy(self.__dict__[par])
            if isinstance(self.__dict__[par],np.ma.masked_array) :
                tmpVar=self.__dict__.pop(par)
                dumVar=copy.deepcopy(tmpVar)
                tmpVar=tmpVar.compress(flag)
                for a in set(dumVar.__dict__.keys()).difference(tmpVar.__dict__.keys()) :
                    tmpVar.__dict__[a]=dumVar.__dict__[a]
                self.__dict__[par] =  tmpVar
            elif isinstance(self.__dict__[par],np.ndarray):
                self.__dict__[par] = self.__dict__[par].compress(flag)
            elif isinstance(self.__dict__[par],list):
                self.__dict__[par] = (np.array(self.__dict__[par])[flag]).tolist()
            if (hasattr(self.__dict__[par], '_dimensions')) : self.__dict__[par]._dimensions['time']=self._dimensions['time']
1152633
def update_dict(input_dict,key,value):
    '''
    '''
    if key in input_dict:
        input_dict[key].append(value)
    else:
        input_dict[key] = [value]
    return input_dict
1079754
def update(self, updict):
        

        with self.lock:
            for (key, value) in updict.items():
                self.setitem(key, value)
434607
def set(self, key_or_attrs, value=None, unset=False):
        
        if isinstance(key_or_attrs, dict) and value is None:
            attrs = key_or_attrs
            keys = attrs.keys()
            for k in keys:
                if isinstance(attrs[k], LocalProxy):
                    attrs[k] = attrs[k]._get_current_object()
        else:
            key = key_or_attrs
            if isinstance(value, LocalProxy):
                value = value._get_current_object()
            attrs = {key: utils.decode(key, value)}

        if unset:
            for k in attrs.keys():
                attrs[k] = operation.Unset()

        self.validate(attrs)

        self._merge_metadata(attrs)

        keys = list(attrs.keys())
        for k in keys:
            v = attrs[k]
            # TODO: Relation

            if not isinstance(v, operation.BaseOp):
                v = operation.Set(v)

            self._attributes[k] = v._apply(self._attributes.get(k), self, k)
            if self._attributes[k] == operation._UNSET:
                del self._attributes[k]
            self._changes[k] = v._merge(self._changes.get(k))

        return self
512052
def _merge(d, u):
    
    for k, v in u.items():
        # if we have a mapping, recursively merge the values
        if isinstance(v, collections.Mapping):
            d[k] = _merge(d.get(k, {}), v)

        # if d (the dict to merge into) is a dict, just add the
        # value to the dict.
        elif isinstance(d, collections.MutableMapping):
            d[k] = v

        # otherwise if d (the dict to merge into) is not a dict (e.g. when
        # recursing into it, `d.get(k, {})` may not be a dict), then do what
        # `update` does and prefer the new value.
        #
        # this means that something like `{'foo': 1}` when updated with
        # `{'foo': {'bar': 1}}` would have the original value (`1`) overwritten
        # and would become: `{'foo': {'bar': 1}}`
        else:
            d = {k: v}

    return d
824738
def union(self, other):
        """"""
        x = SetLikeDict(**self)
        x.update(other)
        return x
474629
def update_dict(self,*args, **kwargs):
        
        super(Dict, self).update(*args, **kwargs)
462848
def update(self, dict):
        """"""
        for k,v in dict.items():
            self[k] = v
1351606
def update(self, instance, oldValue, newValue, subKey):
    """"""
    histogram = self.__get__(instance, None)
    histogram[subKey] += newValue - oldValue