docstr: Verifies that the ClusterSpec generates the correct proto.
  
  We are testing this four different ways to ensure that the ClusterSpec
  returned by the TPUClusterResolver behaves identically to a normal
  ClusterSpec when passed into the generic ClusterSpec libraries.
  
  Args:
    cluster_spec: ClusterSpec returned by the TPUClusterResolver
    expected_proto: Expected protobuf
docstr_tok: ["Verifies","that","the","ClusterSpec","generates","the","correct","proto",".","We","are","testing","this","four","different","ways","to","ensure","that","the","ClusterSpec","returned","by","the","TPUClusterResolver","behaves","identically","to","a","normal","ClusterSpec","when","passed","into","the","generic","ClusterSpec","libraries",".","Args",":","cluster_spec",":","ClusterSpec","returned","by","the","TPUClusterResolver","expected_proto",":","Expected","protobuf"]
code: def _verifyClusterSpecEquality(self, cluster_spec, expected_proto):
      """Verifies that the ClusterSpec generates the correct proto.
  
      We are testing this four different ways to ensure that the ClusterSpec
      returned by the TPUClusterResolver behaves identically to a normal
      ClusterSpec when passed into the generic ClusterSpec libraries.
  
      Args:
        cluster_spec: ClusterSpec returned by the TPUClusterResolver
        expected_proto: Expected protobuf
      """
      self.assertProtoEquals(
          expected_proto, cluster_spec.as_cluster_def()
      )
      self.assertProtoEquals(
          expected_proto,
          server_lib.ClusterSpec(cluster_spec).as_cluster_def(),
      )
      self.assertProtoEquals(
          expected_proto,
          server_lib.ClusterSpec(
              cluster_spec.as_cluster_def()
          ).as_cluster_def(),
      )
      self.assertProtoEquals(
          expected_proto,
          server_lib.ClusterSpec(
              cluster_spec.as_dict()
          ).as_cluster_def(),
      )
  
imports: import os
  import six
  from six.moves.urllib.error import URLError
  from tensorflow.core.protobuf.tpu import topology_pb2
  from tensorflow.python.client import session
  from tensorflow.python.distribute.cluster_resolver.tpu import tpu_cluster_resolver
  from tensorflow.python.eager import context
  from tensorflow.python.framework import config
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import test_util
  from tensorflow.python.platform import test
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.training import server_lib
  from tensorflow.python.util import compat
label_desc: Use image node_id 1 for calling the TPUClusterResolverTest obj's underlying member method code with example usage: obj._verifyClusterSpecEquality(cluster_spec, expected_proto) without return types