code: def __init__(self, device_idx):
      super().__init__()
      self.handle = pynvml.nvmlDeviceGetHandleByIndex(device_idx)
  
imports: import collections
  import itertools
  import os
  import pathlib
  import re
  import pynvml
  from typing import Union
  from enum import Enum, auto
label_desc: Use image node_id 1 to create a new Device object  with example: obj = Device(device_idx)