class_docstr: Client for working with the Cloud TPU API.
  
  This client is intended to be used for resolving tpu name to ip addresses.
  
  It's recommended to use this library as a contextlib to utilize all
  functionality.
docstr: Return a list of tpu endpoints.
code: def network_endpoints(self):
      """Return a list of tpu endpoints."""
      if not self._use_api:
          return list(_environment_var_to_network_endpoints(self._tpu))
      response = self._fetch_cloud_tpu_metadata()
  
      if response.get("state") != "READY":
          raise RuntimeError(
              'TPU "%s" is not yet ready; state: "%s"'
              % (self._tpu, response.get("state"))
          )
      if "networkEndpoints" in response:
          return response["networkEndpoints"]
      else:
          return [
              {
                  "ipAddress": response["ipAddress"],
                  "port": response["port"],
              }
          ]
  
imports: from concurrent import futures
  import datetime
  import json
  import logging
  import os
  import time
  import urllib
  from absl import flags
label_desc: Use image node_id 20 for calling the Client obj's underlying member method code with example usage: obj.network_endpoints() and returns: list, response, list