code: def _compile_channel_pb(
      artifact_type: Type[types.Artifact],
      pipeline_name: str,
      node_id: str,
      output_key: str,
      result: pipeline_pb2.InputSpec.Channel,
  ):
      """Compile InputSpec.Channel with an artifact type and context filters."""
      mlmd_artifact_type = (
          artifact_type._get_artifact_type()
      )  # pylint: disable=protected-access
      result.artifact_query.type.CopyFrom(mlmd_artifact_type)
      result.artifact_query.type.ClearField("properties")
  
      ctx = result.context_queries.add()
      ctx.type.name = constants.PIPELINE_CONTEXT_TYPE_NAME
      ctx.name.field_value.string_value = pipeline_name
  
      if node_id:
          ctx = result.context_queries.add()
          ctx.type.name = constants.NODE_CONTEXT_TYPE_NAME
          ctx.name.field_value.string_value = (
              compiler_utils.node_context_name(pipeline_name, node_id)
          )
  
      if output_key:
          result.output_key = output_key
  
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 2 for calling a global function with example usage: _compile_channel_pb(artifact_type, pipeline_name, node_id, output_key, result) without return types