11. update the hyperlog's change# 12. emit all add/reject events
486770
function (nodes, done) {
      self.changes = nodes.reduce(maxChange, self.changes)
      done(null, nodes)
    }
1260591
function changeHandler(eventOptions = {}) {
    const { key, silent } = eventOptions;
    const def = defs.get(this);

    if (key && key in def.keys && !silent) {
        triggerOne(this, 'set', eventOptions);
        triggerOne(this, 'modify', eventOptions);
    }
}
1294791
def add_event(self, event, prepend=False):
        
        if prepend:
            self._events.insert(0, event)
        else:
            self._events.append(event)
1360481
function _changeEvent(el,attr,value,oldValue,args,action,type,stopChange)
        {
          this.stopPropagation = function(){this._stopPropogation = true;};
          this.preventDefault = function(){this._preventDefault = true;};
          this.value = value;
          this.oldValue = oldValue;
          this.target = el;
          this.attr = attr;
          this.arguments = args;
          this.action = action;
          this.child = undefined;
          this.type = type;
          this.stopChange = stopChange;
        }
353483
function update(evt) {
                if (evt && evt.defaultPrevented) return;

                function check(rule) {
                    var handled = rule($injector, $location);

                    if (!handled) return false;
                    if (isString(handled)) $location.replace().url(handled);
                    return true;
                }
                var n = rules.length, i;

                for (i = 0; i < n; i++) {
                    if (check(rules[i])) return;
                }
                // always check otherwise last to allow dynamic updates to the set of rules
                if (otherwise) check(otherwise);
            }
868439
function watchChanges(io, params) {
    const folder = process.cwd();
    return watch(folder, { recursive: true }, () => {
        emitInfo('changes detected. Recompiling...');
        io.sockets.emit('load');
        const start = new Date().getTime();
        executeWithParams(params)
            .tap(alerts => {
                const ellapsed = new Date().getTime() - start;
                emitSuccess(`wow! recompiled and executed in ${ellapsed}ms!`);
                io.sockets.emit('update', compileMarkdown(alerts));
            })
            .catch(err => {
                emitError(`hot compilation error, baby: ${err.message}`);
                io.sockets.emit('failure', err.stack);
            });
    });
}
565341
public function onDependenciesChangedEvent()
    {
        $io = $this->io;
        $isVerbose = $io->isVerbose();

        if ($isVerbose) {
            $io->write(sprintf('<info>%s</info>', self::MESSAGE_RUNNING_INSTALLER));
        }

        if ($this->isPHPCodeSnifferInstalled() === true) {
            $this->loadInstalledPaths();
            $installPathCleaned = $this->cleanInstalledPaths();
            $installPathUpdated = $this->updateInstalledPaths();

            if ($installPathCleaned === true || $installPathUpdated === true) {
                $this->saveInstalledPaths();
            } elseif ($isVerbose) {
                $io->write(sprintf('<info>%s</info>', self::MESSAGE_NOTHING_TO_INSTALL));
            }
        } elseif ($isVerbose) {
            $io->write(sprintf('<info>%s</info>', self::MESSAGE_NOT_INSTALLED));
        }
    }
841221
function(oValues, sendUpdatedEvt) {
      if(!oValues) {
         return;
      }
	   for (var i = 0 ; i < this.inputs.length ; i++) {
	      var field = this.inputs[i];
	      var name = field.options.name;
	      if(name && !lang.isUndefined(oValues[name]) ) {
	         field.setValue(oValues[name], false); // don't fire the updated event !
	      }
	      else {
	         field.clear(false);
	      }
      }
      
      this.runFieldsInteractions();
      
	   if(sendUpdatedEvt !== false) {
	      // fire update event
         this.fireUpdatedEvt();
      }
   }
1353370
function emit(event) {
  if (typeof EVENTS[event] === 'undefined') return;
  var args = Array.prototype.slice.call(arguments);
  args.splice(0, 1);
  for (var i = 0; i < EVENTS[event].length; i++) {
    EVENTS[event][i].apply(loglet, args);
  }
}
248436
def _notify_change(self, model, attr, old, new, hint=None, setter=None, callback_invoker=None):
        ''' 

        '''
        # if name changes, update by-name index
        if attr == 'name':
            if old is not None:
                self._all_models_by_name.remove_value(old, model)
            if new is not None:
                self._all_models_by_name.add_value(new, model)

        if hint is None:
            serializable_new = model.lookup(attr).serializable_value(model)
        else:
            serializable_new = None

        event = ModelChangedEvent(self, model, attr, old, new, serializable_new, hint, setter, callback_invoker)
        self._trigger_on_change(event)
1306543
def update_alterations(add = [], delete = [])
      response = @http.patch(
        "#{BASE_URL}/#{@knowledgebase_id}/updateAlterations",
        json: { add: add.map {|i| {word: i[0], alterations: i[1]} },
        delete: delete.map {|i| {word: i[0], alterations: i[1]} } }
      )

      case response.code
      when 204
        nil
      when 400
        raise BadArgumentError, response.parse['error']['message'].join(' ')
      when 401
        raise UnauthorizedError, response.parse['error']['message']
      when 403
        raise ForbiddenError, response.parse['error']['message']
      when 404
        raise NotFoundError, response.parse['error']['message']
      when 409
        raise ConflictError, response.parse['error']['message']
      else
        raise UnknownError, "Oh no! (#{response.code})"
      end
    end
713942
def add_update_callback(self, callback, sensor):
        """"""
        self._updateCallbacks.append([callback, sensor])
        _LOGGING.debug('Added update callback to %s on %s', callback, sensor)
305001
function(value, sendUpdatedEvt) {
		
	   if(this.editorReady) {
			this.editor.setContent(value, {format : 'raw'});
      }
		else {
			this.editor.onInit.add(function(ed) {
				ed.setContent(value, {format : 'raw'});
			});
		}
	   
   	if(sendUpdatedEvt !== false) {
   	   // fire update event
         this.fireUpdatedEvt();
      }
	}
1232325
def _nodedev_event_update_cb(conn, dev, opaque):
    '''
    
    '''
    _salt_send_event(opaque, conn, {
        'nodedev': {
            'name': dev.name()
        },
        'event': opaque['event']
    })
528200
function addTypeListener(emitter, type, event, listener) {
    if (!emitter._listeners) {
        emitter._listeners = {
            on: {},
            after: {},
            before: {}
        };
    }

    if (!emitter._listeners[type][event]) {
        emitter._listeners[type][event] = [];
    }
    if ('on' == type && emitter._listeners[type][event].length) {
        throw Error('Listener for event "' + event + '" already defined.');
    }

    emitter._listeners[type][event].push(listener);

    return function remove() {
        const index = emitter._listeners[type][event].indexOf(listener);
        if (-1 !== index) {
            emitter._listeners[type][event].splice(index, 1);
        }
    };
}
1119541
function updateActions() {
        this.plugin('done', function () {
          var cmd;
          if (envOptions['update-actions']) {
            // Don't disable actions since this is mostly for development.
            cmd = 'python manage.py update_actions';

            childProcess.exec(cmd, function (err, stdout, stderr) {
              console.log('\n' + BOLD + 'Updating Actions' + END_BOLD);
              console.log(stdout);
              if (stderr) {
                console.error(stderr);
              }
            });
          }
        });
      }
1158544
def on_change(self, *callbacks):
        ''' 

        '''
        for callback in callbacks:

            if callback in self._callbacks: continue

            _check_callback(callback, ('event',))

            self._callbacks[callback] = callback