def grind(func, n, threshold=10):
    mperc, m0 = get_mem_usage()

    g = Graph()
    for i in xrange(n):
        func()
        
    mperc, m1 = get_mem_usage()
    
    print m0, m1
    assert m1 <= m0+threshold
dataset/ETHPy150Open bmander/graphserver/pygs/test/stress_test/stress_test.py/grind/original