code: def is_composite_tensor(value):
      """Returns True for CTs and non-CT custom pytrees in JAX mode.
  
      Args:
        value: A TFP component (e.g. a distribution or bijector instance) or object
          that behaves as one.
  
      Returns:
        value_is_composite: bool, True if `value` is a `CompositeTensor` in TF mode
          or a non-leaf pytree in JAX mode.
      """
      if isinstance(value, composite_tensor.CompositeTensor):
          return True
      if JAX_MODE:
          from jax import (
              tree_util,
          )  # pylint: disable=g-import-not-at-top
  
          # If `value` is not a pytree leaf, then it must be an instance of a class
          # that was specially registered as a pytree or that inherits from a class
          # representing a nested structure.
          treedef = tree_util.tree_structure(value)
          return not tree_util.treedef_is_leaf(treedef)
      return False
  
imports: import contextlib
  import functools
  import threading
  import numpy
  import tensorflow.compat.v2
  from tensorflow.python.framework import composite_tensor
  from tensorflow.python.framework import type_spec
  from tensorflow.python.framework import type_spec_registry
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.util import tf_inspect
  from tensorflow.python.util import variable_utils
label_desc: Use image node_id 1 for calling a global function with example usage: is_composite_tensor(value) and returns: False, True, unknown