Try to normalize the HAProxy status as one of the statuses defined in `ALL_STATUSES`,
        if it can't be matched return the status as-is in a tag-friendly format
        ex: 'UP 1/2' -> 'up'
            'no check' -> 'no_check'
964949
def _normalize_status(status):
        
        formatted_status = status.lower().replace(" ", "_")
        for normalized_status in Services.ALL_STATUSES:
            if formatted_status.startswith(normalized_status):
                return normalized_status
        return formatted_status
891090
def assert_service_check(self, name, status=None, tags=None, count=None, at_least=1, hostname=None, message=None):
        
        tags = normalize_tags(tags, sort=True)
        candidates = []
        for sc in self.service_checks(name):
            if status is not None and status != sc.status:
                continue

            if tags and tags != sorted(sc.tags):
                continue

            if hostname is not None and hostname != sc.hostname:
                continue

            if message is not None and message != sc.message:
                continue

            candidates.append(sc)

        if count is not None:
            msg = "Needed exactly {} candidates for '{}', got {}".format(count, name, len(candidates))
            assert len(candidates) == count, msg
        else:
            msg = "Needed at least {} candidates for '{}', got {}".format(at_least, name, len(candidates))
            assert len(candidates) >= at_least, msg
138972
def change_status(self, bucket, key, status, cond):
        
        resource = entry(bucket, key)
        if cond and isinstance(cond, dict):
            condstr = ""
            for k, v in cond.items():
                condstr += "{0}={1}&".format(k, v)
            condstr = urlsafe_base64_encode(condstr[:-1])
            return self.__rs_do('chstatus', resource, 'status/{0}'.format(status), 'cond', condstr)
        return self.__rs_do('chstatus', resource, 'status/{0}'.format(status))
1277397
def raise_for_status(self):
        '''
        
        '''
        if 400 <= self.status_code < 500:
            raise BadStatus('{} Client Error: {} for url: {}'.format(self.status_code, self.reason_phrase, self.url), self.status_code)
        elif 500 <= self.status_code < 600:
            raise BadStatus('{} Server Error: {} for url: {}'.format(self.status_code, self.reason_phrase, self.url), self.status_code)
226139
def _check_status(status):
        
        if status == 0:
            # When there are no results, just return.
            return
        if status == 1:
            raise GeocoderServiceError(
                'Internal server error.'
            )
        elif status == 2:
            raise GeocoderQueryError(
                'Invalid request.'
            )
        elif status == 3:
            raise GeocoderAuthenticationFailure(
                'Authentication failure.'
            )
        elif status == 4:
            raise GeocoderQuotaExceeded(
                'Quota validate failure.'
            )
        elif status == 5:
            raise GeocoderQueryError(
                'AK Illegal or Not Exist.'
            )
        elif status == 101:
            raise GeocoderAuthenticationFailure(
                'No AK'
            )
        elif status == 102:
            raise GeocoderAuthenticationFailure(
                'MCODE Error'
            )
        elif status == 200:
            raise GeocoderAuthenticationFailure(
                'Invalid AK'
            )
        elif status == 211:
            raise GeocoderAuthenticationFailure(
                'Invalid SN'
            )
        elif 200 <= status < 300:
            raise GeocoderAuthenticationFailure(
                'Authentication Failure'
            )
        elif 300 <= status < 500:
            raise GeocoderQuotaExceeded(
                'Quota Error.'
            )
        else:
            raise GeocoderQueryError('Unknown error. Status: %r' % status)
129385
protected InstanceInfo.Status translateState(HealthStatus status) {
        if (status.equals(HealthStatus.UP)) {
            return InstanceInfo.Status.UP;
        }
        return InstanceInfo.Status.DOWN;
    }
483145
def status_mercurial(path, ignore_set, options):
    
    lines = run(['hg', '--config', 'extensions.color=!', 'st'], cwd=path)
    subrepos = ()
    return [b' ' + l for l in lines if not l.startswith(b'?')], subrepos
273821
def set_status(self, status: Status, increment_try_count: bool=True,
                   filename: str=None):
        '''
        '''
        url = self.url_record.url
        assert not self._try_count_incremented, (url, status)

        if increment_try_count:
            self._try_count_incremented = True

        _logger.debug(__('Marking URL {0} status {1}.', url, status))

        url_result = URLResult()
        url_result.filename = filename

        self.app_session.factory['URLTable'].check_in(
            url,
            status,
            increment_try_count=increment_try_count,
            url_result=url_result,
        )

        self._processed = True
44349
def _update_statuses(self, sub_job_num=None):
        
        # initialize status dictionary
        status_dict = dict()

        for val in CONDOR_JOB_STATUSES.values():
            status_dict[val] = 0

        for node in self.node_set:
            job = node.job
            try:
                job_status = job.status
                status_dict[job_status] += 1
            except (KeyError, HTCondorError):
                status_dict['Unexpanded'] += 1

        return status_dict
832083
def normalize_status_code(code)
      status_code = if code.is_a?(Symbol)
                      Rack::Utils::SYMBOL_TO_STATUS_CODE[code]
                    else
                      code
                    end

      # API Gateway requires status to be String but local rack is okay with either
      # Note, ELB though requires status to be an Integer. We'll later in rack/adapter.rb
      # adjust status to an Integer if request is coming from an ELB.
      (status_code || 200).to_s
    end
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))
1179081
def get_flag_status(self, name):
        
        f = self.get_flags(name)
        if not f:
            return None

        # This method works only for simple flags that have only one
        # value set.
        assert len(f) <= 1

        return f[0]['status']
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
572869
def as_status(cls, obj):
        """"""
        if obj is None: return None
        return obj if isinstance(obj, cls) else cls.from_string(obj)
920292
def status(DomainName,
             region=None, key=None, keyid=None, profile=None):
    '''
    

    '''

    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
    try:
        domain = conn.describe_elasticsearch_domain(DomainName=DomainName)
        if domain and 'DomainStatus' in domain:
            domain = domain.get('DomainStatus', {})
            keys = ('Endpoint', 'Created', 'Deleted',
                    'DomainName', 'DomainId', 'EBSOptions', 'SnapshotOptions',
                    'AccessPolicies', 'Processing', 'AdvancedOptions', 'ARN',
                    'ElasticsearchVersion')
            return {'domain': dict([(k, domain.get(k)) for k in keys if k in domain])}
        else:
            return {'domain': None}
    except ClientError as e:
        return {'error': __utils__['boto3.get_error'](e)}
1202650
def extract_status(self, status_headers):
        
        self['status'] = status_headers.get_statuscode()
        if not self['status']:
            self['status'] = '-'
        elif self['status'] == '204' and 'Error' in status_headers.statusline:
            self['status'] = '-'