code: def GetContainingXLAContext(ctxt):
      """Returns the first ancestor XLAContext of `ctxt`.
  
      Returns `ctxt` if `ctxt` is a XLAContext, or None if `ctxt` is not in a
      while loop.
  
      Args:
        ctxt: ControlFlowContext
  
      Returns:
        `ctxt` if `ctxt` is a XLAContext, the most nested XLAContext containing
        `ctxt`, or None if `ctxt` is not in a while loop.
      """
      while ctxt:
          if ctxt.IsXLAContext():
              return ctxt
          ctxt = ctxt.outer_context
      return None
  
file_path: tensorflow-upstream/tensorflow/python/keras/utils/control_flow_util.py
imports: from tensorflow.python.framework import smart_cond
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.ops import cond
  from tensorflow.python.ops import variables
label_desc: Use image node_id 5 for calling a global function with example usage: GetContainingXLAContext(ctxt) and returns: None, ctxt