code: def get_first_accelerator():
      tpus = tf.config.experimental.list_logical_devices("TPU")
      if tpus:
          return tpus[0].name
      else:
          gpus = tf.config.experimental.list_logical_devices("GPU")
          return gpus[0].name if gpus else "/device:CPU:0"
  
file_path: sonnet/sonnet/src/functional/utils.py
imports: import functools
  from sonnet.src import utils
  import tensorflow
  import tree
label_desc: Use image node_id 1 for calling a global function with example usage: get_first_accelerator() and returns: tpus, unknown