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.
323429
function(ev, model, collection, options) {
      if ((ev == 'add' || ev == 'remove') && collection != this) return;
      if (ev == 'destroy') {
        this._remove(model, options);
      }
      if (model && ev === 'change:' + model.idAttribute) {
        delete this._byId[model.previous(model.idAttribute)];
        this._byId[model.id] = model;
      }
      this.trigger.apply(this, arguments);
    }
1177763
function(ev, model, collection, options) {
      if ((ev === 'add' || ev === 'remove') && collection !== this) {
        return;
      }
      if (ev === 'destroy') {
        this.remove(model, options);
      }
      if (model && ev === 'change:objectId') {
        delete this._byId[model.previous("objectId")];
        this._byId[model.id] = model;
      }
      this.trigger.apply(this, arguments);
    }
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;
        }
2194
function(model, options) {
      options || (options = {});
      model = this._prepareModel(model, options);
      if (!model) return false;
      var already = this.getByCid(model) || this.get(model);
      if (already) throw new Error(["Can't add the same model to a set twice", already.id]);
      this._byId[model.id] = model;
      this._byCid[model.cid] = model;
      var index = options.at != null ? options.at :
                  this.comparator ? this.sortedIndex(model, this.comparator) :
                  this.length;
      this.models.splice(index, 0, model);
      model.bind('all', this._onModelEvent);
      this.length++;
      if (!options.silent) model.trigger('add', model, this, options);
      return model;
    }
390483
function(to) {
            to.listenTo(this, "add", function(model) {
                this.add(model);
            });
            to.listenTo(this, "remove", function(model) {
                this.remove(model);
            });
            to.listenTo(this, "reset", function(colleciton, options) {
                _.each(options.previousModels, function(model) {
                    this.remove(model);
                }, this);
                collection.each(function(model) {
                    this.add(model);
                }, this);
            });

            this.each(function(model) {
                to.add(model);
            });
        }
233746
protected void doUpdateIndex(Set<String> removedNodes, Set<String> addedNodes, Set<String> parentRemovedNodes,
      Set<String> parentAddedNodes)
   {
      ChangesHolder changes = searchManager.getChanges(removedNodes, addedNodes);
      ChangesHolder parentChanges = parentSearchManager.getChanges(parentRemovedNodes, parentAddedNodes);

      if (changes == null && parentChanges == null)
      {
         return;
      }

      try
      {
         doUpdateIndex(new ChangesFilterListsWrapper(changes, parentChanges));
      }
      catch (RuntimeException e)
      {
         if (isTXAware())
         {
            // The indexing is part of the global tx so the error needs to be thrown to
            // allow to roll back other resources
            throw e;
         }
         getLogger().error(e.getLocalizedMessage(), e);
         logErrorChanges(handler, removedNodes, addedNodes);
         logErrorChanges(parentHandler, parentRemovedNodes, parentAddedNodes);
      }
   }
878643
public final void dispatchEvent(Set<SelectionKey> selectedKeySet) {
    Iterator<SelectionKey> it = selectedKeySet.iterator();
    boolean skipOpRead = false;
    while (it.hasNext()) {
      SelectionKey key = it.next();
      it.remove();
      if (!key.isValid()) {
        if (key.attachment() != null) {
          controller.closeSelectionKey(key);
        } else {
          key.cancel();
        }
        continue;
      }
      try {
        if (key.isValid() && key.isAcceptable()) {
          controller.onAccept(key);
          continue;
        }
        if (key.isValid() && (key.readyOps() & SelectionKey.OP_WRITE) == SelectionKey.OP_WRITE) {
          // Remove write interest
          key.interestOps(key.interestOps() & ~SelectionKey.OP_WRITE);
          controller.onWrite(key);
          if (!controller.isHandleReadWriteConcurrently()) {
            skipOpRead = true;
          }
        }
        if (!skipOpRead && key.isValid()
            && (key.readyOps() & SelectionKey.OP_READ) == SelectionKey.OP_READ) {
          key.interestOps(key.interestOps() & ~SelectionKey.OP_READ);
          if (!controller.getStatistics().isReceiveOverFlow()) {
            // Remove read interest
            controller.onRead(key);
          } else {
            key.interestOps(key.interestOps() | SelectionKey.OP_READ);
          }

        }
        if ((key.readyOps() & SelectionKey.OP_CONNECT) == SelectionKey.OP_CONNECT) {
          controller.onConnect(key);
        }

      } catch (CancelledKeyException e) {
        // ignore
      } catch (RejectedExecutionException e) {

        if (key.attachment() instanceof AbstractNioSession) {
          ((AbstractNioSession) key.attachment()).onException(e);
        }
        controller.notifyException(e);
        if (selector.isOpen()) {
          continue;
        } else {
          break;
        }
      } catch (Exception e) {
        if (key.attachment() instanceof AbstractNioSession) {
          ((AbstractNioSession) key.attachment()).onException(e);
        }
        controller.closeSelectionKey(key);
        controller.notifyException(e);
        log.error("Reactor dispatch events error", e);
        if (selector.isOpen()) {
          continue;
        } else {
          break;
        }
      }
    }
  }
