class_docstr: A `ControlFlowContext` for nodes inside an XLA computation cluster.
  
  THIS IS ONLY FOR TENSORFLOW INTERNAL IMPLEMENTATION, DO NO USE DIRECTLY.
  
  The primary role of `XLACompileContext` is to mark operators inside a
  xla.compile() computation with attribute "_xla_compile_id=XYZ", where XYZ is
  a unique name.
  
  `ControlFlowContext` is used to perform the annotation since it integrates
  with Tensorflow constructs like ResourceVariables. For example, if a
  `ResourceVariable` is constructed inside a xla.compile() block, the
  `ResourceVariable` implementation can use
  `with ops.control_dependencies(None)` to build the variable's definition
  outside the compiled computation.
docstr: Remove any external control dependency on this op.
docstr_tok: ["Remove","any","external","control","dependency","on","this","op","."]
code: def _RemoveExternalControlEdges(self, op: ops.Operation):
      """Remove any external control dependency on this op."""
      internal_control_inputs = []
      external_control_inputs = []
      for x in op.control_inputs:
          # pylint: disable=protected-access
          is_internal_op = False
          ctxt = x._get_control_flow_context()
          while ctxt is not None:
              if ctxt == self:
                  is_internal_op = True
                  break
              ctxt = ctxt._outer_context
          if is_internal_op:
              internal_control_inputs.append(x)
          else:
              external_control_inputs.append(x)
          # pylint: enable=protected-access
      # pylint: disable=protected-access
      op._remove_all_control_inputs()
      op._add_control_inputs(internal_control_inputs)
      # pylint: enable=protected-access
      return internal_control_inputs, external_control_inputs
  
imports: import contextlib
  from tensorflow.compiler.jit.ops import xla_ops
  from tensorflow.compiler.jit.ops import xla_ops_grad
  from tensorflow.core.framework import attr_value_pb2
  from tensorflow.python.distribute import summary_op_util
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.util import compat
  from tensorflow.python.util import nest
  from tensorflow.python.util import tf_inspect
  from tensorflow.python.util.compat import collections_abc
  from tensorflow.python.util.deprecation import deprecated
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 3 for calling the XLACompileContext obj's underlying member method code with example usage: obj._RemoveExternalControlEdges(op) and returns: internal_control_inputs,  external_control_inputs