code: def _backport_tensor_spec():
      if hasattr(tf, "TensorSpec"):
          return tf.TensorSpec
      try:
          # available since 1.7
          from tensorflow.python.framework.tensor_spec import TensorSpec
      except ImportError:
          pass
      else:
          tf.TensorSpec = TensorSpec
          return TensorSpec
  
      from .tensor_spec import TensorSpec
  
      tf.TensorSpec = TensorSpec
      return TensorSpec
  
label_desc: Use image node_id 1 for calling a global function with example usage: _backport_tensor_spec() and returns: TensorSpec, tf, TensorSpec