code: def GetRetiredPagesStr(handle):
      strResult = ""
      causes = [
          "multiple_single_bit_retirement",
          "double_bit_retirement",
      ]
      for idx in range(NVML_PAGE_RETIREMENT_CAUSE_COUNT):
          strResult += "      <" + causes[idx] + ">\n"
          strResult += GetRetiredPagesByCause(handle, idx)
          strResult += "      </" + causes[idx] + ">\n"
  
      strResult += "      <pending_retirement>"
      try:
          if (
              NVML_FEATURE_DISABLED
              == nvmlDeviceGetRetiredPagesPendingStatus(handle)
          ):
              strResult += "No"
          else:
              strResult += "Yes"
      except NVMLError as err:
          strResult += handleError(err)
      strResult += "</pending_retirement>\n"
      return strResult
  
file_path: nvidia-ml-py3/nvidia_smi.py
imports: from pynvml import *
  import datetime
label_desc: Use image node_id 5 for calling a global function with example usage: GetRetiredPagesStr(handle) and returns: strResult