

def setUp(self):
    numpy.random.seed(((9 + 5) + 2015))
    self.train_features_mock = numpy.random.randint(0, 256, (10, 3, 32, 32)).astype('uint8')
    self.train_fine_labels_mock = numpy.random.randint(0, 100, (10,)).astype('uint8')
    self.train_coarse_labels_mock = numpy.random.randint(0, 20, (10,)).astype('uint8')
    self.test_features_mock = numpy.random.randint(0, 256, (10, 3, 32, 32)).astype('uint8')
    self.test_fine_labels_mock = numpy.random.randint(0, 100, (10,)).astype('uint8')
    self.test_coarse_labels_mock = numpy.random.randint(0, 20, (10,)).astype('uint8')
    self.tempdir = tempfile.mkdtemp()
    with remember_cwd():
        os.chdir(self.tempdir)
        os.mkdir('cifar-100-python')
        filename = os.path.join('cifar-100-python', 'train')
        with open(f, 'wb') as f:
            cPickle.dump({
                'data': self.train_features_mock.reshape((10, (- 1))),
                'fine_labels': self.train_fine_labels_mock,
                'coarse_labels': self.train_coarse_labels_mock,
            }, f)
        filename = os.path.join('cifar-100-python', 'test')
        with open(filename, 'wb') as f:
            cPickle.dump({
                'data': self.test_features_mock.reshape((10, (- 1))),
                'fine_labels': self.test_fine_labels_mock,
                'coarse_labels': self.test_coarse_labels_mock,
            }, f)
        with tarfile.open('cifar-100-python.tar.gz', 'w:gz') as tar_file:
            tar_file.add('cifar-100-python')

dataset/ETHPy150Open mila-udem/fuel/tests/test_converters.py TestCIFAR100.setUp/VarMisuse@236/295 `filename`->`f`