code: def canonical_name(device):
      """Returns a canonical name for the given `DeviceSpec` or device name."""
      if device is None:
          return ""
      if is_device_spec(device):
          return device.to_string()
      else:
          device = DeviceSpec.from_string(device)
          return device.to_string()
  
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 3 for calling a global function with example usage: canonical_name(device) and returns: str, device, device