docstr: Test that control_flow_util can check that we're in a TPU context.
docstr_tok: ["Test","that","control_flow_util","can","check","that","we","'re","in","a","TPU","context","."]
code: def testIsInContext(self):
      """Test that control_flow_util can check that we're in a TPU context."""
      with ops.Graph().as_default():
          z1 = array_ops.identity(1)
          pivot = control_flow_ops.no_op()
          context = tpu_replication.TPUReplicateContext(
              b"context", 1, pivot=pivot
          )
          context.Enter()
          z2 = array_ops.identity(1)
          context.Exit()
          self.assertFalse(control_flow_util.IsInXLAContext(z1.op))
          self.assertTrue(control_flow_util.IsInXLAContext(z2.op))
  
imports: from tensorflow.python.eager import def_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import importer
  from tensorflow.python.framework import ops
  from tensorflow.python.layers import convolutional
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import control_flow_util
  from tensorflow.python.ops import init_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import special_math_ops
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.platform import test
  from tensorflow.python.tpu import tpu
  from tensorflow.python.tpu import tpu_feed
  from tensorflow.python.tpu import tpu_replication
  from tensorflow.python.tpu import training_loop
  from tensorflow.python.tpu.ops import tpu_ops
label_desc: Use image node_id 1 for calling the TPUContextTest obj's underlying member method code with example usage: obj.testIsInContext() without return types