code: def create_resource_lifetime_pipeline() -> pipeline_pb2.Pipeline:
      """Creates a pipeline full of chores to be used for testing resource lifetime.
  
        ┌───────┐
        │start_a│
        └┬──────┘
        ┌▽──────┐
        │start_b │
        └┬───────┘
        ┌▽─────┐
        │worker │
        └┬──────┘
        ┌▽────┐
        │end_b │
        └┬─────┘
        ┌▽────┐
        │end_a │
        └──────┘
  
      Returns:
        A pipeline for the above DAG
      """
  
      # pylint: disable=no-value-for-parameter
      start_a = _example_gen().with_id("start_a")
      start_b = _chore().with_id("start_b")
      start_b.add_upstream_node(start_a)
      worker = _chore().with_id("worker")
      worker.add_upstream_node(start_b)
      end_b = _chore().with_id("end_b")
      end_b.add_upstream_nodes([worker, start_b])
      end_b.node_execution_options = utils.NodeExecutionOptions(
          trigger_strategy=pipeline_pb2.NodeExecutionOptions.LIFETIME_END_WHEN_SUBGRAPH_CANNOT_PROGRESS,
          lifetime_start=start_b.id,
      )
      end_a = _chore().with_id("end_a")
      end_a.add_upstream_nodes([start_a, start_b, worker, end_b])
      end_a.node_execution_options = utils.NodeExecutionOptions(
          trigger_strategy=pipeline_pb2.NodeExecutionOptions.LIFETIME_END_WHEN_SUBGRAPH_CANNOT_PROGRESS,
          lifetime_start=start_a.id,
      )
  
      pipeline = pipeline_lib.Pipeline(
          pipeline_name="my_pipeline",
          pipeline_root="/path/to/root",
          components=[
              start_a,
              start_b,
              worker,
              end_b,
              end_a,
          ],
          enable_cache=True,
      )
      dsl_compiler = compiler.Compiler()
      return dsl_compiler.compile(pipeline)
  
imports: from tfx.dsl.compiler import compiler
  from tfx.dsl.component.experimental.annotations import InputArtifact
  from tfx.dsl.component.experimental.annotations import OutputArtifact
  from tfx.dsl.component.experimental.decorators import component
  from tfx.dsl.control_flow.for_each import ForEach
  from tfx.dsl.experimental.conditionals import conditional
  from tfx.dsl.experimental.node_execution_options import utils
  from tfx.orchestration import pipeline
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.types import standard_artifacts
label_desc: Use image node_id 12 for calling a global function with example usage: create_resource_lifetime_pipeline() and returns: dsl_compiler