code: def testNestedConditionWithDuplicatePredicates(self):
      # Note: This only catches the duplication if the _same_ predicate (in terms
      # of Python object identity) is used. Ideally we would also detect
      # equivalent predicates (like __eq__) but placeholders cannot implement
      # __eq__ itself (due to its special function in creating predicates from
      # ChannelWrappedPlaceholder) and placeholders also don't offer another
      # equality function at the moment.
      pred = placeholder.input("foo") == "bar"
      with self.assertRaisesRegex(
          ValueError, "Nested conditionals with duplicate predicates"
      ):
          with conditional.Cond(pred):
              unused_node1 = _FakeNode().with_id("node1")
              with conditional.Cond(pred):
                  unused_node2 = _FakeNode().with_id("node2")
  
file_path: tfx/tfx/dsl/experimental/conditionals/conditional_test.py
imports: from typing import Any, Dict
  import tensorflow
  from tfx.dsl.components.base import base_node
  from tfx.dsl.context_managers import dsl_context_registry
  from tfx.dsl.experimental.conditionals import conditional
  from tfx.dsl.placeholder import placeholder
label_desc: Use image node_id 5 for calling the ConditionalTest obj's underlying member method code with example usage: obj.testNestedConditionWithDuplicatePredicates() without return types