code: def is_gpu_available(host, gpu_card):
      """
      This function checks if a GPU is available on an ESXi host
      """
      bindings = host.config.assignableHardwareBinding
      # No VM bind to any GPU card on this host
      if not bindings:
          return True
  
      for hardware in bindings:
          # There is a VM bind to this GPU card
          pci_id = gpu_card.pciId
          if pci_id in hardware.instanceId and hardware.vm:
              logger.warning(
                  f"GPU {pci_id} is used by VM {hardware.vm.name}"
              )
              return False
      # No VM bind to this GPU card
      return True
  
file_path: ray/python/ray/autoscaler/_private/vsphere/gpu_utils.py
imports: import logging
  from pyVim.task import WaitForTask
  from pyVmomi import vim
label_desc: Use image node_id 1 for calling a global function with example usage: is_gpu_available(host, gpu_card) and returns: True, True, False