def test_bquantize(self):
        x = np.linspace(-10, 10, 101)
        y = ds.bquantize(x)
        yval = [yi.val for yi in y]
        ycsd = [yi.csd for yi in y]
        fname = pkg_resources.resource_filename(__name__, "test_data/test_bquantize.mat")
        s = scipy.io.loadmat(fname)['s']
        mval = []
        mcsd = []
        for i in range(s.shape[1]):
            mval.append(float(s[0, i][0]))
            mcsd.append(s[0, i][1])
        for i in range(len(mval)):
            self.assertTrue(np.allclose(mval[i], yval[i], atol=1e-8, rtol=1e-5))
            self.assertTrue(np.prod(mcsd[i].shape) + np.prod(ycsd[i].shape) == 0 or \
                   mcsd[i].shape == ycsd[i].shape)
            if 0 not in ycsd[i].shape:
                self.assertTrue(np.allclose(mcsd[i], ycsd[i], atol=1e-8, rtol=1e-5))
Verify an hmac hash against a bcrypt value.
dataset/ETHPy150Open ggventurini/python-deltasigma/deltasigma/tests/test_bquantize.py/TestBQuantize.test_bquantize--crossover with--dataset/ETHPy150Open fwenzel/django-sha2/django_sha2/bcrypt_auth.py/_bcrypt_verify