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 | |
H1 = [0.499, 0.499, 0.002] | |
H2 = [0.3333333333, 0.3333333333, 0.3333333333] | |
obs = [14, 14, 1] | |
def psi(hypothesis, observed): | |
assert np.isclose(sum(hypothesis), 1) |
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 threading | |
class TestableThread(threading.Thread): | |
"""Wrapper around `threading.Thread` that propagates exceptions.""" | |
def __init__(self, target, args): | |
super().__init__(self, target=target, args=args) | |
self.exc = None |