code: def nvmlDeviceGetMigDeviceHandleByIndex(self, handle, mig_index):
      try:
          return handle["mig_devices"][mig_index]
      except IndexError:
          raise pynvml.NVMLError_NotFound
  
imports: import pytest
  from typing import List
  from unittest.mock import patch
  import ray._private.thirdparty.pynvml
label_desc: Use image node_id 9 for calling the PyNVMLMock obj's underlying member method code with example usage: obj.nvmlDeviceGetMigDeviceHandleByIndex(handle, mig_index) and returns: handle