code: def get_composite_tensor_type_spec(x):
      """Returns the TypeSpec for `x`, or `None` if it's not a composite tensor."""
      type_spec = getattr(x, "__tf_type_spec__", None)
      if type_spec is None:
          return getattr(x, "_type_spec", None)
      else:
          return type_spec()
  
file_path: hub/tensorflow_hub/tf_utils.py
imports: import os
  import time
  import uuid
  from absl import logging
  import tensorflow
label_desc: Use image node_id 9 for calling a global function with example usage: get_composite_tensor_type_spec(x) and returns: getattr, type_spec