code: def create_pipeline_end_node(p: pipeline.Pipeline) -> _PipelineEnd:
      """Create a dummy pipeline end node.
  
      pipeline end node does not appear in pipeline DSL but only in the pipeline IR.
      To generalizes compilation process for the pipeline end node, create a dummy
      BaseNode whose inputs are set as pipeline.outputs.
  
      Args:
        p: A Pipeline instance whose pipeline end node will be created.
  
      Returns:
        a pipeline end node.
      """
      with dsl_context_registry.use_registry(p.dsl_context_registry):
          return _PipelineEnd(p)
  
imports: from typing import cast, List, Optional, Sequence, Tuple, Type, Union, Dict, Any, Set
  from tfx import types
  from tfx.dsl.compiler import constants
  from tfx.dsl.components.base import base_node
  from tfx.dsl.components.common import importer
  from tfx.dsl.components.common import resolver
  from tfx.dsl.context_managers import dsl_context_registry
  from tfx.dsl.placeholder import placeholder
  from tfx.orchestration import data_types_utils
  from tfx.orchestration import pipeline
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.types import channel
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 23 for calling a global function with example usage: create_pipeline_end_node(p) and returns: _PipelineEnd