code: def _generate_input_spec_for_pipeline_outputs(
      end_node: pipeline_pb2.PipelineNode, p: pipeline.Pipeline
  ) -> Iterator[Tuple[types.Channel, pipeline_pb2.InputSpec.Channel]]:
      """Generates InputSpec for pipeline outputs to be consumed later."""
  
      def remove_inner_pipeline_run_context(
          c: pipeline_pb2.ContextSpec,
      ) -> bool:
          return (
              c.type.name == constants.PIPELINE_RUN_CONTEXT_TYPE_NAME
              and c.name.HasField("structural_runtime_parameter")
          )
  
      yield from _generate_input_spec_for_outputs(
          end_node, p.outputs, remove_inner_pipeline_run_context
      )
  
imports: import itertools
  from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, 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.compiler import node_inputs_compiler
  from tfx.dsl.components.base import base_component
  from tfx.dsl.components.base import base_driver
  from tfx.dsl.components.base import base_node
  from tfx.dsl.experimental.node_execution_options import utils
  from tfx.dsl.placeholder import placeholder
  from tfx.orchestration import data_types
  from tfx.orchestration import data_types_utils
  from tfx.orchestration import pipeline
  from tfx.proto.orchestration import executable_spec_pb2
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.types import channel
  from tfx.types import channel_utils
  from tfx.utils import deprecation_utils
  from tfx.utils import name_utils
label_desc: Use image node_id 6 for calling a global function with example usage: _generate_input_spec_for_pipeline_outputs(end_node, p) and returns: unknown