コード例 #1
0
ファイル: test_ebaybbn.py プロジェクト: wym109/causalnex
def test_make_key():
    class DummyTest:
        def __init__(self, value):

            self.value = value

        def dummy_method(self, value):  # Add this method to by pass linting
            self.value = value

    test = DummyTest(8)
    test.dummy_method(10)
    with pytest.raises(ValueError, match=r"Unexpected type"):
        make_key(test)
コード例 #2
0
 def f_grass_wet(sprinkler, rain, grass_wet):
     table = dict()
     table["fft"] = 0.0
     table["fff"] = 1.0
     table["ftt"] = 0.8
     table["ftf"] = 0.2
     table["tft"] = 0.9
     table["tff"] = 0.1
     table["ttt"] = 0.99
     table["ttf"] = 0.01
     return table[make_key(sprinkler, rain, grass_wet)]
コード例 #3
0
 def f_h(e, g, h):
     tt = dict(
         ttt=0.05,
         ttf=0.95,
         tft=0.95,
         tff=0.05,
         ftt=0.95,
         ftf=0.05,
         fft=0.95,
         fff=0.05,
     )
     return tt[make_key(e, g, h)]
コード例 #4
0
 def f_f(d, e, f):
     tt = dict(
         ttt=0.01,
         ttf=0.99,
         tft=0.01,
         tff=0.99,
         ftt=0.01,
         ftf=0.99,
         fft=0.99,
         fff=0.01,
     )
     return tt[make_key(d, e, f)]
コード例 #5
0
 def f_g(c, g):
     tt = dict(tt=0.8, tf=0.2, ft=0.1, ff=0.9)
     return tt[make_key(c, g)]
コード例 #6
0
 def f_e(c, e):
     tt = dict(tt=0.3, ft=0.6, tf=0.7, ff=0.4)
     return tt[make_key(c, e)]
コード例 #7
0
 def f_d(b, d):
     tt = dict(tt=0.9, ft=0.5, tf=0.1, ff=0.5)
     return tt[make_key(b, d)]
コード例 #8
0
 def f_c(a, c):
     tt = dict(tt=0.7, ft=0.2, tf=0.3, ff=0.8)
     return tt[make_key(a, c)]
コード例 #9
0
 def f_b(a, b):
     tt = dict(tt=0.5, ft=0.4, tf=0.5, ff=0.6)
     return tt[make_key(a, b)]