Apply status mapping to a raw API result.
6981
def adjust_status(info: dict) -> dict:
    """"""
    modified_info = deepcopy(info)
    modified_info.update({
        'level':
            get_nearest_by_numeric_key(STATUS_MAP, int(info['level'])),
        'level2':
            STATUS_MAP[99] if info['level2'] is None else
            get_nearest_by_numeric_key(STATUS_MAP, int(info['level2']))
    })

    return modified_info
1114573
def handleStatus(self, version, code, message):
        ""
        proxy.ProxyClient.handleStatus(self, version, code, message)
        # client.Response is currently just a container for needed data
        self._response = client.Response(version, code, message, {}, None)
667743
def upload_status(self, upload_id):
        """"""

        path = '/api/1.0/upload/status'
        query = 'id={}'.format(upload_id)
        return self._api_get(definition.DatasetUploadStatusResponse, path, query)
124713
def pull_status(self, param=None, must=[APIKEY]):
        '''
        '''
        param = {} if param is None else param
        r = self.verify_param(param, must)
        if not r.is_succ():
            return r
        h = CommonResultHandler(lambda rsp: {VERSION_V1:rsp[FLOW_STATUS] if FLOW_STATUS in rsp else None, VERSION_V2:rsp}[self.version()])
        return self.path('pull_status.json').post(param, h, r)
792132
def add_result(self, result):
        
        for handler in self._handlers:
            handler(result)
        if self._successful and result.status not in _successful_results:
            self._successful = False
1090637
def get_status(with_version=False):
    """"""
    client = get_status_api()

    with catch_raise_api_exception():
        data, _, headers = client.status_check_basic_with_http_info()

    ratelimits.maybe_rate_limit(client, headers)

    if with_version:
        return data.detail, data.version

    return data.detail
572869
def as_status(cls, obj):
        """"""
        if obj is None: return None
        return obj if isinstance(obj, cls) else cls.from_string(obj)
1007957
def status_get(self, unit):
        """"""
        raw_status, return_code = unit.run(
            "status-get --format=json --include-data")
        if return_code != 0:
            return ("unknown", "")
        status = json.loads(raw_status)
        return (status["status"], status["message"])
824597
def status(self, status, headers=None):
        '''
        
        '''
        self.response = _Response(status, headers)
        return self
469623
def _raise_if_bad_http_status_and_method(self, response):
        
        code = response.status_code
        if code in {200, 202} or \
           (code == 201 and self.method in {'PUT', 'PATCH'}) or \
           (code == 204 and self.method in {'DELETE', 'POST'}):
            return
        raise BadStatus(
            "Invalid return status for {!r} operation".format(self.method))
175116
def update_status(status)
      if status.present?
        RRRSpec.redis.hset(key, 'status', status)
      else
        RRRSpec.redis.hdel(key, 'status')
      end
    end
38847
public HttpClientResponseBuilder withStatus(int statusCode) {
        Action lastAction = newRule.getLastAction();
        StatusResponse statusAction = new StatusResponse(lastAction, statusCode);
        newRule.overrideLastAction(statusAction);
        return this;
    }
1024416
def process_result_value(self, value, dialect):
        """"""
        if value is not None:
            value = simplejson.loads(value)
        return value
763096
def upsert_result(client_site_url, apikey, resource_id, result):
    """"""

    # TODO: Handle exceptions and unexpected results.
    url = client_site_url + u"deadoralive/upsert"
    params = result.copy()
    params["resource_id"] = resource_id
    requests.post(url, headers=dict(Authorization=apikey), params=params)
887862
def process_result(self, context, result_body, exc, content_type):
        
        return process_result(self, context, result_body, exc, content_type)
1108283
def process_raw_data(cls, raw_data):
        """"""
        raw_settings = raw_data.get("qosSettings", {})
        qos_settings = QosSettings.from_raw_data(raw_settings)
        raw_data["qosSettings"] = qos_settings
        return super(PortSettings, cls).process_raw_data(raw_data)
876377
def get_status(self):
        """"""
        req_url = ENDPOINTS["getStatus"].format(self.ip_address, self.zone_id)
        return request(req_url)