Check if the currently watched instance (model, feature or
        preprocessing) is outdated and update it eventually.
496198
def update_if_outdated(folder):
    

    folders = []
    while os.path.isdir(folder):
        folders.append(folder)
        # Get info.yml
        with open(os.path.join(folder, "info.yml")) as ymlfile:
            content = yaml.load(ymlfile)
        folder = os.path.join(utils.get_project_root(), content['data-source'])
    raw_source_file = folder
    if not os.path.isfile(raw_source_file):
        logging.error("File '%s' was not found.", raw_source_file)
        logging.error("You should eventually execute 'hwrt download'.")
        sys.exit(-1)
    dt = os.path.getmtime(raw_source_file)
    source_mtime = datetime.datetime.utcfromtimestamp(dt)
    folders = folders[::-1]  # Reverse order to get the most "basic one first"

    for target_folder in folders:
        target_mtime = utils.get_latest_successful_run(target_folder)
        if target_mtime is None or source_mtime > target_mtime:
            # The source is later than the target. That means we need to
            # refresh the target
            if "preprocessed" in target_folder:
                logging.info("Preprocessed file was outdated. Update...")
                preprocess_dataset.main(os.path.join(utils.get_project_root(),
                                                     target_folder))
            elif "feature-files" in target_folder:
                logging.info("Feature file was outdated. Update...")
                create_ffiles.main(target_folder)
            elif "model" in target_folder:
                logging.info("Model file was outdated. Update...")
                create_model.main(target_folder, True)
            target_mtime = datetime.datetime.utcnow()
        else:
            logging.info("'%s' is up-to-date.", target_folder)
        source_mtime = target_mtime
712670
def _is_projection_updated_instance(self):
        
        last = self._last_workflow_started_time
        if not self._router.public_api_in_use:
            most_recent = self.get_most_recent_update_time()
        else:
            most_recent = None
        if last and most_recent:
            return last < most_recent
        return False
452463
def _requires_update(self, old_object, new_object):
        
        old_encoded = self.manager._encode(old_object)
        new_encoded = self.manager._encode(new_object)
        return _compare_recursive(old_encoded, new_encoded)
435344
def watch(ec)
      ec.watch('features/support/.*')  { |m| Providence::CucumberWatchr.run_all }
      ec.watch('features/.*\.feature') { |m| Providence::CucumberWatchr.run m[0] }
    end
344547
def __is_current(filepath):
    ''''''
    if not __DOWNLOAD_PARAMS['auto_update']:
        return True

    if not os.path.isfile(filepath):
        return False

    return datetime.datetime.utcfromtimestamp(os.path.getmtime(filepath)) \
        > __get_last_update_time()
815698
function (instance) {
	if (instance.controller) {
		var i = 0, is_changed;

		for (; i < instance.change_detectors.length; ++i) {
			if (instance.change_detectors[i].is_changed()) {
				is_changed = true;
			}
		}

		if (instance.controller.on_digest) {
			instance.controller.on_digest();
		}
		if (is_changed && instance.controller.on_change) {
			instance.controller.on_change();
		}
	}
}
1112766
public void checkKeepOrRemove() {
    boolean _hasKeepAfterExpired = heapCache.isKeepAfterExpired();
    if (expiry != 0 || remove || _hasKeepAfterExpired) {
      mutationUpdateHeap();
      return;
    }
    if (_hasKeepAfterExpired) {
      expiredImmediatelyKeepData();
      return;
    }
    expiredImmediatelyAndRemove();
  }
999970
def obsolete_and_new(changes = { })
      return if changes.empty?
      if changes['new'].present?
        changes['new'].each { |name, _| ForemanChef::Environment.create(:name => name, :chef_proxy_id => @chef_proxy.id) }
      end
      if changes['obsolete'].present?
        changes['obsolete'].each { |name, _| ForemanChef::Environment.where(:chef_proxy_id => @chef_proxy.id).find_by_name(name).destroy }
      end
      []
    end
750586
def unwatch(value):
    """"""
    if not isinstance(value, Watchable):
        raise TypeError("Expected a Watchable, not %r." % value)
    spectator = watcher(value)
    try:
        del value._instance_spectator
    except Exception:
        pass
    return spectator
1288273
def check_pypi(modeladmin, request, queryset):
    """"""
    for p in queryset:
        if p.is_editable:
            logger.debug("Ignoring version update '%s' is editable", p.package_name)
        else:
            p.update_from_pypi()
1002200
def updated(self):
        ''
        return dateutil.parser.parse(str(self.f.latestRevision.updated))
829485
def up_to_date(self):
        
#        return False
        if not self.updated:
            return False
        return (utils.get_datetime_now() - self.updated).seconds < conf.GOSCALE_POSTS_UPDATE_FREQUENCY
814411
def is_catchup_needed_during_view_change(self) -> bool:
        
        if self.caught_up_for_current_view():
            logger.info('{} is caught up for the current view {}'.format(self, self.viewNo))
            return False
        logger.info('{} is not caught up for the current view {}'.format(self, self.viewNo))

        if self.num_txns_caught_up_in_last_catchup() == 0:
            if self.has_ordered_till_last_prepared_certificate():
                logger.info('{} ordered till last prepared certificate'.format(self))
                return False

        if self.is_catch_up_limit(self.config.MIN_TIMEOUT_CATCHUPS_DONE_DURING_VIEW_CHANGE):
            # No more 3PC messages will be processed since maximum catchup
            # rounds have been done
            self.master_replica.last_prepared_before_view_change = None
            return False

        return True
1102193
function dataWatchFn(newData, oldData) {
                        if (newData !== oldData){
                            if (!scope._config.disabled) {
                                scope._config.refreshDataOnly ? scope.api.update() : scope.api.refresh(); // if wanted to refresh data only, use update method, otherwise use full refresh.
                            }
                        }
                    }
149162
private void updatePreview(TrackMetadataUpdate update, WaveformPreview preview) {
        previewHotCache.put(DeckReference.getDeckReference(update.player, 0), preview);  // Main deck
        if (update.metadata.getCueList() != null) {  // Update the cache with any hot cues in this track as well
            for (CueList.Entry entry : update.metadata.getCueList().entries) {
                if (entry.hotCueNumber != 0) {
                    previewHotCache.put(DeckReference.getDeckReference(update.player, entry.hotCueNumber), preview);
                }
            }
        }
        deliverWaveformPreviewUpdate(update.player, preview);
    }
514364
function() {
			canReflect.onValue( observation, updater,"notify");
			if (observation.hasOwnProperty("_value")) {// can-observation 4.1+
				compute.value = observation._value;
			} else {// can-observation < 4.1
				compute.value = observation.value;
			}
		}
762396
function updateAnimation () {
    if (!animationActive && shouldAnimate()) {
      animationStartTime = Date.now()
      lastFrameNumber = 0
      window.requestAnimationFrame(frame)
      animationActive = true
    }
  }