Ensure all members are running and available.
491088
def reset(self):
        """"""
        # Need to use self.server_map, in case no Servers are left running.
        for member_id in self.server_map:
            host = self.member_id_to_host(member_id)
            server_id = self._servers.host_to_server_id(host)
            # Reset each member.
            self._servers.command(server_id, 'reset')
        # Wait for all members to have a state of 1, 2, or 7.
        # Note that this also waits for a primary to become available.
        self.waiting_member_state()
        # Wait for Server states to match the config from the primary.
        self.waiting_config_state()
        return self.info()
485048
@Override
	public void ensureJvmMembersInitialized() {
		if (jvmMemberInitializers == null)
			return;
		Set<Runnable> localRunnables = null;
		synchronized(this) {
			localRunnables = jvmMemberInitializers;
			jvmMemberInitializers = null;
			hasJvmMemberInitializers = false;
		}
		if (localRunnables == null)
			return;
		boolean wasDeliver = eDeliver();
		LinkedHashSet<Triple<EObject, EReference, INode>> before = resolving;
		try {
			eSetDeliver(false);
			if (!before.isEmpty()) {
				resolving = new LinkedHashSet<Triple<EObject, EReference, INode>>();
			}
			if (isInitializingJvmMembers) {
				throw new IllegalStateException("Reentrant attempt to initialize JvmMembers");
			}
			try {
				isInitializingJvmMembers = true;
				for (Runnable runnable : localRunnables) {
					runnable.run();
				}
			} finally {
				isInitializingJvmMembers = false;
			}
		} catch (Exception e) {
			log.error(e.getMessage(), e);
		} finally {
			if (!before.isEmpty()) {
				resolving = before;
			}
			eSetDeliver(wasDeliver);
		}
	}
821813
def run_check(participants, config, reference_time):
    
    recruiters_with_late_participants = defaultdict(list)
    for p in participants:
        timeline = ParticipationTime(p, reference_time, config)
        if timeline.is_overdue:
            print(
                "Error: participant {} with status {} has been playing for too "
                "long - their recruiter will be notified.".format(p.id, p.status)
            )
            recruiters_with_late_participants[p.recruiter_id].append(p)

    for recruiter_id, participants in recruiters_with_late_participants.items():
        recruiter = recruiters.by_name(recruiter_id)
        recruiter.notify_duration_exceeded(participants, reference_time)
224260
public function flushCache()
    {
        $ids = $this->getMemberIDList();
        foreach ($this->getServices() as $service) {
            $service->flushMemberCache($ids);
        }
    }
876933
def _keep_running(self):
        '''
        
        '''
        if self.config.max_failures:
            if self.session_info.failure_count >= self.config.max_failures:
                return False
        return self._test_list.current() is not None
488975
def check_membership(self, group):
        
        user_groups = self.request.user.groups.values_list("name", flat=True)
        if isinstance(group, (list, tuple)):
            for req_group in group:
                if req_group in user_groups:
                    return True

        is_member = group in user_groups
        if not is_member:
            messages.add_message(self.request, messages.ERROR, 'You do not have sufficient permissions to do that.')

        return is_member
366994
def active_all(self, user=None):
        
        qs = self.deleted()
        if user:
            qs = qs.filter(recipient=user)
        qs.update(deleted=False)
1347370
def run(self):
        """"""
        self._logger.info('starting all runners')
        try:
            with self._lock:
                assert not self.running.set(), 'cannot re-run: %s' % self
                self.running.set()
            thread_runner = self.runners[threading]
            for runner in self.runners.values():
                if runner is not thread_runner:
                    thread_runner.register_payload(runner.run)
            if threading.current_thread() == threading.main_thread():
                asyncio_main_run(root_runner=thread_runner)
            else:
                thread_runner.run()
        except Exception as err:
            self._logger.exception('runner terminated: %s', err)
            raise RuntimeError from err
        finally:
            self._stop_runners()
            self._logger.info('stopped all runners')
            self.running.clear()
59369
def pending_membership_invites
      @pending_membership_invites ||= Membership.inactive
                                                .with_member_id(member_id: guid)
                                                .joins(:group)
                                                .merge(Group.private)
    end
238928
def run_all
      return pending_result unless test_paths?
      Guard::UI.info("Resetting", reset: true)
      do_run{ @runner.run(@test_paths) }
    end
254
def run_checks(collector):
    """"""
    artifact = collector.configuration["dashmat"].artifact
    chosen = artifact
    if chosen in (None, "", NotSpecified):
        chosen = None

    dashmat = collector.configuration["dashmat"]
    modules = collector.configuration["__active_modules__"]
    config_root = collector.configuration["config_root"]
    module_options = collector.configuration["modules"]

    datastore = JsonDataStore(os.path.join(config_root, "data.json"))
    if dashmat.redis_host:
        datastore = RedisDataStore(redis.Redis(dashmat.redis_host))

    scheduler = Scheduler(datastore)

    for name, module in modules.items():
        if chosen is None or name == chosen:
            server = module.make_server(module_options[name].server_options)
            scheduler.register(module, server, name)

    scheduler.twitch(force=True)
642058
def is_ready(instance, pending=False):
    

    last_reload = lookup(instance, 'lastOperatingSystemReload', 'id')
    active_transaction = lookup(instance, 'activeTransaction', 'id')

    reloading = all((
        active_transaction,
        last_reload,
        last_reload == active_transaction,
    ))
    outstanding = False
    if pending:
        outstanding = active_transaction
    if instance.get('provisionDate') and not reloading and not outstanding:
        return True
    return False
1352826
def start_running(self):
        """"""
        self.comp.warm_up()
        self.check_runner()
        self.running = True
126909
def isAvailable(self, requester, access):
        
        debuglog("%s isAvailable(%s, %s): self.owners=%r"
                 % (self, requester, access, self.owners))
        num_excl, num_counting = self._claimed_excl, self._claimed_counting

        # Find all waiters ahead of the requester in the wait queue
        for idx, waiter in enumerate(self.waiting):
            if waiter[0] is requester:
                w_index = idx
                break
        else:
            w_index = len(self.waiting)
        ahead = self.waiting[:w_index]

        if access.mode == 'counting':
            # Wants counting access
            return num_excl == 0 and num_counting + len(ahead) < self.maxCount \
                and all([w[1].mode == 'counting' for w in ahead])
        # else Wants exclusive access
        return num_excl == 0 and num_counting == 0 and not ahead
971077
def _ensure_worker(self):
        """"""
        while len(self._workers) < self._min_workers or len(self._workers) < self._queue.qsize() < self._max_workers:
            worker = threading.Thread(
                target=self._execute_futures,
                name=self.identifier + '_%d' % time.time(),
            )
            worker.daemon = True
            self._workers.add(worker)
            worker.start()
1020850
def wait_for_running(self):
        """"""
        self.server_attrs = self.consul.find_running(
                self.server_attrs,
                self.launch_timeout_s,
                )
1034975
def check_membership(user, group)
      raise JSS::NoSuchItemError, 'LDAPServer not yet saved in the JSS' unless @in_jss
      self.class.check_membership @id, user, group, api: @api
    end