def sample_polya(alpha_vec, n):
    prob = np.random.dirichlet(alpha_vec)
    n_vec = np.random.multinomial(n, prob)
    return n_vec
alpha_vec is the parameter of the Dirichlet distribution, n is the #samples
dataset/ETHPy150Open balajiln/mondrianforest/src/utils.py/sample_polya