code: def setUp(self):
      super().setUp()
      self._test_dir = os.path.join(
          os.environ.get(
              "TEST_UNDECLARED_OUTPUTS_DIR", self.get_temp_dir()
          ),
          self._testMethodName,
      )
      self._pipeline_name = "beam_stub_test"
      # This example assumes that the taxi data and taxi utility function are
      # stored in tfx/examples/chicago_taxi_pipeline. Feel free to customize this
      # as needed.
      taxi_root = os.path.dirname(taxi_pipeline_local.__file__)
      self._data_root = os.path.join(taxi_root, "data", "simple")
      self._module_file = os.path.join(taxi_root, "taxi_utils.py")
      self._serving_model_dir = os.path.join(
          self._test_dir, "serving_model"
      )
      self._pipeline_root = os.path.join(
          self._test_dir, "tfx", "pipelines", self._pipeline_name
      )
      # Metadata path for recording successful pipeline run.
      self._recorded_mlmd_path = os.path.join(
          self._test_dir, "tfx", "record", "metadata.db"
      )
      # Metadata path for stub pipeline runs.
      self._metadata_path = os.path.join(
          self._test_dir,
          "tfx",
          "metadata",
          self._pipeline_name,
          "metadata.db",
      )
      self._recorded_output_dir = os.path.join(
          self._test_dir, "testdata"
      )
  
      # Runs the pipeline and record to self._recorded_output_dir
      record_taxi_pipeline = taxi_pipeline_local._create_pipeline(  # pylint:disable=protected-access
          pipeline_name=self._pipeline_name,
          data_root=self._data_root,
          module_file=self._module_file,
          serving_model_dir=self._serving_model_dir,
          pipeline_root=self._pipeline_root,
          metadata_path=self._recorded_mlmd_path,
          beam_pipeline_args=[],
      )
  
      BeamDagRunner().run(record_taxi_pipeline)
  
      pipeline_recorder_utils.record_pipeline(
          output_dir=self._recorded_output_dir,
          metadata_db_uri=self._recorded_mlmd_path,
          pipeline_name=self._pipeline_name,
      )
  
      self.taxi_pipeline = taxi_pipeline_local._create_pipeline(  # pylint:disable=protected-access
          pipeline_name=self._pipeline_name,
          data_root=self._data_root,
          module_file=self._module_file,
          serving_model_dir=self._serving_model_dir,
          pipeline_root=self._pipeline_root,
          metadata_path=self._metadata_path,
          beam_pipeline_args=[],
      )
  
imports: import os
  from absl import logging
  import tensorflow
  from tfx.dsl.compiler import compiler
  from tfx.dsl.io import fileio
  from tfx.examples.chicago_taxi_pipeline import taxi_pipeline_local
  from tfx.experimental.pipeline_testing import executor_verifier_utils
  from tfx.experimental.pipeline_testing import pipeline_mock
  from tfx.experimental.pipeline_testing import pipeline_recorder_utils
  from tfx.orchestration import metadata
  from tfx.orchestration.beam.beam_dag_runner import BeamDagRunner
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 1 for calling the TaxiPipelineRegressionEndToEndTest obj's underlying member method code with example usage: obj.setUp() without return types