def test_memoizes_two_functions(self):
        called = [0, 0]

        @persistent_memoize
        def target1(arg):
            """Test function..."""
            called[0] += 1
            return 2 * arg

        @persistent_memoize
        def target2(arg):
            """Test function..."""
            called[1] += 1
            return 3 * arg

        result1 = target1(1)
        self.assertEqual(result1, 2)
        self.assertEqual(called[0], 1)
        self.assertEqual(called[1], 0)

        result2 = target1(1)
        self.assertEqual(result2, 2)
        self.assertEqual(called[0], 1)
        self.assertEqual(called[1], 0)

        result3 = target2(1)
        self.assertEqual(result3, 3)
        self.assertEqual(called[0], 1)
        self.assertEqual(called[1], 1)

        result4 = target2(1)
        self.assertEqual(result4, 3)
        self.assertEqual(called[0], 1)
        self.assertEqual(called[1], 1)
Test if memoization works with several functions
dataset/ETHPy150Open duerrp/pyexperiment/tests/test_persistent_memoize.py/TestPersistentMemoize.test_memoizes_two_functions