def sample_multinomial(prob):
    try:
        k = int(np.where(np.random.multinomial(1, prob, size=1)[0]==1)[0])
    except __HOLE__:
        print 'problem in sample_multinomial: prob = '
        print prob
        raise TypeError
    except:
        raise Exception
    return k
dataset/ETHPy150Open balajiln/mondrianforest/src/utils.py/sample_multinomial