class_docstr: CPU usage of the system in percent per core.
class_docstr_tok: ["CPU","usage","of","the","system","in","percent","per","core","."]
code: def aggregate(self) -> dict:
      if not self.samples:
          return {}
      num_cpu = len(self.samples[0])
      cpu_metrics = {}
      for i in range(num_cpu):
          aggregate_i = aggregate_mean(
              [sample[i] for sample in self.samples]
          )
          cpu_metrics[self.name.format(i=i)] = aggregate_i
  
      return cpu_metrics
  
imports: import threading
  from collections import deque
  from typing import TYPE_CHECKING, List, Optional
  from .aggregators import aggregate_last, aggregate_mean
  from .asset_registry import asset_registry
  from .interfaces import Interface, Metric, MetricsMonitor
label_desc: Use image node_id 4 for calling the CpuPercent obj's underlying member method code with example usage: obj.aggregate() and returns: cpu_metrics, dict