class_docstr: Cluster Resolver for Google Cloud TPUs.
  
  This is an implementation of cluster resolvers for the Google Cloud TPU
  service.
  
  TPUClusterResolver supports the following distinct environments:
  Google Compute Engine
  Google Kubernetes Engine
  Google internal
  
  It can be passed into `tf.distribute.TPUStrategy` to support TF2 training on
  Cloud TPUs.
docstr: Returns the metadata of the TPU system.
  
  Users can call this method to get some facts of the TPU system, like
  total number of cores, number of TPU workers and the devices. E.g.
  ```python
  
  resolver = tf.distribute.cluster_resolver.TPUClusterResolver(tpu='')
  tpu_system_metadata = resolver.get_tpu_system_metadata()
  num_hosts = tpu_system_metadata.num_hosts
  ```
  
  Returns:
    A `tf.tpu.experimental.TPUSystemMetadata` object.
code: def get_tpu_system_metadata(self):
      """Returns the metadata of the TPU system.
  
      Users can call this method to get some facts of the TPU system, like
      total number of cores, number of TPU workers and the devices. E.g.
      ```python
  
      resolver = tf.distribute.cluster_resolver.TPUClusterResolver(tpu='')
      tpu_system_metadata = resolver.get_tpu_system_metadata()
      num_hosts = tpu_system_metadata.num_hosts
      ```
  
      Returns:
        A `tf.tpu.experimental.TPUSystemMetadata` object.
      """
      cluster_spec = self.cluster_spec()
      cluster_def = (
          cluster_spec.as_cluster_def() if cluster_spec else None
      )
      tpu_system_metadata = tpu_system_metadata_lib._query_tpu_system_metadata(  # pylint: disable=protected-access
          self.master(), cluster_def=cluster_def, query_topology=False
      )
  
      return tpu_system_metadata
  
imports: import collections
  import re
  from tensorflow.core.protobuf.tpu import topology_pb2
  from tensorflow.python.distribute.cluster_resolver import cluster_resolver
  from tensorflow.python.eager import remote
  from tensorflow.python.framework import config
  from tensorflow.python.framework import errors
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.tpu import tpu_strategy_util
  from tensorflow.python.tpu import tpu_system_metadata
  from tensorflow.python.training import server_lib
  from tensorflow.python.util import compat
label_desc: Use image node_id 11 for calling the TPUClusterResolver obj's underlying member method code with example usage: obj.get_tpu_system_metadata() and returns: tpu_system_metadata