code: def testListLocalDevices(self):
      devices = device_lib.list_local_devices()
      self.assertGreater(len(devices), 0)
      self.assertEqual(devices[0].device_type, "CPU")
  
      devices = device_lib.list_local_devices(config_pb2.ConfigProto())
      self.assertGreater(len(devices), 0)
      self.assertEqual(devices[0].device_type, "CPU")
  
      # GPU test
      if test.is_gpu_available():
          self.assertGreater(len(devices), 1)
          self.assertIn("GPU", [d.device_type for d in devices])
  
file_path: tensorflow-upstream/tensorflow/python/client/device_lib_test.py
imports: from tensorflow.core.protobuf import config_pb2
  from tensorflow.python.client import device_lib
  from tensorflow.python.framework import test_util
  from tensorflow.python.platform import googletest
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling the DeviceLibTest obj's underlying member method code with example usage: obj.testListLocalDevices() without return types