code: def setUp(self):
      super().setUp()
      pipeline_root = os.path.join(
          os.environ.get(
              "TEST_UNDECLARED_OUTPUTS_DIR", self.get_temp_dir()
          ),
          self.id(),
      )
      self._pipeline_root = pipeline_root
  
      # Makes sure multiple connections within a test always connect to the same
      # MLMD instance.
      metadata_path = os.path.join(
          pipeline_root, "metadata", "metadata.db"
      )
      self._metadata_path = metadata_path
      self._mlmd_cm = mlmd_cm.MLMDConnectionManager.sqlite(
          metadata_path
      )
      self.enter_context(self._mlmd_cm)
      self._mlmd_connection = self._mlmd_cm.primary_mlmd_handle
  
      # Sets up the pipeline.
      pipeline = self._make_pipeline(
          self._pipeline_root, str(uuid.uuid4())
      )
      self._pipeline = pipeline
  
      # Extracts components.
      self._example_gen = test_utils.get_node(
          pipeline, "my_example_gen"
      )
      self._stats_gen = test_utils.get_node(
          pipeline, "my_statistics_gen"
      )
      self._schema_gen = test_utils.get_node(pipeline, "my_schema_gen")
      self._transform = test_utils.get_node(pipeline, "my_transform")
      self._example_validator = test_utils.get_node(
          pipeline, "my_example_validator"
      )
      self._trainer = test_utils.get_node(pipeline, "my_trainer")
      self._evaluator = test_utils.get_node(pipeline, "my_evaluator")
      self._chore_a = test_utils.get_node(pipeline, "chore_a")
      self._chore_b = test_utils.get_node(pipeline, "chore_b")
  
      self._task_queue = tq.TaskQueue()
  
      self._mock_service_job_manager = mock.create_autospec(
          service_jobs.ServiceJobManager, instance=True
      )
  
      self._mock_service_job_manager.is_pure_service_node.side_effect = (
          lambda _, node_id: node_id == self._example_gen.node_info.id
      )
      self._mock_service_job_manager.is_mixed_service_node.side_effect = (
          lambda _, node_id: node_id == self._transform.node_info.id
      )
  
      def _default_ensure_node_services(unused_pipeline_state, node_id):
          self.assertIn(
              node_id,
              (
                  self._example_gen.node_info.id,
                  self._transform.node_info.id,
              ),
          )
          return service_jobs.ServiceStatus(
              code=service_jobs.ServiceStatusCode.SUCCESS
          )
  
      self._mock_service_job_manager.ensure_node_services.side_effect = (
          _default_ensure_node_services
      )
  
imports: import itertools
  import os
  from typing import Literal
  import uuid
  from absl.testing import parameterized
  from absl.testing.absltest import mock
  import tensorflow
  from tfx.dsl.compiler import constants
  from tfx.orchestration import data_types_utils
  from tfx.orchestration.experimental.core import constants
  from tfx.orchestration.experimental.core import mlmd_state
  from tfx.orchestration.experimental.core import pipeline_state
  from tfx.orchestration.experimental.core import service_jobs
  from tfx.orchestration.experimental.core import sync_pipeline_task_gen
  from tfx.orchestration.experimental.core import task
  from tfx.orchestration.experimental.core import task_gen_utils
  from tfx.orchestration.experimental.core import task_queue
  from tfx.orchestration.experimental.core import test_utils
  from tfx.orchestration.experimental.core.testing import test_sync_pipeline
  from tfx.orchestration import mlmd_connection_manager
  from tfx.orchestration.portable import runtime_parameter_utils
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.utils import status
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 1 for calling the SyncPipelineTaskGeneratorTest obj's underlying member method code with example usage: obj.setUp() and returns: service_jobs