code: def get_mig_mode(device: _nvmlDevice_t) -> Tuple[int, int]:
      _init_nvml()
      if _nvml_lib is None:
          return None
  
      c_current_mode, c_pending_mode = c_uint(), c_uint()
      _nvml_check_error(
          _nvml_lib.nvmlDeviceGetMigMode(
              device, byref(c_current_mode), byref(c_pending_mode)
          )
      )
      return c_current_mode.value, c_pending_mode.value
  
imports: import dataclasses
  import logging
  import os
  import subprocess
  import sys
  import uuid
  from collections import namedtuple
  from ctypes import c_char, c_char_p, c_int, c_uint, c_ulonglong, byref, create_string_buffer, Structure, POINTER, CDLL
  from typing import List, Tuple, Optional, Union
  from ..utils import parse_readable_size
label_desc: Use image node_id 16 for calling a global function with example usage: get_mig_mode(device) and returns: c_current_mode,  c_pending_mode, None