code: def testInvalidStatisticsError(self):
      class UnitQ(pipeline.Pipeline):
          def __init__(self):
              pipeline.Pipeline.__init__(self, str, str)
  
          def transform(self, input_object):
              self._set_stats([statistics.Counter("stat_1", 5), 1234])
              return [input_object]
  
      class UnitR(pipeline.Pipeline):
          def __init__(self):
              pipeline.Pipeline.__init__(self, str, str)
  
          def transform(self, input_object):
              self._set_stats(statistics.Counter("stat_1", 5))
              return [input_object]
  
      q = UnitQ()
      dag = {
          q: dag_pipeline.DagInput(q.input_type),
          dag_pipeline.DagOutput("output"): q,
      }
      dag_pipe_obj = dag_pipeline.DAGPipeline(dag)
      with self.assertRaises(pipeline.InvalidStatisticsError):
          dag_pipe_obj.transform("hello world")
  
      r = UnitR()
      dag = {
          r: dag_pipeline.DagInput(q.input_type),
          dag_pipeline.DagOutput("output"): r,
      }
      dag_pipe_obj = dag_pipeline.DAGPipeline(dag)
      with self.assertRaises(pipeline.InvalidStatisticsError):
          dag_pipe_obj.transform("hello world")
  
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 19 for calling the DAGPipelineTest obj's underlying member method code with example usage: obj.testInvalidStatisticsError() and returns: list, list