Document changes:
507762
private ListenerToken addDocumentChangeListener(
        Executor executor,
        DocumentChangeListener listener,
        String docID) {
        // NOTE: caller method is synchronized.
        DocumentChangeNotifier docNotifier = docChangeNotifiers.get(docID);
        if (docNotifier == null) {
            docNotifier = new DocumentChangeNotifier((Database) this, docID);
            docChangeNotifiers.put(docID, docNotifier);
        }
        final ChangeListenerToken token = docNotifier.addChangeListener(executor, listener);
        token.setKey(docID);
        return token;
    }
953231
function (docId, name, value, changedByUserId, destroyedAt, recordedAt, updatedAt,
  seq, quorum, userUUID, colId, docUUID, forUserId, forUserUUID,
  recordedByUserId, colName, recordedByUUID) {
  this.docId = docId;
  this.name = name;
  this.value = value;
  this.changedByUserId = changedByUserId;
  this.destroyedAt = destroyedAt;
  this.recordedAt = recordedAt;
  this.updatedAt = updatedAt;
  this.seq = seq;
  this.quorum = quorum;
  this.userUUID = userUUID;
  this.colId = colId;
  this.docUUID = docUUID;
  this.forUserId = forUserId;
  this.forUserUUID = forUserUUID;
  this.recordedByUserId = recordedByUserId;
  this.colName = colName;
  this.recordedByUUID = recordedByUUID;
}
702328
private function computeChangeSet(DocumentMetadata $class, $document): void
    {
        $oid = spl_object_hash($document);
        if (isset($this->readOnlyObjects[$oid])) {
            return;
        }

        $actualData = [];
        foreach ($class->attributesMetadata as $field) {
            if (! $field instanceof FieldMetadata || ! $field->isStored()) {
                continue;
            }

            $actualData[$field->fieldName] = $field->getValue($document);
        }

        if (! isset($this->originalDocumentData[$oid])) {
            // Entity is either NEW or MANAGED but not yet fully persisted.
            $this->originalDocumentData[$oid] = $actualData;

            $changeSet = [];
            foreach ($actualData as $field => $value) {
                $changeSet[$field] = [null, $value];
            }

            $this->documentChangeSets[$oid] = $changeSet;
        } else {
            // Document is MANAGED
            $originalData = $this->originalDocumentData[$oid];
            $changeSet = [];

            if (! $document instanceof LazyLoadingInterface || $document->isProxyInitialized()) {
                foreach ($actualData as $propName => $actualValue) {
                    // skip field, its a partially omitted one!
                    if (! array_key_exists($propName, $originalData)) {
                        continue;
                    }

                    $orgValue = $originalData[$propName];

                    // skip if value haven't changed
                    if ($orgValue === $actualValue) {
                        continue;
                    }

                    $changeSet[$propName] = [$orgValue, $actualValue];
                }
            }

            if ($changeSet) {
                $this->documentChangeSets[$oid] = $changeSet;
                $this->originalDocumentData[$oid] = $actualData;
                $this->documentUpdates[$oid] = $document;
            }
        }
    }
