code: def test_metric():
      def _test(m, values, e):
          for v in values:
              m.update(v)
          assert m.compute() == e
  
      metric = Accumulation()
  
      m1 = dill.loads(dill.dumps(metric))
  
      values = list(range(10))
      expected = sum(values)
  
      _test(m1, values, expected)
  
      metric.update(5)
  
      m2 = dill.loads(dill.dumps(metric))
  
      _test(m2, values, expected + 5)
  
file_path: ignite/tests/ignite/metrics/test_dill.py
imports: import dill
  from ignite.metrics import Metric
label_desc: Use image node_id 1 for calling a global function with example usage: test_metric() without return types