code: def detect_platform():
      """Returns the platform and device information."""
      if on_gcp():
          if context.context().list_logical_devices("GPU"):
              return PlatformDevice.GCE_GPU
          elif context.context().list_logical_devices("TPU"):
              return PlatformDevice.GCE_TPU
          else:
              return PlatformDevice.GCE_CPU
  
      else:
          if context.context().list_logical_devices("GPU"):
              return PlatformDevice.INTERNAL_GPU
          elif context.context().list_logical_devices("TPU"):
              return PlatformDevice.INTERNAL_TPU
          else:
              return PlatformDevice.INTERNAL_CPU
  
file_path: tensorflow/tensorflow/python/distribute/failure_handling/failure_handling_util.py
imports: import enum
  import os
  import sys
  import requests
  from six.moves.urllib import request
  from tensorflow.python.eager import context
  from tensorflow.python.platform import tf_logging
label_desc: Use image node_id 6 for calling a global function with example usage: detect_platform() and returns: PlatformDevice, PlatformDevice, PlatformDevice, PlatformDevice, PlatformDevice, PlatformDevice