36284
public static ChangeEvent fromBsonDocument(final BsonDocument document) {
    keyPresent(Fields.ID_FIELD, document);
    keyPresent(Fields.OPERATION_TYPE_FIELD, document);
    keyPresent(Fields.NS_FIELD, document);
    keyPresent(Fields.DOCUMENT_KEY_FIELD, document);

    final BsonDocument nsDoc = document.getDocument(Fields.NS_FIELD);

    final UpdateDescription updateDescription;
    if (document.containsKey(Fields.UPDATE_DESCRIPTION_FIELD)) {
      updateDescription = UpdateDescription.fromBsonDocument(
          document.getDocument(Fields.UPDATE_DESCRIPTION_FIELD)
      );
    } else {
      updateDescription = null;
    }

    final BsonDocument fullDocument;
    if (document.containsKey(Fields.FULL_DOCUMENT_FIELD)) {
      final BsonValue fdVal = document.get(Fields.FULL_DOCUMENT_FIELD);
      if (fdVal.isDocument()) {
        fullDocument = fdVal.asDocument();
      } else {
        fullDocument = null;
      }
    } else {
      fullDocument = null;
    }

    return new ChangeEvent<>(
        document.getDocument(Fields.ID_FIELD),
        OperationType.fromRemote(document.getString(Fields.OPERATION_TYPE_FIELD).getValue()),
        fullDocument,
        new MongoNamespace(
            nsDoc.getString(Fields.NS_DB_FIELD).getValue(),
            nsDoc.getString(Fields.NS_COLL_FIELD).getValue()),
        document.getDocument(Fields.DOCUMENT_KEY_FIELD),
        updateDescription,
        document.getBoolean(Fields.WRITE_PENDING_FIELD, BsonBoolean.FALSE).getValue());
  }
344388
def changed(self):
        '''
        
        '''
        def _changed(diffs, prefix):
            keys = []
            for key in diffs.keys():
                if not isinstance(diffs[key], dict):
                    continue

                if isinstance(diffs[key], dict) and 'old' not in diffs[key]:
                    keys.extend(_changed(diffs[key],
                                       prefix='{0}{1}.'.format(prefix, key)))
                    continue
                if self.ignore_unset_values:
                    if 'old' in diffs[key] and 'new' in diffs[key] and \
                            diffs[key]['old'] != self.NONE_VALUE and \
                            diffs[key]['new'] != self.NONE_VALUE:
                        if isinstance(diffs[key]['new'], dict):
                            keys.extend(
                                _changed(diffs[key]['new'],
                                         prefix='{0}{1}.'.format(prefix, key)))
                        else:
                            keys.append('{0}{1}'.format(prefix, key))
                    elif isinstance(diffs[key], dict):
                        keys.extend(
                            _changed(diffs[key],
                                     prefix='{0}{1}.'.format(prefix, key)))
                else:
                    if 'old' in diffs[key] and 'new' in diffs[key]:
                        if isinstance(diffs[key]['new'], dict):
                            keys.extend(
                                _changed(diffs[key]['new'],
                                         prefix='{0}{1}.'.format(prefix, key)))
                        else:
                            keys.append('{0}{1}'.format(prefix, key))
                    elif isinstance(diffs[key], dict):
                        keys.extend(
                            _changed(diffs[key],
                                     prefix='{0}{1}.'.format(prefix, key)))

            return keys

        return sorted(_changed(self._diffs, prefix=''))
607090
void replaceC4Document(C4Document c4doc) {
        synchronized (lock) {
            final C4Document oldDoc = this.c4doc;
            this.c4doc = c4doc;
            if (oldDoc != this.c4doc) {
                if (this.c4doc != null) { this.c4doc.retain(); }
                if (oldDoc != null) {
                    oldDoc.release();  // oldDoc should be retained.
                }
            }
        }
    }
263577
public function getDocumentChangeSet($document)
    {
        $oid = spl_object_hash($document);
        if (isset($this->documentChangeSets[$oid])) {
            return $this->documentChangeSets[$oid];
        }
        return array();
    }
361155
function handleCurrentFileChange() {
        var newFile = MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE);

        if (newFile) {
            var newDocument = DocumentManager.getOpenDocumentForPath(newFile.fullPath);

            if (newDocument) {
                _currentTitlePath = _shortTitleForDocument(newDocument);
            } else {
                _currentTitlePath = ProjectManager.makeProjectRelativeIfPossible(newFile.fullPath);
            }
        } else {
            _currentTitlePath = null;
        }

        // Update title text & "dirty dot" display
        _updateTitle();
    }
