This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Server Application which should be debugged | |
def acticvate_remote_post_mortem_debugger(): | |
def info(type, value, tb): | |
import traceback | |
traceback.print_exception(type, value, tb) | |
import socket | |
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
server.bind(('127.0.0.1', 8002)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scipy.special | |
import scipy.stats | |
def binomial_limit(n, k, sigma=1): | |
""" | |
Calculates the upper and lower limit for the probability p of a binomial distribution | |
if an experiment yielded k successes for n trials. | |
The confidence level for the limits is given in sigmas of the gaussian distribution. | |
In contrast to other methods (see https://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval), | |
this method is exact in the sense that there is no approximation involved for the binomial distribution. |