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
TRACE_STACK = [lambda f, *args, **kwargs: f(*args, **kwargs)] | |
@contextmanager | |
def trace(tracer): | |
TRACE_STACK.append(tracer) | |
yield | |
TRACE_STACK.pop() | |
def traceable(func): | |
def func_wrapped(*args, **kwargs): |
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 numpy as np | |
import scipy.stats | |
from typing import List | |
def shifty_investigator(num_trials: int, | |
num_successes: int, | |
p_success: float): | |
p_fail = 1. - p_success | |
target_p = 1. - scipy.stats.binom.cdf(n=num_trials, |
OlderNewer