code: def test_partial_uuid_resolver(self):
      from torch.cuda import _transform_uuid_to_ordinals
  
      uuids = [
          "GPU-9942190a-aa31-4ff1-4aa9-c388d80f85f1",
          "GPU-9e8d35e3-a134-0fdd-0e01-23811fdbd293",
          "GPU-e429a63e-c61c-4795-b757-5132caeb8e70",
          "GPU-eee1dfbc-0a0f-6ad8-5ff6-dc942a8b9d98",
          "GPU-bbcd6503-5150-4e92-c266-97cc4390d04e",
          "GPU-472ea263-58d7-410d-cc82-f7fdece5bd28",
          "GPU-e56257c4-947f-6a5b-7ec9-0f45567ccf4e",
          "GPU-1c20e77d-1c1a-d9ed-fe37-18b8466a78ad",
      ]
      self.assertEqual(
          _transform_uuid_to_ordinals(["GPU-9e8d35e3"], uuids), [1]
      )
      self.assertEqual(
          _transform_uuid_to_ordinals(
              ["GPU-e4", "GPU-9e8d35e3"], uuids
          ),
          [2, 1],
      )
      self.assertEqual(
          _transform_uuid_to_ordinals(
              "GPU-9e8d35e3,GPU-1,GPU-47".split(","), uuids
          ),
          [1, 7, 5],
      )
      # First invalid UUID aborts parsing
      self.assertEqual(
          _transform_uuid_to_ordinals(
              ["GPU-123", "GPU-9e8d35e3"], uuids
          ),
          [],
      )
      self.assertEqual(
          _transform_uuid_to_ordinals(
              ["GPU-9e8d35e3", "GPU-123", "GPU-47"], uuids
          ),
          [1],
      )
      # First ambigous UUID aborts parsing
      self.assertEqual(
          _transform_uuid_to_ordinals(
              ["GPU-9e8d35e3", "GPU-e", "GPU-47"], uuids
          ),
          [1],
      )
      # Duplicate UUIDs result in empty set
      self.assertEqual(
          _transform_uuid_to_ordinals(
              ["GPU-9e8d35e3", "GPU-47", "GPU-9e8"], uuids
          ),
          [],
      )
  
file_path: pytorch/test/test_cuda_nvml_based_avail.py
imports: import os
  import sys
  import multiprocessing
  import torch
  import unittest
  from unittest.mock import patch
label_desc: Use image node_id 2 for calling the TestVisibleDeviceParses obj's underlying member method code with example usage: obj.test_partial_uuid_resolver() without return types