parameters: (self, mu, sigma)
return_statement: return mu + z*sigma
docstring: Normal distribution.
  
          mu is the mean, and sigma is the standard deviation.
docstring_summary: Normal distribution.
docstring_tokens: Normal distribution .
function: def normalvariate(self, mu, sigma):
          """Normal distribution.
  
          mu is the mean, and sigma is the standard deviation.
  
          """
          # mu = mean, sigma = standard deviation
  
          # Uses Kinderman and Monahan method. Reference: Kinderman,
          # A.J. and Monahan, J.F., "Computer generation of random
          # variables using the ratio of uniform deviates", ACM Trans
          # Math Software, 3, (1977), pp257-260.
  
          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
function_tokens: def normalvariate ( self , mu , sigma ) : # mu = mean, sigma = standard deviation # Uses Kinderman and Monahan method. Reference: Kinderman, # A.J. and Monahan, J.F., "Computer generation of random # variables using the ratio of uniform deviates", ACM Trans # Math Software, 3, (1977), pp257-260. 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