code: def _get_machine_specs(self):
      # type: () -> dict
      specs = {}
      # noinspection PyBroadException
      try:
          specs = {
              "platform": str(sys.platform),
              "python_version": str(platform.python_version()),
              "python_exec": str(sys.executable),
              "OS": str(platform.platform(aliased=True)),
              "processor": str(platform.machine()),
              "cpu_cores": int(psutil.cpu_count()),
              "memory_gb": round(
                  psutil.virtual_memory().total / 1024**3, 1
              ),
              "hostname": str(platform.node()),
              "gpu_count": 0,
          }
          if self._gpustat:
              gpu_stat = self._gpustat.new_query(
                  shutdown=True, get_driver_info=True
              )
              if gpu_stat.gpus:
                  gpus = [
                      g
                      for i, g in enumerate(gpu_stat.gpus)
                      if not self._active_gpus or i in self._active_gpus
                  ]
                  specs.update(
                      gpu_count=int(len(gpus)),
                      gpu_type=", ".join(g.name for g in gpus),
                      gpu_memory=", ".join(
                          "{}GB".format(round(g.memory_total / 1024.0))
                          for g in gpus
                      ),
                      gpu_driver_version=gpu_stat.driver_version or "",
                      gpu_driver_cuda_version=gpu_stat.driver_cuda_version
                      or "",
                  )
  
      except Exception:
          pass
  
      return specs
  
imports: import logging
  import os
  import platform
  import sys
  import warnings
  from time import time
  import psutil
  from pathlib2 import Path
  from typing import Text
  from .process.mp import BackgroundMonitor
  from ..backend_api import Session
  from ..binding.frameworks.tensorflow_bind import IsTensorboardInit
label_desc: Use image node_id 13 for calling the ResourceMonitor obj's underlying member method code with example usage: obj._get_machine_specs() and returns: specs