code: def testStatistics(self):
      class UnitQ(pipeline.Pipeline):
          def __init__(self):
              pipeline.Pipeline.__init__(self, Type0, Type1)
              self.stats = []
  
          def transform(self, input_object):
              self._set_stats(
                  [statistics.Counter("output_count", input_object.z)]
              )
              return [
                  Type1(x=input_object.x + i, y=input_object.y + i)
                  for i in range(input_object.z)
              ]
  
      class UnitR(pipeline.Pipeline):
          def __init__(self):
              pipeline.Pipeline.__init__(self, Type1, Type1)
  
          def transform(self, input_object):
              self._set_stats([statistics.Counter("input_count", 1)])
              return [input_object]
  
      q, r = UnitQ(), UnitR()
      dag = {
          q: dag_pipeline.DagInput(q.input_type),
          r: q,
          dag_pipeline.DagOutput("output"): r,
      }
      dag_pipe_obj = dag_pipeline.DAGPipeline(dag, "DAGPipelineName")
      for x, y, z in [(-3, 0, 8), (1, 2, 3), (5, -5, 5)]:
          dag_pipe_obj.transform(Type0(x, y, z))
          stats_1 = dag_pipe_obj.get_stats()
          stats_2 = dag_pipe_obj.get_stats()
          self.assertEqual(stats_1, stats_2)
  
          for stat in stats_1:
              self.assertIsInstance(stat, statistics.Counter)
  
          names = sorted([stat.name for stat in stats_1])
          self.assertEqual(
              names,
              (
                  ["DAGPipelineName_UnitQ_output_count"]
                  + ["DAGPipelineName_UnitR_input_count"] * z
              ),
          )
  
          for stat in stats_1:
              if stat.name == "DAGPipelineName_UnitQ_output_count":
                  self.assertEqual(stat.count, z)
              else:
                  self.assertEqual(stat.count, 1)
  
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 10 for calling the DAGPipelineTest obj's underlying member method code with example usage: obj.testStatistics() and returns: unknown, list