code: def _compile_conditionals(
      context: compiler_context.PipelineContext,
      tfx_node: base_node.BaseNode,
      result: pipeline_pb2.NodeInputs,
  ) -> None:
      """Compiles conditionals attached to the BaseNode.
  
      It also compiles the channels that each conditional predicate depends on. If
      the channel already appears in the node inputs, reuses it. Otherwise, creates
      an implicit hidden input.
  
      Args:
        context: A `PipelineContext`.
        tfx_node: A `BaseNode` instance from pipeline DSL.
        result: A `NodeInputs` proto to which the compiled result would be written.
      """
      try:
          contexts = context.dsl_context_registry.get_contexts(tfx_node)
      except ValueError:
          return
  
      for dsl_context in contexts:
          if not isinstance(dsl_context, conditional.CondContext):
              continue
          cond_context = cast(conditional.CondContext, dsl_context)
          for channel in channel_utils.get_dependent_channels(
              cond_context.predicate
          ):
              _compile_input_spec(
                  pipeline_ctx=context,
                  tfx_node=tfx_node,
                  input_key=context.get_node_context(
                      tfx_node
                  ).get_input_key(channel),
                  channel=channel,
                  hidden=False,
                  min_count=1,
                  result=result,
              )
          cond_id = context.get_conditional_id(cond_context)
          expr = channel_utils.encode_placeholder_with_channels(
              cond_context.predicate,
              context.get_node_context(tfx_node).get_input_key,
          )
          result.conditionals[cond_id].placeholder_expression.CopyFrom(
              expr
          )
  
imports: from typing import Type, cast
  from tfx import types
  from tfx.dsl.compiler import compiler_context
  from tfx.dsl.compiler import compiler_utils
  from tfx.dsl.compiler import constants
  from tfx.dsl.components.base import base_component
  from tfx.dsl.components.base import base_node
  from tfx.dsl.experimental.conditionals import conditional
  from tfx.dsl.input_resolution import resolver_op
  from tfx.dsl.placeholder import artifact_placeholder
  from tfx.dsl.placeholder import placeholder
  from tfx.orchestration import data_types_utils
  from tfx.proto.orchestration import metadata_pb2
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.types import channel
  from tfx.types import channel_utils
  from tfx.types import resolved_channel
  from tfx.types import value_artifact
  from tfx.utils import deprecation_utils
  from tfx.utils import name_utils
  from tfx.utils import typing_utils
label_desc: Use image node_id 4 for calling a global function with example usage: _compile_conditionals(context, tfx_node, result) without return types