def getCovMatrix(self,x=None,z=None,mode=None):
        self.checkInputGetCovMatrix(x,z,mode)
        if not x is None:
            assert x.shape[1]==1, 'periodic covariance can only be used for 1d data'
        if not z is None:
            assert z.shape[1]==1, 'periodic covariance can only be used for 1d data'
        ell = np.exp(self.hyp[0])        # characteristic length scale
        p   = np.exp(self.hyp[1])        # period
        sf2 = np.exp(2.*self.hyp[2])     # signal variance
        if mode == 'self_test':           # self covariances for the test cases
            nn,D = z.shape
            A = np.zeros((nn,1))
        elif mode == 'train':             # compute covariance matix for dataset x
            A = np.sqrt(spdist.cdist(x, x, 'sqeuclidean'))
        elif mode == 'cross':             # compute covariance between data sets x and z
            A = np.sqrt(spdist.cdist(x, z, 'sqeuclidean'))
        A = np.pi*p/A
        A = old_div(np.sin(A),ell)
        A = A * A
        A = sf2 *np.exp(-2.*A)
        return A
dataset/ETHPy150Open marionmari/pyGPs/pyGPs/Core/cov.py/Periodic.getCovMatrix/swapped operands of `/`