queries the database and returns that status of the item.

        args:
            status_item: the name of the item to check
543173
def get(self, status_item):
        
        lg = logging.getLogger("%s.%s" % (self.ln, inspect.stack()[0][3]))
        lg.setLevel(self.log_level)

        sparql = '''
            SELECT ?loaded
            WHERE {{
                kdr:{0} kds:{1} ?loaded .
            }}'''
        value = self.conn.query(sparql=sparql.format(self.group, status_item))
        if len(value) > 0 and \
                cbool(value[0].get('loaded',{}).get("value",False)):
            return True
        else:
            return False
28644
def query_apsupsd_status():
    
    import subprocess
    output = {}
    try:
        apc_status = subprocess.check_output("/sbin/apcaccess")
    except:
        return None
    output['timestamp'] = time()
    for line in apc_status.split('\n'):
        (key, spl, val) = line.partition(': ')
        key = key.rstrip().upper()
        val = val.strip()
        val = val.split(' ')[0]
        if key == 'STATUS':
            output[key] = True if val.upper() == 'ONLINE' else False
        elif key in ['LINEV', 'BATTV', 'BCHARGE', 'TIMELEFT', 'LOADPCT']:
            output[key] = float(val)

    return output
957966
def status(cls):
        """"""
        return cls.json_get('%s/status' % cls.api_url, empty_key=True,
                            send_key=False)
333943
def check_status(status):
    
    if status:
        msg = lib.DftiErrorMessage(status)
        msg = ctypes.c_char_p(msg).value
        raise RuntimeError(msg)
782950
def check(self, item_id):
        
        try:
            return self.jbx.info(item_id).get('status').lower() == 'finished'
        except jbxapi.JoeException:
            return False

        return False
1113644
def do_status(self, _):
        '''  '''
        server_status = self.server.is_server_running()
        if server_status == 'yes':
            print 'Server: ' + colorize('currently online', 'green')
        elif server_status == 'no':
            print 'Server: ' + colorize('currently offline', 'red')
        elif server_status == 'maybe':
            print 'Server: ' + colorize('status unknown', 'yellow')
        elif server_status == 'blocked':
            print 'Server: ' + colorize('blocked', 'red')
800455
def status(self, column=None, value=None, **kwargs):
        
        return self._resolve_call('GIC_STATUS', column, value, **kwargs)
225831
def get(self, item, default_value=None):
        

        found, name = self._contains_and_name(item)
        if found:
            return self._record_map[name]['value']
        else:
            return default_value
431681
def status(self, **kwargs):
        
        self.services = dict(
            init_system=self.init_system,
            services=[]
        )
