code: def testInvalidTransformOutputError(self):
      # This happens when the output of a pipeline's `transform` method does not
      # match the type signature given by the pipeline's `output_type`.
  
      class UnitQ1(pipeline.Pipeline):
          def __init__(self):
              pipeline.Pipeline.__init__(self, Type0, Type1)
  
          def transform(self, input_object):
              return [Type2(1)]
  
      class UnitQ2(pipeline.Pipeline):
          def __init__(self):
              pipeline.Pipeline.__init__(self, Type0, Type1)
  
          def transform(self, input_object):
              return [Type1(1, 2), Type2(1)]
  
      class UnitQ3(pipeline.Pipeline):
          def __init__(self):
              pipeline.Pipeline.__init__(self, Type0, Type1)
  
          def transform(self, input_object):
              return Type1(1, 2)
  
      class UnitR1(pipeline.Pipeline):
          def __init__(self):
              pipeline.Pipeline.__init__(
                  self, Type0, {"xy": Type1, "z": Type2}
              )
  
          def transform(self, input_object):
              return {"xy": [Type1(1, 2)], "z": [Type1(1, 2)]}
  
      class UnitR2(pipeline.Pipeline):
          def __init__(self):
              pipeline.Pipeline.__init__(
                  self, Type0, {"xy": Type1, "z": Type2}
              )
  
          def transform(self, input_object):
              return {"xy": [Type1(1, 2)]}
  
      class UnitR3(pipeline.Pipeline):
          def __init__(self):
              pipeline.Pipeline.__init__(
                  self, Type0, {"xy": Type1, "z": Type2}
              )
  
          def transform(self, input_object):
              return [{"xy": [Type1(1, 2)], "z": Type2(1)}]
  
      class UnitR4(pipeline.Pipeline):
          def __init__(self):
              pipeline.Pipeline.__init__(
                  self, Type0, {"xy": Type1, "z": Type2}
              )
  
          def transform(self, input_object):
              return [{"xy": [Type1(1, 2), Type2(1)], "z": [Type2(1)]}]
  
      class UnitR5(pipeline.Pipeline):
          def __init__(self):
              pipeline.Pipeline.__init__(
                  self, Type0, {"xy": Type1, "z": Type2}
              )
  
          def transform(self, input_object):
              return [
                  {
                      "xy": [Type1(1, 2), Type1(1, 3)],
                      "z": [Type2(1)],
                      "q": [],
                  }
              ]
  
      for pipeline_class in [
          UnitQ1,
          UnitQ2,
          UnitQ3,
          UnitR1,
          UnitR2,
          UnitR3,
          UnitR4,
          UnitR5,
      ]:
          pipe = pipeline_class()
          if pipeline_class.__name__.startswith("UnitR"):
              output = dag_pipeline.DagOutput()
          else:
              output = dag_pipeline.DagOutput("output")
          dag = {
              pipe: dag_pipeline.DagInput(pipe.input_type),
              output: pipe,
          }
          dag_pipe_obj = dag_pipeline.DAGPipeline(dag)
          with self.assertRaises(
              dag_pipeline.InvalidTransformOutputError
          ):
              dag_pipe_obj.transform(Type0(1, 2, 3))
  
imports: import collections
  from absl.testing import absltest
  from magenta.pipelines import dag_pipeline
  from magenta.pipelines import pipeline
  from magenta.pipelines import statistics
label_desc: Use image node_id 18 for calling the DAGPipelineTest obj's underlying member method code with example usage: obj.testInvalidTransformOutputError() and returns: list, list, Type1, dict, dict, list, list, list