Validate that the time we think is the load time is correct.  This can be wrong if boomerang was loaded
after onload, so in that case, if navigation timing is available, we use that instead.
435860
function(t_now, data) {
		var t_done = t_now;

		// xhr beacon with detailed timing information
		if (data && data.timing && data.timing.loadEventEnd) {
			t_done = data.timing.loadEventEnd;
		}
		// Boomerang loaded late and...
		else if (BOOMR.loadedLate) {
			// We have navigation timing,
			if(w.performance && w.performance.timing) {
				// and boomerang loaded after onload fired
				if(w.performance.timing.loadEventStart && w.performance.timing.loadEventStart < BOOMR.t_end) {
					t_done = w.performance.timing.loadEventStart;
				}
			}
			// We don't have navigation timing,
			else {
				// So we'll just use the time when boomerang was added to the page
				// Assuming that this means boomerang was added in onload
				t_done = BOOMR.t_lstart || BOOMR.t_start || t_now;
			}
		}

		return t_done;
	}
1248279
public boolean loadFallback() {
        try {
            if (fallbackLocation == null) {
                Logger.getLogger(getClass().getName()).warning("No fallback resource for " + this +
                        ", loadFallback not supported.");
                return false;
            }
            load(fallbackLocation, true);
            clearCache();
            return true;
        } catch (Exception e) {
            LOG.log(Level.SEVERE, "Failed to load fallback resource: " + fallbackLocation, e);
        }
        return false;
    }
876792
public boolean isValidTimeout(AllocationID allocationId, UUID ticket) {
		checkInit();

		return timerService.isValid(allocationId, ticket);
	}
29605
def _after_valid_time_range(self):
        
        if self.end_time is not None:
            try:
                if self.time > self.end_time:
                    return True
            except TypeError:
                return False
        return False
2558
def is_correct(self):
        # pylint: disable=too-many-branches
        
        state = True

        if hasattr(self, 'trigger') and getattr(self, 'trigger', None):
            self.add_warning("[%s::%s] 'trigger' property is not allowed"
                             % (self.my_type, self.get_name()))

        # If no notif period, set it to None, mean 24x7
        if not hasattr(self, 'notification_period'):
            self.notification_period = None

        # If freshness_threshold is not set, use check interval or retry interval
        if hasattr(self, 'freshness_threshold') and not self.freshness_threshold:
            if getattr(self, 'check_interval', 0):
                self.freshness_threshold = self.check_interval * 60
                # self.add_warning("[%s::%s] using check interval as a freshness threshold: %d s"
                #                  % (self.my_type, self.get_name(), self.freshness_threshold))
            elif getattr(self, 'retry_interval', 0):
                self.freshness_threshold = self.retry_interval * 60
                # self.add_warning("[%s::%s] using retry interval as a freshness threshold: %d s"
                #                  % (self.my_type, self.get_name(), self.freshness_threshold))

        # If we got an event handler, it should be valid
        if getattr(self, 'event_handler', None) and not self.event_handler.is_valid():
            self.add_error("[%s::%s] event_handler '%s' is invalid"
                           % (self.my_type, self.get_name(), self.event_handler.command))
            state = False

        if not hasattr(self, 'check_command'):
            # todo: This should never happen because the default exists as an empty string
            self.add_error("[%s::%s] no property check_command" % (self.my_type, self.get_name()))
            state = False
        # Ok got a command, but maybe it's invalid
        else:
            # if not self.check_command:
            #     self.add_warning("[%s::%s] no check_command, will always be considered as Up"
            #                      % (self.my_type, self.get_name()))
            if self.check_command and not self.check_command.is_valid():
                self.add_error("[%s::%s] check_command '%s' invalid"
                               % (self.my_type, self.get_name(), self.check_command.command))
                state = False
            if self.got_business_rule:
                if not self.business_rule.is_valid():
                    self.add_error("[%s::%s] business_rule invalid"
                                   % (self.my_type, self.get_name()))
                    for bperror in self.business_rule.configuration_errors:
                        self.add_error("[%s::%s]: %s" % (self.my_type, self.get_name(), bperror))
                    state = False

        if not hasattr(self, 'notification_interval') \
                and self.notifications_enabled is True:  # pragma: no cover, should never happen
            self.add_error("[%s::%s] no notification_interval but notifications enabled"
                           % (self.my_type, self.get_name()))
            state = False

        # if no check_period, means 24x7, like for services
        if not hasattr(self, 'check_period'):
            self.check_period = None

        state = super(SchedulingItem, self).is_correct()
        return state
1285391
def check_critical_load(self):
        """"""
        if self.load_avg.intervals['1m'].value > 1:
            if self.last_load_level == 1 and time.time() - self.last_load_log < 30:
                return
            self.last_load_log = time.time()
            self.last_load_level = 1
            logger.error(
                "Listener load limit exceeded, the system can't handle this!",
                extra=self._make_stats()
            )

        elif self.load_avg.intervals['1m'].value > 0.8:
            if self.last_load_level == 0.8 and time.time() - self.last_load_log < 30:
                return
            self.last_load_log = time.time()
            self.last_load_level = 0.8
            logger.warning(
                "Listener load approaching critical!",
                extra=self._make_stats()
            )

        else:
            self.last_load_log = -math.inf
            self.last_load_level = 0
