Return if status match the current host status

        :param status: status to compare ( "o", "d", "x"). Usually comes from config files
        :type status: str
        :return: True if status <=> self.status, otherwise False
        :rtype: bool
767758
def is_state(self, status):
        
        if status == self.state:
            return True
        # Now low status
        if status == 'o' and self.state == u'UP':
            return True
        if status == 'd' and self.state == u'DOWN':
            return True
        if status in ['u', 'x'] and self.state == u'UNREACHABLE':
            return True
        return False
85355
def status(self, *args, priority=0):
        ''
        k = (priority, args)
        self.statuses[k] = self.statuses.get(k, 0) + 1

        if self.statusHistory:
            prevpri, prevargs, prevn = self.statusHistory[-1]
            if prevpri == priority and prevargs == args:
                self.statusHistory[-1][2] += 1
                return True

        self.statusHistory.append([priority, args, 1])
        return True
823489
def _check_status(status):
    """"""
    if status != constants.STATUS_SUCCESS:
        exception = STATUS_TO_EXCEPTION.get(status, CairoError)
        status_name = ffi.string(ffi.cast("cairo_status_t", status))
        message = 'cairo returned %s: %s' % (
            status_name, ffi.string(cairo.cairo_status_to_string(status)))
        raise exception(message, status)
430474
def modem_configuration(self, host, port):
        
        request = {
            "command": "modem_configuration",
            "host": host,
            "port": port
        }
        status = self._check_command_response_status(request)
        return status
435807
def status(self, indices=None):
        
        path = self.conn._make_path(indices, (), '_status', allow_all_indices=False)
        return self.conn._send_request('GET', path)
786433
def status(self):
        ''''''
        message = self.status_message
        if message is None:
            message = STATUS[self.status_code]
        return '%s %s' % (self.status_code, message)
139229
def status(reset=None):
    '''
        
    '''
    global RECEIVED_INDICATION_DICT
    for host, count in six.iteritems(RECEIVED_INDICATION_DICT):
        print('Host %s Received %s indications' % (host, count))
        
    if reset:
        for host in RECEIVED_INDICATION_DICT:
            RECEIVED_INDICATION_DICT[host] = 0
            print('Host %s Reset: Received %s indications' %
                  (host, RECEIVED_INDICATION_DICT[host]))
        print('counts reset to 0')
463137
def get_status(self):
        

        codes = [error['status'] for error in self.errors]
        same = all(code == codes[0] for code in codes)

        if not same and codes[0].startswith('4'):
            return falcon.HTTP_400
        elif not same and codes[0].startswith('5'):
            return falcon.HTTP_500
        else:
            return codes[0]
447995
def status(self, status_id, raise_exception_on_failure=False):
        """"""
        query = {"output": "json", "user_credentials": self.api_key}

        resp = requests.get(
            "%sstatus/%s" % (self._url, status_id), params=query, timeout=self._timeout
        )

        if raise_exception_on_failure and resp.status_code != 200:
            raise DocumentStatusFailure(resp.content, resp.status_code)

        if resp.status_code == 200:
            as_json = json.loads(resp.content)
            if as_json["status"] == "completed":
                as_json["download_key"] = _get_download_key(as_json["download_url"])
            return as_json
        return resp
388778
def get_status(self):
        
        if self.status is not None:
            return self.status
        if self.subsection == "dmdSec":
            if self.older is None:
                return "original"
            else:
                return "updated"
        if self.subsection in ("techMD", "rightsMD"):
            # TODO how to handle ones where newer has been deleted?
            if self.newer is None:
                return "current"
            else:
                return "superseded"
        return None
