code: def GetRetiredPagesByCause(handle, cause):
      strResult = ""
      try:
          pages = nvmlDeviceGetRetiredPages(handle, cause)
          count = str(len(pages))
      except NVMLError as err:
          error = handleError(err)
          pages = None
          count = error
      strResult += (
          "        <retired_count>" + count + "</retired_count>\n"
      )
      if pages is not None:
          strResult += "        <retired_page_addresses>\n"
          for page in pages:
              strResult += (
                  "          <retired_page_address>"
                  + "0x%016x" % page
                  + "</retired_page_address>\n"
              )
          strResult += "        </retired_page_addresses>\n"
      else:
          strResult += (
              "        <retired_page_addresses>"
              + error
              + "</retired_page_addresses>\n"
          )
      return strResult
  
file_path: nvidia-ml-py3/nvidia_smi.py
imports: from pynvml import *
  import datetime
label_desc: Use image node_id 4 for calling a global function with example usage: GetRetiredPagesByCause(handle, cause) and returns: strResult