def test_stats7(self):
        th = TestHelper()

        # tree of prefixes
        p1 = th.add_prefix('1.0.0.0/20', 'reservation', 'test')
        p2 =  th.add_prefix('1.0.0.0/21', 'reservation', 'test')
        p3 =   th.add_prefix('1.0.0.0/22', 'reservation', 'test')
        p4 =    th.add_prefix('1.0.0.0/23', 'reservation', 'test')
        p5 =     th.add_prefix('1.0.0.0/24', 'reservation', 'test')
        p6 =    th.add_prefix('1.0.2.0/24', 'reservation', 'test')
        p7 =   th.add_prefix('1.0.4.0/22', 'reservation', 'test')

        # check stats for p2
        res = Prefix.smart_search('1.0.0.0/21', {})
        self.assertEqual(2048, res['result'][0].total_addresses)
        self.assertEqual(2048, res['result'][0].used_addresses)
        self.assertEqual(0, res['result'][0].free_addresses)

        # move p3 outside of the tree
        p3.prefix = '2.0.0.0/22'
        p3.save()

        # check stats for p2
        res = Prefix.smart_search('1.0.0.0/21', {})
        self.assertEqual(2048, res['result'][0].total_addresses)
        self.assertEqual(1792, res['result'][0].used_addresses)
        self.assertEqual(256, res['result'][0].free_addresses)

        # move p3 into the tree again
        p3.prefix = '1.0.0.0/22'
        p3.save()

        # check stats for p2
        res = Prefix.smart_search('1.0.0.0/21', {})
        self.assertEqual(2048, res['result'][0].total_addresses)
        self.assertEqual(2048, res['result'][0].used_addresses)
        self.assertEqual(0, res['result'][0].free_addresses)
Plotting function of GeneralizationAcrossTime object
dataset/ETHPy150Open SpriteLink/NIPAP/tests/nipaptest.py/TestPrefixStatistics.test_stats7--crossover with--dataset/ETHPy150Open mne-tools/mne-python/mne/decoding/time_gen.py/GeneralizationAcrossTime.plot_diagonal