Observe the target for changes and update the handlers accordingly
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]);
							}
						}
					})}
1354243
def trigger(self, target: str, trigger: str, parameters: Dict[str, Any]={}):
		
		pass
574523
def parse(bundle, handler=handle_services):
    
    changeset = ChangeSet(bundle)
    while True:
        handler = handler(changeset)
        for change in changeset.recv():
            yield change
        if handler is None:
            break
515007
def _update_proxy(self, change):
        
        if change['type'] in ['event', 'update'] and self.proxy_is_active:
            handler = getattr(self.proxy, 'set_' + change['name'], None)
            if handler is not None:
                handler(change['value'])
1156419
protected final void notifyChanged() {
        for (int i = mObservers.size() - 1; i >= 0; i--) {
            mObservers.get(i).onChanged();
        }
    }
763992
def on_modified(self, event):
        
        if not self._event_error:
            self.logger.info(u"Change detected from an edit on: %s",
                             event.src_path)

            self.compile_dependencies(event.src_path)
407524
function observeArgs(args, run) {

  function observeArg(arg, i, args) {
    var observer = Observer(
      arg,
      function argObserver(changes) {
        changes.forEach(({type, newValue}) => {
          if (type === 'upward') {
            args[i] = newValue;
            observer.reobserve(newValue);
          }
        });

        run();
      },
      // @TODO: consider whether to check for D/A/U here, or use 'modify' change type
      ['upward', 'delete', 'add', 'update'] // @TODO: check all these are necessary
    );
    observer.observe();
  }

  args.forEach(observeArg);
}
661203
function watch() {
  gulp.watch([appSrc + '/app/**/*.ts', '!' + appSrc + '/app/**/*.spec.ts']).on('change', function (e) {
    console.log('TypeScript file ' + e.path + ' has been changed. Compiling.');
  });
  gulp.watch([appSrc + '/app/**/*.less']).on('change', function (e) {
    console.log(e.path + ' has been changed. Updating.');
    transpileLESS(e.path);
    updateWatchDist();
  });
  gulp.watch([appSrc + '/app/**/*.html']).on('change', function (e) {
    console.log(e.path + ' has been changed. Updating.');
    copyToDist(e.path);
    updateWatchDist();
  });
}
159643
function observableChanged(change) {
  const store = this;
  action(() => {
    store.dataChanges.set(change.name, change.newValue);

    if (store.isSame(store.dataChanges.get(change.name), store.dataServer[change.name])) {
      store.dataChanges.delete(change.name);
    }
  })();
}
462125
def _do_update_callback(self, msg):
        """"""
        for callback, sensor in self._updateCallbacks:
            if sensor == msg:
                _LOGGING.debug('Update callback %s for sensor %s',
                               callback, sensor)
                callback(msg)
