Internal method called every time a model in the set fires an event. Sets need to update their indexes when models change ids. All other events simply proxy through. "add" and "remove" events that originate in other collections are ignored.
553489
function(event, model, collection, options) {
      if ((event == 'add' || event == 'remove') && collection != this) return;
      if (event == 'destroy') {
        this.remove(model, options);
      }
      if (model && event === 'change:' + model.idAttribute) {
        delete this._byId[model.previous(model.idAttribute)];
        this._byId[model.id] = model;
      }
      this.trigger.apply(this, arguments);
    }
159787
function(oldModel, newModel){
        var index;

        if (oldModel && newModel && this.hasModel(oldModel) && !this.hasModel(newModel)) {
            index = this.indexOf(oldModel);

            if (index > -1) {
                this.act(function(){
                    this.add(newModel, index);

                    this.remove(oldModel);
                });

                !this.isActive() && this.signalChange() && this.resetChange();
            }
        }

        return this;
    }
1012921
private void onDataSetModifiedEvent(@Observes DataSetModifiedEvent event) {
        if (!editOn) {

            String targetUUID = event.getDataSetDef().getUUID();
            for (Displayer displayer : displayerCoordinator.getDisplayerList()) {
                DisplayerSettings settings = displayer.getDisplayerSettings();

                // Do nothing if the displayer:
                // - Is not drawn
                // - Is handling the refresh by itself
                // - Is not configured to be updated on stale data
                if (!displayer.isDrawn() || displayer.isRefreshOn() || !settings.isRefreshStaleData()) {
                    continue;
                }

                String uuid = null;
                DataSet dataSet = settings.getDataSet();
                if (dataSet != null) {
                    uuid = dataSet.getUUID();
                }
                DataSetLookup dataSetLookup = settings.getDataSetLookup();
                if (uuid == null && dataSetLookup != null) {
                    uuid = dataSetLookup.getDataSetUUID();
                }
                if (uuid != null && targetUUID.equals(uuid)) {
                    displayer.redraw();
                }
            }
        }
    }
666886
private void onDataSetStaleEvent(@Observes DataSetStaleEvent event) {
        DataSetDef def = event.getDataSetDef();
        if (DataSetProviderType.ELASTICSEARCH.equals(def.getProvider())) {
            remove(def.getUUID());
        }
    }
376962
def set(self, models):
        
        # Do not add None values to selection
        if models is None:
            models = set()

        models = self._check_model_types(models)
        if len(models) > 1:
            models = reduce_to_parent_states(models)

        self._selected = set(models)
210720
def event_happened(event_name, model)
      self.last_action = event_name
      self.last_updated_node = model
      self.updated_at = Time.zone.now
      self.save!
    end
265328
def data_changed(self, change):
        
        index = self.index
        if index:
            self.view.model.dataChanged.emit(index, index)
463084
function listen(model, listener) {
    model.on('change', listener);

    model.values().forEach(function listenRecur(value) {
        var isCollection = value && value._byId;

        if (!isCollection) {
            return;
        }

        // for each collection listen to it
        // console.log('listenCollection')
        listenCollection(value, listener);
    });
}
34844
public function appendEvents ($event_set) {
		$this->removeEvents(array_keys($event_set));
		foreach ($event_set as $event_name => $event_method) {
			$this->_events[$event_name] = $event_method;
		}
	}
917403
function(events){
    this._delegateDOMEvents(events);
    Marionette.bindEntityEvents(this, this.model, Marionette.getOption(this, "modelEvents"));
    Marionette.bindEntityEvents(this, this.collection, Marionette.getOption(this, "collectionEvents"));
  }
403439
function listenCollection(collection, listener) {
    collection.forEach(function listenModel(model) {
        listen(model, listener);
    });

    collection.on('add', function onAdd(model) {
        listen(model, listener);
        listener();
    });
}
397777
function(index, value, name) {

		if (index > this._count) Lava.t("Index is out of range");

		var old_uid = this._data_uids[index],
			old_value = this._data_values[index],
			old_name = this._data_names[index],
			new_uid = this._uid++;

		this._data_uids[index] = new_uid;
		this._data_values[index] = value;
		if (name) {
			this._data_names[index] = name;
		}

		this._fire('items_removed', {
			uids: [old_uid],
			values: [old_value],
			names: [old_name]
		});

		this._fire('items_added', {
			uids: [new_uid],
			values: [value],
			names: [this._data_names[index]]
		});

		this._fire('collection_changed');

	}
1154840
def model_m2m_changed(sender, instance, action, **kwargs):
    

    if sender._meta.app_label == 'rest_framework_reactive':
        # Ignore own events.
        return

    def notify():
        table = sender._meta.db_table
        if action == 'post_add':
            notify_observers(table, ORM_NOTIFY_KIND_CREATE)
        elif action in ('post_remove', 'post_clear'):
            notify_observers(table, ORM_NOTIFY_KIND_DELETE)

    transaction.on_commit(notify)
760417
function(model, options) {
            var item, tag;

            // Define options
            options = _.defaults(options || {}, {
                silent: false,
                render: true,
                at: _.size(this.items),
            });

            if (this.items[model.id] != null) {
                this.removeModel(model);
            }

            item = new this.Item({
                "model": model,
                "list": this,
                "collection": this.collection
            }, this);
            this.listenTo(model, "set", function() {
                item.update();
                this.applyFilter(item);
            });
            this.listenTo(model, "id", function(newId, oldId) {
                this.items[newId] = this.items[oldId];
                delete this.items[oldId];
            });

            item.update();
            tag = this.Item.prototype.tagName;
            if (this.Item.prototype.className) tag = tag+"."+this.Item.prototype.className.split(" ")[0];

            if (options.at > 0) {
                this.$("> "+tag).eq(options.at-1).after(item.$el);
            } else {
                this.$el.prepend(item.$el);
            }
            this.items[model.id] = item;

            this.applyFilter(item);

            if (!options.silent) this.trigger("add", model);
            if (options.render) this.update();

            return this;
        }
204949
function EventSet(opt_events) {
    this.bounds_dirty_ = true;
    this.bounds_ = new tr.b.Range();
    this.length_ = 0;
    this.guid_ = tr.b.GUID.allocate();
    this.pushed_guids_ = {};

    if (opt_events) {
      if (opt_events instanceof Array) {
        for (var i = 0; i < opt_events.length; i++)
          this.push(opt_events[i]);
      } else if (opt_events instanceof EventSet) {
        this.addEventSet(opt_events);
      } else {
        this.push(opt_events);
      }
    }
  }
490235
function (model, options) {
        this._index(model);
        if (!model.collection) model.collection = this;
        if (model.on) model.on('all', this._onModelEvent, this);
    }
1203058
def dispatch(self, receiver):
        ''' 

        '''
        super(ModelChangedEvent, self).dispatch(receiver)
        if hasattr(receiver, '_document_model_changed'):
            receiver._document_model_changed(self)