def sample_bernoulli(X):
    return (X >= random.uniform(size=X.shape)).astype('b')
All values of X must be probabilities of independent events occuring according
dataset/ETHPy150Open theusual/kaggle-seeclickfix-ensemble/Miroslaw/sparserbm.py/sample_bernoulli