code: def is_xla():
      """Returns `True` when we are tracing a function for XLA compilation."""
      if JAX_MODE:
          return True
      # Import locally to avoid TF dependency for TFP-on-JAX.
      from tensorflow.python.framework import (
          ops,
      )  # pylint: disable=g-direct-tensorflow-import,g-import-not-at-top
      from tensorflow.python.ops import (
          control_flow_util,
      )  # pylint: disable=g-direct-tensorflow-import,g-import-not-at-top
  
      return (
          not tf.executing_eagerly()
          and control_flow_util.GraphOrParentsInXlaContext(
              ops.get_default_graph()
          )
      )
  
imports: import functools
  import uuid
  import tensorflow.compat.v2
label_desc: Use image node_id 1 for calling a global function with example usage: is_xla() and returns: unknown, True