1191806
def status(zpool=None):
    '''
    

    '''
    ret = OrderedDict()

    ## collect status output
    res = __salt__['cmd.run_all'](
        __utils__['zfs.zpool_command']('status', target=zpool),
        python_shell=False,
    )

    if res['retcode'] != 0:
        return __utils__['zfs.parse_command_result'](res)

    # NOTE: command output for reference
    # =====================================================================
    #   pool: data
    #  state: ONLINE
    #   scan: scrub repaired 0 in 2h27m with 0 errors on Mon Jan  8 03:27:25 2018
    # config:
    #
    #     NAME                       STATE     READ WRITE CKSUM
    #     data                       ONLINE       0     0     0
    #       mirror-0                 ONLINE       0     0     0
    #         c0tXXXXCXXXXXXXXXXXd0  ONLINE       0     0     0
    #         c0tXXXXCXXXXXXXXXXXd0  ONLINE       0     0     0
    #         c0tXXXXCXXXXXXXXXXXd0  ONLINE       0     0     0
    #
    # errors: No known data errors
    # =====================================================================

    ## parse status output
    # NOTE: output is 'key: value' except for the 'config' key.
    #       mulitple pools will repeat the output, so if switch pools if
    #       we see 'pool:'
    current_pool = None
    current_prop = None
    for zpd in res['stdout'].splitlines():
        if zpd.strip() == '':
            continue
        if ':' in zpd:
            # NOTE: line is 'key: value' format, we just update a dict
            prop = zpd.split(':')[0].strip()
            value = ":".join(zpd.split(':')[1:]).strip()
            if prop == 'pool' and current_pool != value:
                current_pool = value
                ret[current_pool] = OrderedDict()
            if prop != 'pool':
                ret[current_pool][prop] = value

            current_prop = prop
        else:
            # NOTE: we append the line output to the last property
            #       this should only happens once we hit the config
            #       section
            ret[current_pool][current_prop] = "{0}\n{1}".format(
                ret[current_pool][current_prop],
                zpd
            )

    ## parse config property for each pool
    # NOTE: the config property has some structured data
    #       sadly this data is in a different format than
    #       the rest and it needs further processing
    for pool in ret:
        if 'config' not in ret[pool]:
            continue
        header = None
        root_vdev = None
        vdev = None
        dev = None
        rdev = None
        config = ret[pool]['config']
        config_data = OrderedDict()
        for line in config.splitlines():
            # NOTE: the first line is the header
            #       we grab all the none whitespace values
            if not header:
                header = line.strip().lower()
                header = [x for x in header.split(' ') if x not in ['']]
                continue

            # NOTE: data is indented by 1 tab, then multiples of 2 spaces
            #       to differential root vdev, vdev, and dev
            #
            #       we just strip the intial tab (can't use .strip() here)
            if line[0] == "\t":
                line = line[1:]

            # NOTE: transform data into dict
            stat_data = OrderedDict(list(zip(
                header,
                [x for x in line.strip().split(' ') if x not in ['']],
            )))

            # NOTE: decode the zfs values properly
            stat_data = __utils__['zfs.from_auto_dict'](stat_data)

            # NOTE: store stat_data in the proper location
            if line.startswith(' ' * 6):
                rdev = stat_data['name']
                config_data[root_vdev][vdev][dev][rdev] = stat_data
            elif line.startswith(' ' * 4):
                rdev = None
                dev = stat_data['name']
                config_data[root_vdev][vdev][dev] = stat_data
            elif line.startswith(' ' * 2):
                rdev = dev = None
                vdev = stat_data['name']
                config_data[root_vdev][vdev] = stat_data
            else:
                rdev = dev = vdev = None
                root_vdev = stat_data['name']
                config_data[root_vdev] = stat_data

            # NOTE: name already used as identifier, drop duplicate data
            del stat_data['name']

        ret[pool]['config'] = config_data

    return ret
349211
def get_load_status(self):
        
        url, method = self.command_set['daemonstatus'][0], self.command_set['daemonstatus'][1]
        response = http_utils.request(url, method_type=method, return_type=http_utils.RETURN_JSON)
        if response is None:
            logging.warning('%s failure: not found or connection fail' % sys._getframe().f_code.co_name)
            response = DaemonStatus().__dict__
        return response
718452
def status(self) -> str:
        """"""
        # As status is a modifiable property, have to reload from the db.
        self._config = self._load_config()
        return self._config.get('status')
383072
def show_status(self, status):
        
        statuses = self.get_statuses()
        statuses = [x for x in statuses if x['value'] == status]
        if len(statuses) == 0:
            raise Exception("Unknown status value")
        else:
            return statuses[0]
553565
def status(self, value):
        
        if self._bug.get('id', None):
            if value in VALID_STATUS:
                self._bug['status'] = value
            else:
                raise BugException("Invalid status type was used")
        else:
            raise BugException("Can not set status unless there is a bug id."
                               " Please call Update() before setting")
1261252
def _get_status(host, services, zconf, path):
    

    if not host:
        for service in services.copy():
            service_info = get_info_from_service(service, zconf)
            host, _ = get_host_from_service_info(service_info)
            if host:
                _LOGGER.debug("Resolved service %s to %s", service, host)
                break

    req = CC_SESSION.get(FORMAT_BASE_URL.format(host) + path, timeout=10)

    req.raise_for_status()

    # The Requests library will fall back to guessing the encoding in case
    # no encoding is specified in the response headers - which is the case
    # for the Chromecast.
    # The standard mandates utf-8 encoding, let's fall back to that instead
    # if no encoding is provided, since the autodetection does not always
    # provide correct results.
    if req.encoding is None:
        req.encoding = 'utf-8'

    return req.json()
431681
def status(self, **kwargs):
        
        self.services = dict(
            init_system=self.init_system,
            services=[]
        )