code: def _get_gpu_info_for_localhost() -> list:
      NVIDIA_CMD = "nvidia-smi"
  
      if not command_exists_on_localhost(NVIDIA_CMD):
          return []
  
      gpus = []
  
      try:
          sp = subprocess.Popen(
              ["nvidia-smi", "-q"],
              stdout=subprocess.PIPE,
              stderr=subprocess.PIPE,
          )
          out_str = sp.communicate()
          out_list = out_str[0].decode("utf-8").split("\n")
  
          count_gpu = 0
          for item in out_list:
              try:
                  key, val = item.split(":")
                  key, val = key.strip(), val.strip()
                  if key == "Product Name":
                      count_gpu += 1
                      gpus.append(val)
              except:  # noqa: E722
                  continue
      except:  # noqa: E722
          gpus = []
  
      return gpus
  
imports: import os
  import platform
  import socket
  import subprocess
  import sys
  from typing import Dict, List, Union
  import lazycluster.settings
  from .utils import Environment
label_desc: Use image node_id 14 for calling a global function with example usage: _get_gpu_info_for_localhost() and returns: gpus, list