code: def latest_pipeline_run_outputs(
      pipeline, output_keys: Sequence[str] = ()
  ):
      """Returns the artifacts in the latest COMPLETE pipeline run.
  
      Example usage:
  
        producer_pipeline = Pipeline(outputs={
            'examples': example_gen.outputs['examples'],
            'schema': schema_gen.outputs['schema']
        })
  
        consumer_pipeline_inputs = PipelineInputs(
            latest_pipeline_run_outputs(producer_pipeline),
            output_keys=['examples', 'schema'])
        trainer = TFTrainer(
            examples=consumer_pipeline_inputs.inputs['examples'],
            schema=consumer_pipeline_inputs.inputs['schema'])
        consumer_pipeline = Pipeline(
            inputs=consumer_pipeline_inputs,
            components=[trainer],
        )
  
      Args:
        pipeline: The pipeline producing the artifacts
        output_keys: (Optional) A list of output keys. If provided, only the
          artifacts of the key in this list will return by this function, otherwise,
          all available output keys of the producer pipeline will be used.
  
      Returns:
        The artifacts in the latest COMPLETE pipeline run.
      """
      for output_key in output_keys:
          if output_key not in pipeline.outputs:
              raise ValueError(
                  f"Output key {output_key} does not exist in pipeline {pipeline.id}. "
                  f"Available: {list(pipeline.outputs)}"
              )
      return ops.LatestPipelineRunOutputs(
          pipeline_name=pipeline.pipeline_name, output_keys=output_keys
      )
  
imports: from typing import Optional, Sequence, Union
  from absl import logging
  from tfx.dsl.input_resolution import resolver_function
  from tfx.dsl.input_resolution.ops import ops
  from tfx.types import artifact
  from tfx.types import channel
label_desc: Use image node_id 7 for calling a global function with example usage: latest_pipeline_run_outputs(pipeline, output_keys) and returns: ops