def sample(self, n=1):
        u = np.random.rand(n)
        rez = np.zeros([n])
        for ii in range(0, n):
            jj = 0
            while u[ii] > self.cdf[jj]:
                jj += 1
            rez[ii] = self.support[jj]
        return Sample(rez.astype(np.int32))
dataset/ETHPy150Open karlnapf/kameleon-mcmc/kameleon_mcmc/distribution/Discrete.py/Discrete.sample/original