def test_parent_validity(self):

        # Test scalar index, no shape
        X = GaussianARD(1, 1, plates=(2,), shape=())
        Y = Take(X, 1)
        self.assertEqual(
            Y.plates,
            (),
        )
        self.assertEqual(
            Y.dims,
            ( (), () )
        )

        # Test vector indices, no shape
        X = GaussianARD(1, 1, plates=(2,), shape=())
        Y = Take(X, [1, 1, 0, 1])
        self.assertEqual(
            Y.plates,
            (4,),
        )
        self.assertEqual(
            Y.dims,
            ( (), () )
        )

        # Test matrix indices, no shape
        X = GaussianARD(1, 1, plates=(2,), shape=())
        Y = Take(X, [[1, 1, 0], [1, 0, 1]])
        self.assertEqual(
            Y.plates,
            (2, 3),
        )
        self.assertEqual(
            Y.dims,
            ( (), () )
        )

        # Test scalar index, with shape
        X = GaussianARD(1, 1, plates=(3,), shape=(2,))
        Y = Take(X, 2)
        self.assertEqual(
            Y.plates,
            (),
        )
        self.assertEqual(
            Y.dims,
            ( (2,), (2, 2) )
        )

        # Test vector indices, with shape
        X = GaussianARD(1, 1, plates=(3,), shape=(2,))
        Y = Take(X, [1, 1, 0, 2])
        self.assertEqual(
            Y.plates,
            (4,),
        )
        self.assertEqual(
            Y.dims,
            ( (2,), (2, 2) )
        )

        # Test matrix indices, no shape
        X = GaussianARD(1, 1, plates=(3,), shape=(2,))
        Y = Take(X, np.ones((4, 5), dtype=np.int))
        self.assertEqual(
            Y.plates,
            (4, 5),
        )
        self.assertEqual(
            Y.dims,
            ( (2,), (2, 2) )
        )

        # Test scalar indices with more plate axes
        X = GaussianARD(1, 1, plates=(4, 2), shape=())
        Y = Take(X, 1)
        self.assertEqual(
            Y.plates,
            (4,),
        )
        self.assertEqual(
            Y.dims,
            ( (), () )
        )

        # Test vector indices with more plate axes
        X = GaussianARD(1, 1, plates=(4, 2), shape=())
        Y = Take(X, np.ones(3, dtype=np.int))
        self.assertEqual(
            Y.plates,
            (4, 3),
        )
        self.assertEqual(
            Y.dims,
            ( (), () )
        )

        # Test take on other plate axis
        X = GaussianARD(1, 1, plates=(4, 2), shape=())
        Y = Take(X, np.ones(3, dtype=np.int), plate_axis=-2)
        self.assertEqual(
            Y.plates,
            (3, 2),
        )
        self.assertEqual(
            Y.dims,
            ( (), () )
        )

        # Test positive plate axis
        X = GaussianARD(1, 1, plates=(4, 2), shape=())
        self.assertRaises(
            ValueError,
            Take,
            X,
            np.ones(3, dtype=np.int),
            plate_axis=0,
        )

        # Test indices out of bounds
        X = GaussianARD(1, 1, plates=(2,), shape=())
        self.assertRaises(
            ValueError,
            Take,
            X,
            [0, -3],
        )
        X = GaussianARD(1, 1, plates=(2,), shape=())
        self.assertRaises(
            ValueError,
            Take,
            X,
            [0, 2],
        )

        # Test non-integer indices
        X = GaussianARD(1, 1, plates=(2,), shape=())
        self.assertRaises(
            ValueError,
            Take,
            X,
            [0, 1.5],
        )

        pass
Recursive workhorse for assertPreciseEqual().
dataset/ETHPy150Open bayespy/bayespy/bayespy/inference/vmp/nodes/tests/test_take.py/TestTake.test_parent_validity--crossover with--dataset/ETHPy150Open numba/numba/numba/tests/support.py/TestCase._assertPreciseEqual