1322347
def _cursor_position_changed(self):
        
        cursor = self._text_edit.textCursor()
        position = cursor.position()
        document = self._text_edit.document()
        char = to_text_string(document.characterAt(position - 1))
        if position <= self._start_position:
            self.hide()
        elif char == ')':
            pos, _ = self._find_parenthesis(position - 1, forward=False)
            if pos == -1:
                self.hide()
451620
function changeOptionPosition( combo, steps, documentObject )
	{
		combo = getSelect( combo );
		var iActualIndex = getSelectedIndex( combo );
		if ( iActualIndex < 0 )
			return false;

		var iFinalIndex = iActualIndex + steps;
		iFinalIndex = ( iFinalIndex < 0 ) ? 0 : iFinalIndex;
		iFinalIndex = ( iFinalIndex >= combo.getChildCount() ) ? combo.getChildCount() - 1 : iFinalIndex;

		if ( iActualIndex == iFinalIndex )
			return false;

		var oOption = combo.getChild( iActualIndex ),
			sText	= oOption.getText(),
			sValue	= oOption.getValue();

		oOption.remove();

		oOption = addOption( combo, sText, sValue, ( !documentObject ) ? null : documentObject, iFinalIndex );
		setSelectedIndex( combo, iFinalIndex );
		return oOption;
	}
1243366
function updateListeners() {
        if (_enabled) {
            // register our event listeners
            MainViewManager
                .on("currentFileChange.codeInspection", function () {
                    run();
                });
            DocumentManager
                .on("currentDocumentLanguageChanged.codeInspection", function () {
                    run();
                })
                .on("documentSaved.codeInspection documentRefreshed.codeInspection", function (event, document) {
                    if (document === DocumentManager.getCurrentDocument()) {
                        run();
                    }
                });
        } else {
            DocumentManager.off(".codeInspection");
            MainViewManager.off(".codeInspection");
        }
    }
850991
def print_change(self, symbol, typ, changes=None, document=None, **kwargs):
        """"""
        values = ", ".join("{0}={1}".format(key, val) for key, val in sorted(kwargs.items()))
        print("{0} {1}({2})".format(symbol, typ, values))
        if changes:
            for change in changes:
                print("\n".join("\t{0}".format(line) for line in change.split('\n')))
        elif document:
            print("\n".join("\t{0}".format(line) for line in document.split('\n')))
913502
function(doc) {
  if (doc.params) {
    _.each(doc.params, function(param) {
      replaceNewLines(param, 'description');
    });
  }

  // Replace new lines in the return and params descriptions.
  var returns = doc.returns;
  if (returns) {
    replaceNewLines(returns, 'description');
  }
}
448677
private function computeScheduleInsertsChangeSets() : void
    {
        foreach ($this->documentInsertions as $document) {
            $class = $this->dm->getClassMetadata(get_class($document));
            if ($class->isEmbeddedDocument) {
                continue;
            }

            $this->computeChangeSet($class, $document);
        }
    }
1288686
function(session) {
    this.session = session;
    this.doc = session.getDocument();

    this.clearSelection();
    this.selectionLead = this.doc.createAnchor(0, 0);
    this.selectionAnchor = this.doc.createAnchor(0, 0);

    var _self = this;
    this.selectionLead.on("change", function(e) {
        _self._emit("changeCursor");
        if (!_self.$isEmpty)
            _self._emit("changeSelection");
        if (!_self.$preventUpdateDesiredColumnOnChange && e.old.column != e.value.column)
            _self.$updateDesiredColumn();
    });

    this.selectionAnchor.on("change", function() {
        if (!_self.$isEmpty)
            _self._emit("changeSelection");
    });
}
543207
def changed(self):
        """"""
        return dict(
            (field, self.previous(field))
            for field in self.fields
            if self.has_changed(field)
        )
355355
def bookmarks_changed(self):
        """"""
        bookmarks = self.editor.get_bookmarks()
        if self.editor.bookmarks != bookmarks:
            self.editor.bookmarks = bookmarks
            self.sig_save_bookmarks.emit(self.filename, repr(bookmarks))