def propose(self, current, r):
stay = (r.uniform(<NUM_LIT:0>, <NUM_LIT:1>) < self.kernel)<EOL>if stay:<EOL><INDENT>logKernel = numpy.log(self.kernel)<EOL>return current, logKernel, logKernel<EOL><DEDENT>else: <EOL><INDENT>curIndex = self.keyMap[current]<EOL>ri = r.randint(<NUM_LIT:0>, self.nKeys-<NUM_LIT:1>)<EOL>logKernel = numpy.log(<NUM_LIT:1.0> - self.kernel)<EOL>lp = logKernel + self.logp<EOL>if ri < curIndex: return self.keys[ri], lp, lp<EOL>else: return self.keys[ri+<NUM_LIT:1>], lp, lp<EOL><DEDENT>
Generates a random sample from the discrete probability distribution and
        returns its value, the log of the probability of sampling that value and the
        log of the probability of sampling the current value (passed in).