Did I find the right examples for you? yes no

All Samples(10)  |  Call(10)  |  Derive(0)  |  Import(0)

src/c/o/cogent-1.5.3/tests/test_maths/test_matrix/test_distance.py   cogent(Download)
            dm = DistanceMatrix(data=n, RowOrder=n.keys(),ColOrder=n.keys(),\
                    Pad=False)
            dm.elementPow(2)
            self.assertEqual(dm.Power, 2)
            self.assertEqual(dm['A']['A'],m['A']['A']**2)
            dm = DistanceMatrix(data=n, RowOrder=n.keys(),ColOrder=n.keys(),\
                    Pad=False)
            dm.elementPow(3)
            dm.elementPow(1./2.)
            self.assertEqual(dm.Power, 3./2.)
                    Pad=False)
            dm['A']['A'] = 'p'
            dm.elementPow(2)
            self.assertEqual(dm.Power, 2.)
            self.assertEqual(dm['A']['A'],'p')
                    Pad=False)
            dm['A']['A'] = None
            dm.elementPow(2)
            self.assertEqual(dm.Power, 2.)
            self.assertEqual(dm['A']['A'],None)

src/p/y/pycogent-HEAD/tests/test_maths/test_matrix/test_distance.py   pycogent(Download)
            dm = DistanceMatrix(data=n, RowOrder=n.keys(),ColOrder=n.keys(),\
                    Pad=False)
            dm.elementPow(2)
            self.assertEqual(dm.Power, 2)
            self.assertEqual(dm['A']['A'],m['A']['A']**2)
            dm = DistanceMatrix(data=n, RowOrder=n.keys(),ColOrder=n.keys(),\
                    Pad=False)
            dm.elementPow(3)
            dm.elementPow(1./2.)
            self.assertEqual(dm.Power, 3./2.)
                    Pad=False)
            dm['A']['A'] = 'p'
            dm.elementPow(2)
            self.assertEqual(dm.Power, 2.)
            self.assertEqual(dm['A']['A'],'p')
                    Pad=False)
            dm['A']['A'] = None
            dm.elementPow(2)
            self.assertEqual(dm.Power, 2.)
            self.assertEqual(dm['A']['A'],None)