code: def testRecursiveCriticalSectionAccessIsIllegalSameSharedName(self):
      # This does not work properly in eager mode.  Eager users will
      # just hit a deadlock if they do this.  But at least it'll be easier
      # to debug.
      cs = critical_section_ops.CriticalSection(shared_name="cs")
      cs_same = critical_section_ops.CriticalSection(shared_name="cs")
      add = lambda x: x + 1
  
      def fn(x):
          return cs_same.execute(lambda: add(x))
  
      with self.assertRaisesRegex(
          ValueError,
          r"Attempting to lock a CriticalSection .* in which we are",
      ):
          cs.execute(lambda: fn(1.0))
  
imports: import itertools
  from absl.testing import parameterized
  from tensorflow.python.data.experimental.ops import prefetching_ops
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import cond
  from tensorflow.python.ops import control_flow_assert
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import control_flow_v2_toggles
  from tensorflow.python.ops import critical_section_ops
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.ops import while_loop
  from tensorflow.python.platform import test
  from tensorflow.python.platform import tf_logging
label_desc: Use image node_id 9 for calling the CriticalSectionTest obj's underlying member method code with example usage: obj.testRecursiveCriticalSectionAccessIsIllegalSameSharedName() and returns: cs_same