methods 
 Builds the mongodb updates based on
 the new state of the field.
 Call a different method if the field has a different behaviour.

 @param [ Hash ] memo Store the updates

 @return [ Hash ] The memo object upgraded
976134
def collect_diff(memo)
      method_name = :"collect_#{self.type}_diff"

      if self.respond_to?(method_name)
        self.send(method_name, memo)
      else
        collect_default_diff(memo)
      end
    end
674507
def updated(self, instance):
        
        self.session_manager.save(instance, commit=True)
        return instance
497807
def memo(f):
        
        def inner(self, memo=None, **kwargs):
            if memo is None:
                memo = {}
            if id(self) in memo:
                return memo[id(self)]
            else:
                c = f(self, memo, **kwargs)
                memo[id(self)] = c
                return c
        return inner
78952
def update(self, storagemodel:object, modeldefinition = None, hide = 0) -> StorageQueueModel:
        

        if (storagemodel.id != '') and (storagemodel.pop_receipt != '') and (not storagemodel.id is None) and (not storagemodel.pop_receipt is None):
            try:
                content = storagemodel.getmessage()
                message = modeldefinition['queueservice'].update_message(storagemodel._queuename, storagemodel.id, storagemodel.pop_receipt, visibility_timeout = hide, content=content)
                storagemodel.content = content
                storagemodel.pop_receipt = message.pop_receipt

            except Exception as e:
                msg = 'can not update queue message:  queue {} with message.id {!s} because {!s}'.format(storagemodel._queuename, storagemodel.id, e)
                storagemodel = None
                raise AzureStorageWrapException(msg=msg)
        else:
            msg = 'cant update queuemessage in {!s} due to missing id {!s} and/or pop_receipt {!s}'.format(storagemodel._queuename, storagemodel.id, storagemodel.pop_receipt)
            storagemodel = None
            raise AzureStorageWrapException(msg=msg)

        return storagemodel
731126
def options
      options_storage.each_with_object({}) do |(k, v), memo|
        memo[k.to_sym] = get(k)
      end
    end
912222
def a(memo, other)
      if keys == other.keys.take(keys.size)
        keys.each do |order|
          if other.keys.include?(order)
            memo << [order, flip_direction(other.assoc(order).last)]
          end
        end
      else
        keys.each do |order|
          if other.keys.include?(order)
            memo << other.assoc(order)
          end
        end
      end
    end
548791
function CacheUpdate(bit, hash, state) {
  this.bit = bit;
  this.hash = hash;
  this.state = state;
}
163643
function update( hash, getKey, arr ) {
	var list,
		str,
		key,
		len,
		i;

	len = arr.length;
	for ( i = 0; i < len; i++ ) {
		str = arr[ i ];

		// Create a hash key...
		if ( str.length > 1 ) {
			key = getKey( str );
		} else {
			key = str;
		}
		// Check if key exists in the hash...
		if ( hash.hasOwnProperty( key ) ) {
			// Key already exists. Determine if we have already seen this string before...
			list = hash[ key ];
			if ( !contains( list, str ) ) {
				list.push ( str );
			}
		} else {
			hash[ key ] = [ str ];
		}
	}
}
131643
def slice(*keep)
        inject(Characterizable::BetterHash.new) do |memo, ary|
          if keep.include?(ary[0])
            memo[ary[0]] = ary[1]
          end
          memo
        end
      end
1325804
def memo_update(self, tid, session, memo=None, flag=None, reset=None):
        ''''''
        request = TOPRequest('taobao.trade.memo.update')
        request['tid'] = tid
        if memo!=None: request['memo'] = memo
        if flag!=None: request['flag'] = flag
        if reset!=None: request['reset'] = reset
        self.create(self.execute(request, session)['trade'])
        return self
1141405
def to_h
      hash                        = {:churn => {:changes => @changes}}
      hash[:churn][:class_churn]  = @class_changes
      hash[:churn][:method_churn] = @method_changes
      #detail the most recent changes made this revision
      first_revision         = @revisions.first
      first_revision_changes = @revision_changes[first_revision]
      if first_revision_changes
        changes = first_revision_changes
        hash[:churn][:changed_files]   = changes[:files]
        hash[:churn][:changed_classes] = changes[:classes]
        hash[:churn][:changed_methods] = changes[:methods]
      end
      # TODO crappy place to do this but save hash to revision file but
      # while entirely under metric_fu only choice
      ChurnHistory.store_revision_history(first_revision, hash, @churn_options.data_directory)
      hash
    end
323371
function(key, updates) {
      var that = this;

      if (!this._key || !key) {
        return Promise.reject(new Error('No unique key specified'));
      }

      return this.readByKey(key).then(function(doc) {
        return that._updateDoc(doc, updates);
      });
    }
452463
def _requires_update(self, old_object, new_object):
        
        old_encoded = self.manager._encode(old_object)
        new_encoded = self.manager._encode(new_object)
        return _compare_recursive(old_encoded, new_encoded)
307916
def refresh(self, document):
		
		try:
			old_cache_size = self.cache_size
			self.cache_size = 0
			obj = self.query(type(document)).filter_by(mongo_id=document.mongo_id).one()
		finally:
			self.cache_size = old_cache_size
		self.cache_write(obj)
		return obj
327874
def update(self, data=None, **kwargs):
        
        if data is None:
            data = {}
        data.update(kwargs)
        return self.model.write([self.id], data)
704818
def memoize(self, hasher=None):
        
        ns = self.Namespace()
        ns.memo = {}
        if hasher is None:
            hasher = lambda x: x

        def memoized(*args, **kwargs):
            key = hasher(*args)
            if key not in ns.memo:
                ns.memo[key] = self.obj(*args, **kwargs)
            return ns.memo[key]

        return self._wrap(memoized)
779413
def update(class_or_classname, record_id, new_attrs)
      class_or_classname = find_or_materialize(class_or_classname)
      json_for_update = coerced_json(new_attrs, class_or_classname)
      http_patch("/services/data/v#{self.version}/sobjects/#{class_or_classname.sobject_name}/#{record_id}", json_for_update)
    end