490235
function (model, options) {
        this._index(model);
        if (!model.collection) model.collection = this;
        if (model.on) model.on('all', this._onModelEvent, this);
    }
1284785
def _set_id(self, Id, is_added, index):
        """"""
        if is_added:
            self.selected_ids.add(Id)
        else:
            self.selected_ids.remove(Id)
        self.dataChanged.emit(index, index)
681390
def handle_new_selection(self, items):
        
        if items is None:
            items = ()
        elif not hasattr(items, "__iter__"):
            items = (items,)
        models = set(item.model for item in items)
        self._selection.handle_new_selection(models)
594999
public void setEvent(int index, int event) {
        if (events == null || index < 0 || index >= events.length) {
            throw new IndexOutOfBoundsException("index = " + index + ", limit = " + (events == null ? "null" : events.length));
        }

        events[index] = (byte)event;
    }
1130252
public void observeUpdateModelValues(@Observes @Before @UpdateModelValues PhaseEvent event) {
        log.debug("After Update Model Values event");
        performObservation(event, PhaseIdType.UPDATE_MODEL_VALUES);
    }
464400
protected final void firePropertyDataChanged(Collection<? extends D> oldData, Collection<? extends D> newData) {
		firePropertyDataChanged(new TreeDataEvent(this, oldData, newData, this.data));
	}
297434
function(changeset) {
					changeset.forEach(function(change) {
						if(change.name!=="__target__") {
							if(change.type==="delete") {
								if(handler.deleteProperty) {
									if(!handler.deleteProperty(target,change.name)) { // restore property if delete handler fails
										Object.original.defineProperty(Object,proxy,Object.original.getOwnPropertyDescriptor(target,change.name));
									}
								} else {
									delete target[change.name];
								}
							} else {
								if(handler.defineProperty) {
									var desc = Object.getOwnPropertyDescriptor(target,change.name);
									if(!desc) {
										desc = Object.original.getOwnPropertyDescriptor.call(Object,proxy,change.name);
									}
									if(desc && handler.defineProperty(target,change.name,desc)) {
										addHandling(proxy,change.name,desc.value);
									} else { // delete property if define handler fails
										delete proxy[change.name];
									}
								} 
								if(target[change.name]!==proxy[change.name]){
									target[change.name] = proxy[change.name];
								}
							}
						}
					});
				}
11464
function (changeset) {
					changeset.forEach(function(change) {
						if(change.name!=="__target__") {
							if(change.type==="delete") {
								delete proxy[change.name];
							} else if(change.type==="update") { // update handler if target key value changes from function to non-function or from a non-function to a function
								if((typeof(change.oldValue)==="function" && typeof(target[change.name])!=="function") || (typeof(change.oldValue)!=="function" && typeof(target[change.name])==="function")) {
									addHandling(proxy,change.name,target[change.name]);
								}
							} else if(!proxy[change.name]) {
								addHandling(proxy,change.name,target[change.name]);
							}
						}
					})}
988194
def update(self, **kwargs):
        
        super(ModelQuerySet, self).update(_changed=True, **kwargs)
174481
function ModelIndices(model) {
    // For now the only indices we construct are for flowEvents
    this.flowEventsById_ = {};
    model.flowEvents.forEach(function(fe) {
      if (fe.id !== undefined) {
        if (!this.flowEventsById_.hasOwnProperty(fe.id)) {
          this.flowEventsById_[fe.id] = new Array();
        }
        this.flowEventsById_[fe.id].push(fe);
      }
    }, this);
  }