Checks if a unit is patrolling.
11263
def is_patrolling(self) -> bool:
        
        return self.orders and self.orders[0].ability.id is AbilityId.PATROL
801317
private void checkForCycles(Class<?> target) {
        Stack<Class<?>> trace = new Stack<>();
        trace.push(target);
        checkForCycles(target, target, trace);
    }
239668
synchronized public boolean isBlacklisted(String trackerID) {
    TaskTrackerStatus status = getTaskTrackerStatus(trackerID);
    if (status != null) {
      return faultyTrackers.isBlacklisted(status.getHost());
    }
    return false;
  }
936892
private void checkAlarms(final ZonedDateTime TIME) {
        alarmsToRemove.clear();
        for (Alarm alarm : alarms) {
            final ZonedDateTime ALARM_TIME = alarm.getTime();
            switch (alarm.getRepetition()) {
                case ONCE:
                    if (TIME.isAfter(ALARM_TIME)) {
                        if (alarm.isArmed()) {
                            fireAlarmEvent(new AlarmEvent(Clock.this, alarm));
                            alarm.executeCommand();
                        }
                        alarmsToRemove.add(alarm);
                    }
                    break;
                case HALF_HOURLY:
                    if ((ALARM_TIME.getMinute() == TIME.getMinute() ||
                        ALARM_TIME.plusMinutes(30).getMinute() == TIME.getMinute()) &&
                        ALARM_TIME.getSecond() == TIME.getSecond()) {
                        if (alarm.isArmed()) {
                            fireAlarmEvent(new AlarmEvent(Clock.this, alarm));
                            alarm.executeCommand();
                        }
                    }
                    break;
                case HOURLY:
                    if (ALARM_TIME.getMinute() == TIME.getMinute() &&
                        ALARM_TIME.getSecond() == TIME.getSecond()) {
                        if (alarm.isArmed()) {
                            fireAlarmEvent(new AlarmEvent(Clock.this, alarm));
                            alarm.executeCommand();
                        }
                    }
                    break;
                case DAILY:
                    if (ALARM_TIME.getHour()   == TIME.getHour() &&
                        ALARM_TIME.getMinute() == TIME.getMinute() &&
                        ALARM_TIME.getSecond() == TIME.getSecond()) {
                        if (alarm.isArmed()) {
                            fireAlarmEvent(new AlarmEvent(Clock.this, alarm));
                            alarm.executeCommand();
                        }
                    }
                    break;
                case WEEKLY:
                    if (ALARM_TIME.getDayOfWeek() == TIME.getDayOfWeek() &&
                        ALARM_TIME.getHour()      == TIME.getHour() &&
                        ALARM_TIME.getMinute()    == TIME.getMinute() &&
                        ALARM_TIME.getSecond()    == TIME.getSecond()) {
                        if (alarm.isArmed()) {
                            fireAlarmEvent(new AlarmEvent(Clock.this, alarm));
                            alarm.executeCommand();
                        }
                    }
                    break;
            }
        }
        for (Alarm alarm : alarmsToRemove) {
            removeAlarm(alarm);
        }
    }
676257
def check(
    state,
    unused=False,
    style=False,
    ignore=None,
    args=None,
    **kwargs
):
    """"""
    from ..core import do_check

    do_check(
        three=state.three,
        python=state.python,
        system=state.system,
        unused=unused,
        ignore=ignore,
        args=args,
        pypi_mirror=state.pypi_mirror,
    )
283144
def _check_forest(self, sensors):
        """"""
        if self in sensors:
            raise ValueError('Circular dependency in sensors: %s is its own'
                             'parent.' % (self.name,))
        sensors.add(self)
        for parent in self._parents:
            parent._check_forest(sensors)
1208840
function check(message, ranges, id) {
      /* Check the state at the message's position. */
      var index = ranges && ranges.length
      var length = -1
      var range

      while (--index > length) {
        range = ranges[index]

        /* istanbul ignore if - generated marker. */
        if (!range.position || !range.position.line || !range.position.column) {
          continue
        }

        if (
          range.position.line < message.line ||
          (range.position.line === message.line &&
            range.position.column < message.column)
        ) {
          return range.state === true
        }
      }

      /* The first marker ocurred after the first
       * message, so we check the initial state. */
      if (!id) {
        return initial || reset
      }

      return reset ? enable.indexOf(id) !== -1 : disable.indexOf(id) === -1
    }
1007606
def has_pending(self):
        
        if self.workqueue:
            return True

        for assigned_unit in self.assigned_work.values():
            if self._pending_of(assigned_unit) > 0:
                return True

        return False
