code: def is_device_spec(obj):
      """Abstract away the fact that DeviceSpecV2 is the base class."""
      return isinstance(obj, device_spec.DeviceSpecV2)
  
file_path: tensorflow/tensorflow/python/framework/device.py
imports: from tensorflow.python import tf2
  from tensorflow.python.framework import device_spec
label_desc: Use image node_id 2 for calling a global function with example usage: is_device_spec(obj) and returns: isinstance