test_random.py
来自「mallet是自然语言处理、机器学习领域的一个开源项目。」· Python 代码 · 共 20 行
PY
20 行
import test_supportimport random# Ensure that the seed() method initializes all the hidden state. In# particular, through 2.2.1 it failed to reset a piece of state used by# (and only by) the .gauss() method.for seed in 1, 12, 123, 1234, 12345, 123456, 654321: for seeder in random.seed, random.whseed: seeder(seed) x1 = random.random() y1 = random.gauss(0, 1) seeder(seed) x2 = random.random() y2 = random.gauss(0, 1) test_support.vereq(x1, x2) test_support.vereq(y1, y2)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?