<s> import numpy as np <EOL> from scipy . special import erfinv <EOL> def uniform ( sample , lo = - <NUM_LIT:1> , hi = <NUM_LIT:1> ) : <EOL> return lo + ( hi - lo ) * sample <EOL> def normal ( sample , avg = <NUM_LIT:0.0> , std = <NUM_LIT:1.0> ) : <EOL> return avg + std * np . sqrt ( <NUM_LIT:2> ) * erfinv ( <NUM_LIT:2> * sample - <NUM_LIT:1> ) <EOL> def lognormal ( sample , avg = <NUM_LIT:0.0> , std = <NUM_LIT:1.0> ) : <EOL> return np . exp ( normal ( sample , avg , std ) ) <EOL> def bernoulli ( sample , p = <NUM_LIT:0.5> ) : <EOL> return ( sample > p ) </s>
