The notation X ~ N(μ, σ²) means that X is normally distributed with mean μ and variance σ², so in the RBM training routine, v should be sampled from such a distribution. In NumPy terms, that's
v = sigma * np.random.randn(v_size) + b + sigma * W.dot(h)
Or use scipy.stats.norm
for better readable code.