compute filter in test.py