Did I find the right examples for you? yes no

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)
Checks the default probability is sane

        def sane_probability(prob):
    "Checks the default probability is sane"
    if prob >= 1:
        raise EnvironmentError, "Probability cannot be more than 1!"
    elif prob > 0.01:
        raise Warning, "Probability set very high! Continuing..."
    elif prob <= 0:
        raise EnvironmentError, "Probability cannot be less than 0!"
        


src/b/l/bloomd-HEAD/bloomd/conn_handler.py   bloomd(Download)
                try:
                    prob = custom["default_probability"] = float(args[1])
                    config.sane_probability(prob)
                except (ValueError, EnvironmentError):
                    return "Client Error: Bad false positive probability!"