class_docstr: Test that we can connect to a real Cloud TPU.
code: def test_connect(self):
      # Log full diff on failure.
      self.maxDiff = None  # pylint:disable=invalid-name
  
      self.assertCountEqual(
          EXPECTED_DEVICES_PRE_CONNECT,
          [device.name for device in config.list_logical_devices()],
      )
  
      resolver = tpu_cluster_resolver.TPUClusterResolver(
          tpu=FLAGS.tpu, zone=FLAGS.zone, project=FLAGS.project
      )
      remote.connect_to_cluster(resolver)
  
      expected_devices = EXPECTED_DEVICES_PRE_CONNECT
      for task in range(FLAGS.num_tpu_devices // DEVICES_PER_TASK):
          expected_devices.extend(
              [
                  template.format(task=task)
                  for template in EXPECTED_NEW_DEVICES_AFTER_CONNECT_TEMPLATES
              ]
          )
  
      self.assertCountEqual(
          expected_devices,
          [device.name for device in config.list_logical_devices()],
      )
  
      tpu_cluster_resolver.initialize_tpu_system(resolver)
  
file_path: tensorflow-upstream/tensorflow/python/eager/remote_cloud_tpu_test.py
imports: from absl import flags
  from absl.testing import absltest
  from tensorflow.python.distribute.cluster_resolver import tpu_cluster_resolver
  from tensorflow.python.eager import remote
  from tensorflow.python.framework import config
label_desc: Use image node_id 1 for calling the RemoteCloudTPUTest obj's underlying member method code with example usage: obj.test_connect() without return types