Print the status of instances in the given roles, filtered by state.
436314
def print_status(self, roles=None, state_filter="running"):
    
    if not roles:
      for instance in self._get_instances(self._get_cluster_group_name(),
                                          state_filter):
        self._print_instance("", instance)
    else:
      for role in roles:
        for instance in self._get_instances(self._group_name_for_role(role),
                                            state_filter):
          self._print_instance(role, instance)
1294373
def role_data_from_results(res, rolename)
      roles = res['roles']
      roles.each do |role|
        return role[0].to_i if role[1] == rolename
      end
      nil
    end
950992
def get_status(self):
        '''
        
        '''
        jobs = Job.objects.filter(push=self).filter(
            Q(failure_classification__isnull=True) |
            Q(failure_classification__name='not classified')).exclude(tier=3)

        status_dict = {}
        for (state, result, total) in jobs.values_list(
                'state', 'result').annotate(
                    total=Count('result')):
            if state == 'completed':
                status_dict[result] = total
            else:
                status_dict[state] = total
        if 'superseded' in status_dict:
            # backward compatability for API consumers
            status_dict['coalesced'] = status_dict['superseded']

        return status_dict
1108802
def print_status(self, indent="", recurse=False):
        """"""
        print ("%s%30s : %15s : %20s" %
               (indent, "Linkname", "Link Status", "Jobs Status"))
        for link in self._links.values():
            if hasattr(link, 'check_status'):
                status_vect = link.check_status(
                    stream=sys.stdout, no_wait=True, do_print=False)
            else:
                status_vect = None
            key = JobDetails.make_fullkey(link.full_linkname)
            link_status = JOB_STATUS_STRINGS[link.check_job_status(key)]
            if status_vect is None:
                jobs_status = JOB_STATUS_STRINGS[link.check_jobs_status()]
            else:
                jobs_status = status_vect
            print ("%s%30s : %15s : %20s" %
                   (indent, link.linkname, link_status, jobs_status))
            if hasattr(link, 'print_status') and recurse:
                print ("----------   %30s    -----------" % link.linkname)
                link.print_status(indent + "  ", recurse=True)
                print ("------------------------------------------------")
431681
def status(self, **kwargs):
        
        self.services = dict(
            init_system=self.init_system,
            services=[]
        )
1211791
def status(config, group, accounts=(), region=None):
    """"""
    config = validate.callback(config)
    destination = config.get('destination')
    client = boto3.Session().client('s3')

    for account in config.get('accounts', ()):
        if accounts and account['name'] not in accounts:
            continue

        session = get_session(account['role'], region)
        account_id = session.client('sts').get_caller_identity()['Account']
        prefix = destination.get('prefix', '').rstrip('/') + '/%s' % account_id
        prefix = "%s/flow-log" % prefix

        role = account.pop('role')
        if isinstance(role, six.string_types):
            account['account_id'] = role.split(':')[4]
        else:
            account['account_id'] = role[-1].split(':')[4]

        account.pop('groups')

        try:
            tag_set = client.get_object_tagging(
                Bucket=destination['bucket'], Key=prefix).get('TagSet', [])
        except ClientError:
            account['export'] = 'missing'
            continue
        tags = {t['Key']: t['Value'] for t in tag_set}

        if 'LastExport' not in tags:
            account['export'] = 'empty'
        else:
            last_export = parse(tags['LastExport'])
            account['export'] = last_export.strftime('%Y/%m/%d')

    accounts = [a for a in config.get('accounts') if a in accounts or not accounts]
    accounts.sort(key=operator.itemgetter('export'), reverse=True)
    print(tabulate(accounts, headers='keys'))
884565
def state(self, state):
        ''''''
        logger.debug('client changing to state=%s', ClientState.Names[state])
        self._state = state
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 ));
		}
	}
229835
def status(config):
    """"""
    with open(config) as fh:
        config = yaml.safe_load(fh.read())
    jsonschema.validate(config, CONFIG_SCHEMA)
    last_index = get_incremental_starts(config, None)
    accounts = {}
    for (a, region), last in last_index.items():
        accounts.setdefault(a, {})[region] = last
    print(yaml.safe_dump(accounts, default_flow_style=False))
668957
public final InstanceState getInstanceState() {
        return isTerminated() ? InstanceState.TERMINATED
                : (isBooting() ? InstanceState.PENDING
                        : (isStopping() ? InstanceState.STOPPING
                                : (isRunning() ? InstanceState.RUNNING
                                        : InstanceState.STOPPED)));
    }
129385
protected InstanceInfo.Status translateState(HealthStatus status) {
        if (status.equals(HealthStatus.UP)) {
            return InstanceInfo.Status.UP;
        }
        return InstanceInfo.Status.DOWN;
    }
685359
def log_state(self, state):
        
        results = []
        for field_idx, field in enumerate(self.fields):
            parent, stat = None, state
            for f in field:
                parent, stat = stat, stat[f]
            results.append(stat)
        self.log(*results)
547096
def status(queue, munin, munin_config):
    """"""
    if munin_config:
        return status_print_config(queue)
    queues = get_queues(queue)
    for queue in queues:
        status_print_queue(queue, munin=munin)
    if not munin:
        print('-' * 40)
1342697
def grok_state(self, obj):
        """"""
        if 'state' in obj:
            my_state = obj['state'].lower()
            if my_state != 'absent' and my_state != 'present':
                raise aomi_excep \
                    .Validation('state must be either "absent" or "present"')

        self.present = obj.get('state', 'present').lower() == 'present'
307693
def _has_role(self, identifiers, role_s):
        
        for realm in self.realms:
            # the realm's has_role returns a generator
            yield from realm.has_role(identifiers, role_s)
504583
def print_state(state: State, file: TextIO = None) -> None:
    """"""
    state = state.vec.asarray()
    for index, amplitude in np.ndenumerate(state):
        ket = "".join([str(n) for n in index])
        print(ket, ":", amplitude, file=file)
1374012
def _print_status(self):
        ''''''
        self._clear_line()

        self._print('  ')

        if self.max_value:
            self._print_percent()
            self._print(' ')
            self._print_bar()
        else:
            self._print_throbber()

        self._print(' ')

        if self.measurement == Measurement.bytes:
            self._print_size_downloaded()
        else:
            self._print(self.current_value)

        self._print(' ')
        self._print_duration()
        self._print(' ')

        if self.measurement == Measurement.bytes:
            self._print_speed()

        self._flush()