747094
def status(self, return_json=False):
        

        def tabular_print(title, value):
            """
            Convenience function for priting formatted table items.
            """
            click.echo('%-*s%s' % (32, click.style("\t" + title, fg='green') + ':', str(value)))
            return

        # Lambda Env Details
        lambda_versions = self.zappa.get_lambda_function_versions(self.lambda_name)

        if not lambda_versions:
            raise ClickException(click.style("No Lambda %s detected in %s - have you deployed yet?" %
                                             (self.lambda_name, self.zappa.aws_region), fg='red'))

        status_dict = collections.OrderedDict()
        status_dict["Lambda Versions"] = len(lambda_versions)
        function_response = self.zappa.lambda_client.get_function(FunctionName=self.lambda_name)
        conf = function_response['Configuration']
        self.lambda_arn = conf['FunctionArn']
        status_dict["Lambda Name"] = self.lambda_name
        status_dict["Lambda ARN"] = self.lambda_arn
        status_dict["Lambda Role ARN"] = conf['Role']
        status_dict["Lambda Handler"] = conf['Handler']
        status_dict["Lambda Code Size"] = conf['CodeSize']
        status_dict["Lambda Version"] = conf['Version']
        status_dict["Lambda Last Modified"] = conf['LastModified']
        status_dict["Lambda Memory Size"] = conf['MemorySize']
        status_dict["Lambda Timeout"] = conf['Timeout']
        status_dict["Lambda Runtime"] = conf['Runtime']
        if 'VpcConfig' in conf.keys():
            status_dict["Lambda VPC ID"] = conf.get('VpcConfig', {}).get('VpcId', 'Not assigned')
        else:
            status_dict["Lambda VPC ID"] = None

        # Calculated statistics
        try:
            function_invocations = self.zappa.cloudwatch.get_metric_statistics(
                                       Namespace='AWS/Lambda',
                                       MetricName='Invocations',
                                       StartTime=datetime.utcnow()-timedelta(days=1),
                                       EndTime=datetime.utcnow(),
                                       Period=1440,
                                       Statistics=['Sum'],
                                       Dimensions=[{'Name': 'FunctionName',
                                                    'Value': '{}'.format(self.lambda_name)}]
                                       )['Datapoints'][0]['Sum']
        except Exception as e:
            function_invocations = 0
        try:
            function_errors = self.zappa.cloudwatch.get_metric_statistics(
                                       Namespace='AWS/Lambda',
                                       MetricName='Errors',
                                       StartTime=datetime.utcnow()-timedelta(days=1),
                                       EndTime=datetime.utcnow(),
                                       Period=1440,
                                       Statistics=['Sum'],
                                       Dimensions=[{'Name': 'FunctionName',
                                                    'Value': '{}'.format(self.lambda_name)}]
                                       )['Datapoints'][0]['Sum']
        except Exception as e:
            function_errors = 0

        try:
            error_rate = "{0:.2f}%".format(function_errors / function_invocations * 100)
        except:
            error_rate = "Error calculating"
        status_dict["Invocations (24h)"] = int(function_invocations)
        status_dict["Errors (24h)"] = int(function_errors)
        status_dict["Error Rate (24h)"] = error_rate

        # URLs
        if self.use_apigateway:
            api_url = self.zappa.get_api_url(
                self.lambda_name,
                self.api_stage)

            status_dict["API Gateway URL"] = api_url

            # Api Keys
            api_id = self.zappa.get_api_id(self.lambda_name)
            for api_key in self.zappa.get_api_keys(api_id, self.api_stage):
                status_dict["API Gateway x-api-key"] = api_key

            # There literally isn't a better way to do this.
            # AWS provides no way to tie a APIGW domain name to its Lambda function.
            domain_url = self.stage_config.get('domain', None)
            base_path = self.stage_config.get('base_path', None)
            if domain_url:
                status_dict["Domain URL"] = 'https://' + domain_url
                if base_path:
                    status_dict["Domain URL"] += '/' + base_path
            else:
                status_dict["Domain URL"] = "None Supplied"

        # Scheduled Events
        event_rules = self.zappa.get_event_rules_for_lambda(lambda_arn=self.lambda_arn)
        status_dict["Num. Event Rules"] = len(event_rules)
        if len(event_rules) > 0:
            status_dict['Events'] = []
        for rule in event_rules:
            event_dict = {}
            rule_name = rule['Name']
            event_dict["Event Rule Name"] = rule_name
            event_dict["Event Rule Schedule"] = rule.get(u'ScheduleExpression', None)
            event_dict["Event Rule State"] = rule.get(u'State', None).title()
            event_dict["Event Rule ARN"] = rule.get(u'Arn', None)
            status_dict['Events'].append(event_dict)

        if return_json:
            # Putting the status in machine readable format
            # https://github.com/Miserlou/Zappa/issues/407
            print(json.dumpsJSON(status_dict))
        else:
            click.echo("Status for " + click.style(self.lambda_name, bold=True) + ": ")
            for k, v in status_dict.items():
                if k == 'Events':
                    # Events are a list of dicts
                    for event in v:
                        for item_k, item_v in event.items():
                            tabular_print(item_k, item_v)
                else:
                    tabular_print(k, v)

        # TODO: S3/SQS/etc. type events?

        return True
554930
def get_proc_return_status(self):
        
        if self._session is None:
            return None
        if not self._session.has_status:
            self._session.find_return_status()
        return self._session.ret_status if self._session.has_status else None
885842
def status(self):
        
        message = self.end_message if self.end_message else self.start_message
        if message:
            return message.contents[ACTION_STATUS_FIELD]
        else:
            return None
1290218
def get_statuses(self, batch_ids):
        
        with self._lock:
            return {b: self.get_status(b) for b in batch_ids}
14521
def get_transaction_status(self, transactionId):
        
        params = {}
        params['TransactionId'] = transactionId
    
        response = self.make_request("GetTransactionStatus", params)
        body = response.read()
        if(response.status == 200):
            rs = ResultSet()
            h = handler.XmlHandler(rs, self)
            xml.sax.parseString(body, h)
            return rs
        else:
            raise FPSResponseError(response.status, response.reason, body)
371625
def get_connection_status(self, connection_id):
        
        with self._connections_lock:
            try:
                connection_info = self._connections[connection_id]
                return connection_info.status
            except KeyError:
                return None
484187
def check_status(self, delay=0):
        
        if not self.item_id:
            while not self._request_status():
                # wait until _request_status returns True
                yield self.status, self.completion_percentage
                if self.item_id is None:
                    sleep(delay)
        else:
            yield self.status, self.completion_percentage
649838
def show_item(name, id_):
    '''
    
    '''
    status, result = _query(action=name, command=id_)
    return result