1054556
function(isLoaded) {
    var self = this;
    var isLoading = !isLoaded;
    var state = self.state;
    var prev = state.loadingStatus;

    isLoading = isLoading || false;
    state.loadingStatus = isLoading;

    self._notifyParentLoadingStatus(prev, !self.isLoaded());
  }
580480
private void checkExistingTracks() {
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                for (Map.Entry<DeckReference, TrackMetadata> entry : MetadataFinder.getInstance().getLoadedTracks().entrySet()) {
                    if (entry.getKey().hotCue == 0) {  // The track is currently loaded in a main player deck
                        checkIfSignatureReady(entry.getKey().player);
                    }
                }
            }
        });
    }
1362590
function checkLoadStatus(onload) {
            if (loadCount === resourceCount) {
                // wait 1/2s and execute callback (cheap workaround to ensure everything is loaded)
                if (onload || api.onload) {
                    // make sure we clear the timer
                    clearTimeout(timerId);
                    // trigger the onload callback
                    // we call either the supplied callback (which takes precedence) or the global one
                    var callback = onload || api.onload;
                    setTimeout(function () {
                        callback();
                        me.event.publish(me.event.LOADER_COMPLETE);
                    }, 300);
                }
                else {
                    throw new Error("no load callback defined");
                }
            }
            else {
                timerId = setTimeout(function() {
                    checkLoadStatus(onload);
                }, 100);
            }
        }
450319
public boolean isUnloadedAtDestination() {
		for (HandlingEvent event : this.lnkDeliveryHistory.eventsOrderedByCompletionTime()) {
			if (HandlingEvent.Type.UNLOAD.equals(event.getType()) && hasArrived()) {
				return true;
			}
		}
		return false;
	}
916528
def _check_time_backwards(self):
        

        now = time.time()

        if now < self.start:
            self.start = now
            self.end = self.start + self.length
841262
public boolean isUnloadedAtDestination() {
		for (HandlingEvent event : deliveryHistory().eventsOrderedByCompletionTime()) {
			if (Type.UNLOAD.equals(event.getType()) && getDestination().equals(event.getLocation())) {
				return true;
			}
		}
		return false;
	}
1116236
private boolean isLoadTimeValid(final String loadTimeParam) {
		return !StringUtils.isEmpty(loadTimeParam) && isLong(loadTimeParam) && Long.valueOf(loadTimeParam) > 0;
	}
59682
def arrival_delay_greater_than(item_id, delay, namespace="_expected_arrival"):
    """"""
    expected = get_state(item_id, namespace=namespace)
    now = time.time()
    if expected and (now - expected) > delay:
        logger.error("Timeout: waited %s seconds for parent.", delay)
        return True
    elif expected:
        logger.info("Still out of order but no timeout: %s-%s <= %s.",
                    now, expected, delay)
        return False
    elif delay > 0:
        logger.info("Storing expected arrival time (%s) for context '%s'",
                    datetime.fromtimestamp(now).isoformat(), item_id)
        set_state(item_id, now, namespace=namespace)
        return False
    else:
        logger.info("Event is out of order but not waiting for parent.")
        return True
931793
function () {

		var valid = true;

		var valueSize = this.getValueSize();
		if ( valueSize - Math.floor( valueSize ) !== 0 ) {

			console.error( 'THREE.KeyframeTrack: Invalid value size in track.', this );
			valid = false;

		}

		var times = this.times,
			values = this.values,

			nKeys = times.length;

		if ( nKeys === 0 ) {

			console.error( 'THREE.KeyframeTrack: Track is empty.', this );
			valid = false;

		}

		var prevTime = null;

		for ( var i = 0; i !== nKeys; i ++ ) {

			var currTime = times[ i ];

			if ( typeof currTime === 'number' && isNaN( currTime ) ) {

				console.error( 'THREE.KeyframeTrack: Time is not a valid number.', this, i, currTime );
				valid = false;
				break;

			}

			if ( prevTime !== null && prevTime > currTime ) {

				console.error( 'THREE.KeyframeTrack: Out of order keys.', this, i, currTime, prevTime );
				valid = false;
				break;

			}

			prevTime = currTime;

		}

		if ( values !== undefined ) {

			if ( AnimationUtils.isTypedArray( values ) ) {

				for ( var i = 0, n = values.length; i !== n; ++ i ) {

					var value = values[ i ];

					if ( isNaN( value ) ) {

						console.error( 'THREE.KeyframeTrack: Value is not a valid number.', this, i, value );
						valid = false;
						break;

					}

				}

			}

		}

		return valid;

	}
59696
boolean hasValidTimes() {

        if ((getEnd() > 0L) && (getEnd() < System.currentTimeMillis())) {
            return false;
        }

        return ((getEnd() == 0) | (getStart() == 0)) || (getEnd() >= getStart());
    }
1249713
private void validateAndSetClock(long newSimulationTime) {
     
    // We do not use the getClock routine here as 
    // the Engine and JobTracker clocks are different at
    // this point.
    long currentSimulationTime = clock.getTime();   
    if (newSimulationTime < currentSimulationTime) {
      // time has gone backwards
      throw new IllegalArgumentException("Time has gone backwards! " +
                                 "newSimulationTime: " + newSimulationTime +
                                 " while currentTime: " + 
                                 currentSimulationTime);
    }
    // the simulation time should also match that in the engine
    assert(newSimulationTime == engine.getCurrentTime()) : 
    	     " newTime =" + newSimulationTime + 
    	     " engineTime = " + engine.getCurrentTime();

    // set the current simulation time
    clock.setTime(newSimulationTime);
  }