Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(6)  |  Call(6)  |  Derive(0)  |  Import(0)

src/c/o/coils-1.0.6/test/testAverager.py   coils(Download)
    a = Averager(0)  # Same as Averager(1)
    assert len(a) == 0
    assert a.add(1.0) == 1.0  # 1.0 / 1
    assert len(a) == 1
    assert a.add(2.0) == 2.0  # 2.0 / 1
    assert len(a) == 1
    assert a.add(3.0) == 3.0  # 3.0 / 1
    a = Averager(2)
    assert len(a) == 0
    assert a.add(1.0) == 1.0  # 1.0 / 1
    assert len(a) == 1
    assert a.add(2.0) == 1.5  # (1.0 + 2.0) / 2