code: def tpu_available(sess=None):
      """Return true if a TPU device is available to the default session."""
      if sess is None:
          init_op = tf.group(
              tf.compat.v1.global_variables_initializer(),
              tf.compat.v1.local_variables_initializer(),
          )
          with tf.compat.v1.Session() as sess:
              sess.run(init_op)
              devices = sess.list_devices()
      else:
          devices = sess.list_devices()
      return any(dev.device_type == "TPU" for dev in devices)
  
imports: import json
  from typing import Optional
  from absl import logging
  import numpy
  import tensorflow
  from deepvariant.protos import deepvariant_pb2
  from third_party.nucleus.io import sharded_file_utils
  from third_party.nucleus.io import tfrecord
  from third_party.nucleus.protos import variants_pb2
  from tensorflow.core.example import example_pb2
label_desc: Use image node_id 23 for calling a global function with example usage: tpu_available(sess) and returns: any