code: def num_available_tpu_chips_and_device_id():
      """Returns the device id and number of TPU chips attached through PCI."""
      num_chips = 0
      device_id = ""
      for vendor_path in glob.glob("/sys/bus/pci/devices/*/vendor"):
          vendor_id = pathlib.Path(vendor_path).read_text().strip()
          if vendor_id != _GOOGLE_PCI_VENDOR_ID:
              continue
  
          device_path = os.path.join(
              os.path.dirname(vendor_path), "device"
          )
          device_id = pathlib.Path(device_path).read_text().strip()
          if device_id in _TPU_PCI_DEVICE_IDS:
              num_chips += 1
  
      return num_chips, device_id
  
imports: import os
  import pathlib
  import glob
label_desc: Use image node_id 1 for calling a global function with example usage: num_available_tpu_chips_and_device_id() and returns: num_chips,  device_id