code: def test_statistics_compile(self):
      s = tools.Statistics()
      s.register("mean", numpy.mean)
      s.register("max", max)
      res = s.compile([1, 2, 3, 4])
      self.assertDictEqual(res, {"max": 4, "mean": 2.5})
  
      res = s.compile([5, 6, 7, 8])
      self.assertDictEqual(res, {"mean": 6.5, "max": 8})
  
file_path: deap/tests/test_statistics.py
imports: from operator import itemgetter
  import unittest
  import numpy
  from deap import tools
label_desc: Use image node_id 1 for calling the LogbookTest obj's underlying member method code with example usage: obj.test_statistics_compile() without return types