code: def testCanonicalizeWithDefaultDevice(self):
      self.assertEqual(
          device_util.canonicalize(
              "/job:worker/task:1/cpu:0", default="/gpu:0"
          ),
          "/job:worker/replica:0/task:1/device:CPU:0",
      )
      self.assertEqual(
          device_util.canonicalize(
              "/job:worker/task:1", default="/gpu:0"
          ),
          "/job:worker/replica:0/task:1/device:GPU:0",
      )
      self.assertEqual(
          device_util.canonicalize("/cpu:0", default="/job:worker"),
          "/job:worker/replica:0/task:0/device:CPU:0",
      )
      self.assertEqual(
          device_util.canonicalize(
              "/job:worker/replica:0/task:1/device:CPU:0",
              default="/job:chief/replica:0/task:1/device:CPU:0",
          ),
          "/job:worker/replica:0/task:1/device:CPU:0",
      )
  
imports: from absl.testing import parameterized
  from tensorflow.core.protobuf import tensorflow_server_pb2
  from tensorflow.python.distribute import combinations
  from tensorflow.python.distribute import device_util
  from tensorflow.python.distribute import multi_worker_test_base
  from tensorflow.python.eager import context
  from tensorflow.python.framework import ops
  from tensorflow.python.platform import test
  from tensorflow.python.training import server_lib
label_desc: Use image node_id 7 for calling the DeviceUtilTest obj's underlying member method code with example usage: obj.testCanonicalizeWithDefaultDevice() without return types