code: def test_identity_pipeline(self):
      dataset = MockDataset()
  
      def doTransform(pipeline):
          pipeline_model = pipeline.fit(dataset)
          return pipeline_model.transform(dataset)
  
      # check that empty pipeline did not perform any transformation
      self.assertEqual(
          dataset.index, doTransform(Pipeline(stages=[])).index
      )
      # check that failure to set stages param will raise KeyError for missing param
      self.assertRaises(KeyError, lambda: doTransform(Pipeline()))
  
imports: import unittest
  from pyspark.ml.pipeline import Pipeline
  from pyspark.testing.mlutils import MockDataset, MockEstimator, MockTransformer, PySparkTestCase
label_desc: Use image node_id 2 for calling the PipelineTests obj's underlying member method code with example usage: obj.test_identity_pipeline() and returns: pipeline_model