To check the load status of a service.
        :return: a dictionary that include json data.
                 example: { "status": "ok", "running": "0", "pending": "0", "finished": "0", "node_name": "node-name" }
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
114802
def json(self):
        
        return json.dumps(self.dict_rules,
                          sort_keys=True,
                          indent=2,
                          separators=(',', ': '))
675031
def get_instance_status(self):
        
        status_url = self._get_url('status_path')
        res = self.rest_client.session.get(status_url)
        _handle_http_errors(res)
        return res.json()
234454
def get_task_statuses(self):
        

        params = {'taskstatus': ''}

        resp = self._client.get(self.resource(), params=params)
        self.parse(self._client, resp, obj=self)

        return dict([(task.name, task) for task in self._tasks])
812500
def json_output(self):
        
        enabled = self.lib.iperf_get_test_json_output(self._test)

        if enabled:
            self._json_output = True
        else:
            self._json_output = False

        return self._json_output
361002
def getProcessStatus(self):
        
        info_dict = {}
        cur = self._conn.cursor()
        cur.execute("""SHOW FULL PROCESSLIST;""")
        rows = cur.fetchall()
        if rows:
            for row in rows:
                if row[6] == '':
                    state = 'idle'
                elif row[6] is None:
                    state = 'other'
                else:
                    state = str(row[6]).replace(' ', '_').lower()
                info_dict[state] = info_dict.get(state, 0) + 1
        return info_dict
661628
def get_results(self):
        

        return {'status': self.status,
                'error_msg': self.error_msg,
                'k': self.k,
                'x': self.x,
                'lam': self.lam*self.obj_sca,
                'nu': self.nu*self.obj_sca,
                'mu': self.mu*self.obj_sca,
                'pi': self.pi*self.obj_sca}
1209764
def format_status_json(self):
        """"""
        status_json = {}

        status_json['code'] = self.code
        status_json['message'] = self.message

        if self.details is not None:
            status_json['details'] = self.details

        return status_json
525793
def info(self):
        
        pending = 0
        for q in self.queues():
             pending += self.size(q)
        return {
            'pending'   : pending,
            'processed' : Stat('processed',self).get(),
            'queues'    : len(self.queues()),
            'workers'   : len(self.workers()),
            #'working'   : len(self.working()),
            'failed'    : Stat('failed',self).get(),
            'servers'   : ['%s:%s' % (self.host, self.port)]
        }
971684
def daemon_status(self):
        
        url = self._build_url(constants.DAEMON_STATUS_ENDPOINT)
        json = self.client.get(url, timeout=self.timeout)
        return json
147476
def data(self):
        
        try:
            data = self._data
        except AttributeError:
            data = self._data = json.loads(self.json)
        return data
1359303
def json(self):
        
        data = super(CalTRACKHourlyModel, self).json()
        data.update(
            {
                "occupancy_lookup": self.occupancy_lookup.to_json(orient="split"),
                "temperature_bins": self.temperature_bins.to_json(orient="split"),
            }
        )
        return data
1317352
def get_stats(self):
        '''
        
        '''
        resp = requests.get('%s/api/stats.json' % self.url)
        assert(resp.status_code == 200)
        return resp.json()
1138775
def get_run_details_json(self):
        
        run_details_filename = "run_details.json"
        run_details_json_id = dxpy.find_one_data_object(more_ok=False,zero_ok=True,project=self.dx_project_id,name=run_details_filename)["id"]
        json_data = json.loads(dxpy.open_dxfile(dxid=run_details_json_id).read())
        #dxpy.download_dxfile(show_progress=True,dxid=run_details_json_id,project=self.dx_project_id,filename=output_name)
        return json_data
1115351
def parsed(self):
        
        if not self._parsed:

            self._parsed = json.loads(self.content)

        return self._parsed
173407
def json_data(self):
        """"""
        return {
            "info_in_id": self.info_in_id,
            "info_out_id": self.info_out_id,
            "node_id": self.node_id,
            "network_id": self.network_id,
        }
562486
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'gateway_id') and self.gateway_id is not None:
            _dict['gateway_id'] = self.gateway_id
        if hasattr(self, 'status') and self.status is not None:
            _dict['status'] = self.status
        return _dict