code: def test_list_devices(self):
      device_type = config.preferred_device_type()
  
      local_devices = [
          tf_device.DeviceSpec.from_string(
              f"/job:localhost/replica:0/task:0/device:{device_type}:0"
          ),
          tf_device.DeviceSpec.from_string(
              f"/job:localhost/replica:0/task:0/device:{device_type}:1"
          ),
      ]
  
      self.assertEqual(config.local_devices(device_type), local_devices)
      self.assertEqual(config.num_local_devices(device_type), 2)
      self.assertEqual(config.num_global_devices(device_type), 2)
      # The eager context should not be initialized by any of the calls
      self.assertFalse(context.context()._initialized)
  
file_path: tensorflow/tensorflow/dtensor/python/tests/config_test.py
imports: import os
  from tensorflow.dtensor.python import config
  from tensorflow.dtensor.python.tests import test_util
  from tensorflow.python.eager import context
  from tensorflow.python.framework import device
  from tensorflow.python.platform import test
label_desc: Use image node_id 4 for calling the ConfigTest obj's underlying member method code with example usage: obj.test_list_devices() without return types