/*
Get the current status of a GrabzIt screenshot

id - The id of the screenshot

This function returns a Status object representing the screenshot
348729
public function GetStatus($id)
	{
		if (empty($id))
		{
			return null;
		}

		$result = $this->Get($this->getRootUrl(false) . "getstatus.ashx?id=" . $id);

		$obj = simplexml_load_string($result);

		$status = new GrabzItStatus();
		$status->Processing = ((string)$obj->Processing == GrabzItClient::TrueString);
		$status->Cached = ((string)$obj->Cached == GrabzItClient::TrueString);
		$status->Expired = ((string)$obj->Expired == GrabzItClient::TrueString);
		$status->Message = (string)$obj->Message;

		return $status;
	}
1285115
def _get_async_status(self, response):
        
        if self._is_empty(response):
            return None
        body = response.json()
        return body.get('status')
263786
def status(task_id)
      uri = 'api/status'
      params = {
        appkey: @appkey,
        timestamp: Time.now.to_i,
        task_id: task_id
      }
      request(uri, params)
    end
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
412822
def get_status(self, statusid):

        

        response = self._req('/user/statuses/{}'.format(statusid))

        s = Status()
        s.from_dict(response)

        return s
447587
@Override
    public BatchStatus getStatus(String snapshotId) throws SnapshotNotFoundException, SnapshotException {

        checkInitialized();
        JobExecution ex = getJobExecution(this.snapshotRepo.findByName(snapshotId));
        if (ex == null) {
            return BatchStatus.UNKNOWN;
        } else {
            return ex.getStatus();
        }
    }
856952
function _getResponseStatus(handler, req, callback) {
        // Number
        if (!_(handler.reply.status).isFunction()) {
            return callback(handler.reply.status || 0);
        }

        // Synch function
        return callback(handler.reply.status(req) || 0);
    }
381264
def status(self):
        ''''''
        transfered = self.download - self.prev_download
        now = time.time()
        interval = now - self.last_status_time
        self.last_status_time = now
        return("DFLogger: %(state)s Rate(%(interval)ds):%(rate).3fkB/s Block:%(block_cnt)d Missing:%(missing)d Fixed:%(fixed)d Abandoned:%(abandoned)d" %
              {"interval": interval,
               "rate": transfered/(interval*1000),
               "block_cnt": self.block_cnt,
               "missing": len(self.missing_blocks),
               "fixed": self.missing_found,
               "abandoned": self.abandoned,
               "state": "Inactive" if self.stopped else "Active"
           })
369318
function pull_status(array $param) {
        static $must = [self::APIKEY];
        $r = $this->verifyParam($param, $must);
        if (!$r->isSucc()) return $r;
        
        $v = $this->version();
        $h = new CommonResultHandler(function ($rsp) use ($v) {
            switch ($v) {
                case self::VERSION_V1:
                    return $rsp[self::VOICE_STATUS];
                case self::VERSION_V2:
                    return $rsp;
            }
            return null;
        });
        return $this->path("pull_status.json")->post($param, $h, $r);
    }
1340983
function getStatus(url, callback) {
  var client = new HttpClient(url);
  var executor = new Executor(client);
  var command = new Command(CommandName.GET_SERVER_STATUS);
  executor.execute(command, function(err, responseObj) {
    if (err) return callback(err);
    try {
      checkResponse(responseObj);
    } catch (ex) {
      return callback(ex);
    }
    callback(null, responseObj['value']);
  });
}
277118
function status( $asObject = false )
    {
        if ( $asObject )
            return eZOrderStatus::fetch( $this->StatusID );
        else
            return $this->StatusID;
    }
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
1189209
def status(self):
        ''''''
        if self.download is None:
            return "Not started"

        transferred = self.download - self.prev_download
        self.prev_download = self.download
        now = time.time()
        interval = now - self.last_status_time
        self.last_status_time = now
        return("DFLogger: %(state)s Rate(%(interval)ds):%(rate).3fkB/s "
               "Block:%(block_cnt)d Missing:%(missing)d Fixed:%(fixed)d "
               "Abandoned:%(abandoned)d" %
               {"interval": interval,
                "rate": transferred/(interval*1000),
                "block_cnt": self.last_seqno,
                "missing": len(self.missing_blocks),
                "fixed": self.missing_found,
                "abandoned": self.abandoned,
                "state": "Inactive" if self.stopped else "Active"})
823651
public Status getStatus(CmsUUID id) {

        CmsDetailPageInfo info = m_infoById.get(id);
        if (info == null) {
            return Status.noDetailPage;
        }
        String type = info.getType();
        int index = m_map.get(type).indexOf(info);
        if (index == 0) {
            return Status.firstDetailPage;
        }
        return Status.otherDetailPage;
    }
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)
1057870
def get_async_doc_status(id, opts = {})
      data, _status_code, _headers = get_async_doc_status_with_http_info(id, opts)
      return data
    end
1278782
function pollStatusFile(fileKey) {
  return poll(function onPoll(onSuccess, onError, next) {
    /*
    1. Read status file content
    2. Check if we're done -> call onSuccess
       Check if it failed  -> call onError
       Otherwise call next
     */
    getFromStorage(fileKey, { type: "json", cdn: false }).then(function checkContent(content) {
      if (content && content.params) {
        switch (content.params.status) {
          case 'SUCCESS':
            onSuccess(content.params.data)
            break
          case 'PROCESSING':
          case 'ENQUEUED':
            next()
            break
          default:
            onError(content.params.data)
        }
      }
    })
  })
}