docs: def flatten(cls, stats):
          """Makes a flat statistics from the given statistics."""
          flat_children = {}
          for _stats in spread_stats(stats):
              key = (_stats.name, _stats.filename, _stats.lineno, _stats.module)
              try:
                  flat_stats = flat_children[key]
              except KeyError:
                  flat_stats = flat_children[key] = cls(*key)
              flat_stats.own_hits += _stats.own_hits
              flat_stats.deep_hits += _stats.deep_hits
              flat_stats.own_time += _stats.own_time
              flat_stats.deep_time += _stats.deep_time
          children = list(itervalues(flat_children))
          return cls(stats.name, stats.filename, stats.lineno, stats.module,
                     stats.own_hits, stats.deep_hits, stats.own_time,
                     stats.deep_time, children)