204824
function (getterSetter, context, callback, computeState) {
            // track what we are observing
            var observing = {},
                // a flag indicating if this observe/attr pair is already bound
                matched = true,
                // the data to return
                data = {
                    // we will maintain the value while live-binding is taking place
                    value: undefined,
                    // a teardown method that stops listening
                    teardown: function () {
                        for (var name in observing) {
                            var ob = observing[name];
                            ob.observe.obj.unbind(ob.observe.attr, onchanged);
                            delete observing[name];
                        }
                    }
                },
                batchNum;

            // when a property value is changed
            var onchanged = function (ev) {
                // If the compute is no longer bound (because the same change event led to an unbind)
                // then do not call getValueAndBind, or we will leak bindings.
                if (computeState && !computeState.bound) {
                    return;
                }
                if (ev.batchNum === undefined || ev.batchNum !== batchNum) {
                    // store the old value
                    var oldValue = data.value,
                        // get the new value
                        newvalue = getValueAndBind();
                    // update the value reference (in case someone reads)
                    data.value = newvalue;
                    // if a change happened
                    if (newvalue !== oldValue) {
                        callback(newvalue, oldValue);
                    }
                    batchNum = batchNum = ev.batchNum;
                }


            };

            // gets the value returned by `getterSetter` and also binds to any attributes
            // read by the call
            var getValueAndBind = function () {
                var info = getValueAndObserved(getterSetter, context),
                    newObserveSet = info.observed;

                var value = info.value;
                matched = !matched;

                // go through every attribute read by this observe
                can.each(newObserveSet, function (ob) {
                    // if the observe/attribute pair is being observed
                    if (observing[ob.obj._cid + "|" + ob.attr]) {
                        // mark at as observed
                        observing[ob.obj._cid + "|" + ob.attr].matched = matched;
                    } else {
                        // otherwise, set the observe/attribute on oldObserved, marking it as being observed
                        observing[ob.obj._cid + "|" + ob.attr] = {
                            matched: matched,
                            observe: ob
                        };
                        ob.obj.bind(ob.attr, onchanged);
                    }
                });

                // Iterate through oldObserved, looking for observe/attributes
                // that are no longer being bound and unbind them
                for (var name in observing) {
                    var ob = observing[name];
                    if (ob.matched !== matched) {
                        ob.observe.obj.unbind(ob.observe.attr, onchanged);
                        delete observing[name];
                    }
                }
                return value;
            };
            // set the initial value
            data.value = getValueAndBind();
            data.isListening = !can.isEmptyObject(observing);
            return data;
        }
1010828
function mutation(target, handler) {
    target.addEventListener("mutation", function(evt) {
        handler.call(this, this, evt.mutations);
    });
}
840002
def listen_for_updates(self):
        """"""
        self.toredis.subscribe(self.group_pubsub, callback=self.callback)
802462
function applyStateChanges(state, changes) {
  let result = false;

  // Applying the changes may produce a new round of changes, and that round
  // might produce new changes, and so on. Loop until we complete a pass that
  // produces no changes.
  for (
    let changed;
    changed = fieldsChanged(state, changes), !isEmpty(changed);
  ) {
    // We do have some real changes to report.
    result = true;

    // Apply the changes to the state.
    Object.assign(state, changes);

    // Run the change handlers, gathering up the changes those produce.
    const nextChanges = {};
    if (state[changeHandlersKey]) {
      state[changeHandlersKey].forEach(handler => {
        const { dependencies, callback } = handler;
        // Does this handler trigger on any of the changes we have?
        const run = dependencies.some(dependency => changed[dependency]);
        if (run) {
          // Yes, run the change handler and collect its changes.
          const handlerChanges = callback(state, changed);
          Object.assign(nextChanges, handlerChanges);
        }
      });
    }

    // If the change handlers produced changes, we'll run the loop again.
    changes = nextChanges;
  }

  return result;
}
895055
private void updateAttacking()
    {
        if (tick.elapsed(attackPause))
        {
            updateAttackHit();
        }
        else if (attacked)
        {
            if (AnimState.FINISHED == animator.getAnimState())
            {
                for (final AttackerListener listener : listeners)
                {
                    listener.notifyAttackAnimEnded();
                }
                attacked = false;
                state = AttackState.CHECK;
            }
        }
        else
        {
            for (final AttackerListener listener : listeners)
            {
                listener.notifyPreparingAttack();
            }
        }
    }
926225
def _update_proxy(self, change):
        
        if change['type'] == 'event':
            self.proxy.set_refreshed(True)
        else:
            super(SwipeRefreshLayout, self)._update_proxy(change)
218954
def _update_project_watch(config, task_presenter, results,
                          long_description, tutorial):  # pragma: no cover
    """"""
    logging.basicConfig(level=logging.INFO,
                        format='%(asctime)s - %(message)s',
                        datefmt='%Y-%m-%d %H:%M:%S')
    path = os.getcwd()
    event_handler = PbsHandler(config, task_presenter, results,
                               long_description, tutorial)
    observer = Observer()
    # We only want the current folder, not sub-folders
    observer.schedule(event_handler, path, recursive=False)
    observer.start()
    try:
        while True:
            time.sleep(1)
    except KeyboardInterrupt:
        observer.stop()
    observer.join()