code: def tpu_is_available() -> bool:
      try:
          resolver = tf.distribute.cluster_resolver.TPUClusterResolver()
          tf.config.experimental_connect_to_cluster(resolver)
          tf.tpu.experimental.initialize_tpu_system(resolver)
          tf.config.list_logical_devices("TPU")
          tf.distribute.experimental.TPUStrategy(resolver)
          return True
      except ValueError:
          return False
  
imports: import tensorflow
  from typing import Union, Optional
  import ivy
  from ivy.functional.ivy.device import Profiler
label_desc: Use image node_id 9 for calling a global function with example usage: tpu_is_available() and returns: True, False