732995
@SubscribeEvent
    public void onCheckSpawn(CheckSpawn cs)
    {
        // Decide whether or not to allow spawning.
        // We shouldn't allow spawning unless it has been specifically turned on - whether
        // a mission is running or not. (Otherwise spawning may happen in between missions.)
        boolean allowSpawning = false;
        if (currentMissionInit() != null && currentMissionInit().getMission() != null)
        {
            // There is a mission running - does it allow spawning?
            ServerSection ss = currentMissionInit().getMission().getServerSection();
            ServerInitialConditions sic = (ss != null) ? ss.getServerInitialConditions() : null;
            if (sic != null)
                allowSpawning = (sic.isAllowSpawning() == Boolean.TRUE);

            if (allowSpawning && sic.getAllowedMobs() != null && !sic.getAllowedMobs().isEmpty())
            {
                // Spawning is allowed, but restricted to our list.
                // Is this mob on our list?
                String mobName = EntityList.getEntityString(cs.getEntity());
                allowSpawning = false;
                for (EntityTypes mob : sic.getAllowedMobs())
                {
                    if (mob.value().equals(mobName))
                    {
                        allowSpawning = true;
                        break;
                    }
                }
            }
        }
        if (allowSpawning)
            cs.setResult(Result.DEFAULT);
        else
            cs.setResult(Result.DENY);
    }
587648
public void checkStates( INotificationMngr notificationMngr ) {

		// Check the status of scoped instances
		Collection<Instance> scopedInstances = InstanceHelpers.findAllScopedInstances( this.application );
		for( Instance scopedInstance : scopedInstances ) {

			// Never started instances,
			// or scoped instances that have been stopped by an agent,
			// are not processed anymore here
			if( scopedInstance.getStatus() == InstanceStatus.NOT_DEPLOYED
					|| scopedInstance.getStatus() == InstanceStatus.DEPLOYING
					|| scopedInstance.getStatus() == InstanceStatus.UNDEPLOYING ) {
				scopedInstance.data.remove( MISSED_HEARTBEATS );
				continue;
			}

			// Otherwise
			String countAs = scopedInstance.data.get( MISSED_HEARTBEATS );
			int count = countAs == null ? 0 : Integer.parseInt( countAs );
			if( ++ count > THRESHOLD ) {
				scopedInstance.setStatus( InstanceStatus.PROBLEM );
				notificationMngr.instance( scopedInstance, this.application, EventType.CHANGED );
				this.logger.severe( "Agent " + InstanceHelpers.computeInstancePath( scopedInstance ) + " has not sent heart beats for quite a long time. Status changed to PROBLEM." );
			}

			scopedInstance.data.put( MISSED_HEARTBEATS, String.valueOf( count ));
		}
	}
496959
def watch_firings(self, flag):
        """"""
        lib.EnvSetDefruleWatchFirings(self._env, int(flag), self._rule)
809157
def is_armed(self):
        """"""
        alarm_code = self.get_armed_status()

        if alarm_code == YALE_STATE_ARM_FULL:
            return True

        if alarm_code == YALE_STATE_ARM_PARTIAL:
            return True

        return False
656636
def check_concurrency(self) -> bool:
        
        if not self.operation.concurrency:  # No concurrency set
            return True

        ops_count = self.operation.runs.filter(
            status__status__in=self.STATUSES.RUNNING_STATUS).count()
        return ops_count < self.operation.concurrency
563246
def _watchdog(self):
        '''  '''
        too_early = (time.time() - self._last_time < self._min_interval)
        too_much = (self._count >= self._rate_limit)
        return (False if (too_early or too_much) else True)
541698
def is_recording(self) -> Optional[bool]:
        """"""
        status_response = self._client.get_state(
            'api/monitors/alarm/id:{}/command:status.json'.format(
                self._monitor_id
            )
        )

        if not status_response:
            _LOGGER.warning('Could not get status for monitor {}'.format(
                self._monitor_id
            ))
            return None

        status = status_response.get('status')
        # ZoneMinder API returns an empty string to indicate that this monitor
        # cannot record right now
        if status == '':
            return False
        return int(status) == STATE_ALARM
782234
def all_checks_enabled(self):
        ''' '''
        arming_mask = int(self.get_mav_param("ARMING_CHECK",0))
        if arming_mask == 1:
            return True
        for bit in arming_masks.values():
            if not arming_mask & bit and bit != 1:
                return False
        return True
76644
def check(self):
        '''  '''
        if self.lastrun + self.interval < time.time():
            return True
        else:
            return False