'Normal distribution.
mu is the mean, and sigma is the standard deviation.'

def normalvariate(self, mu, sigma):

    random = self.random
    while 1:
        u1 = random()
        u2 = (1.0 - random())
        z = ((NV_MAGICCONST * (u1 - 0.5)) / u2)
        zz = ((z * z) / 4.0)
        if (zz <= (- _log(u2))):
            break
    return (mu + (z * sigma))
