code: def GraphOrParentsInXlaContext(graph):
      while True:
          if InXlaContext(graph):
              return True
          try:
              graph = graph.outer_graph
          except AttributeError:
              return False
  
imports: import os
  import traceback
  from tensorflow.python import tf2
  from tensorflow.python.platform import tf_logging
label_desc: Use image node_id 5 for calling a global function with example usage: GraphOrParentsInXlaContext(graph) and returns: True, False