Get vehicle health report summary.
768095
def get_report(session, vehicle_index):
    """"""
    vhr = get_vehicle_health_report(session, vehicle_index)
    if 'reportCard' not in vhr:
        raise MoparError("no vhr found")
    return _traverse_report(vhr['reportCard'])
1172260
def chassis_info(self, chassis):
        """"""
        if not chassis or not isinstance(chassis, str):
            raise RuntimeError('missing chassis address')
        self._check_session()
        status, data = self._rest.get_request('chassis', chassis)
        return data
830687
def make_report(self):
        """"""
        oq, ds = self.oq, self.dstore
        for name in ('params', 'inputs'):
            self.add(name)
        if 'csm_info' in ds:
            self.add('csm_info')
            if ds['csm_info'].source_models[0].name != 'scenario':
                # required_params_per_trt makes no sense for GMFs from file
                self.add('required_params_per_trt')
            self.add('rlzs_assoc', ds['csm_info'].get_rlzs_assoc())
        if 'csm_info' in ds:
            self.add('ruptures_per_trt')
        if 'rup_data' in ds:
            self.add('ruptures_events')
        if oq.calculation_mode in ('event_based_risk',):
            self.add('avglosses_data_transfer')
        if 'exposure' in oq.inputs:
            self.add('exposure_info')
        if 'source_info' in ds:
            self.add('slow_sources')
            self.add('times_by_source_class')
            self.add('dupl_sources')
        if 'task_info' in ds:
            self.add('task_info')
            tasks = set(ds['task_info'])
            if 'classical' in tasks:
                self.add('task_hazard:0')
                self.add('task_hazard:-1')
            self.add('job_info')
        if 'performance_data' in ds:
            self.add('performance')
        return self.text
602670
def get_extra_vehicle_info(self, authentication_info):
        """"""
        import requests

        base_url = "https://secure.ritassist.nl/GenericServiceJSONP.ashx"
        query = "?f=CheckExtraVehicleInfo" \
                "&token={token}" \
                "&equipmentId={identifier}" \
                "&lastHash=null&padding=false"

        parameters = {
            'token': authentication_info.access_token,
            'identifier': str(self.identifier)
        }

        response = requests.get(base_url + query.format(**parameters))
        json = response.json()

        self.malfunction_light = json['MalfunctionIndicatorLight']
        self.fuel_level = json['FuelLevel']
        self.coolant_temperature = json['EngineCoolantTemperature']
        self.power_voltage = json['PowerVoltage']
1259269
def get_details(self):
        """"""
        body = helpers.req_body(self.manager, 'devicedetail')
        head = helpers.req_headers(self.manager)

        r, _ = helpers.call_api('/131airpurifier/v1/device/deviceDetail',
                                method='post', headers=head, json=body)

        if r is not None and helpers.check_response(r, 'airpur_detail'):
            self.device_status = r.get('deviceStatus', 'unknown')
            self.connection_status = r.get('connectionStatus', 'unknown')
            self.details['active_time'] = r.get('activeTime', 0)
            self.details['filter_life'] = r.get('filterLife', {})
            self.details['screeen_status'] = r.get('screenStatus', 'unknown')
            self.details['mode'] = r.get('mode', 'unknown')
            self.details['level'] = r.get('level', None)
604552
def _GetReportService(self):
    """"""
    if not self._report_service:
      self._report_service = self._ad_manager_client.GetService(
          'ReportService', self._version, self._server)
    return self._report_service
56944
async def info(self):
        """
        {'MasterCapability': 9, 'TransportPort': 3975}
        """
        act = self.service.action("X_GetDeviceInfo")
        res = await act.async_call()
        return res
1263545
def summary_str(self) -> str:
        """"""
        return '{}\n'.format(self) + '\n'.join(
            '{}: {}'.format(label, value)
            for label, value in self._describe_list()
        )
90365
def report(data):
    """"""
    work_dir = dd.get_work_dir(data[0][0])
    out_dir = op.join(work_dir, "report")
    safe_makedir(out_dir)
    summary_file = op.join(out_dir, "summary.csv")
    with file_transaction(summary_file) as out_tx:
        with open(out_tx, 'w') as out_handle:
            out_handle.write("sample_id,%s\n" % _guess_header(data[0][0]))
            for sample in data:
                info = sample[0]
                group = _guess_group(info)
                files = info["seqbuster"] if "seqbuster" in info else "None"
                out_handle.write(",".join([dd.get_sample_name(info),
                                           group]) + "\n")
    _modify_report(work_dir, out_dir)
    return summary_file
709814
def summary(self, indicator_data):
        """"""
        summary = []
        for v in self._value_fields:
            summary.append(indicator_data.get(v, ''))
        return indicator_data.get('summary', ' : '.join(summary))
1257600
def get_overall_services_health(self) -> str:
        
        services_health_status = self.get_services_health()

        # Evaluate overall health
        health_status = all(status == "Healthy" for status in
                            services_health_status.values())

        # Converting from bool to str
        if health_status:
            overall_status = "Healthy"
        else:
            overall_status = "Unhealthy"

        return overall_status
740789
def get_report(self, report_type, qs=None):
        """"""
        if qs is None:
            qs = {}

        url = self.api_url + "/company/{0}/reports/{1}".format(self.company_id, report_type)
        result = self.get(url, params=qs)
        return result
241493
def status(self):
        
        if self.report == None:
            return SentSms.ENROUTE
        else:
            return SentSms.DELIVERED if self.report.deliveryStatus == StatusReport.DELIVERED else SentSms.FAILED
712360
def update_health(self, reporter, info):
        # type: (object, HealthInfo) -> None
        """"""
        with self.changes_squashed:
            alarm = info.alarm
            if alarm.is_ok():
                self._faults.pop(reporter, None)
            else:
                self._faults[reporter] = alarm
            if self._faults:
                # Sort them by severity
                faults = sorted(self._faults.values(),
                                key=lambda a: a.severity.value)
                alarm = faults[-1]
                text = faults[-1].message
            else:
                alarm = None
                text = "OK"
            self.health.set_value(text, alarm=alarm)
658777
def mysummary(self):
    """"""

    if isinstance(self.underlayer, IP):
      return self.underlayer.sprintf("IGMPv3: %IP.src% > %IP.dst% %IGMPv3.type% %IGMPv3.gaddr%")
    else:
      return self.sprintf("IGMPv3 %IGMPv3.type% %IGMPv3.gaddr%")
248619
async def summary(self, show_archived: bool = False) -> dict:
        """"""
        summary_resp = await self._request(
            'post',
            API_URL_BUYER,
            json={
                'version': '1.0',
                'method': 'GetIndexData',
                'param': {
                    'IsArchived': show_archived
                },
                'sourcetype': 0
            })

        _LOGGER.debug('Summary response: %s', summary_resp)

        results = {}
        for kind in summary_resp.get('Json', {}).get('eitem', []):
            results[PACKAGE_STATUS_MAP[kind['e']]] = kind['ec']
        return results
660605
def get_status(api_subject):
  ''' 
  '''
  summary = api_subject.healthSummary
  if summary is None:
    return None
  # status string always starts with "<nagios code>: <summary>"
  status = "%s: %s" % (NAGIOS_CODE_MESSAGES[CM_STATE_CODES[summary]], summary)
  if summary != "GOOD" and summary != "DISABLED":
    # if the summary is CONCERNING or BAD, then append the health checks
    for health_check in api_subject.healthChecks:
      if health_check['summary'] != "GOOD" and health_check['summary'] != "DISABLED":
        status = ("%s, %s=%s" % (status, health_check['name'], health_check['summary']))
  return status