def generate(self):
        p = random.random()
        p_init = p
        for sample in self.samples():
            p -= self.prob(sample)
            if p <= 0: return sample
        # allow for some rounding error:
        if p < .0001:
            return sample
        # we *should* never get here
        if self.SUM_TO_ONE:
            warnings.warn("Probability distribution %r sums to %r; generate()"
                          " is returning an arbitrary sample." % (self, p_init-p))
        return random.choice(list(self.samples()))
Configure the port HTTP should listen on
dataset/ETHPy150Open nltk/nltk/nltk/probability.py/ProbDistI.generate--crossover with--dataset/ETHPy150Open saltstack/salt/salt/modules/ilo.py/set_http_port