code: def _promote_shapes(o):
      """Promotes lists of ints/Nones to :tf:`TensorSpec` instances."""
      if isinstance(o, (list, tuple)) and all(
          _int_or_none(e) for e in o
      ):
          return tf.TensorSpec(o)
      return o
  
imports: from typing import Any, Callable
  import tensorflow
  import tree
label_desc: Use image node_id 2 for calling a global function with example usage: _promote_shapes(o) and returns: o, tf