Displays the load status of a service.
        :rtype: dict
971684
def daemon_status(self):
        
        url = self._build_url(constants.DAEMON_STATUS_ENDPOINT)
        json = self.client.get(url, timeout=self.timeout)
        return json
1344672
def status(ctx, services, show_all):
    """"""
    logger.debug("running command %s (%s)", ctx.command.name, ctx.params,
                 extra={"command": ctx.command.name, "params": ctx.params})

    home = ctx.obj["HOME"]
    services_path = os.path.join(home, SERVICES)

    def print_status(service):
        service_dir = os.path.join(services_path, service)
        if os.path.exists(service_dir):
            pidfile = service_dir + ".pid"
            if os.path.exists(pidfile):
                try:
                    with open(pidfile) as fh:
                        pid = int(fh.read().strip())
                    os.kill(pid, 0)
                    status = "running (pid: {})".format(pid)
                except OSError:
                    status = "not running (stale pidfile)"
            else:
                status = "not running"
        else:
            status = "no such service"
        click.secho("{} - {}".format(service, status))

    if show_all:
        for service in next(os.walk(services_path))[1]:
            print_status(service)
    elif services:
        for service in services:
            print_status(service)
    else:
        raise click.UsageError("You must specify a service name or use --show-all")
1250332
def status(self):
        
        data = self._read()
        self._status = YubiKeyUSBHIDStatus(data)
        return self._status
951368
def config_status():
    
    s = boto3.Session()
    client = s.client('config')
    channels = client.describe_delivery_channel_status()[
        'DeliveryChannelsStatus']
    for c in channels:
        print(yaml.safe_dump({
            c['name']: dict(
                snapshot=str(
                    c['configSnapshotDeliveryInfo'].get('lastSuccessfulTime')),
                history=str(
                    c['configHistoryDeliveryInfo'].get('lastSuccessfulTime')),
                stream=str(
                    c['configStreamDeliveryInfo'].get('lastStatusChangeTime'))
            ),
        }, default_flow_style=False))
685784
def status(self, event):
        """"""
        result = AsyncResult(str(event.id))
        return (
            self.CELERY_STATES_TO_HTTP.get(result.state),
            result.info.get('message')
            if result.state in self.CELERY_RESULT_INFO_FOR and result.info
            else event.response.get('message')
        )
192338
def get_status(self):
        
        if self._value == 'loaded':
            status = 'loaded'

        elif not _is_server and self._bundle is not None and self._server_status is not None:
            if not _can_requests:
                raise ImportError("requests module required for external jobs")

            if self._value in ['complete']:
                # then we have no need to bother checking again
                status = self._value
            else:
                url = self._server_status
                logger.info("checking job status on server from {}".format(url))
                # "{}/{}/parameters/{}".format(server, bundleid, self.uniqueid)
                r = requests.get(url, timeout=5)
                try:
                    rjson = r.json()
                except ValueError:
                    # TODO: better exception here - perhaps look for the status code from the response?
                    status = self._value
                else:
                    status = rjson['data']['attributes']['value']

        else:

            if self.status_method == 'exists':
                output_exists = os.path.isfile("_{}.out".format(self.uniqueid))
                if output_exists:
                    status = 'complete'
                else:
                    status = 'unknown'
            else:
                raise NotImplementedError

        # here we'll set the value to be the latest CHECKED status for the sake
        # of exporting to JSON and updating the status for clients.  get_value
        # will still call status so that it will return the CURRENT value.
        self._value = status
        return status
110237
def _show_stat(self):
        
        _show_stat_wrapper_multi_Progress(self.count,
                                          self.last_count, 
                                          self.start_time, 
                                          self.max_count, 
                                          self.speed_calc_cycles,
                                          self.width,
                                          self.q,
                                          self.last_speed,
                                          self.prepend,
                                          self.show_stat,
                                          self.len, 
                                          self.add_args,
                                          self.lock,
                                          self.info_line,
                                          no_move_up=True)
670634
def workload_state_compare(current_workload_state, workload_state):
    
    hierarchy = {'unknown': -1,
                 'active': 0,
                 'maintenance': 1,
                 'waiting': 2,
                 'blocked': 3,
                 }

    if hierarchy.get(workload_state) is None:
        workload_state = 'unknown'
    if hierarchy.get(current_workload_state) is None:
        current_workload_state = 'unknown'

    # Set workload_state based on hierarchy of statuses
    if hierarchy.get(current_workload_state) > hierarchy.get(workload_state):
        return current_workload_state
    else:
        return workload_state
150080
def show(name):
    '''
    
    '''
    ret = {}
    ret['enabled'] = False
    ret['disabled'] = True
    ret['running'] = False
    ret['service_path'] = None
    ret['autostart'] = False
    ret['command_path'] = None

    ret['available'] = available(name)
    if not ret['available']:
        return ret

    ret['enabled'] = enabled(name)
    ret['disabled'] = not ret['enabled']
    ret['running'] = status(name)
    ret['autostart'] = status_autostart(name)
    ret['service_path'] = _get_svc_path(name)[0]
    if ret['service_path']:
        ret['command_path'] = os.path.join(ret['service_path'], 'run')

    # XXX provide info about alias ?

    return ret
70730
@GET
  @Path("/loadStatus")
  @Produces(MediaType.APPLICATION_JSON)
  @Consumes(MediaType.APPLICATION_JSON)
  @ResourceFilters(BasicSecurityResourceFilter.class)
  public Response getLoadStatus(
      @Context HttpServletRequest req
  )
  {
    return handler.getLoadStatus();
  }
234454
def get_task_statuses(self):
        

        params = {'taskstatus': ''}

        resp = self._client.get(self.resource(), params=params)
        self.parse(self._client, resp, obj=self)

        return dict([(task.name, task) for task in self._tasks])
334971
async def get_status_info(self) -> Tuple[str, str, int]:
        """"""
        return await self.gateway.commands.GetStatusInfo()
548920
def show_status(self):
    
    print_header('Attack work statistics')
    self.attack_work.read_all_from_datastore()
    self._show_status_for_work(self.attack_work)
    self._export_work_errors(
        self.attack_work,
        os.path.join(self.results_dir, 'attack_errors.txt'))
    print_header('Defense work statistics')
    self.defense_work.read_all_from_datastore()
    self._show_status_for_work(self.defense_work)
    self._export_work_errors(
        self.defense_work,
        os.path.join(self.results_dir, 'defense_errors.txt'))
675031
def get_instance_status(self):
        
        status_url = self._get_url('status_path')
        res = self.rest_client.session.get(status_url)
        _handle_http_errors(res)
        return res.json()
361002
def getProcessStatus(self):
        
        info_dict = {}
        cur = self._conn.cursor()
        cur.execute("""SHOW FULL PROCESSLIST;""")
        rows = cur.fetchall()
        if rows:
            for row in rows:
                if row[6] == '':
                    state = 'idle'
                elif row[6] is None:
                    state = 'other'
                else:
                    state = str(row[6]).replace(' ', '_').lower()
                info_dict[state] = info_dict.get(state, 0) + 1
        return info_dict
88412
def do_status(self, service):
        
        if service:
            self.do_show("services", single=service)
        else:
            self.do_show("services")
957966
def status(cls):
        """"""
        return cls.json_get('%s/status' % cls.api_url, empty_key=True,
                            send_key=False)