Gets a client summary object.

    Returns:
      rdf_client.ClientSummary
    Raises:
      ValueError: on bad cloud type
325184
def GetSummary(self):
    
    summary = rdf_client.ClientSummary()
    summary.client_id = self.client_id
    summary.timestamp = self.timestamp

    summary.system_info.release = self.os_release
    summary.system_info.version = str(self.os_version or "")
    summary.system_info.kernel = self.kernel
    summary.system_info.machine = self.arch
    summary.system_info.install_date = self.install_time
    kb = self.knowledge_base
    if kb:
      summary.system_info.fqdn = kb.fqdn
      summary.system_info.system = kb.os
      summary.users = kb.users
      summary.interfaces = self.interfaces
      summary.client_info = self.startup_info.client_info
      if kb.os_release:
        summary.system_info.release = kb.os_release
        if kb.os_major_version:
          summary.system_info.version = "%d.%d" % (kb.os_major_version,
                                                   kb.os_minor_version)

    hwi = self.hardware_info
    if hwi:
      summary.serial_number = hwi.serial_number
      summary.system_manufacturer = hwi.system_manufacturer
      summary.system_uuid = hwi.system_uuid

    cloud_instance = self.cloud_instance
    if cloud_instance:
      summary.cloud_type = cloud_instance.cloud_type
      if cloud_instance.cloud_type == "GOOGLE":
        summary.cloud_instance_id = cloud_instance.google.unique_id
      elif cloud_instance.cloud_type == "AMAZON":
        summary.cloud_instance_id = cloud_instance.amazon.instance_id
      else:
        raise ValueError("Bad cloud type: %s" % cloud_instance.cloud_type)
    return summary
1128640
def get_client_data(self, client):
        
        data = self._request('GET', '/clients/{}'.format(client))
        return data.json()
611269
def fetch_summary(self):
        
        self.response_from()
        #should really clean up the triple nest
        for k,v in self.response.items():
            if not isinstance(v,dict):
                setattr(self,k,v)
            else:
                for subk,subv in v.items():
                    if not isinstance(subv,dict):
                        setattr(self,subk,subv)
                    else:
                        for ssk,ssv in subv.items():
                            setattr(self,ssk,ssv)
        self.fetched_summary = True
1197599
def get(self, id, no_summary=False):
        
        resp = self.client.accounts.get(id)
        if no_summary:
            return self.display(resp)

        results = []
        # Get a list of all volumes for this tenant id
        client = LunrClient(self.get_admin(), debug=self.debug)
        volumes = client.volumes.list(account_id=resp['id'])
        #volumes = self.client.volumes.list(resp['id'])
        for volume in volumes:
            if volume['status'] == 'DELETED':
                continue
            results.append(volume)

        self.display(resp, ['name', 'status', 'last_modified', 'created_at'])
        if results:
            return self.display(response(results, 200),
                                ['id', 'status', 'size'])
        else:
            print("-- This account has no active volumes --")
        print("\nThis is a summary, use --no-summary "
              "to see the entire response")
1077006
def system_summary(providername=None):
    
    _providername = providername
    if not _providername:
        _providername = provider_check()

    import_str = 'netshowlib.%s.system_summary' % _providername
    return import_module(import_str).SystemSummary()
1288300
def get_summaries(client, filter=None):
    
    try:
        index = 0
        while True:
            rb = _RightBarPage(client, index)

            summaries = rb.summaries()
            if filter is not None:
                summaries = filter.filter(summaries)

            for summary in summaries:
                    yield summary

            index += len(summaries)
    except StopIteration:
        pass
290315
def _ExtractRequestSummaryFields(document):
  
  headers = document.childAtPath('Header/RequestHeader')
  body = document.childAtPath('Body')

  summary_fields = {
      'methodName': body.getChildren()[0].name
  }

  # Extract AdWords-specific fields if they exist.
  # Note: We need to check if None because this will always evaluate False.
  client_customer_id = headers.getChild('clientCustomerId')
  if client_customer_id is not None:
    summary_fields['clientCustomerId'] = client_customer_id.text

  # Extract Ad Manager-specific fields if they exist.
  # Note: We need to check if None because this will always evaluate False.
  network_code = headers.getChild('networkCode')
  if network_code is not None:
    summary_fields['networkCode'] = network_code.text

  return summary_fields
178059
def _get_client_fqdn(self, client_info_contents):
    
    yamldict = yaml.safe_load(client_info_contents)
    fqdn = yamldict['system_info']['fqdn']
    client_id = yamldict['client_id'].split('/')[1]
    return client_id, fqdn
331346
def _get_client(self):
        
        client_kwargs = self._storage_parameters.get('client', dict())

        # Handles unsecure mode
        if self._unsecure:
            client_kwargs = client_kwargs.copy()
            client_kwargs['use_ssl'] = False

        return self._get_session().client("s3", **client_kwargs)
1199279
def get_client_nowait(self):
        
        if self.__sem is not None:
            if self.__sem._value == 0:
                return None
            self.__sem.acquire()
        _, client = self._get_client_from_pool_or_make_it()
        return client
661665
def ReadClientStats(self, client_id,
                      min_timestamp,
                      max_timestamp
                     ):
    """"""
    results = []
    for timestamp, stats in iteritems(self.client_stats[client_id]):
      if min_timestamp <= timestamp <= max_timestamp:
        results.append(stats)
    return results
952995
def GetClientsByStatus(self):
    """"""
    started = self.GetClients()
    completed = self.GetCompletedClients()
    outstanding = started - completed

    return {
        "STARTED": started,
        "COMPLETED": completed,
        "OUTSTANDING": outstanding
    }
162358
public String summarize()
    {
        return String.format(SUMMARY_FORMAT,
                ticket,
                action,
                (client != null ? client.getServiceNumber() : 0),
                (client != null ? client.getNumber() : 0),
                (client != null ? client.getClientId() : 0),
                (client != null ? client.getClientSecret() : null),
                (client != null ? client.getClientType() : null),
                (client != null ? client.getDeveloper() : null),
                display,
                maxAge,
                Utils.stringifyScopeNames(scopes),
                Utils.join(uiLocales, " "),
                Utils.join(claimsLocales, " "),
                Utils.join(claims, " "),
                acrEssential,
                clientIdAliasUsed,
                Utils.join(acrs, " "),
                subject,
                loginHint,
                lowestPrompt,
                Utils.stringifyPrompts(prompts)
                );
    }
1022396
def summarize(self, host):
        '''  '''

        return dict(
            ok          = self.ok.get(host, 0),
            failures    = self.failures.get(host, 0),
            unreachable = self.dark.get(host,0),
            changed     = self.changed.get(host, 0),
            skipped     = self.skipped.get(host, 0)
        )
1143060
public String summarize()
    {
        return String.format(SUMMARY_FORMAT,
                action, clientId, subject, existent, usable,
                sufficient, refreshable, expiresAt,
                Utils.join(scopes, " "),
                Utils.stringifyProperties(properties),
                clientIdAlias, clientIdAliasUsed,
                certificateThumbprint);
    }
629983
def ReadClientCrashInfo(self, client_id):
    """"""
    history = self.crash_history.get(client_id, None)
    if not history:
      return None

    ts = max(history)
    res = rdf_client.ClientCrash.FromSerializedString(history[ts])
    res.timestamp = ts
    return res
725941
def summary(self):
        
        if self.hasSummary:
            return KMeansSummary(super(KMeansModel, self).summary)
        else:
            raise RuntimeError("No training summary available for this %s" %
                               self.__class__.__name__)