Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def setUp(self):
master_seed(1234)
def test_master_seed_py(self):
import random
master_seed(1234)
x = random.getrandbits(128)
y = random.getrandbits(128)
master_seed(1234)
z = random.getrandbits(128)
self.assertNotEqual(x, y)
self.assertEqual(z, x)
def setUp(self):
master_seed(1234)
def setUpClass(cls):
master_seed(301)
(x_train, y_train), (x_test, y_test), min_, max_ = load_mnist()
y_train = np.argmax(y_train, axis=1)
y_test = np.argmax(y_test, axis=1)
zero_or_four = np.logical_or(y_train == 4, y_train == 0)
x_train = x_train[zero_or_four]
y_train = y_train[zero_or_four]
tr_labels = np.zeros((y_train.shape[0], 2))
tr_labels[y_train == 0] = np.array([1, 0])
tr_labels[y_train == 4] = np.array([0, 1])
y_train = tr_labels
zero_or_four = np.logical_or(y_test == 4, y_test == 0)
x_test = x_test[zero_or_four]
y_test = y_test[zero_or_four]
te_labels = np.zeros((y_test.shape[0], 2))
te_labels[y_test == 0] = np.array([1, 0])
def setUp(self):
# Set master seed
master_seed(1234)
def setUp(self):
master_seed(1234)
def setUp(self):
master_seed(1234)
def setUp(self):
# Set master seed
master_seed(1234)
def setUp(self):
# Set master seed
master_seed(1234)
def setUp(cls):
master_seed(42)